diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/LICENSE b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..04b6b1f37c4dffb82942cdcc2b77092798ca4aa2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/LICENSE @@ -0,0 +1,22 @@ +Copyright 2006 Dan-Haim. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of Dan Haim nor the names of his contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/METADATA b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..79a2ee5db96b01c23842c2b01b25435ccd732871 --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/METADATA @@ -0,0 +1,319 @@ +Metadata-Version: 2.1 +Name: PySocks +Version: 1.7.1 +Summary: A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information. +Home-page: https://github.com/Anorov/PySocks +Author: Anorov +Author-email: anorov.vorona@gmail.com +License: BSD +Keywords: socks,proxy +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Description-Content-Type: text/markdown +License-File: LICENSE + +PySocks +======= + +PySocks lets you send traffic through SOCKS and HTTP proxy servers. It is a modern fork of [SocksiPy](http://socksipy.sourceforge.net/) with bug fixes and extra features. + +Acts as a drop-in replacement to the socket module. Seamlessly configure SOCKS proxies for any socket object by calling `socket_object.set_proxy()`. + +---------------- + +Features +======== + +* SOCKS proxy client for Python 2.7 and 3.4+ +* TCP supported +* UDP mostly supported (issues may occur in some edge cases) +* HTTP proxy client included but not supported or recommended (you should use urllib2's or requests' own HTTP proxy interface) +* urllib2 handler included. `pip install` / `setup.py install` will automatically install the `sockshandler` module. + +Installation +============ + + pip install PySocks + +Or download the tarball / `git clone` and... + + python setup.py install + +These will install both the `socks` and `sockshandler` modules. + +Alternatively, include just `socks.py` in your project. + +-------------------------------------------- + +*Warning:* PySocks/SocksiPy only supports HTTP proxies that use CONNECT tunneling. Certain HTTP proxies may not work with this library. If you wish to use HTTP (not SOCKS) proxies, it is recommended that you rely on your HTTP client's native proxy support (`proxies` dict for `requests`, or `urllib2.ProxyHandler` for `urllib2`) instead. + +-------------------------------------------- + +Usage +===== + +## socks.socksocket ## + + import socks + + s = socks.socksocket() # Same API as socket.socket in the standard lib + + s.set_proxy(socks.SOCKS5, "localhost") # SOCKS4 and SOCKS5 use port 1080 by default + # Or + s.set_proxy(socks.SOCKS4, "localhost", 4444) + # Or + s.set_proxy(socks.HTTP, "5.5.5.5", 8888) + + # Can be treated identical to a regular socket object + s.connect(("www.somesite.com", 80)) + s.sendall("GET / HTTP/1.1 ...") + print s.recv(4096) + +## Monkeypatching ## + +To monkeypatch the entire standard library with a single default proxy: + + import urllib2 + import socket + import socks + + socks.set_default_proxy(socks.SOCKS5, "localhost") + socket.socket = socks.socksocket + + urllib2.urlopen("http://www.somesite.com/") # All requests will pass through the SOCKS proxy + +Note that monkeypatching may not work for all standard modules or for all third party modules, and generally isn't recommended. Monkeypatching is usually an anti-pattern in Python. + +## urllib2 Handler ## + +Example use case with the `sockshandler` urllib2 handler. Note that you must import both `socks` and `sockshandler`, as the handler is its own module separate from PySocks. The module is included in the PyPI package. + + import urllib2 + import socks + from sockshandler import SocksiPyHandler + + opener = urllib2.build_opener(SocksiPyHandler(socks.SOCKS5, "127.0.0.1", 9050)) + print opener.open("http://www.somesite.com/") # All requests made by the opener will pass through the SOCKS proxy + +-------------------------------------------- + +Original SocksiPy README attached below, amended to reflect API changes. + +-------------------------------------------- + +SocksiPy + +A Python SOCKS module. + +(C) 2006 Dan-Haim. All rights reserved. + +See LICENSE file for details. + + +*WHAT IS A SOCKS PROXY?* + +A SOCKS proxy is a proxy server at the TCP level. In other words, it acts as +a tunnel, relaying all traffic going through it without modifying it. +SOCKS proxies can be used to relay traffic using any network protocol that +uses TCP. + +*WHAT IS SOCKSIPY?* + +This Python module allows you to create TCP connections through a SOCKS +proxy without any special effort. +It also supports relaying UDP packets with a SOCKS5 proxy. + +*PROXY COMPATIBILITY* + +SocksiPy is compatible with three different types of proxies: + +1. SOCKS Version 4 (SOCKS4), including the SOCKS4a extension. +2. SOCKS Version 5 (SOCKS5). +3. HTTP Proxies which support tunneling using the CONNECT method. + +*SYSTEM REQUIREMENTS* + +Being written in Python, SocksiPy can run on any platform that has a Python +interpreter and TCP/IP support. +This module has been tested with Python 2.3 and should work with greater versions +just as well. + + +INSTALLATION +------------- + +Simply copy the file "socks.py" to your Python's `lib/site-packages` directory, +and you're ready to go. [Editor's note: it is better to use `python setup.py install` for PySocks] + + +USAGE +------ + +First load the socks module with the command: + + >>> import socks + >>> + +The socks module provides a class called `socksocket`, which is the base to all of the module's functionality. + +The `socksocket` object has the same initialization parameters as the normal socket +object to ensure maximal compatibility, however it should be noted that `socksocket` will only function with family being `AF_INET` and +type being either `SOCK_STREAM` or `SOCK_DGRAM`. +Generally, it is best to initialize the `socksocket` object with no parameters + + >>> s = socks.socksocket() + >>> + +The `socksocket` object has an interface which is very similiar to socket's (in fact +the `socksocket` class is derived from socket) with a few extra methods. +To select the proxy server you would like to use, use the `set_proxy` method, whose +syntax is: + + set_proxy(proxy_type, addr[, port[, rdns[, username[, password]]]]) + +Explanation of the parameters: + +`proxy_type` - The type of the proxy server. This can be one of three possible +choices: `PROXY_TYPE_SOCKS4`, `PROXY_TYPE_SOCKS5` and `PROXY_TYPE_HTTP` for SOCKS4, +SOCKS5 and HTTP servers respectively. `SOCKS4`, `SOCKS5`, and `HTTP` are all aliases, respectively. + +`addr` - The IP address or DNS name of the proxy server. + +`port` - The port of the proxy server. Defaults to 1080 for socks and 8080 for http. + +`rdns` - This is a boolean flag than modifies the behavior regarding DNS resolving. +If it is set to True, DNS resolving will be preformed remotely, on the server. +If it is set to False, DNS resolving will be preformed locally. Please note that +setting this to True with SOCKS4 servers actually use an extension to the protocol, +called SOCKS4a, which may not be supported on all servers (SOCKS5 and http servers +always support DNS). The default is True. + +`username` - For SOCKS5 servers, this allows simple username / password authentication +with the server. For SOCKS4 servers, this parameter will be sent as the userid. +This parameter is ignored if an HTTP server is being used. If it is not provided, +authentication will not be used (servers may accept unauthenticated requests). + +`password` - This parameter is valid only for SOCKS5 servers and specifies the +respective password for the username provided. + +Example of usage: + + >>> s.set_proxy(socks.SOCKS5, "socks.example.com") # uses default port 1080 + >>> s.set_proxy(socks.SOCKS4, "socks.test.com", 1081) + +After the set_proxy method has been called, simply call the connect method with the +traditional parameters to establish a connection through the proxy: + + >>> s.connect(("www.sourceforge.net", 80)) + >>> + +Connection will take a bit longer to allow negotiation with the proxy server. +Please note that calling connect without calling `set_proxy` earlier will connect +without a proxy (just like a regular socket). + +Errors: Any errors in the connection process will trigger exceptions. The exception +may either be generated by the underlying socket layer or may be custom module +exceptions, whose details follow: + +class `ProxyError` - This is a base exception class. It is not raised directly but +rather all other exception classes raised by this module are derived from it. +This allows an easy way to catch all proxy-related errors. It descends from `IOError`. + +All `ProxyError` exceptions have an attribute `socket_err`, which will contain either a +caught `socket.error` exception, or `None` if there wasn't any. + +class `GeneralProxyError` - When thrown, it indicates a problem which does not fall +into another category. + +* `Sent invalid data` - This error means that unexpected data has been received from +the server. The most common reason is that the server specified as the proxy is +not really a SOCKS4/SOCKS5/HTTP proxy, or maybe the proxy type specified is wrong. + +* `Connection closed unexpectedly` - The proxy server unexpectedly closed the connection. +This may indicate that the proxy server is experiencing network or software problems. + +* `Bad proxy type` - This will be raised if the type of the proxy supplied to the +set_proxy function was not one of `SOCKS4`/`SOCKS5`/`HTTP`. + +* `Bad input` - This will be raised if the `connect()` method is called with bad input +parameters. + +class `SOCKS5AuthError` - This indicates that the connection through a SOCKS5 server +failed due to an authentication problem. + +* `Authentication is required` - This will happen if you use a SOCKS5 server which +requires authentication without providing a username / password at all. + +* `All offered authentication methods were rejected` - This will happen if the proxy +requires a special authentication method which is not supported by this module. + +* `Unknown username or invalid password` - Self descriptive. + +class `SOCKS5Error` - This will be raised for SOCKS5 errors which are not related to +authentication. +The parameter is a tuple containing a code, as given by the server, +and a description of the +error. The possible errors, according to the RFC, are: + +* `0x01` - General SOCKS server failure - If for any reason the proxy server is unable to +fulfill your request (internal server error). +* `0x02` - connection not allowed by ruleset - If the address you're trying to connect to +is blacklisted on the server or requires authentication. +* `0x03` - Network unreachable - The target could not be contacted. A router on the network +had replied with a destination net unreachable error. +* `0x04` - Host unreachable - The target could not be contacted. A router on the network +had replied with a destination host unreachable error. +* `0x05` - Connection refused - The target server has actively refused the connection +(the requested port is closed). +* `0x06` - TTL expired - The TTL value of the SYN packet from the proxy to the target server +has expired. This usually means that there are network problems causing the packet +to be caught in a router-to-router "ping-pong". +* `0x07` - Command not supported - For instance if the server does not support UDP. +* `0x08` - Address type not supported - The client has provided an invalid address type. +When using this module, this error should not occur. + +class `SOCKS4Error` - This will be raised for SOCKS4 errors. The parameter is a tuple +containing a code and a description of the error, as given by the server. The +possible error, according to the specification are: + +* `0x5B` - Request rejected or failed - Will be raised in the event of an failure for any +reason other then the two mentioned next. +* `0x5C` - request rejected because SOCKS server cannot connect to identd on the client - +The Socks server had tried an ident lookup on your computer and has failed. In this +case you should run an identd server and/or configure your firewall to allow incoming +connections to local port 113 from the remote server. +* `0x5D` - request rejected because the client program and identd report different user-ids - +The Socks server had performed an ident lookup on your computer and has received a +different userid than the one you have provided. Change your userid (through the +username parameter of the set_proxy method) to match and try again. + +class `HTTPError` - This will be raised for HTTP errors. The message will contain +the HTTP status code and provided error message. + +After establishing the connection, the object behaves like a standard socket. + +Methods like `makefile()` and `settimeout()` should behave just like regular sockets. +Call the `close()` method to close the connection. + +In addition to the `socksocket` class, an additional function worth mentioning is the +`set_default_proxy` function. The parameters are the same as the `set_proxy` method. +This function will set default proxy settings for newly created `socksocket` objects, +in which the proxy settings haven't been changed via the `set_proxy` method. +This is quite useful if you wish to force 3rd party modules to use a SOCKS proxy, +by overriding the socket object. +For example: + + >>> socks.set_default_proxy(socks.SOCKS5, "socks.example.com") + >>> socket.socket = socks.socksocket + >>> urllib.urlopen("http://www.sourceforge.net/") + + +PROBLEMS +--------- + +Please open a GitHub issue at https://github.com/Anorov/PySocks diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/RECORD b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..3e907013bc7ad29010dbc1ce85e86339b97a8abd --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/RECORD @@ -0,0 +1,12 @@ +PySocks-1.7.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +PySocks-1.7.1.dist-info/LICENSE,sha256=cCfiFOAU63i3rcwc7aWspxOnn8T2oMUsnaWz5wfm_-k,1401 +PySocks-1.7.1.dist-info/METADATA,sha256=snuJ49RLchERn_OEVglGdbaQY-srgq78o84aaw3OwyI,13556 +PySocks-1.7.1.dist-info/RECORD,, +PySocks-1.7.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +PySocks-1.7.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91 +PySocks-1.7.1.dist-info/direct_url.json,sha256=TPdQXLghXC6TNv3uvwUbuW0ixPsIn6FxHApBBNvEyGI,68 +PySocks-1.7.1.dist-info/top_level.txt,sha256=TKSOIfCFBoK9EY8FBYbYqC3PWd3--G15ph9n8-QHPDk,19 +__pycache__/socks.cpython-39.pyc,, +__pycache__/sockshandler.cpython-39.pyc,, +socks.py,sha256=xOYn27t9IGrbTBzWsUUuPa0YBuplgiUykzkOB5V5iFY,31086 +sockshandler.py,sha256=2SYGj-pwt1kjgLoZAmyeaEXCeZDWRmfVS_QG6kErGtY,3966 diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/WHEEL b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..ae527e7d64811439e61b93aa375defb30e06edfe --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (75.6.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..edd8bbcd4d93a200abe5c7e2eb3856a5942b4601 --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/pysocks_1733217287171/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..9476163ae51c2dba237187f3b76d5ff46e40892f --- /dev/null +++ b/micromamba_root/Lib/site-packages/PySocks-1.7.1.dist-info/top_level.txt @@ -0,0 +1,2 @@ +socks +sockshandler diff --git a/micromamba_root/Lib/site-packages/__pycache__/_black_version.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/_black_version.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cff353dca05227fdce883d594285e4dac8d5787 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/_black_version.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/brotli.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/brotli.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afdb2386a4b3775e399f5a70a3655d6288144719 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/brotli.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/ghp_import.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/ghp_import.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ca15056fbce25dc45be90fa1313e4d8a02795d1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/ghp_import.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/mypy_extensions.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/mypy_extensions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d975e13a9a1fced9289034058955830c551ec41 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/mypy_extensions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/py.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/py.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51b47e94cef360392acc29a740bf412177232d8f Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/py.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/six.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/six.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b1aeeb10b2fb7819084a3829e9c53bceafa1a45 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/six.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/socks.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/socks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..142f4e52846c071e7b7aa7d97aaacdf9eaff0780 Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/socks.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/sockshandler.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/sockshandler.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..228397cdc2fc96c306d06bb5205abc940c00a01d Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/sockshandler.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/win_inet_pton.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/win_inet_pton.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1126bab615e268d75d740e9f90a90c773481994f Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/win_inet_pton.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/__pycache__/yaml_env_tag.cpython-314.pyc b/micromamba_root/Lib/site-packages/__pycache__/yaml_env_tag.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e30be38f8ae89a80e1bb41374167646e157cbba Binary files /dev/null and b/micromamba_root/Lib/site-packages/__pycache__/yaml_env_tag.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__init__.py b/micromamba_root/Lib/site-packages/_pytest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8eb8ec9605c73aeba33b5a2031d59a84d6841225 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/__init__.py @@ -0,0 +1,13 @@ +from __future__ import annotations + + +__all__ = ["__version__", "version_tuple"] + +try: + from ._version import version as __version__ + from ._version import version_tuple +except ImportError: # pragma: no cover + # broken installation, we don't even try + # unknown only works because we do poor mans version compare + __version__ = "unknown" + version_tuple = (0, 0, "unknown") diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91f6ca6749acde2b684097b6499f50c856d9dfa0 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/_argcomplete.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/_argcomplete.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd11b477dbf9f90b3714bae328b2c565fb692f8b Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/_argcomplete.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/_version.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/_version.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9117fb6255e0146d27f52b714ea3af9177dbc92a Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/_version.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/cacheprovider.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/cacheprovider.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d288c8de106a15046ceb1a3e0526d742db6fcb4 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/cacheprovider.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/capture.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/capture.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d3e264fe12d243f3307d724cbb23431403ad252 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/capture.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/compat.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/compat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3444aeb59e4292c6384c2cc236a0435a6faa770 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/compat.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/debugging.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/debugging.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b42f331ae1960cf3db029e1711f94e4c24b4eb27 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/debugging.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/deprecated.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/deprecated.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d12090a8e12bc95c6aa220a6663089c0c194635e Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/deprecated.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/doctest.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/doctest.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73c5cf60afff12e792cc6ad2a96cfdfc9645d9ca Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/doctest.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/faulthandler.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/faulthandler.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d37af69b7da67802529916a6b668b129e7894f93 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/faulthandler.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/fixtures.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/fixtures.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5debeb1776ace7b4f554366513c0743af33c88a5 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/fixtures.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/freeze_support.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/freeze_support.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ab7c77f243fbc6c4f2361e09b917a63ac1e23e9 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/freeze_support.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/helpconfig.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/helpconfig.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1505e53822d6aeab7be5f43ddfbfbb76a5bad7c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/helpconfig.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/hookspec.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/hookspec.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb782fe9913a6dde0aba9f0226d59c11339cba47 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/hookspec.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/junitxml.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/junitxml.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6ef1979b872a56c812727745f1d0553036416c3 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/junitxml.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/legacypath.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/legacypath.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aca3404811092d201ab9f84d8ec9d6502f628630 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/legacypath.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/logging.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/logging.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b90856b5dafed43bc7d87993e407d7257d144e8e Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/logging.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/main.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/main.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a02b52a9953879bf4743b27e1907c277aaefae6 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/main.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/monkeypatch.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/monkeypatch.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85ca71b885e9c13c3142f046257d1db2b48df90d Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/monkeypatch.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/nodes.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/nodes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..779f66cfc9c50942befe8dbc595959bb9d0301c7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/nodes.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/outcomes.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/outcomes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84b3f32ea1bee043843dccff56c3a40e9387fad4 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/outcomes.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/pastebin.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pastebin.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8646c029d90b1f7a8f3ae488cfad73ff90d9155 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pastebin.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/pathlib.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pathlib.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24e6199daf34e3acf8b0b3df2dcfeb114b9f400c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pathlib.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/pytester_assertions.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pytester_assertions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92613beb831f8b28bc6aae9e5f5ad8e4aea18b49 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/pytester_assertions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/python.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/python.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c500255c1c31082a947946bb231862ec085f93d1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/python.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/python_api.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/python_api.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..459a64642e13300daa1b64eec8ad1baa37f36590 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/python_api.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/raises.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/raises.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83cd8c9dc5a33e4f06cbd9d9ab5ae09935b2d70d Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/raises.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/recwarn.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/recwarn.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc60f321eaf94436ec9b1cd1a141887b3362c332 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/recwarn.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/reports.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/reports.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db849a328932b93a0e1f93ee35bd855659e71d29 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/reports.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/runner.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/runner.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7721670b9fe6dfa8116fbc8076b482a6d1e150c5 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/runner.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/scope.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/scope.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..738faabeea27db4dd304e9680eb707cabcc6e56c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/scope.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/setuponly.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/setuponly.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..129cf67c4523309ae7e3b5ba2f39746835bea87a Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/setuponly.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/setupplan.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/setupplan.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f2308e6eca23cece3d450a985b4bbf6f9860ba8 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/setupplan.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/skipping.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/skipping.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc6312014b3d454e92ec8214df3e760222a8c3b1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/skipping.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/stash.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/stash.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57ea16859c2a08ae34b191214ce3f33e6787517c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/stash.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/stepwise.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/stepwise.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cbf0fb0d051a1464075dc7671a0f2d6b3363fd7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/stepwise.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/subtests.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/subtests.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbf24c44d52b139c585455a38d469626bbdbf745 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/subtests.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/terminalprogress.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/terminalprogress.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46d01eb44386edcdd7049ebece8e24b931c38318 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/terminalprogress.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/threadexception.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/threadexception.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3102edda9c55004670266cc9784ea38bf50071f Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/threadexception.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/timing.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/timing.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1e7101a87e7e629b7418bcceb82b3beac734965 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/timing.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/tmpdir.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/tmpdir.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f337354ae6c06d002970a633b27751924274299e Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/tmpdir.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/tracemalloc.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/tracemalloc.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c421f553299d059a14d99ec25dce8b5427d509fb Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/tracemalloc.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/unittest.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/unittest.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f96ed15271e82d4f906b3ec23b278059184ffd2 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/unittest.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/unraisableexception.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/unraisableexception.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50de84685b69d26d1b708d943fbc8f307edb022c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/unraisableexception.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/warning_types.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/warning_types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d112a443302876c49af86c14f88ce30ce8a859b7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/warning_types.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/__pycache__/warnings.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/__pycache__/warnings.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a60a2ba69ff116ac157d9698e83c698a7232c8d Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/__pycache__/warnings.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_argcomplete.py b/micromamba_root/Lib/site-packages/_pytest/_argcomplete.py new file mode 100644 index 0000000000000000000000000000000000000000..59426ef949ed9276b5708f9f44e6893f2333f2e1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_argcomplete.py @@ -0,0 +1,117 @@ +"""Allow bash-completion for argparse with argcomplete if installed. + +Needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail +to find the magic string, so _ARGCOMPLETE env. var is never set, and +this does not need special code). + +Function try_argcomplete(parser) should be called directly before +the call to ArgumentParser.parse_args(). + +The filescompleter is what you normally would use on the positional +arguments specification, in order to get "dirname/" after "dirn" +instead of the default "dirname ": + + optparser.add_argument(Config._file_or_dir, nargs='*').completer=filescompleter + +Other, application specific, completers should go in the file +doing the add_argument calls as they need to be specified as .completer +attributes as well. (If argcomplete is not installed, the function the +attribute points to will not be used). + +SPEEDUP +======= + +The generic argcomplete script for bash-completion +(/etc/bash_completion.d/python-argcomplete.sh) +uses a python program to determine startup script generated by pip. +You can speed up completion somewhat by changing this script to include + # PYTHON_ARGCOMPLETE_OK +so the python-argcomplete-check-easy-install-script does not +need to be called to find the entry point of the code and see if that is +marked with PYTHON_ARGCOMPLETE_OK. + +INSTALL/DEBUGGING +================= + +To include this support in another application that has setup.py generated +scripts: + +- Add the line: + # PYTHON_ARGCOMPLETE_OK + near the top of the main python entry point. + +- Include in the file calling parse_args(): + from _argcomplete import try_argcomplete, filescompleter + Call try_argcomplete just before parse_args(), and optionally add + filescompleter to the positional arguments' add_argument(). + +If things do not work right away: + +- Switch on argcomplete debugging with (also helpful when doing custom + completers): + export _ARC_DEBUG=1 + +- Run: + python-argcomplete-check-easy-install-script $(which appname) + echo $? + will echo 0 if the magic line has been found, 1 if not. + +- Sometimes it helps to find early on errors using: + _ARGCOMPLETE=1 _ARC_DEBUG=1 appname + which should throw a KeyError: 'COMPLINE' (which is properly set by the + global argcomplete script). +""" + +from __future__ import annotations + +import argparse +from glob import glob +import os +import sys +from typing import Any + + +class FastFilesCompleter: + """Fast file completer class.""" + + def __init__(self, directories: bool = True) -> None: + self.directories = directories + + def __call__(self, prefix: str, **kwargs: Any) -> list[str]: + # Only called on non option completions. + if os.sep in prefix[1:]: + prefix_dir = len(os.path.dirname(prefix) + os.sep) + else: + prefix_dir = 0 + completion = [] + globbed = [] + if "*" not in prefix and "?" not in prefix: + # We are on unix, otherwise no bash. + if not prefix or prefix[-1] == os.sep: + globbed.extend(glob(prefix + ".*")) + prefix += "*" + globbed.extend(glob(prefix)) + for x in sorted(globbed): + if os.path.isdir(x): + x += "/" + # Append stripping the prefix (like bash, not like compgen). + completion.append(x[prefix_dir:]) + return completion + + +if os.environ.get("_ARGCOMPLETE"): + try: + import argcomplete.completers + except ImportError: + sys.exit(-1) + filescompleter: FastFilesCompleter | None = FastFilesCompleter() + + def try_argcomplete(parser: argparse.ArgumentParser) -> None: + argcomplete.autocomplete(parser, always_complete_options=False) + +else: + + def try_argcomplete(parser: argparse.ArgumentParser) -> None: + pass + + filescompleter = None diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/__init__.py b/micromamba_root/Lib/site-packages/_pytest/_code/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f67a2e3e0a6f34e04444d9410f517d59d21c422 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_code/__init__.py @@ -0,0 +1,26 @@ +"""Python inspection/code generation API.""" + +from __future__ import annotations + +from .code import Code +from .code import ExceptionInfo +from .code import filter_traceback +from .code import Frame +from .code import getfslineno +from .code import Traceback +from .code import TracebackEntry +from .source import getrawcode +from .source import Source + + +__all__ = [ + "Code", + "ExceptionInfo", + "Frame", + "Source", + "Traceback", + "TracebackEntry", + "filter_traceback", + "getfslineno", + "getrawcode", +] diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d99640e0063f520c7fd6fecf1b308df142279643 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/code.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/code.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..051ec6b74d738f61ca728279ecf93135b7fa8c4c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/code.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/source.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/source.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae7068242baf59da59c13be64308d3995113a243 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_code/__pycache__/source.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/code.py b/micromamba_root/Lib/site-packages/_pytest/_code/code.py new file mode 100644 index 0000000000000000000000000000000000000000..4cf99a77340f13b0b57937b7cbfea325233c8702 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_code/code.py @@ -0,0 +1,1571 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import ast +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Mapping +from collections.abc import Sequence +import dataclasses +import inspect +from inspect import CO_VARARGS +from inspect import CO_VARKEYWORDS +from io import StringIO +import os +from pathlib import Path +import re +import sys +from traceback import extract_tb +from traceback import format_exception +from traceback import format_exception_only +from traceback import FrameSummary +from types import CodeType +from types import FrameType +from types import TracebackType +from typing import Any +from typing import ClassVar +from typing import Final +from typing import final +from typing import Generic +from typing import Literal +from typing import overload +from typing import SupportsIndex +from typing import TypeAlias +from typing import TypeVar + +import pluggy + +import _pytest +from _pytest._code.source import findsource +from _pytest._code.source import getrawcode +from _pytest._code.source import getstatementrange_ast +from _pytest._code.source import Source +from _pytest._io import TerminalWriter +from _pytest._io.saferepr import safeformat +from _pytest._io.saferepr import saferepr +from _pytest.compat import get_real_func +from _pytest.deprecated import check_ispytest +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + +TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] + +EXCEPTION_OR_MORE = type[BaseException] | tuple[type[BaseException], ...] + + +class Code: + """Wrapper around Python code objects.""" + + __slots__ = ("raw",) + + def __init__(self, obj: CodeType) -> None: + self.raw = obj + + @classmethod + def from_function(cls, obj: object) -> Code: + return cls(getrawcode(obj)) + + def __eq__(self, other): + return self.raw == other.raw + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + @property + def firstlineno(self) -> int: + return self.raw.co_firstlineno - 1 + + @property + def name(self) -> str: + return self.raw.co_name + + @property + def path(self) -> Path | str: + """Return a path object pointing to source code, or an ``str`` in + case of ``OSError`` / non-existing file.""" + if not self.raw.co_filename: + return "" + try: + p = absolutepath(self.raw.co_filename) + # maybe don't try this checking + if not p.exists(): + raise OSError("path check failed.") + return p + except OSError: + # XXX maybe try harder like the weird logic + # in the standard lib [linecache.updatecache] does? + return self.raw.co_filename + + @property + def fullsource(self) -> Source | None: + """Return a _pytest._code.Source object for the full source file of the code.""" + full, _ = findsource(self.raw) + return full + + def source(self) -> Source: + """Return a _pytest._code.Source object for the code object's source only.""" + # return source only for that part of code + return Source(self.raw) + + def getargs(self, var: bool = False) -> tuple[str, ...]: + """Return a tuple with the argument names for the code object. + + If 'var' is set True also return the names of the variable and + keyword arguments when present. + """ + # Handy shortcut for getting args. + raw = self.raw + argcount = raw.co_argcount + if var: + argcount += raw.co_flags & CO_VARARGS + argcount += raw.co_flags & CO_VARKEYWORDS + return raw.co_varnames[:argcount] + + +class Frame: + """Wrapper around a Python frame holding f_locals and f_globals + in which expressions can be evaluated.""" + + __slots__ = ("raw",) + + def __init__(self, frame: FrameType) -> None: + self.raw = frame + + @property + def lineno(self) -> int: + return self.raw.f_lineno - 1 + + @property + def f_globals(self) -> dict[str, Any]: + return self.raw.f_globals + + @property + def f_locals(self) -> dict[str, Any]: + return self.raw.f_locals + + @property + def code(self) -> Code: + return Code(self.raw.f_code) + + @property + def statement(self) -> Source: + """Statement this frame is at.""" + if self.code.fullsource is None: + return Source("") + return self.code.fullsource.getstatement(self.lineno) + + def eval(self, code, **vars): + """Evaluate 'code' in the frame. + + 'vars' are optional additional local variables. + + Returns the result of the evaluation. + """ + f_locals = self.f_locals.copy() + f_locals.update(vars) + return eval(code, self.f_globals, f_locals) + + def repr(self, object: object) -> str: + """Return a 'safe' (non-recursive, one-line) string repr for 'object'.""" + return saferepr(object) + + def getargs(self, var: bool = False): + """Return a list of tuples (name, value) for all arguments. + + If 'var' is set True, also include the variable and keyword arguments + when present. + """ + retval = [] + for arg in self.code.getargs(var): + try: + retval.append((arg, self.f_locals[arg])) + except KeyError: + pass # this can occur when using Psyco + return retval + + +class TracebackEntry: + """A single entry in a Traceback.""" + + __slots__ = ("_rawentry", "_repr_style") + + def __init__( + self, + rawentry: TracebackType, + repr_style: Literal["short", "long"] | None = None, + ) -> None: + self._rawentry: Final = rawentry + self._repr_style: Final = repr_style + + def with_repr_style( + self, repr_style: Literal["short", "long"] | None + ) -> TracebackEntry: + return TracebackEntry(self._rawentry, repr_style) + + @property + def lineno(self) -> int: + return self._rawentry.tb_lineno - 1 + + def get_python_framesummary(self) -> FrameSummary: + # Python's built-in traceback module implements all the nitty gritty + # details to get column numbers of out frames. + stack_summary = extract_tb(self._rawentry, limit=1) + return stack_summary[0] + + # Column and end line numbers introduced in python 3.11 + if sys.version_info < (3, 11): + + @property + def end_lineno_relative(self) -> int | None: + return None + + @property + def colno(self) -> int | None: + return None + + @property + def end_colno(self) -> int | None: + return None + else: + + @property + def end_lineno_relative(self) -> int | None: + frame_summary = self.get_python_framesummary() + if frame_summary.end_lineno is None: # pragma: no cover + return None + return frame_summary.end_lineno - 1 - self.frame.code.firstlineno + + @property + def colno(self) -> int | None: + """Starting byte offset of the expression in the traceback entry.""" + return self.get_python_framesummary().colno + + @property + def end_colno(self) -> int | None: + """Ending byte offset of the expression in the traceback entry.""" + return self.get_python_framesummary().end_colno + + @property + def frame(self) -> Frame: + return Frame(self._rawentry.tb_frame) + + @property + def relline(self) -> int: + return self.lineno - self.frame.code.firstlineno + + def __repr__(self) -> str: + return f"" + + @property + def statement(self) -> Source: + """_pytest._code.Source object for the current statement.""" + source = self.frame.code.fullsource + assert source is not None + return source.getstatement(self.lineno) + + @property + def path(self) -> Path | str: + """Path to the source code.""" + return self.frame.code.path + + @property + def locals(self) -> dict[str, Any]: + """Locals of underlying frame.""" + return self.frame.f_locals + + def getfirstlinesource(self) -> int: + return self.frame.code.firstlineno + + def getsource( + self, astcache: dict[str | Path, ast.AST] | None = None + ) -> Source | None: + """Return failing source code.""" + # we use the passed in astcache to not reparse asttrees + # within exception info printing + source = self.frame.code.fullsource + if source is None: + return None + key = astnode = None + if astcache is not None: + key = self.frame.code.path + if key is not None: + astnode = astcache.get(key, None) + start = self.getfirstlinesource() + try: + astnode, _, end = getstatementrange_ast( + self.lineno, source, astnode=astnode + ) + except SyntaxError: + end = self.lineno + 1 + else: + if key is not None and astcache is not None: + astcache[key] = astnode + return source[start:end] + + source = property(getsource) + + def ishidden(self, excinfo: ExceptionInfo[BaseException] | None) -> bool: + """Return True if the current frame has a var __tracebackhide__ + resolving to True. + + If __tracebackhide__ is a callable, it gets called with the + ExceptionInfo instance and can decide whether to hide the traceback. + + Mostly for internal use. + """ + tbh: bool | Callable[[ExceptionInfo[BaseException] | None], bool] = False + for maybe_ns_dct in (self.frame.f_locals, self.frame.f_globals): + # in normal cases, f_locals and f_globals are dictionaries + # however via `exec(...)` / `eval(...)` they can be other types + # (even incorrect types!). + # as such, we suppress all exceptions while accessing __tracebackhide__ + try: + tbh = maybe_ns_dct["__tracebackhide__"] + except Exception: + pass + else: + break + if tbh and callable(tbh): + return tbh(excinfo) + return tbh + + def __str__(self) -> str: + name = self.frame.code.name + try: + line = str(self.statement).lstrip() + except KeyboardInterrupt: + raise + except BaseException: + line = "???" + # This output does not quite match Python's repr for traceback entries, + # but changing it to do so would break certain plugins. See + # https://github.com/pytest-dev/pytest/pull/7535/ for details. + return f" File '{self.path}':{self.lineno + 1} in {name}\n {line}\n" + + @property + def name(self) -> str: + """co_name of underlying code.""" + return self.frame.code.raw.co_name + + +class Traceback(list[TracebackEntry]): + """Traceback objects encapsulate and offer higher level access to Traceback entries.""" + + def __init__( + self, + tb: TracebackType | Iterable[TracebackEntry], + ) -> None: + """Initialize from given python traceback object and ExceptionInfo.""" + if isinstance(tb, TracebackType): + + def f(cur: TracebackType) -> Iterable[TracebackEntry]: + cur_: TracebackType | None = cur + while cur_ is not None: + yield TracebackEntry(cur_) + cur_ = cur_.tb_next + + super().__init__(f(tb)) + else: + super().__init__(tb) + + def cut( + self, + path: os.PathLike[str] | str | None = None, + lineno: int | None = None, + firstlineno: int | None = None, + excludepath: os.PathLike[str] | None = None, + ) -> Traceback: + """Return a Traceback instance wrapping part of this Traceback. + + By providing any combination of path, lineno and firstlineno, the + first frame to start the to-be-returned traceback is determined. + + This allows cutting the first part of a Traceback instance e.g. + for formatting reasons (removing some uninteresting bits that deal + with handling of the exception/traceback). + """ + path_ = None if path is None else os.fspath(path) + excludepath_ = None if excludepath is None else os.fspath(excludepath) + for x in self: + code = x.frame.code + codepath = code.path + if path is not None and str(codepath) != path_: + continue + if ( + excludepath is not None + and isinstance(codepath, Path) + and excludepath_ in (str(p) for p in codepath.parents) # type: ignore[operator] + ): + continue + if lineno is not None and x.lineno != lineno: + continue + if firstlineno is not None and x.frame.code.firstlineno != firstlineno: + continue + return Traceback(x._rawentry) + return self + + @overload + def __getitem__(self, key: SupportsIndex) -> TracebackEntry: ... + + @overload + def __getitem__(self, key: slice) -> Traceback: ... + + def __getitem__(self, key: SupportsIndex | slice) -> TracebackEntry | Traceback: + if isinstance(key, slice): + return self.__class__(super().__getitem__(key)) + else: + return super().__getitem__(key) + + def filter( + self, + excinfo_or_fn: ExceptionInfo[BaseException] | Callable[[TracebackEntry], bool], + /, + ) -> Traceback: + """Return a Traceback instance with certain items removed. + + If the filter is an `ExceptionInfo`, removes all the ``TracebackEntry``s + which are hidden (see ishidden() above). + + Otherwise, the filter is a function that gets a single argument, a + ``TracebackEntry`` instance, and should return True when the item should + be added to the ``Traceback``, False when not. + """ + if isinstance(excinfo_or_fn, ExceptionInfo): + fn = lambda x: not x.ishidden(excinfo_or_fn) # noqa: E731 + else: + fn = excinfo_or_fn + return Traceback(filter(fn, self)) + + def recursionindex(self) -> int | None: + """Return the index of the frame/TracebackEntry where recursion originates if + appropriate, None if no recursion occurred.""" + cache: dict[tuple[Any, int, int], list[dict[str, Any]]] = {} + for i, entry in enumerate(self): + # id for the code.raw is needed to work around + # the strange metaprogramming in the decorator lib from pypi + # which generates code objects that have hash/value equality + # XXX needs a test + key = entry.frame.code.path, id(entry.frame.code.raw), entry.lineno + values = cache.setdefault(key, []) + # Since Python 3.13 f_locals is a proxy, freeze it. + loc = dict(entry.frame.f_locals) + if values: + for otherloc in values: + if otherloc == loc: + return i + values.append(loc) + return None + + +def stringify_exception( + exc: BaseException, include_subexception_msg: bool = True +) -> str: + try: + notes = getattr(exc, "__notes__", []) + except KeyError: + # Workaround for https://github.com/python/cpython/issues/98778 on + # some 3.10 and 3.11 patch versions. + HTTPError = getattr(sys.modules.get("urllib.error", None), "HTTPError", ()) + if sys.version_info < (3, 12) and isinstance(exc, HTTPError): + notes = [] + else: # pragma: no cover + # exception not related to above bug, reraise + raise + if not include_subexception_msg and isinstance(exc, BaseExceptionGroup): + message = exc.message + else: + message = str(exc) + + return "\n".join( + [ + message, + *notes, + ] + ) + + +E = TypeVar("E", bound=BaseException, covariant=True) + + +@final +@dataclasses.dataclass +class ExceptionInfo(Generic[E]): + """Wraps sys.exc_info() objects and offers help for navigating the traceback.""" + + _assert_start_repr: ClassVar = "AssertionError('assert " + + _excinfo: tuple[type[E], E, TracebackType] | None + _striptext: str + _traceback: Traceback | None + + def __init__( + self, + excinfo: tuple[type[E], E, TracebackType] | None, + striptext: str = "", + traceback: Traceback | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._excinfo = excinfo + self._striptext = striptext + self._traceback = traceback + + @classmethod + def from_exception( + cls, + # Ignoring error: "Cannot use a covariant type variable as a parameter". + # This is OK to ignore because this class is (conceptually) readonly. + # See https://github.com/python/mypy/issues/7049. + exception: E, # type: ignore[misc] + exprinfo: str | None = None, + ) -> ExceptionInfo[E]: + """Return an ExceptionInfo for an existing exception. + + The exception must have a non-``None`` ``__traceback__`` attribute, + otherwise this function fails with an assertion error. This means that + the exception must have been raised, or added a traceback with the + :py:meth:`~BaseException.with_traceback()` method. + + :param exprinfo: + A text string helping to determine if we should strip + ``AssertionError`` from the output. Defaults to the exception + message/``__str__()``. + + .. versionadded:: 7.4 + """ + assert exception.__traceback__, ( + "Exceptions passed to ExcInfo.from_exception(...)" + " must have a non-None __traceback__." + ) + exc_info = (type(exception), exception, exception.__traceback__) + return cls.from_exc_info(exc_info, exprinfo) + + @classmethod + def from_exc_info( + cls, + exc_info: tuple[type[E], E, TracebackType], + exprinfo: str | None = None, + ) -> ExceptionInfo[E]: + """Like :func:`from_exception`, but using old-style exc_info tuple.""" + _striptext = "" + if exprinfo is None and isinstance(exc_info[1], AssertionError): + exprinfo = getattr(exc_info[1], "msg", None) + if exprinfo is None: + exprinfo = saferepr(exc_info[1]) + if exprinfo and exprinfo.startswith(cls._assert_start_repr): + _striptext = "AssertionError: " + + return cls(exc_info, _striptext, _ispytest=True) + + @classmethod + def from_current(cls, exprinfo: str | None = None) -> ExceptionInfo[BaseException]: + """Return an ExceptionInfo matching the current traceback. + + .. warning:: + + Experimental API + + :param exprinfo: + A text string helping to determine if we should strip + ``AssertionError`` from the output. Defaults to the exception + message/``__str__()``. + """ + tup = sys.exc_info() + assert tup[0] is not None, "no current exception" + assert tup[1] is not None, "no current exception" + assert tup[2] is not None, "no current exception" + exc_info = (tup[0], tup[1], tup[2]) + return ExceptionInfo.from_exc_info(exc_info, exprinfo) + + @classmethod + def for_later(cls) -> ExceptionInfo[E]: + """Return an unfilled ExceptionInfo.""" + return cls(None, _ispytest=True) + + def fill_unfilled(self, exc_info: tuple[type[E], E, TracebackType]) -> None: + """Fill an unfilled ExceptionInfo created with ``for_later()``.""" + assert self._excinfo is None, "ExceptionInfo was already filled" + self._excinfo = exc_info + + @property + def type(self) -> type[E]: + """The exception class.""" + assert self._excinfo is not None, ( + ".type can only be used after the context manager exits" + ) + return self._excinfo[0] + + @property + def value(self) -> E: + """The exception value.""" + assert self._excinfo is not None, ( + ".value can only be used after the context manager exits" + ) + return self._excinfo[1] + + @property + def tb(self) -> TracebackType: + """The exception raw traceback.""" + assert self._excinfo is not None, ( + ".tb can only be used after the context manager exits" + ) + return self._excinfo[2] + + @property + def typename(self) -> str: + """The type name of the exception.""" + assert self._excinfo is not None, ( + ".typename can only be used after the context manager exits" + ) + return self.type.__name__ + + @property + def traceback(self) -> Traceback: + """The traceback.""" + if self._traceback is None: + self._traceback = Traceback(self.tb) + return self._traceback + + @traceback.setter + def traceback(self, value: Traceback) -> None: + self._traceback = value + + def __repr__(self) -> str: + if self._excinfo is None: + return "" + return f"<{self.__class__.__name__} {saferepr(self._excinfo[1])} tblen={len(self.traceback)}>" + + def exconly(self, tryshort: bool = False) -> str: + """Return the exception as a string. + + When 'tryshort' resolves to True, and the exception is an + AssertionError, only the actual exception part of the exception + representation is returned (so 'AssertionError: ' is removed from + the beginning). + """ + + def _get_single_subexc( + eg: BaseExceptionGroup[BaseException], + ) -> BaseException | None: + if len(eg.exceptions) != 1: + return None + if isinstance(e := eg.exceptions[0], BaseExceptionGroup): + return _get_single_subexc(e) + return e + + if ( + tryshort + and isinstance(self.value, BaseExceptionGroup) + and (subexc := _get_single_subexc(self.value)) is not None + ): + return f"{subexc!r} [single exception in {type(self.value).__name__}]" + + lines = format_exception_only(self.type, self.value) + text = "".join(lines) + text = text.rstrip() + if tryshort: + if text.startswith(self._striptext): + text = text[len(self._striptext) :] + return text + + def errisinstance(self, exc: EXCEPTION_OR_MORE) -> bool: + """Return True if the exception is an instance of exc. + + Consider using ``isinstance(excinfo.value, exc)`` instead. + """ + return isinstance(self.value, exc) + + def _getreprcrash(self) -> ReprFileLocation | None: + # Find last non-hidden traceback entry that led to the exception of the + # traceback, or None if all hidden. + for i in range(-1, -len(self.traceback) - 1, -1): + entry = self.traceback[i] + if not entry.ishidden(self): + path, lineno = entry.frame.code.raw.co_filename, entry.lineno + exconly = self.exconly(tryshort=True) + return ReprFileLocation(path, lineno + 1, exconly) + return None + + def getrepr( + self, + showlocals: bool = False, + style: TracebackStyle = "long", + abspath: bool = False, + tbfilter: bool | Callable[[ExceptionInfo[BaseException]], Traceback] = True, + funcargs: bool = False, + truncate_locals: bool = True, + truncate_args: bool = True, + chain: bool = True, + ) -> ReprExceptionInfo | ExceptionChainRepr: + """Return str()able representation of this exception info. + + :param bool showlocals: + Show locals per traceback entry. + Ignored if ``style=="native"``. + + :param str style: + long|short|line|no|native|value traceback style. + + :param bool abspath: + If paths should be changed to absolute or left unchanged. + + :param tbfilter: + A filter for traceback entries. + + * If false, don't hide any entries. + * If true, hide internal entries and entries that contain a local + variable ``__tracebackhide__ = True``. + * If a callable, delegates the filtering to the callable. + + Ignored if ``style`` is ``"native"``. + + :param bool funcargs: + Show fixtures ("funcargs" for legacy purposes) per traceback entry. + + :param bool truncate_locals: + With ``showlocals==True``, make sure locals can be safely represented as strings. + + :param bool truncate_args: + With ``showargs==True``, make sure args can be safely represented as strings. + + :param bool chain: + If chained exceptions in Python 3 should be shown. + + .. versionchanged:: 3.9 + + Added the ``chain`` parameter. + """ + if style == "native": + return ReprExceptionInfo( + reprtraceback=ReprTracebackNative( + format_exception( + self.type, + self.value, + self.traceback[0]._rawentry if self.traceback else None, + ) + ), + reprcrash=self._getreprcrash(), + ) + + fmt = FormattedExcinfo( + showlocals=showlocals, + style=style, + abspath=abspath, + tbfilter=tbfilter, + funcargs=funcargs, + truncate_locals=truncate_locals, + truncate_args=truncate_args, + chain=chain, + ) + return fmt.repr_excinfo(self) + + def match(self, regexp: str | re.Pattern[str]) -> Literal[True]: + """Check whether the regular expression `regexp` matches the string + representation of the exception using :func:`python:re.search`. + + If it matches `True` is returned, otherwise an `AssertionError` is raised. + """ + __tracebackhide__ = True + value = stringify_exception(self.value) + msg = ( + f"Regex pattern did not match.\n" + f" Expected regex: {regexp!r}\n" + f" Actual message: {value!r}" + ) + if regexp == value: + msg += "\n Did you mean to `re.escape()` the regex?" + assert re.search(regexp, value), msg + # Return True to allow for "assert excinfo.match()". + return True + + def _group_contains( + self, + exc_group: BaseExceptionGroup[BaseException], + expected_exception: EXCEPTION_OR_MORE, + match: str | re.Pattern[str] | None, + target_depth: int | None = None, + current_depth: int = 1, + ) -> bool: + """Return `True` if a `BaseExceptionGroup` contains a matching exception.""" + if (target_depth is not None) and (current_depth > target_depth): + # already descended past the target depth + return False + for exc in exc_group.exceptions: + if isinstance(exc, BaseExceptionGroup): + if self._group_contains( + exc, expected_exception, match, target_depth, current_depth + 1 + ): + return True + if (target_depth is not None) and (current_depth != target_depth): + # not at the target depth, no match + continue + if not isinstance(exc, expected_exception): + continue + if match is not None: + value = stringify_exception(exc) + if not re.search(match, value): + continue + return True + return False + + def group_contains( + self, + expected_exception: EXCEPTION_OR_MORE, + *, + match: str | re.Pattern[str] | None = None, + depth: int | None = None, + ) -> bool: + """Check whether a captured exception group contains a matching exception. + + :param Type[BaseException] | Tuple[Type[BaseException]] expected_exception: + The expected exception type, or a tuple if one of multiple possible + exception types are expected. + + :param str | re.Pattern[str] | None match: + If specified, a string containing a regular expression, + or a regular expression object, that is tested against the string + representation of the exception and its `PEP-678 ` `__notes__` + using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. + + :param Optional[int] depth: + If `None`, will search for a matching exception at any nesting depth. + If >= 1, will only match an exception if it's at the specified depth (depth = 1 being + the exceptions contained within the topmost exception group). + + .. versionadded:: 8.0 + + .. warning:: + This helper makes it easy to check for the presence of specific exceptions, + but it is very bad for checking that the group does *not* contain + *any other exceptions*. + You should instead consider using :class:`pytest.RaisesGroup` + + """ + msg = "Captured exception is not an instance of `BaseExceptionGroup`" + assert isinstance(self.value, BaseExceptionGroup), msg + msg = "`depth` must be >= 1 if specified" + assert (depth is None) or (depth >= 1), msg + return self._group_contains(self.value, expected_exception, match, depth) + + +# Type alias for the `tbfilter` setting: +# bool: If True, it should be filtered using Traceback.filter() +# callable: A callable that takes an ExceptionInfo and returns the filtered traceback. +TracebackFilter: TypeAlias = bool | Callable[[ExceptionInfo[BaseException]], Traceback] + + +@dataclasses.dataclass +class FormattedExcinfo: + """Presenting information about failing Functions and Generators.""" + + # for traceback entries + flow_marker: ClassVar = ">" + fail_marker: ClassVar = "E" + + showlocals: bool = False + style: TracebackStyle = "long" + abspath: bool = True + tbfilter: TracebackFilter = True + funcargs: bool = False + truncate_locals: bool = True + truncate_args: bool = True + chain: bool = True + astcache: dict[str | Path, ast.AST] = dataclasses.field( + default_factory=dict, init=False, repr=False + ) + + def _getindent(self, source: Source) -> int: + # Figure out indent for the given source. + try: + s = str(source.getstatement(len(source) - 1)) + except KeyboardInterrupt: + raise + except BaseException: + try: + s = str(source[-1]) + except KeyboardInterrupt: + raise + except BaseException: + return 0 + return 4 + (len(s) - len(s.lstrip())) + + def _getentrysource(self, entry: TracebackEntry) -> Source | None: + source = entry.getsource(self.astcache) + if source is not None: + source = source.deindent() + return source + + def repr_args(self, entry: TracebackEntry) -> ReprFuncArgs | None: + if self.funcargs: + args = [] + for argname, argvalue in entry.frame.getargs(var=True): + if self.truncate_args: + str_repr = saferepr(argvalue) + else: + str_repr = saferepr(argvalue, maxsize=None) + args.append((argname, str_repr)) + return ReprFuncArgs(args) + return None + + def get_source( + self, + source: Source | None, + line_index: int = -1, + excinfo: ExceptionInfo[BaseException] | None = None, + short: bool = False, + end_line_index: int | None = None, + colno: int | None = None, + end_colno: int | None = None, + ) -> list[str]: + """Return formatted and marked up source lines.""" + lines = [] + if source is not None and line_index < 0: + line_index += len(source) + if source is None or line_index >= len(source.lines) or line_index < 0: + # `line_index` could still be outside `range(len(source.lines))` if + # we're processing AST with pathological position attributes. + source = Source("???") + line_index = 0 + space_prefix = " " + if short: + lines.append(space_prefix + source.lines[line_index].strip()) + lines.extend( + self.get_highlight_arrows_for_line( + raw_line=source.raw_lines[line_index], + line=source.lines[line_index].strip(), + lineno=line_index, + end_lineno=end_line_index, + colno=colno, + end_colno=end_colno, + ) + ) + else: + for line in source.lines[:line_index]: + lines.append(space_prefix + line) + lines.append(self.flow_marker + " " + source.lines[line_index]) + lines.extend( + self.get_highlight_arrows_for_line( + raw_line=source.raw_lines[line_index], + line=source.lines[line_index], + lineno=line_index, + end_lineno=end_line_index, + colno=colno, + end_colno=end_colno, + ) + ) + for line in source.lines[line_index + 1 :]: + lines.append(space_prefix + line) + if excinfo is not None: + indent = 4 if short else self._getindent(source) + lines.extend(self.get_exconly(excinfo, indent=indent, markall=True)) + return lines + + def get_highlight_arrows_for_line( + self, + line: str, + raw_line: str, + lineno: int | None, + end_lineno: int | None, + colno: int | None, + end_colno: int | None, + ) -> list[str]: + """Return characters highlighting a source line. + + Example with colno and end_colno pointing to the bar expression: + "foo() + bar()" + returns " ^^^^^" + """ + if lineno != end_lineno: + # Don't handle expressions that span multiple lines. + return [] + if colno is None or end_colno is None: + # Can't do anything without column information. + return [] + + num_stripped_chars = len(raw_line) - len(line) + + start_char_offset = _byte_offset_to_character_offset(raw_line, colno) + end_char_offset = _byte_offset_to_character_offset(raw_line, end_colno) + num_carets = end_char_offset - start_char_offset + # If the highlight would span the whole line, it is redundant, don't + # show it. + if num_carets >= len(line.strip()): + return [] + + highlights = " " + highlights += " " * (start_char_offset - num_stripped_chars + 1) + highlights += "^" * num_carets + return [highlights] + + def get_exconly( + self, + excinfo: ExceptionInfo[BaseException], + indent: int = 4, + markall: bool = False, + ) -> list[str]: + lines = [] + indentstr = " " * indent + # Get the real exception information out. + exlines = excinfo.exconly(tryshort=True).split("\n") + failindent = self.fail_marker + indentstr[1:] + for line in exlines: + lines.append(failindent + line) + if not markall: + failindent = indentstr + return lines + + def repr_locals(self, locals: Mapping[str, object]) -> ReprLocals | None: + if self.showlocals: + lines = [] + keys = [loc for loc in locals if loc[0] != "@"] + keys.sort() + for name in keys: + value = locals[name] + if name == "__builtins__": + lines.append("__builtins__ = ") + else: + # This formatting could all be handled by the + # _repr() function, which is only reprlib.Repr in + # disguise, so is very configurable. + if self.truncate_locals: + str_repr = saferepr(value) + else: + str_repr = safeformat(value) + # if len(str_repr) < 70 or not isinstance(value, (list, tuple, dict)): + lines.append(f"{name:<10} = {str_repr}") + # else: + # self._line("%-10s =\\" % (name,)) + # # XXX + # pprint.pprint(value, stream=self.excinfowriter) + return ReprLocals(lines) + return None + + def repr_traceback_entry( + self, + entry: TracebackEntry | None, + excinfo: ExceptionInfo[BaseException] | None = None, + ) -> ReprEntry: + lines: list[str] = [] + style = ( + entry._repr_style + if entry is not None and entry._repr_style is not None + else self.style + ) + if style in ("short", "long") and entry is not None: + source = self._getentrysource(entry) + if source is None: + source = Source("???") + line_index = 0 + end_line_index, colno, end_colno = None, None, None + else: + line_index = entry.relline + end_line_index = entry.end_lineno_relative + colno = entry.colno + end_colno = entry.end_colno + short = style == "short" + reprargs = self.repr_args(entry) if not short else None + s = self.get_source( + source=source, + line_index=line_index, + excinfo=excinfo, + short=short, + end_line_index=end_line_index, + colno=colno, + end_colno=end_colno, + ) + lines.extend(s) + if short: + message = f"in {entry.name}" + else: + message = (excinfo and excinfo.typename) or "" + entry_path = entry.path + path = self._makepath(entry_path) + reprfileloc = ReprFileLocation(path, entry.lineno + 1, message) + localsrepr = self.repr_locals(entry.locals) + return ReprEntry(lines, reprargs, localsrepr, reprfileloc, style) + elif style == "value": + if excinfo: + lines.extend(str(excinfo.value).split("\n")) + return ReprEntry(lines, None, None, None, style) + else: + if excinfo: + lines.extend(self.get_exconly(excinfo, indent=4)) + return ReprEntry(lines, None, None, None, style) + + def _makepath(self, path: Path | str) -> str: + if not self.abspath and isinstance(path, Path): + try: + np = bestrelpath(Path.cwd(), path) + except OSError: + return str(path) + if len(np) < len(str(path)): + return np + return str(path) + + def repr_traceback(self, excinfo: ExceptionInfo[BaseException]) -> ReprTraceback: + traceback = filter_excinfo_traceback(self.tbfilter, excinfo) + + if isinstance(excinfo.value, RecursionError): + traceback, extraline = self._truncate_recursive_traceback(traceback) + else: + extraline = None + + if not traceback: + if extraline is None: + extraline = "All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames." + entries = [self.repr_traceback_entry(None, excinfo)] + return ReprTraceback(entries, extraline, style=self.style) + + last = traceback[-1] + if self.style == "value": + entries = [self.repr_traceback_entry(last, excinfo)] + return ReprTraceback(entries, None, style=self.style) + + entries = [ + self.repr_traceback_entry(entry, excinfo if last == entry else None) + for entry in traceback + ] + return ReprTraceback(entries, extraline, style=self.style) + + def _truncate_recursive_traceback( + self, traceback: Traceback + ) -> tuple[Traceback, str | None]: + """Truncate the given recursive traceback trying to find the starting + point of the recursion. + + The detection is done by going through each traceback entry and + finding the point in which the locals of the frame are equal to the + locals of a previous frame (see ``recursionindex()``). + + Handle the situation where the recursion process might raise an + exception (for example comparing numpy arrays using equality raises a + TypeError), in which case we do our best to warn the user of the + error and show a limited traceback. + """ + try: + recursionindex = traceback.recursionindex() + except Exception as e: + max_frames = 10 + extraline: str | None = ( + "!!! Recursion error detected, but an error occurred locating the origin of recursion.\n" + " The following exception happened when comparing locals in the stack frame:\n" + f" {type(e).__name__}: {e!s}\n" + f" Displaying first and last {max_frames} stack frames out of {len(traceback)}." + ) + # Type ignored because adding two instances of a List subtype + # currently incorrectly has type List instead of the subtype. + traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore + else: + if recursionindex is not None: + extraline = "!!! Recursion detected (same locals & position)" + traceback = traceback[: recursionindex + 1] + else: + extraline = None + + return traceback, extraline + + def repr_excinfo(self, excinfo: ExceptionInfo[BaseException]) -> ExceptionChainRepr: + repr_chain: list[tuple[ReprTraceback, ReprFileLocation | None, str | None]] = [] + e: BaseException | None = excinfo.value + excinfo_: ExceptionInfo[BaseException] | None = excinfo + descr = None + seen: set[int] = set() + while e is not None and id(e) not in seen: + seen.add(id(e)) + + if excinfo_: + # Fall back to native traceback as a temporary workaround until + # full support for exception groups added to ExceptionInfo. + # See https://github.com/pytest-dev/pytest/issues/9159 + reprtraceback: ReprTraceback | ReprTracebackNative + if isinstance(e, BaseExceptionGroup): + # don't filter any sub-exceptions since they shouldn't have any internal frames + traceback = filter_excinfo_traceback(self.tbfilter, excinfo) + reprtraceback = ReprTracebackNative( + format_exception( + type(excinfo.value), + excinfo.value, + traceback[0]._rawentry if traceback else None, + ) + ) + if not traceback: + reprtraceback.extraline = ( + "All traceback entries are hidden. " + "Pass `--full-trace` to see hidden and internal frames." + ) + + else: + reprtraceback = self.repr_traceback(excinfo_) + reprcrash = excinfo_._getreprcrash() + else: + # Fallback to native repr if the exception doesn't have a traceback: + # ExceptionInfo objects require a full traceback to work. + reprtraceback = ReprTracebackNative(format_exception(type(e), e, None)) + reprcrash = None + repr_chain += [(reprtraceback, reprcrash, descr)] + + if e.__cause__ is not None and self.chain: + e = e.__cause__ + excinfo_ = ExceptionInfo.from_exception(e) if e.__traceback__ else None + descr = "The above exception was the direct cause of the following exception:" + elif ( + e.__context__ is not None and not e.__suppress_context__ and self.chain + ): + e = e.__context__ + excinfo_ = ExceptionInfo.from_exception(e) if e.__traceback__ else None + descr = "During handling of the above exception, another exception occurred:" + else: + e = None + repr_chain.reverse() + return ExceptionChainRepr(repr_chain) + + +@dataclasses.dataclass(eq=False) +class TerminalRepr: + def __str__(self) -> str: + # FYI this is called from pytest-xdist's serialization of exception + # information. + io = StringIO() + tw = TerminalWriter(file=io) + self.toterminal(tw) + return io.getvalue().strip() + + def __repr__(self) -> str: + return f"<{self.__class__} instance at {id(self):0x}>" + + def toterminal(self, tw: TerminalWriter) -> None: + raise NotImplementedError() + + +# This class is abstract -- only subclasses are instantiated. +@dataclasses.dataclass(eq=False) +class ExceptionRepr(TerminalRepr): + # Provided by subclasses. + reprtraceback: ReprTraceback + reprcrash: ReprFileLocation | None + sections: list[tuple[str, str, str]] = dataclasses.field( + init=False, default_factory=list + ) + + def addsection(self, name: str, content: str, sep: str = "-") -> None: + self.sections.append((name, content, sep)) + + def toterminal(self, tw: TerminalWriter) -> None: + for name, content, sep in self.sections: + tw.sep(sep, name) + tw.line(content) + + +@dataclasses.dataclass(eq=False) +class ExceptionChainRepr(ExceptionRepr): + chain: Sequence[tuple[ReprTraceback, ReprFileLocation | None, str | None]] + + def __init__( + self, + chain: Sequence[tuple[ReprTraceback, ReprFileLocation | None, str | None]], + ) -> None: + # reprcrash and reprtraceback of the outermost (the newest) exception + # in the chain. + super().__init__( + reprtraceback=chain[-1][0], + reprcrash=chain[-1][1], + ) + self.chain = chain + + def toterminal(self, tw: TerminalWriter) -> None: + for element in self.chain: + element[0].toterminal(tw) + if element[2] is not None: + tw.line("") + tw.line(element[2], yellow=True) + super().toterminal(tw) + + +@dataclasses.dataclass(eq=False) +class ReprExceptionInfo(ExceptionRepr): + reprtraceback: ReprTraceback + reprcrash: ReprFileLocation | None + + def toterminal(self, tw: TerminalWriter) -> None: + self.reprtraceback.toterminal(tw) + super().toterminal(tw) + + +@dataclasses.dataclass(eq=False) +class ReprTraceback(TerminalRepr): + reprentries: Sequence[ReprEntry | ReprEntryNative] + extraline: str | None + style: TracebackStyle + + entrysep: ClassVar = "_ " + + def toterminal(self, tw: TerminalWriter) -> None: + # The entries might have different styles. + for i, entry in enumerate(self.reprentries): + if entry.style == "long": + tw.line("") + entry.toterminal(tw) + if i < len(self.reprentries) - 1: + next_entry = self.reprentries[i + 1] + if entry.style == "long" or ( + entry.style == "short" and next_entry.style == "long" + ): + tw.sep(self.entrysep) + + if self.extraline: + tw.line(self.extraline) + + +class ReprTracebackNative(ReprTraceback): + def __init__(self, tblines: Sequence[str]) -> None: + self.reprentries = [ReprEntryNative(tblines)] + self.extraline = None + self.style = "native" + + +@dataclasses.dataclass(eq=False) +class ReprEntryNative(TerminalRepr): + lines: Sequence[str] + + style: ClassVar[TracebackStyle] = "native" + + def toterminal(self, tw: TerminalWriter) -> None: + tw.write("".join(self.lines)) + + +@dataclasses.dataclass(eq=False) +class ReprEntry(TerminalRepr): + lines: Sequence[str] + reprfuncargs: ReprFuncArgs | None + reprlocals: ReprLocals | None + reprfileloc: ReprFileLocation | None + style: TracebackStyle + + def _write_entry_lines(self, tw: TerminalWriter) -> None: + """Write the source code portions of a list of traceback entries with syntax highlighting. + + Usually entries are lines like these: + + " x = 1" + "> assert x == 2" + "E assert 1 == 2" + + This function takes care of rendering the "source" portions of it (the lines without + the "E" prefix) using syntax highlighting, taking care to not highlighting the ">" + character, as doing so might break line continuations. + """ + if not self.lines: + return + + if self.style == "value": + # Using tw.write instead of tw.line for testing purposes due to TWMock implementation; + # lines written with TWMock.line and TWMock._write_source cannot be distinguished + # from each other, whereas lines written with TWMock.write are marked with TWMock.WRITE + for line in self.lines: + tw.write(line) + tw.write("\n") + return + + # separate indents and source lines that are not failures: we want to + # highlight the code but not the indentation, which may contain markers + # such as "> assert 0" + fail_marker = f"{FormattedExcinfo.fail_marker} " + indent_size = len(fail_marker) + indents: list[str] = [] + source_lines: list[str] = [] + failure_lines: list[str] = [] + for index, line in enumerate(self.lines): + is_failure_line = line.startswith(fail_marker) + if is_failure_line: + # from this point on all lines are considered part of the failure + failure_lines.extend(self.lines[index:]) + break + else: + indents.append(line[:indent_size]) + source_lines.append(line[indent_size:]) + + tw._write_source(source_lines, indents) + + # failure lines are always completely red and bold + for line in failure_lines: + tw.line(line, bold=True, red=True) + + def toterminal(self, tw: TerminalWriter) -> None: + if self.style == "short": + if self.reprfileloc: + self.reprfileloc.toterminal(tw) + self._write_entry_lines(tw) + if self.reprlocals: + self.reprlocals.toterminal(tw, indent=" " * 8) + return + + if self.reprfuncargs: + self.reprfuncargs.toterminal(tw) + + self._write_entry_lines(tw) + + if self.reprlocals: + tw.line("") + self.reprlocals.toterminal(tw) + if self.reprfileloc: + if self.lines: + tw.line("") + self.reprfileloc.toterminal(tw) + + def __str__(self) -> str: + return "{}\n{}\n{}".format( + "\n".join(self.lines), self.reprlocals, self.reprfileloc + ) + + +@dataclasses.dataclass(eq=False) +class ReprFileLocation(TerminalRepr): + path: str + lineno: int + message: str + + def __post_init__(self) -> None: + self.path = str(self.path) + + def toterminal(self, tw: TerminalWriter) -> None: + # Filename and lineno output for each entry, using an output format + # that most editors understand. + msg = self.message + i = msg.find("\n") + if i != -1: + msg = msg[:i] + tw.write(self.path, bold=True, red=True) + tw.line(f":{self.lineno}: {msg}") + + +@dataclasses.dataclass(eq=False) +class ReprLocals(TerminalRepr): + lines: Sequence[str] + + def toterminal(self, tw: TerminalWriter, indent="") -> None: + for line in self.lines: + tw.line(indent + line) + + +@dataclasses.dataclass(eq=False) +class ReprFuncArgs(TerminalRepr): + args: Sequence[tuple[str, object]] + + def toterminal(self, tw: TerminalWriter) -> None: + if self.args: + linesofar = "" + for name, value in self.args: + ns = f"{name} = {value}" + if len(ns) + len(linesofar) + 2 > tw.fullwidth: + if linesofar: + tw.line(linesofar) + linesofar = ns + else: + if linesofar: + linesofar += ", " + ns + else: + linesofar = ns + if linesofar: + tw.line(linesofar) + tw.line("") + + +def getfslineno(obj: object) -> tuple[str | Path, int]: + """Return source location (path, lineno) for the given object. + + If the source cannot be determined return ("", -1). + + The line number is 0-based. + """ + # xxx let decorators etc specify a sane ordering + # NOTE: this used to be done in _pytest.compat.getfslineno, initially added + # in 6ec13a2b9. It ("place_as") appears to be something very custom. + obj = get_real_func(obj) + if hasattr(obj, "place_as"): + obj = obj.place_as + + try: + code = Code.from_function(obj) + except TypeError: + try: + fn = inspect.getsourcefile(obj) or inspect.getfile(obj) # type: ignore[arg-type] + except TypeError: + return "", -1 + + fspath = (fn and absolutepath(fn)) or "" + lineno = -1 + if fspath: + try: + _, lineno = findsource(obj) + except OSError: + pass + return fspath, lineno + + return code.path, code.firstlineno + + +def _byte_offset_to_character_offset(str, offset): + """Converts a byte based offset in a string to a code-point.""" + as_utf8 = str.encode("utf-8") + return len(as_utf8[:offset].decode("utf-8", errors="replace")) + + +# Relative paths that we use to filter traceback entries from appearing to the user; +# see filter_traceback. +# note: if we need to add more paths than what we have now we should probably use a list +# for better maintenance. + +_PLUGGY_DIR = Path(pluggy.__file__.rstrip("oc")) +# pluggy is either a package or a single module depending on the version +if _PLUGGY_DIR.name == "__init__.py": + _PLUGGY_DIR = _PLUGGY_DIR.parent +_PYTEST_DIR = Path(_pytest.__file__).parent + + +def filter_traceback(entry: TracebackEntry) -> bool: + """Return True if a TracebackEntry instance should be included in tracebacks. + + We hide traceback entries of: + + * dynamically generated code (no code to show up for it); + * internal traceback from pytest or its internal libraries, py and pluggy. + """ + # entry.path might sometimes return a str object when the entry + # points to dynamically generated code. + # See https://bitbucket.org/pytest-dev/py/issues/71. + raw_filename = entry.frame.code.raw.co_filename + is_generated = "<" in raw_filename and ">" in raw_filename + if is_generated: + return False + + # entry.path might point to a non-existing file, in which case it will + # also return a str object. See #1133. + p = Path(entry.path) + + parents = p.parents + if _PLUGGY_DIR in parents: + return False + if _PYTEST_DIR in parents: + return False + + return True + + +def filter_excinfo_traceback( + tbfilter: TracebackFilter, excinfo: ExceptionInfo[BaseException] +) -> Traceback: + """Filter the exception traceback in ``excinfo`` according to ``tbfilter``.""" + if callable(tbfilter): + return tbfilter(excinfo) + elif tbfilter: + return excinfo.traceback.filter(excinfo) + else: + return excinfo.traceback diff --git a/micromamba_root/Lib/site-packages/_pytest/_code/source.py b/micromamba_root/Lib/site-packages/_pytest/_code/source.py new file mode 100644 index 0000000000000000000000000000000000000000..99c242dd98e27ad6dcdf25a2c7e68e6fad209dd6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_code/source.py @@ -0,0 +1,225 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import ast +from bisect import bisect_right +from collections.abc import Iterable +from collections.abc import Iterator +import inspect +import textwrap +import tokenize +import types +from typing import overload +import warnings + + +class Source: + """An immutable object holding a source code fragment. + + When using Source(...), the source lines are deindented. + """ + + def __init__(self, obj: object = None) -> None: + if not obj: + self.lines: list[str] = [] + self.raw_lines: list[str] = [] + elif isinstance(obj, Source): + self.lines = obj.lines + self.raw_lines = obj.raw_lines + elif isinstance(obj, tuple | list): + self.lines = deindent(x.rstrip("\n") for x in obj) + self.raw_lines = list(x.rstrip("\n") for x in obj) + elif isinstance(obj, str): + self.lines = deindent(obj.split("\n")) + self.raw_lines = obj.split("\n") + else: + try: + rawcode = getrawcode(obj) + src = inspect.getsource(rawcode) + except TypeError: + src = inspect.getsource(obj) # type: ignore[arg-type] + self.lines = deindent(src.split("\n")) + self.raw_lines = src.split("\n") + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Source): + return NotImplemented + return self.lines == other.lines + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + @overload + def __getitem__(self, key: int) -> str: ... + + @overload + def __getitem__(self, key: slice) -> Source: ... + + def __getitem__(self, key: int | slice) -> str | Source: + if isinstance(key, int): + return self.lines[key] + else: + if key.step not in (None, 1): + raise IndexError("cannot slice a Source with a step") + newsource = Source() + newsource.lines = self.lines[key.start : key.stop] + newsource.raw_lines = self.raw_lines[key.start : key.stop] + return newsource + + def __iter__(self) -> Iterator[str]: + return iter(self.lines) + + def __len__(self) -> int: + return len(self.lines) + + def strip(self) -> Source: + """Return new Source object with trailing and leading blank lines removed.""" + start, end = 0, len(self) + while start < end and not self.lines[start].strip(): + start += 1 + while end > start and not self.lines[end - 1].strip(): + end -= 1 + source = Source() + source.raw_lines = self.raw_lines + source.lines[:] = self.lines[start:end] + return source + + def indent(self, indent: str = " " * 4) -> Source: + """Return a copy of the source object with all lines indented by the + given indent-string.""" + newsource = Source() + newsource.raw_lines = self.raw_lines + newsource.lines = [(indent + line) for line in self.lines] + return newsource + + def getstatement(self, lineno: int) -> Source: + """Return Source statement which contains the given linenumber + (counted from 0).""" + start, end = self.getstatementrange(lineno) + return self[start:end] + + def getstatementrange(self, lineno: int) -> tuple[int, int]: + """Return (start, end) tuple which spans the minimal statement region + which containing the given lineno.""" + if not (0 <= lineno < len(self)): + raise IndexError("lineno out of range") + _ast, start, end = getstatementrange_ast(lineno, self) + return start, end + + def deindent(self) -> Source: + """Return a new Source object deindented.""" + newsource = Source() + newsource.lines[:] = deindent(self.lines) + newsource.raw_lines = self.raw_lines + return newsource + + def __str__(self) -> str: + return "\n".join(self.lines) + + +# +# helper functions +# + + +def findsource(obj) -> tuple[Source | None, int]: + try: + sourcelines, lineno = inspect.findsource(obj) + except Exception: + return None, -1 + source = Source() + source.lines = [line.rstrip() for line in sourcelines] + source.raw_lines = sourcelines + return source, lineno + + +def getrawcode(obj: object, trycall: bool = True) -> types.CodeType: + """Return code object for given function.""" + try: + return obj.__code__ # type: ignore[attr-defined,no-any-return] + except AttributeError: + pass + if trycall: + call = getattr(obj, "__call__", None) + if call and not isinstance(obj, type): + return getrawcode(call, trycall=False) + raise TypeError(f"could not get code object for {obj!r}") + + +def deindent(lines: Iterable[str]) -> list[str]: + return textwrap.dedent("\n".join(lines)).splitlines() + + +def get_statement_startend2(lineno: int, node: ast.AST) -> tuple[int, int | None]: + # Flatten all statements and except handlers into one lineno-list. + # AST's line numbers start indexing at 1. + values: list[int] = [] + for x in ast.walk(node): + if isinstance(x, ast.stmt | ast.ExceptHandler): + # The lineno points to the class/def, so need to include the decorators. + if isinstance(x, ast.ClassDef | ast.FunctionDef | ast.AsyncFunctionDef): + for d in x.decorator_list: + values.append(d.lineno - 1) + values.append(x.lineno - 1) + for name in ("finalbody", "orelse"): + val: list[ast.stmt] | None = getattr(x, name, None) + if val: + # Treat the finally/orelse part as its own statement. + values.append(val[0].lineno - 1 - 1) + values.sort() + insert_index = bisect_right(values, lineno) + start = values[insert_index - 1] + if insert_index >= len(values): + end = None + else: + end = values[insert_index] + return start, end + + +def getstatementrange_ast( + lineno: int, + source: Source, + assertion: bool = False, + astnode: ast.AST | None = None, +) -> tuple[ast.AST, int, int]: + if astnode is None: + content = str(source) + # See #4260: + # Don't produce duplicate warnings when compiling source to find AST. + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + astnode = ast.parse(content, "source", "exec") + + start, end = get_statement_startend2(lineno, astnode) + # We need to correct the end: + # - ast-parsing strips comments + # - there might be empty lines + # - we might have lesser indented code blocks at the end + if end is None: + end = len(source.lines) + + if end > start + 1: + # Make sure we don't span differently indented code blocks + # by using the BlockFinder helper used which inspect.getsource() uses itself. + block_finder = inspect.BlockFinder() + # If we start with an indented line, put blockfinder to "started" mode. + block_finder.started = ( + bool(source.lines[start]) and source.lines[start][0].isspace() + ) + it = ((x + "\n") for x in source.lines[start:end]) + try: + for tok in tokenize.generate_tokens(lambda: next(it)): + block_finder.tokeneater(*tok) + except (inspect.EndOfBlock, IndentationError): + end = block_finder.last + start + except Exception: + pass + + # The end might still point to a comment or empty line, correct it. + while end: + line = source.lines[end - 1].lstrip() + if line.startswith("#") or not line: + end -= 1 + else: + break + return astnode, start, end diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__init__.py b/micromamba_root/Lib/site-packages/_pytest/_io/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b0155b18b605326ba0a3104deaefde938b7d651a --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_io/__init__.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +from .terminalwriter import get_terminal_width +from .terminalwriter import TerminalWriter + + +__all__ = [ + "TerminalWriter", + "get_terminal_width", +] diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9daa1538bd84cab5b80aad557126b77e476bb155 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/pprint.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/pprint.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d915c58269964b95195b16a7668e5678d941839 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/pprint.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/saferepr.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/saferepr.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4cc713d258d55fe2d79c9b5664ec9b5a21089f6e Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/saferepr.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/terminalwriter.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/terminalwriter.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee7070982145032b6fa2d2f74fe345e428975521 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/terminalwriter.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/wcwidth.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/wcwidth.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..929e23db78a8e78b9dc346224c6a34114c130831 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_io/__pycache__/wcwidth.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/pprint.py b/micromamba_root/Lib/site-packages/_pytest/_io/pprint.py new file mode 100644 index 0000000000000000000000000000000000000000..28f069092061928a1c06aaba94b6e8ba4f03075f --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_io/pprint.py @@ -0,0 +1,673 @@ +# mypy: allow-untyped-defs +# This module was imported from the cpython standard library +# (https://github.com/python/cpython/) at commit +# c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd (python3.12). +# +# +# Original Author: Fred L. Drake, Jr. +# fdrake@acm.org +# +# This is a simple little module I wrote to make life easier. I didn't +# see anything quite like it in the library, though I may have overlooked +# something. I wrote this when I was trying to read some heavily nested +# tuples with fairly non-descriptive content. This is modeled very much +# after Lisp/Scheme - style pretty-printing of lists. If you find it +# useful, thank small children who sleep at night. +from __future__ import annotations + +import collections as _collections +from collections.abc import Callable +from collections.abc import Iterator +import dataclasses as _dataclasses +from io import StringIO as _StringIO +import re +import types as _types +from typing import Any +from typing import IO + + +class _safe_key: + """Helper function for key functions when sorting unorderable objects. + + The wrapped-object will fallback to a Py2.x style comparison for + unorderable types (sorting first comparing the type name and then by + the obj ids). Does not work recursively, so dict.items() must have + _safe_key applied to both the key and the value. + + """ + + __slots__ = ["obj"] + + def __init__(self, obj): + self.obj = obj + + def __lt__(self, other): + try: + return self.obj < other.obj + except TypeError: + return (str(type(self.obj)), id(self.obj)) < ( + str(type(other.obj)), + id(other.obj), + ) + + +def _safe_tuple(t): + """Helper function for comparing 2-tuples""" + return _safe_key(t[0]), _safe_key(t[1]) + + +class PrettyPrinter: + def __init__( + self, + indent: int = 4, + width: int = 80, + depth: int | None = None, + ) -> None: + """Handle pretty printing operations onto a stream using a set of + configured parameters. + + indent + Number of spaces to indent for each level of nesting. + + width + Attempted maximum number of columns in the output. + + depth + The maximum depth to print out nested structures. + + """ + if indent < 0: + raise ValueError("indent must be >= 0") + if depth is not None and depth <= 0: + raise ValueError("depth must be > 0") + if not width: + raise ValueError("width must be != 0") + self._depth = depth + self._indent_per_level = indent + self._width = width + + def pformat(self, object: Any) -> str: + sio = _StringIO() + self._format(object, sio, 0, 0, set(), 0) + return sio.getvalue() + + def _format( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + objid = id(object) + if objid in context: + stream.write(_recursion(object)) + return + + p = self._dispatch.get(type(object).__repr__, None) + if p is not None: + context.add(objid) + p(self, object, stream, indent, allowance, context, level + 1) + context.remove(objid) + elif ( + _dataclasses.is_dataclass(object) + and not isinstance(object, type) + and object.__dataclass_params__.repr # type:ignore[attr-defined] + and + # Check dataclass has generated repr method. + hasattr(object.__repr__, "__wrapped__") + and "__create_fn__" in object.__repr__.__wrapped__.__qualname__ + ): + context.add(objid) + self._pprint_dataclass( + object, stream, indent, allowance, context, level + 1 + ) + context.remove(objid) + else: + stream.write(self._repr(object, context, level)) + + def _pprint_dataclass( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + cls_name = object.__class__.__name__ + items = [ + (f.name, getattr(object, f.name)) + for f in _dataclasses.fields(object) + if f.repr + ] + stream.write(cls_name + "(") + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch: dict[ + Callable[..., str], + Callable[[PrettyPrinter, Any, IO[str], int, int, set[int], int], None], + ] = {} + + def _pprint_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + write("{") + items = sorted(object.items(), key=_safe_tuple) + self._format_dict_items(items, stream, indent, allowance, context, level) + write("}") + + _dispatch[dict.__repr__] = _pprint_dict + + def _pprint_ordered_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + "(") + self._pprint_dict(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.OrderedDict.__repr__] = _pprint_ordered_dict + + def _pprint_list( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("[") + self._format_items(object, stream, indent, allowance, context, level) + stream.write("]") + + _dispatch[list.__repr__] = _pprint_list + + def _pprint_tuple( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("(") + self._format_items(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[tuple.__repr__] = _pprint_tuple + + def _pprint_set( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object): + stream.write(repr(object)) + return + typ = object.__class__ + if typ is set: + stream.write("{") + endchar = "}" + else: + stream.write(typ.__name__ + "({") + endchar = "})" + object = sorted(object, key=_safe_key) + self._format_items(object, stream, indent, allowance, context, level) + stream.write(endchar) + + _dispatch[set.__repr__] = _pprint_set + _dispatch[frozenset.__repr__] = _pprint_set + + def _pprint_str( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + if not len(object): + write(repr(object)) + return + chunks = [] + lines = object.splitlines(True) + if level == 1: + indent += 1 + allowance += 1 + max_width1 = max_width = self._width - indent + for i, line in enumerate(lines): + rep = repr(line) + if i == len(lines) - 1: + max_width1 -= allowance + if len(rep) <= max_width1: + chunks.append(rep) + else: + # A list of alternating (non-space, space) strings + parts = re.findall(r"\S*\s*", line) + assert parts + assert not parts[-1] + parts.pop() # drop empty last part + max_width2 = max_width + current = "" + for j, part in enumerate(parts): + candidate = current + part + if j == len(parts) - 1 and i == len(lines) - 1: + max_width2 -= allowance + if len(repr(candidate)) > max_width2: + if current: + chunks.append(repr(current)) + current = part + else: + current = candidate + if current: + chunks.append(repr(current)) + if len(chunks) == 1: + write(rep) + return + if level == 1: + write("(") + for i, rep in enumerate(chunks): + if i > 0: + write("\n" + " " * indent) + write(rep) + if level == 1: + write(")") + + _dispatch[str.__repr__] = _pprint_str + + def _pprint_bytes( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + if len(object) <= 4: + write(repr(object)) + return + parens = level == 1 + if parens: + indent += 1 + allowance += 1 + write("(") + delim = "" + for rep in _wrap_bytes_repr(object, self._width - indent, allowance): + write(delim) + write(rep) + if not delim: + delim = "\n" + " " * indent + if parens: + write(")") + + _dispatch[bytes.__repr__] = _pprint_bytes + + def _pprint_bytearray( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + write("bytearray(") + self._pprint_bytes( + bytes(object), stream, indent + 10, allowance + 1, context, level + 1 + ) + write(")") + + _dispatch[bytearray.__repr__] = _pprint_bytearray + + def _pprint_mappingproxy( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("mappingproxy(") + self._format(object.copy(), stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_types.MappingProxyType.__repr__] = _pprint_mappingproxy + + def _pprint_simplenamespace( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if type(object) is _types.SimpleNamespace: + # The SimpleNamespace repr is "namespace" instead of the class + # name, so we do the same here. For subclasses; use the class name. + cls_name = "namespace" + else: + cls_name = object.__class__.__name__ + items = object.__dict__.items() + stream.write(cls_name + "(") + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_types.SimpleNamespace.__repr__] = _pprint_simplenamespace + + def _format_dict_items( + self, + items: list[tuple[Any, Any]], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + for key, ent in items: + write(delimnl) + write(self._repr(key, context, level)) + write(": ") + self._format(ent, stream, item_indent, 1, context, level) + write(",") + + write("\n" + " " * indent) + + def _format_namespace_items( + self, + items: list[tuple[Any, Any]], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + for key, ent in items: + write(delimnl) + write(key) + write("=") + if id(ent) in context: + # Special-case representation of recursion to match standard + # recursive dataclass repr. + write("...") + else: + self._format( + ent, + stream, + item_indent + len(key) + 1, + 1, + context, + level, + ) + + write(",") + + write("\n" + " " * indent) + + def _format_items( + self, + items: list[Any], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + + for item in items: + write(delimnl) + self._format(item, stream, item_indent, 1, context, level) + write(",") + + write("\n" + " " * indent) + + def _repr(self, object: Any, context: set[int], level: int) -> str: + return self._safe_repr(object, context.copy(), self._depth, level) + + def _pprint_default_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + rdf = self._repr(object.default_factory, context, level) + stream.write(f"{object.__class__.__name__}({rdf}, ") + self._pprint_dict(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.defaultdict.__repr__] = _pprint_default_dict + + def _pprint_counter( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write(object.__class__.__name__ + "(") + + if object: + stream.write("{") + items = object.most_common() + self._format_dict_items(items, stream, indent, allowance, context, level) + stream.write("}") + + stream.write(")") + + _dispatch[_collections.Counter.__repr__] = _pprint_counter + + def _pprint_chain_map( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object.maps) or (len(object.maps) == 1 and not len(object.maps[0])): + stream.write(repr(object)) + return + + stream.write(object.__class__.__name__ + "(") + self._format_items(object.maps, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.ChainMap.__repr__] = _pprint_chain_map + + def _pprint_deque( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write(object.__class__.__name__ + "(") + if object.maxlen is not None: + stream.write(f"maxlen={object.maxlen}, ") + stream.write("[") + + self._format_items(object, stream, indent, allowance + 1, context, level) + stream.write("])") + + _dispatch[_collections.deque.__repr__] = _pprint_deque + + def _pprint_user_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserDict.__repr__] = _pprint_user_dict + + def _pprint_user_list( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserList.__repr__] = _pprint_user_list + + def _pprint_user_string( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserString.__repr__] = _pprint_user_string + + def _safe_repr( + self, object: Any, context: set[int], maxlevels: int | None, level: int + ) -> str: + typ = type(object) + if typ in _builtin_scalars: + return repr(object) + + r = getattr(typ, "__repr__", None) + + if issubclass(typ, dict) and r is dict.__repr__: + if not object: + return "{}" + objid = id(object) + if maxlevels and level >= maxlevels: + return "{...}" + if objid in context: + return _recursion(object) + context.add(objid) + components: list[str] = [] + append = components.append + level += 1 + for k, v in sorted(object.items(), key=_safe_tuple): + krepr = self._safe_repr(k, context, maxlevels, level) + vrepr = self._safe_repr(v, context, maxlevels, level) + append(f"{krepr}: {vrepr}") + context.remove(objid) + return "{{{}}}".format(", ".join(components)) + + if (issubclass(typ, list) and r is list.__repr__) or ( + issubclass(typ, tuple) and r is tuple.__repr__ + ): + if issubclass(typ, list): + if not object: + return "[]" + format = "[%s]" + elif len(object) == 1: + format = "(%s,)" + else: + if not object: + return "()" + format = "(%s)" + objid = id(object) + if maxlevels and level >= maxlevels: + return format % "..." + if objid in context: + return _recursion(object) + context.add(objid) + components = [] + append = components.append + level += 1 + for o in object: + orepr = self._safe_repr(o, context, maxlevels, level) + append(orepr) + context.remove(objid) + return format % ", ".join(components) + + return repr(object) + + +_builtin_scalars = frozenset( + {str, bytes, bytearray, float, complex, bool, type(None), int} +) + + +def _recursion(object: Any) -> str: + return f"" + + +def _wrap_bytes_repr(object: Any, width: int, allowance: int) -> Iterator[str]: + current = b"" + last = len(object) // 4 * 4 + for i in range(0, len(object), 4): + part = object[i : i + 4] + candidate = current + part + if i == last: + width -= allowance + if len(repr(candidate)) > width: + if current: + yield repr(current) + current = part + else: + current = candidate + if current: + yield repr(current) diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/saferepr.py b/micromamba_root/Lib/site-packages/_pytest/_io/saferepr.py new file mode 100644 index 0000000000000000000000000000000000000000..cee70e332f9802a5963bfed8149ac997e5b30de2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_io/saferepr.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import pprint +import reprlib + + +def _try_repr_or_str(obj: object) -> str: + try: + return repr(obj) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException: + return f'{type(obj).__name__}("{obj}")' + + +def _format_repr_exception(exc: BaseException, obj: object) -> str: + try: + exc_info = _try_repr_or_str(exc) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as inner_exc: + exc_info = f"unpresentable exception ({_try_repr_or_str(inner_exc)})" + return ( + f"<[{exc_info} raised in repr()] {type(obj).__name__} object at 0x{id(obj):x}>" + ) + + +def _ellipsize(s: str, maxsize: int) -> str: + if len(s) > maxsize: + i = max(0, (maxsize - 3) // 2) + j = max(0, maxsize - 3 - i) + return s[:i] + "..." + s[len(s) - j :] + return s + + +class SafeRepr(reprlib.Repr): + """ + repr.Repr that limits the resulting size of repr() and includes + information on exceptions raised during the call. + """ + + def __init__(self, maxsize: int | None, use_ascii: bool = False) -> None: + """ + :param maxsize: + If not None, will truncate the resulting repr to that specific size, using ellipsis + somewhere in the middle to hide the extra text. + If None, will not impose any size limits on the returning repr. + """ + super().__init__() + # ``maxstring`` is used by the superclass, and needs to be an int; using a + # very large number in case maxsize is None, meaning we want to disable + # truncation. + self.maxstring = maxsize if maxsize is not None else 1_000_000_000 + self.maxsize = maxsize + self.use_ascii = use_ascii + + def repr(self, x: object) -> str: + try: + if self.use_ascii: + s = ascii(x) + else: + s = super().repr(x) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as exc: + s = _format_repr_exception(exc, x) + if self.maxsize is not None: + s = _ellipsize(s, self.maxsize) + return s + + def repr_instance(self, x: object, level: int) -> str: + try: + s = repr(x) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as exc: + s = _format_repr_exception(exc, x) + if self.maxsize is not None: + s = _ellipsize(s, self.maxsize) + return s + + +def safeformat(obj: object) -> str: + """Return a pretty printed string for the given object. + + Failing __repr__ functions of user instances will be represented + with a short exception info. + """ + try: + return pprint.pformat(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) + + +# Maximum size of overall repr of objects to display during assertion errors. +DEFAULT_REPR_MAX_SIZE = 240 + + +def saferepr( + obj: object, maxsize: int | None = DEFAULT_REPR_MAX_SIZE, use_ascii: bool = False +) -> str: + """Return a size-limited safe repr-string for the given object. + + Failing __repr__ functions of user instances will be represented + with a short exception info and 'saferepr' generally takes + care to never raise exceptions itself. + + This function is a wrapper around the Repr/reprlib functionality of the + stdlib. + """ + return SafeRepr(maxsize, use_ascii).repr(obj) + + +def saferepr_unlimited(obj: object, use_ascii: bool = True) -> str: + """Return an unlimited-size safe repr-string for the given object. + + As with saferepr, failing __repr__ functions of user instances + will be represented with a short exception info. + + This function is a wrapper around simple repr. + + Note: a cleaner solution would be to alter ``saferepr``this way + when maxsize=None, but that might affect some other code. + """ + try: + if use_ascii: + return ascii(obj) + return repr(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/terminalwriter.py b/micromamba_root/Lib/site-packages/_pytest/_io/terminalwriter.py new file mode 100644 index 0000000000000000000000000000000000000000..9191b4edace06d673febe36b708fdefd53bae9be --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_io/terminalwriter.py @@ -0,0 +1,258 @@ +"""Helper functions for writing to terminals and files.""" + +from __future__ import annotations + +from collections.abc import Sequence +import os +import shutil +import sys +from typing import final +from typing import Literal +from typing import TextIO + +import pygments +from pygments.formatters.terminal import TerminalFormatter +from pygments.lexer import Lexer +from pygments.lexers.diff import DiffLexer +from pygments.lexers.python import PythonLexer + +from ..compat import assert_never +from .wcwidth import wcswidth + + +# This code was initially copied from py 1.8.1, file _io/terminalwriter.py. + + +def get_terminal_width() -> int: + width, _ = shutil.get_terminal_size(fallback=(80, 24)) + + # The Windows get_terminal_size may be bogus, let's sanify a bit. + if width < 40: + width = 80 + + return width + + +def should_do_markup(file: TextIO) -> bool: + if os.environ.get("PY_COLORS") == "1": + return True + if os.environ.get("PY_COLORS") == "0": + return False + if os.environ.get("NO_COLOR"): + return False + if os.environ.get("FORCE_COLOR"): + return True + return ( + hasattr(file, "isatty") and file.isatty() and os.environ.get("TERM") != "dumb" + ) + + +@final +class TerminalWriter: + _esctable = dict( + black=30, + red=31, + green=32, + yellow=33, + blue=34, + purple=35, + cyan=36, + white=37, + Black=40, + Red=41, + Green=42, + Yellow=43, + Blue=44, + Purple=45, + Cyan=46, + White=47, + bold=1, + light=2, + blink=5, + invert=7, + ) + + def __init__(self, file: TextIO | None = None) -> None: + if file is None: + file = sys.stdout + if hasattr(file, "isatty") and file.isatty() and sys.platform == "win32": + try: + import colorama + except ImportError: + pass + else: + file = colorama.AnsiToWin32(file).stream + assert file is not None + self._file = file + self.hasmarkup = should_do_markup(file) + self._current_line = "" + self._terminal_width: int | None = None + self.code_highlight = True + + @property + def fullwidth(self) -> int: + if self._terminal_width is not None: + return self._terminal_width + return get_terminal_width() + + @fullwidth.setter + def fullwidth(self, value: int) -> None: + self._terminal_width = value + + @property + def width_of_current_line(self) -> int: + """Return an estimate of the width so far in the current line.""" + return wcswidth(self._current_line) + + def markup(self, text: str, **markup: bool) -> str: + for name in markup: + if name not in self._esctable: + raise ValueError(f"unknown markup: {name!r}") + if self.hasmarkup: + esc = [self._esctable[name] for name, on in markup.items() if on] + if esc: + text = "".join(f"\x1b[{cod}m" for cod in esc) + text + "\x1b[0m" + return text + + def sep( + self, + sepchar: str, + title: str | None = None, + fullwidth: int | None = None, + **markup: bool, + ) -> None: + if fullwidth is None: + fullwidth = self.fullwidth + # The goal is to have the line be as long as possible + # under the condition that len(line) <= fullwidth. + if sys.platform == "win32": + # If we print in the last column on windows we are on a + # new line but there is no way to verify/neutralize this + # (we may not know the exact line width). + # So let's be defensive to avoid empty lines in the output. + fullwidth -= 1 + if title is not None: + # we want 2 + 2*len(fill) + len(title) <= fullwidth + # i.e. 2 + 2*len(sepchar)*N + len(title) <= fullwidth + # 2*len(sepchar)*N <= fullwidth - len(title) - 2 + # N <= (fullwidth - len(title) - 2) // (2*len(sepchar)) + N = max((fullwidth - len(title) - 2) // (2 * len(sepchar)), 1) + fill = sepchar * N + line = f"{fill} {title} {fill}" + else: + # we want len(sepchar)*N <= fullwidth + # i.e. N <= fullwidth // len(sepchar) + line = sepchar * (fullwidth // len(sepchar)) + # In some situations there is room for an extra sepchar at the right, + # in particular if we consider that with a sepchar like "_ " the + # trailing space is not important at the end of the line. + if len(line) + len(sepchar.rstrip()) <= fullwidth: + line += sepchar.rstrip() + + self.line(line, **markup) + + def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None: + if msg: + current_line = msg.rsplit("\n", 1)[-1] + if "\n" in msg: + self._current_line = current_line + else: + self._current_line += current_line + + msg = self.markup(msg, **markup) + + self.write_raw(msg, flush=flush) + + def write_raw(self, msg: str, *, flush: bool = False) -> None: + try: + self._file.write(msg) + except UnicodeEncodeError: + # Some environments don't support printing general Unicode + # strings, due to misconfiguration or otherwise; in that case, + # print the string escaped to ASCII. + # When the Unicode situation improves we should consider + # letting the error propagate instead of masking it (see #7475 + # for one brief attempt). + msg = msg.encode("unicode-escape").decode("ascii") + self._file.write(msg) + + if flush: + self.flush() + + def line(self, s: str = "", **markup: bool) -> None: + self.write(s, **markup) + self.write("\n") + + def flush(self) -> None: + self._file.flush() + + def _write_source(self, lines: Sequence[str], indents: Sequence[str] = ()) -> None: + """Write lines of source code possibly highlighted. + + Keeping this private for now because the API is clunky. We should discuss how + to evolve the terminal writer so we can have more precise color support, for example + being able to write part of a line in one color and the rest in another, and so on. + """ + if indents and len(indents) != len(lines): + raise ValueError( + f"indents size ({len(indents)}) should have same size as lines ({len(lines)})" + ) + if not indents: + indents = [""] * len(lines) + source = "\n".join(lines) + new_lines = self._highlight(source).splitlines() + # Would be better to strict=True but that fails some CI jobs. + for indent, new_line in zip(indents, new_lines, strict=False): + self.line(indent + new_line) + + def _get_pygments_lexer(self, lexer: Literal["python", "diff"]) -> Lexer: + if lexer == "python": + return PythonLexer() + elif lexer == "diff": + return DiffLexer() + else: + assert_never(lexer) + + def _get_pygments_formatter(self) -> TerminalFormatter: + from _pytest.config.exceptions import UsageError + + theme = os.getenv("PYTEST_THEME") + theme_mode = os.getenv("PYTEST_THEME_MODE", "dark") + + try: + return TerminalFormatter(bg=theme_mode, style=theme) + except pygments.util.ClassNotFound as e: + raise UsageError( + f"PYTEST_THEME environment variable has an invalid value: '{theme}'. " + "Hint: See available pygments styles with `pygmentize -L styles`." + ) from e + except pygments.util.OptionError as e: + raise UsageError( + f"PYTEST_THEME_MODE environment variable has an invalid value: '{theme_mode}'. " + "The allowed values are 'dark' (default) and 'light'." + ) from e + + def _highlight( + self, source: str, lexer: Literal["diff", "python"] = "python" + ) -> str: + """Highlight the given source if we have markup support.""" + if not source or not self.hasmarkup or not self.code_highlight: + return source + + pygments_lexer = self._get_pygments_lexer(lexer) + pygments_formatter = self._get_pygments_formatter() + + highlighted: str = pygments.highlight( + source, pygments_lexer, pygments_formatter + ) + # pygments terminal formatter may add a newline when there wasn't one. + # We don't want this, remove. + if highlighted[-1] == "\n" and source[-1] != "\n": + highlighted = highlighted[:-1] + + # Some lexers will not set the initial color explicitly + # which may lead to the previous color being propagated to the + # start of the expression, so reset first. + highlighted = "\x1b[0m" + highlighted + + return highlighted diff --git a/micromamba_root/Lib/site-packages/_pytest/_io/wcwidth.py b/micromamba_root/Lib/site-packages/_pytest/_io/wcwidth.py new file mode 100644 index 0000000000000000000000000000000000000000..23886ff1581a16aa97e5c375e62261622e24c169 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_io/wcwidth.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +from functools import lru_cache +import unicodedata + + +@lru_cache(100) +def wcwidth(c: str) -> int: + """Determine how many columns are needed to display a character in a terminal. + + Returns -1 if the character is not printable. + Returns 0, 1 or 2 for other characters. + """ + o = ord(c) + + # ASCII fast path. + if 0x20 <= o < 0x07F: + return 1 + + # Some Cf/Zp/Zl characters which should be zero-width. + if ( + o == 0x0000 + or 0x200B <= o <= 0x200F + or 0x2028 <= o <= 0x202E + or 0x2060 <= o <= 0x2063 + ): + return 0 + + category = unicodedata.category(c) + + # Control characters. + if category == "Cc": + return -1 + + # Combining characters with zero width. + if category in ("Me", "Mn"): + return 0 + + # Full/Wide east asian characters. + if unicodedata.east_asian_width(c) in ("F", "W"): + return 2 + + return 1 + + +def wcswidth(s: str) -> int: + """Determine how many columns are needed to display a string in a terminal. + + Returns -1 if the string contains non-printable characters. + """ + width = 0 + for c in unicodedata.normalize("NFC", s): + wc = wcwidth(c) + if wc < 0: + return -1 + width += wc + return width diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/__init__.py b/micromamba_root/Lib/site-packages/_pytest/_py/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1894d884d3647dbd36652b7b3634946cbd187eac Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/error.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/error.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e7e721d8b591dfad1dd4906961e2611c010b47a Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/error.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/path.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/path.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bef0226dcd08e5dc4e08bb46efc2201ad134bcb6 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/_py/__pycache__/path.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/error.py b/micromamba_root/Lib/site-packages/_pytest/_py/error.py new file mode 100644 index 0000000000000000000000000000000000000000..dace23764ffb4da9744cf23b668c9e7011674c67 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_py/error.py @@ -0,0 +1,119 @@ +"""create errno-specific classes for IO or os calls.""" + +from __future__ import annotations + +from collections.abc import Callable +import errno +import os +import sys +from typing import TYPE_CHECKING +from typing import TypeVar + + +if TYPE_CHECKING: + from typing_extensions import ParamSpec + + P = ParamSpec("P") + +R = TypeVar("R") + + +class Error(EnvironmentError): + def __repr__(self) -> str: + return "{}.{} {!r}: {} ".format( + self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + # repr(self.args) + ) + + def __str__(self) -> str: + s = "[{}]: {}".format( + self.__class__.__doc__, + " ".join(map(str, self.args)), + ) + return s + + +_winerrnomap = { + 2: errno.ENOENT, + 3: errno.ENOENT, + 17: errno.EEXIST, + 18: errno.EXDEV, + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailable + 22: errno.ENOTDIR, + 20: errno.ENOTDIR, + 267: errno.ENOTDIR, + 5: errno.EACCES, # anything better? +} + + +class ErrorMaker: + """lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. + """ + + _errno2class: dict[int, type[Error]] = {} + + def __getattr__(self, name: str) -> type[Error]: + if name[0] == "_": + raise AttributeError(name) + eno = getattr(errno, name) + cls = self._geterrnoclass(eno) + setattr(self, name, cls) + return cls + + def _geterrnoclass(self, eno: int) -> type[Error]: + try: + return self._errno2class[eno] + except KeyError: + clsname = errno.errorcode.get(eno, f"UnknownErrno{eno}") + errorcls = type( + clsname, + (Error,), + {"__module__": "py.error", "__doc__": os.strerror(eno)}, + ) + self._errno2class[eno] = errorcls + return errorcls + + def checked_call( + self, func: Callable[P, R], *args: P.args, **kwargs: P.kwargs + ) -> R: + """Call a function and raise an errno-exception if applicable.""" + __tracebackhide__ = True + try: + return func(*args, **kwargs) + except Error: + raise + except OSError as value: + if not hasattr(value, "errno"): + raise + if sys.platform == "win32": + try: + # error: Invalid index type "Optional[int]" for "dict[int, int]"; expected type "int" [index] + # OK to ignore because we catch the KeyError below. + cls = self._geterrnoclass(_winerrnomap[value.errno]) # type:ignore[index] + except KeyError: + raise value + else: + # we are not on Windows, or we got a proper OSError + if value.errno is None: + cls = type( + "UnknownErrnoNone", + (Error,), + {"__module__": "py.error", "__doc__": None}, + ) + else: + cls = self._geterrnoclass(value.errno) + + raise cls(f"{func.__name__}{args!r}") + + +_error_maker = ErrorMaker() +checked_call = _error_maker.checked_call + + +def __getattr__(attr: str) -> type[Error]: + return getattr(_error_maker, attr) # type: ignore[no-any-return] diff --git a/micromamba_root/Lib/site-packages/_pytest/_py/path.py b/micromamba_root/Lib/site-packages/_pytest/_py/path.py new file mode 100644 index 0000000000000000000000000000000000000000..998a7819972ac010a535887ab8f2a4c6560621af --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_py/path.py @@ -0,0 +1,1475 @@ +# mypy: allow-untyped-defs +"""local path implementation.""" + +from __future__ import annotations + +import atexit +from collections.abc import Callable +from contextlib import contextmanager +import fnmatch +import importlib.util +import io +import os +from os.path import abspath +from os.path import dirname +from os.path import exists +from os.path import isabs +from os.path import isdir +from os.path import isfile +from os.path import islink +from os.path import normpath +import posixpath +from stat import S_ISDIR +from stat import S_ISLNK +from stat import S_ISREG +import sys +from typing import Any +from typing import cast +from typing import Literal +from typing import overload +from typing import TYPE_CHECKING +import uuid +import warnings + +from . import error + + +# Moved from local.py. +iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") + + +class Checkers: + _depend_on_existence = "exists", "link", "dir", "file" + + def __init__(self, path): + self.path = path + + def dotfile(self): + return self.path.basename.startswith(".") + + def ext(self, arg): + if not arg.startswith("."): + arg = "." + arg + return self.path.ext == arg + + def basename(self, arg): + return self.path.basename == arg + + def basestarts(self, arg): + return self.path.basename.startswith(arg) + + def relto(self, arg): + return self.path.relto(arg) + + def fnmatch(self, arg): + return self.path.fnmatch(arg) + + def endswith(self, arg): + return str(self.path).endswith(arg) + + def _evaluate(self, kw): + from .._code.source import getrawcode + + for name, value in kw.items(): + invert = False + meth = None + try: + meth = getattr(self, name) + except AttributeError: + if name[:3] == "not": + invert = True + try: + meth = getattr(self, name[3:]) + except AttributeError: + pass + if meth is None: + raise TypeError(f"no {name!r} checker available for {self.path!r}") + try: + if getrawcode(meth).co_argcount > 1: + if (not meth(value)) ^ invert: + return False + else: + if bool(value) ^ bool(meth()) ^ invert: + return False + except (error.ENOENT, error.ENOTDIR, error.EBUSY): + # EBUSY feels not entirely correct, + # but its kind of necessary since ENOMEDIUM + # is not accessible in python + for name in self._depend_on_existence: + if name in kw: + if kw.get(name): + return False + name = "not" + name + if name in kw: + if not kw.get(name): + return False + return True + + _statcache: Stat + + def _stat(self) -> Stat: + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + + +class NeverRaised(Exception): + pass + + +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, (str, bytes)): + fil = FNMatcher(fil) + if isinstance(rec, str): + self.rec: Callable[[LocalPath], bool] = FNMatcher(rec) + elif not hasattr(rec, "__call__") and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = cast(Callable[[Any], Any], sorted) if sort else (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) + if not self.breadthfirst: + for subdir in dirs: + yield from self.gen(subdir) + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + yield from self.gen(subdir) + + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = "*" + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +def map_as_list(func, iter): + return list(map(func, iter)) + + +class Stat: + if TYPE_CHECKING: + + @property + def size(self) -> int: ... + + @property + def mtime(self) -> float: ... + + def __getattr__(self, name: str) -> Any: + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + + entry = error.checked_call(pwd.getpwuid, self.uid) # type:ignore[attr-defined,unused-ignore] + return entry[0] + + @property + def group(self): + """Return group name of file.""" + if iswin32: + raise NotImplementedError("XXX win32") + import grp + + entry = error.checked_call(grp.getgrgid, self.gid) # type:ignore[attr-defined,unused-ignore] + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + + +def getuserid(user): + import pwd + + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] # type:ignore[attr-defined,unused-ignore] + return user + + +def getgroupid(group): + import grp + + if not isinstance(group, int): + group = grp.getgrnam(group)[2] # type:ignore[attr-defined,unused-ignore] + return group + + +class LocalPath: + """Object oriented interface to os.path and other local filesystem + related information. + """ + + class ImportMismatchError(ImportError): + """raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + + def __init__(self, path=None, expanduser=False): + """Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = os.fspath(path) + except TypeError: + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self) -> str: + """Return value of a symbolic link.""" + # https://github.com/python/mypy/issues/12278 + return error.checked_call(os.readlink, self.strpath) # type: ignore[arg-type,return-value,unused-ignore] + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) + + def __div__(self, other): + return self.join(os.fspath(other)) + + __truediv__ = __div__ # py3k + + @property + def basename(self): + """Basename part of path.""" + return self._getbyspec("basename")[0] + + @property + def dirname(self): + """Dirname part of path.""" + return self._getbyspec("dirname")[0] + + @property + def purebasename(self): + """Pure base name of the path.""" + return self._getbyspec("purebasename")[0] + + @property + def ext(self): + """Extension of the path (including the '.').""" + return self._getbyspec("ext")[0] + + def read_binary(self): + """Read and return a bytestring from reading the path.""" + with self.open("rb") as f: + return f.read() + + def read_text(self, encoding): + """Read and return a Unicode string from reading the path.""" + with self.open("r", encoding=encoding) as f: + return f.read() + + def read(self, mode="r"): + """Read and return a bytestring from reading the path.""" + with self.open(mode) as f: + return f.read() + + def readlines(self, cr=1): + """Read and return a list of lines from the path. if cr is False, the + newline will be removed from the end of each line.""" + mode = "r" + + if not cr: + content = self.read(mode) + return content.split("\n") + else: + f = self.open(mode) + try: + return f.readlines() + finally: + f.close() + + def load(self): + """(deprecated) return object unpickled from self.read()""" + f = self.open("rb") + try: + import pickle + + return error.checked_call(pickle.load, f) + finally: + f.close() + + def move(self, target): + """Move this path to target.""" + if target.relto(self): + raise error.EINVAL(target, "cannot move path into a subdirectory of itself") + try: + self.rename(target) + except error.EXDEV: # invalid cross-device link + self.copy(target) + self.remove() + + def fnmatch(self, pattern): + """Return true if the basename/fullname matches the glob-'pattern'. + + valid pattern characters:: + + * matches everything + ? matches any single character + [seq] matches any character in seq + [!seq] matches any char not in seq + + If the pattern contains a path-separator then the full path + is used for pattern matching and a '*' is prepended to the + pattern. + + if the pattern doesn't contain a path-separator the pattern + is only matched against the basename. + """ + return FNMatcher(pattern)(self) + + def relto(self, relpath): + """Return a string which is the relative part of the path + to the given 'relpath'. + """ + if not isinstance(relpath, str | LocalPath): + raise TypeError(f"{relpath!r}: not a string or path object") + strrelpath = str(relpath) + if strrelpath and strrelpath[-1] != self.sep: + strrelpath += self.sep + # assert strrelpath[-1] == self.sep + # assert strrelpath[-2] != self.sep + strself = self.strpath + if sys.platform == "win32" or getattr(os, "_name", None) == "nt": + if os.path.normcase(strself).startswith(os.path.normcase(strrelpath)): + return strself[len(strrelpath) :] + elif strself.startswith(strrelpath): + return strself[len(strrelpath) :] + return "" + + def ensure_dir(self, *args): + """Ensure the path joined with args is a directory.""" + return self.ensure(*args, dir=True) + + def bestrelpath(self, dest): + """Return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. + """ + try: + if self == dest: + return os.curdir + base = self.common(dest) + if not base: # can be the case on windows + return str(dest) + self2base = self.relto(base) + reldest = dest.relto(base) + if self2base: + n = self2base.count(self.sep) + 1 + else: + n = 0 + lst = [os.pardir] * n + if reldest: + lst.append(reldest) + target = dest.sep.join(lst) + return target + except AttributeError: + return str(dest) + + def exists(self): + return self.check() + + def isdir(self): + return self.check(dir=1) + + def isfile(self): + return self.check(file=1) + + def parts(self, reverse=False): + """Return a root-first list of all ancestor directories + plus the path itself. + """ + current = self + lst = [self] + while 1: + last = current + current = current.dirpath() + if last == current: + break + lst.append(current) + if not reverse: + lst.reverse() + return lst + + def common(self, other): + """Return the common part shared with the other path + or None if there is no common part. + """ + last = None + for x, y in zip(self.parts(), other.parts()): + if x != y: + return last + last = x + return last + + def __add__(self, other): + """Return new path object with 'other' added to the basename""" + return self.new(basename=self.basename + str(other)) + + def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): + """Yields all paths below the current one + + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) + + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None + + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) + + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False + + sort if True will sort entries within each directory level. + """ + yield from Visitor(fil, rec, ignore, bf, sort).gen(self) + + def _sortlist(self, res, sort): + if sort: + if hasattr(sort, "__call__"): + warnings.warn( + DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), + stacklevel=3, + ) + res.sort(sort) + else: + res.sort() + + def __fspath__(self): + return self.strpath + + def __hash__(self): + s = self.strpath + if iswin32: + s = s.lower() + return hash(s) + + def __eq__(self, other): + s1 = os.fspath(self) + try: + s2 = os.fspath(other) + except TypeError: + return False + if iswin32: + s1 = s1.lower() + try: + s2 = s2.lower() + except AttributeError: + return False + return s1 == s2 + + def __ne__(self, other): + return not (self == other) + + def __lt__(self, other): + return os.fspath(self) < os.fspath(other) + + def __gt__(self, other): + return os.fspath(self) > os.fspath(other) + + def samefile(self, other): + """Return True if 'other' references the same file as 'self'.""" + other = os.fspath(other) + if not isabs(other): + other = abspath(other) + if self == other: + return True + if not hasattr(os.path, "samefile"): + return False + return error.checked_call(os.path.samefile, self.strpath, other) + + def remove(self, rec=1, ignore_errors=False): + """Remove a file or directory (or a directory tree if rec=1). + if ignore_errors is True, errors while removing directories will + be ignored. + """ + if self.check(dir=1, link=0): + if rec: + # force remove of readonly files on windows + if iswin32: + self.chmod(0o700, rec=1) + import shutil + + error.checked_call( + shutil.rmtree, self.strpath, ignore_errors=ignore_errors + ) + else: + error.checked_call(os.rmdir, self.strpath) + else: + if iswin32: + self.chmod(0o700) + error.checked_call(os.remove, self.strpath) + + def computehash(self, hashtype="md5", chunksize=524288): + """Return hexdigest of hashvalue for this file.""" + try: + try: + import hashlib as mod + except ImportError: + if hashtype == "sha1": + hashtype = "sha" + mod = __import__(hashtype) + hash = getattr(mod, hashtype)() + except (AttributeError, ImportError): + raise ValueError(f"Don't know how to compute {hashtype!r} hash") + f = self.open("rb") + try: + while 1: + buf = f.read(chunksize) + if not buf: + return hash.hexdigest() + hash.update(buf) + finally: + f.close() + + def new(self, **kw): + """Create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext + """ + obj = object.__new__(self.__class__) + if not kw: + obj.strpath = self.strpath + return obj + drive, dirname, _basename, purebasename, ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext" + ) + if "basename" in kw: + if "purebasename" in kw or "ext" in kw: + raise ValueError(f"invalid specification {kw!r}") + else: + pb = kw.setdefault("purebasename", purebasename) + try: + ext = kw["ext"] + except KeyError: + pass + else: + if ext and not ext.startswith("."): + ext = "." + ext + kw["basename"] = pb + ext + + if "dirname" in kw and not kw["dirname"]: + kw["dirname"] = drive + else: + kw.setdefault("dirname", dirname) + kw.setdefault("sep", self.sep) + obj.strpath = normpath("{dirname}{sep}{basename}".format(**kw)) + return obj + + def _getbyspec(self, spec: str) -> list[str]: + """See new for what 'spec' can be.""" + res = [] + parts = self.strpath.split(self.sep) + + args = filter(None, spec.split(",")) + for name in args: + if name == "drive": + res.append(parts[0]) + elif name == "dirname": + res.append(self.sep.join(parts[:-1])) + else: + basename = parts[-1] + if name == "basename": + res.append(basename) + else: + i = basename.rfind(".") + if i == -1: + purebasename, ext = basename, "" + else: + purebasename, ext = basename[:i], basename[i:] + if name == "purebasename": + res.append(purebasename) + elif name == "ext": + res.append(ext) + else: + raise ValueError(f"invalid part specification {name!r}") + return res + + def dirpath(self, *args, **kwargs): + """Return the directory path joined with any given path arguments.""" + if not kwargs: + path = object.__new__(self.__class__) + path.strpath = dirname(self.strpath) + if args: + path = path.join(*args) + return path + return self.new(basename="").join(*args, **kwargs) + + def join(self, *args: os.PathLike[str], abs: bool = False) -> LocalPath: + """Return a new path by appending all 'args' as path + components. if abs=1 is used restart from root if any + of the args is an absolute path. + """ + sep = self.sep + strargs = [os.fspath(arg) for arg in args] + strpath = self.strpath + if abs: + newargs: list[str] = [] + for arg in reversed(strargs): + if isabs(arg): + strpath = arg + strargs = newargs + break + newargs.insert(0, arg) + # special case for when we have e.g. strpath == "/" + actual_sep = "" if strpath.endswith(sep) else sep + for arg in strargs: + arg = arg.strip(sep) + if iswin32: + # allow unix style paths even on windows. + arg = arg.strip("/") + arg = arg.replace("/", sep) + strpath = strpath + actual_sep + arg + actual_sep = sep + obj = object.__new__(self.__class__) + obj.strpath = normpath(strpath) + return obj + + def open(self, mode="r", ensure=False, encoding=None): + """Return an opened file with the given mode. + + If ensure is True, create parent directories if needed. + """ + if ensure: + self.dirpath().ensure(dir=1) + if encoding: + return error.checked_call( + io.open, + self.strpath, + mode, + encoding=encoding, + ) + return error.checked_call(open, self.strpath, mode) + + def _fastjoin(self, name): + child = object.__new__(self.__class__) + child.strpath = self.strpath + self.sep + name + return child + + def islink(self): + return islink(self.strpath) + + def check(self, **kw): + """Check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file = 1 # is a file + file = 0 # is not a file (may not even exist) + dir = 1 # is a dir + link = 1 # is a link + exists = 1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ + if not kw: + return exists(self.strpath) + if len(kw) == 1: + if "dir" in kw: + return not kw["dir"] ^ isdir(self.strpath) + if "file" in kw: + return not kw["file"] ^ isfile(self.strpath) + if not kw: + kw = {"exists": 1} + return Checkers(self)._evaluate(kw) + + _patternchars = set("*?[" + os.sep) + + def listdir(self, fil=None, sort=None): + """List directory contents, possibly filter by the given fil func + and possibly sorted. + """ + if fil is None and sort is None: + names = error.checked_call(os.listdir, self.strpath) + return map_as_list(self._fastjoin, names) + if isinstance(fil, str): + if not self._patternchars.intersection(fil): + child = self._fastjoin(fil) + if exists(child.strpath): + return [child] + return [] + fil = FNMatcher(fil) + names = error.checked_call(os.listdir, self.strpath) + res = [] + for name in names: + child = self._fastjoin(name) + if fil is None or fil(child): + res.append(child) + self._sortlist(res, sort) + return res + + def size(self) -> int: + """Return size of the underlying file object""" + return self.stat().size + + def mtime(self) -> float: + """Return last modification time of the path.""" + return self.stat().mtime + + def copy(self, target, mode=False, stat=False): + """Copy path to target. + + If mode is True, will copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. + """ + if self.check(file=1): + if target.check(dir=1): + target = target.join(self.basename) + assert self != target + copychunked(self, target) + if mode: + copymode(self.strpath, target.strpath) + if stat: + copystat(self, target) + else: + + def rec(p): + return p.check(link=0) + + for x in self.visit(rec=rec): + relpath = x.relto(self) + newx = target.join(relpath) + newx.dirpath().ensure(dir=1) + if x.check(link=1): + newx.mksymlinkto(x.readlink()) + continue + elif x.check(file=1): + copychunked(x, newx) + elif x.check(dir=1): + newx.ensure(dir=1) + if mode: + copymode(x.strpath, newx.strpath) + if stat: + copystat(x, newx) + + def rename(self, target): + """Rename this path to target.""" + target = os.fspath(target) + return error.checked_call(os.rename, self.strpath, target) + + def dump(self, obj, bin=1): + """Pickle object into path location""" + f = self.open("wb") + import pickle + + try: + error.checked_call(pickle.dump, obj, f, bin) + finally: + f.close() + + def mkdir(self, *args): + """Create & return the directory joined with args.""" + p = self.join(*args) + error.checked_call(os.mkdir, os.fspath(p)) + return p + + def write_binary(self, data, ensure=False): + """Write binary data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open("wb") as f: + f.write(data) + + def write_text(self, data, encoding, ensure=False): + """Write text data into path using the specified encoding. + If ensure is True create missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open("w", encoding=encoding) as f: + f.write(data) + + def write(self, data, mode="w", ensure=False): + """Write data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + if "b" in mode: + if not isinstance(data, bytes): + raise ValueError("can only process bytes") + else: + if not isinstance(data, str): + if not isinstance(data, bytes): + data = str(data) + else: + data = data.decode(sys.getdefaultencoding()) + f = self.open(mode) + try: + f.write(data) + finally: + f.close() + + def _ensuredirs(self): + parent = self.dirpath() + if parent == self: + return self + if parent.check(dir=0): + parent._ensuredirs() + if self.check(dir=0): + try: + self.mkdir() + except error.EEXIST: + # race condition: file/dir created by another thread/process. + # complain if it is not a dir + if self.check(dir=0): + raise + return self + + def ensure(self, *args, **kwargs): + """Ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. + """ + p = self.join(*args) + if kwargs.get("dir", 0): + return p._ensuredirs() + else: + p.dirpath()._ensuredirs() + if not p.check(file=1): + p.open("wb").close() + return p + + @overload + def stat(self, raising: Literal[True] = ...) -> Stat: ... + + @overload + def stat(self, raising: Literal[False]) -> Stat | None: ... + + def stat(self, raising: bool = True) -> Stat | None: + """Return an os.stat() tuple.""" + if raising: + return Stat(self, error.checked_call(os.stat, self.strpath)) + try: + return Stat(self, os.stat(self.strpath)) + except KeyboardInterrupt: + raise + except Exception: + return None + + def lstat(self) -> Stat: + """Return an os.lstat() tuple.""" + return Stat(self, error.checked_call(os.lstat, self.strpath)) + + def setmtime(self, mtime=None): + """Set modification time for the given path. if 'mtime' is None + (the default) then the file's mtime is set to current time. + + Note that the resolution for 'mtime' is platform dependent. + """ + if mtime is None: + return error.checked_call(os.utime, self.strpath, mtime) + try: + return error.checked_call(os.utime, self.strpath, (-1, mtime)) + except error.EINVAL: + return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) + + def chdir(self): + """Change directory to self and return old current directory""" + try: + old = self.__class__() + except error.ENOENT: + old = None + error.checked_call(os.chdir, self.strpath) + return old + + @contextmanager + def as_cwd(self): + """ + Return a context manager, which changes to the path's dir during the + managed "with" context. + On __enter__ it returns the old dir, which might be ``None``. + """ + old = self.chdir() + try: + yield old + finally: + if old is not None: + old.chdir() + + def realpath(self): + """Return a new path which contains no symbolic links.""" + return self.__class__(os.path.realpath(self.strpath)) + + def atime(self): + """Return last access time of the path.""" + return self.stat().atime + + def __repr__(self): + return f"local({self.strpath!r})" + + def __str__(self): + """Return string representation of the Path.""" + return self.strpath + + def chmod(self, mode, rec=0): + """Change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. + """ + if not isinstance(mode, int): + raise TypeError(f"mode {mode!r} must be an integer") + if rec: + for x in self.visit(rec=rec): + error.checked_call(os.chmod, str(x), mode) + error.checked_call(os.chmod, self.strpath, mode) + + def pypkgpath(self): + """Return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + Return None if a pkgpath cannot be determined. + """ + pkgpath = None + for parent in self.parts(reverse=True): + if parent.isdir(): + if not parent.join("__init__.py").exists(): + break + if not isimportable(parent.basename): + break + pkgpath = parent + return pkgpath + + def _ensuresyspath(self, ensuremode, path): + if ensuremode: + s = str(path) + if ensuremode == "append": + if s not in sys.path: + sys.path.append(s) + else: + if s != sys.path[0]: + sys.path.insert(0, s) + + def pyimport(self, modname=None, ensuresyspath=True): + """Return path as an imported python module. + + If modname is None, look for the containing package + and construct an according module name. + The module will be put/looked up in sys.modules. + if ensuresyspath is True then the root dir for importing + the file (taking __init__.py files into account) will + be prepended to sys.path if it isn't there already. + If ensuresyspath=="append" the root dir will be appended + if it isn't already contained in sys.path. + if ensuresyspath is False no modification of syspath happens. + + Special value of ensuresyspath=="importlib" is intended + purely for using in pytest, it is capable only of importing + separate .py files outside packages, e.g. for test suite + without any __init__.py file. It effectively allows having + same-named test modules in different places and offers + mild opt-in via this option. Note that it works only in + recent versions of python. + """ + if not self.check(): + raise error.ENOENT(self) + + if ensuresyspath == "importlib": + if modname is None: + modname = self.purebasename + spec = importlib.util.spec_from_file_location(modname, str(self)) + if spec is None or spec.loader is None: + raise ImportError(f"Can't find module {modname} at location {self!s}") + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + pkgpath = None + if modname is None: + pkgpath = self.pypkgpath() + if pkgpath is not None: + pkgroot = pkgpath.dirpath() + names = self.new(ext="").relto(pkgroot).split(self.sep) + if names[-1] == "__init__": + names.pop() + modname = ".".join(names) + else: + pkgroot = self.dirpath() + modname = self.purebasename + + self._ensuresyspath(ensuresyspath, pkgroot) + __import__(modname) + mod = sys.modules[modname] + if self.basename == "__init__.py": + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check + modfile = mod.__file__ + assert modfile is not None + if modfile[-4:] in (".pyc", ".pyo"): + modfile = modfile[:-1] + elif modfile.endswith("$py.class"): + modfile = modfile[:-9] + ".py" + if modfile.endswith(os.sep + "__init__.py"): + if self.basename != "__init__.py": + modfile = modfile[:-12] + try: + issame = self.samefile(modfile) + except error.ENOENT: + issame = False + if not issame: + ignore = os.getenv("PY_IGNORE_IMPORTMISMATCH") + if ignore != "1": + raise self.ImportMismatchError(modname, modfile, self) + return mod + else: + try: + return sys.modules[modname] + except KeyError: + # we have a custom modname, do a pseudo-import + import types + + mod = types.ModuleType(modname) + mod.__file__ = str(self) + sys.modules[modname] = mod + try: + with open(str(self), "rb") as f: + exec(f.read(), mod.__dict__) + except BaseException: + del sys.modules[modname] + raise + return mod + + def sysexec(self, *argv: os.PathLike[str], **popen_opts: Any) -> str: + """Return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. + """ + from subprocess import PIPE + from subprocess import Popen + + popen_opts.pop("stdout", None) + popen_opts.pop("stderr", None) + proc = Popen( + [str(self)] + [str(arg) for arg in argv], + **popen_opts, + stdout=PIPE, + stderr=PIPE, + ) + stdout: str | bytes + stdout, stderr = proc.communicate() + ret = proc.wait() + if isinstance(stdout, bytes): + stdout = stdout.decode(sys.getdefaultencoding()) + if ret != 0: + if isinstance(stderr, bytes): + stderr = stderr.decode(sys.getdefaultencoding()) + raise RuntimeError( + ret, + ret, + str(self), + stdout, + stderr, + ) + return stdout + + @classmethod + def sysfind(cls, name, checker=None, paths=None): + """Return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. + """ + if isabs(name): + p = local(name) + if p.check(file=1): + return p + else: + if paths is None: + if iswin32: + paths = os.environ["Path"].split(";") + if "" not in paths and "." not in paths: + paths.append(".") + try: + systemroot = os.environ["SYSTEMROOT"] + except KeyError: + pass + else: + paths = [ + path.replace("%SystemRoot%", systemroot) for path in paths + ] + else: + paths = os.environ["PATH"].split(":") + tryadd = [] + if iswin32: + tryadd += os.environ["PATHEXT"].split(os.pathsep) + tryadd.append("") + + for x in paths: + for addext in tryadd: + p = local(x).join(name, abs=True) + addext + try: + if p.check(file=1): + if checker: + if not checker(p): + continue + return p + except error.EACCES: + pass + return None + + @classmethod + def _gethomedir(cls): + try: + x = os.environ["HOME"] + except KeyError: + try: + x = os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] + except KeyError: + return None + return cls(x) + + # """ + # special class constructors for local filesystem paths + # """ + @classmethod + def get_temproot(cls): + """Return the system's temporary directory + (where tempfiles are usually created in) + """ + import tempfile + + return local(tempfile.gettempdir()) + + @classmethod + def mkdtemp(cls, rootdir=None): + """Return a Path object pointing to a fresh new temporary directory + (which we created ourselves). + """ + import tempfile + + if rootdir is None: + rootdir = cls.get_temproot() + path = error.checked_call(tempfile.mkdtemp, dir=str(rootdir)) + return cls(path) + + @classmethod + def make_numbered_dir( + cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 + ): # two days + """Return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. + """ + if rootdir is None: + rootdir = cls.get_temproot() + + nprefix = prefix.lower() + + def parse_num(path): + """Parse the number out of a path (if it matches the prefix)""" + nbasename = path.basename.lower() + if nbasename.startswith(nprefix): + try: + return int(nbasename[len(nprefix) :]) + except ValueError: + pass + + def create_lockfile(path): + """Exclusively create lockfile. Throws when failed""" + mypid = os.getpid() + lockfile = path.join(".lock") + if hasattr(lockfile, "mksymlinkto"): + lockfile.mksymlinkto(str(mypid)) + else: + fd = error.checked_call( + os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644 + ) + with os.fdopen(fd, "w") as f: + f.write(str(mypid)) + return lockfile + + def atexit_remove_lockfile(lockfile): + """Ensure lockfile is removed at process exit""" + mypid = os.getpid() + + def try_remove_lockfile(): + # in a fork() situation, only the last process should + # remove the .lock, otherwise the other processes run the + # risk of seeing their temporary dir disappear. For now + # we remove the .lock in the parent only (i.e. we assume + # that the children finish before the parent). + if os.getpid() != mypid: + return + try: + lockfile.remove() + except error.Error: + pass + + atexit.register(try_remove_lockfile) + + # compute the maximum number currently in use with the prefix + lastmax = None + while True: + maxnum = -1 + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None: + maxnum = max(maxnum, num) + + # make the new directory + try: + udir = rootdir.mkdir(prefix + str(maxnum + 1)) + if lock_timeout: + lockfile = create_lockfile(udir) + atexit_remove_lockfile(lockfile) + except (error.EEXIST, error.ENOENT, error.EBUSY): + # race condition (1): another thread/process created the dir + # in the meantime - try again + # race condition (2): another thread/process spuriously acquired + # lock treating empty directory as candidate + # for removal - try again + # race condition (3): another thread/process tried to create the lock at + # the same time (happened in Python 3.3 on Windows) + # https://ci.appveyor.com/project/pytestbot/py/build/1.0.21/job/ffi85j4c0lqwsfwa + if lastmax == maxnum: + raise + lastmax = maxnum + continue + break + + def get_mtime(path): + """Read file modification time""" + try: + return path.lstat().mtime + except error.Error: + pass + + garbage_prefix = prefix + "garbage-" + + def is_garbage(path): + """Check if path denotes directory scheduled for removal""" + bn = path.basename + return bn.startswith(garbage_prefix) + + # prune old directories + udir_time = get_mtime(udir) + if keep and udir_time: + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None and num <= (maxnum - keep): + try: + # try acquiring lock to remove directory as exclusive user + if lock_timeout: + create_lockfile(path) + except (error.EEXIST, error.ENOENT, error.EBUSY): + path_time = get_mtime(path) + if not path_time: + # assume directory doesn't exist now + continue + if abs(udir_time - path_time) < lock_timeout: + # assume directory with lockfile exists + # and lock timeout hasn't expired yet + continue + + # path dir locked for exclusive use + # and scheduled for removal to avoid another thread/process + # treating it as a new directory or removal candidate + garbage_path = rootdir.join(garbage_prefix + str(uuid.uuid4())) + try: + path.rename(garbage_path) + garbage_path.remove(rec=1) + except KeyboardInterrupt: + raise + except Exception: # this might be error.Error, WindowsError ... + pass + if is_garbage(path): + try: + path.remove(rec=1) + except KeyboardInterrupt: + raise + except Exception: # this might be error.Error, WindowsError ... + pass + + # make link... + try: + username = os.environ["USER"] # linux, et al + except KeyError: + try: + username = os.environ["USERNAME"] # windows + except KeyError: + username = "current" + + src = str(udir) + dest = src[: src.rfind("-")] + "-" + username + try: + os.unlink(dest) + except OSError: + pass + try: + os.symlink(src, dest) + except (OSError, AttributeError, NotImplementedError): + pass + + return udir + + +def copymode(src, dest): + """Copy permission from src to dst.""" + import shutil + + shutil.copymode(src, dest) + + +def copystat(src, dest): + """Copy permission, last modification time, + last access time, and flags from src to dst.""" + import shutil + + shutil.copystat(str(src), str(dest)) + + +def copychunked(src, dest): + chunksize = 524288 # half a meg of bytes + fsrc = src.open("rb") + try: + fdest = dest.open("wb") + try: + while 1: + buf = fsrc.read(chunksize) + if not buf: + break + fdest.write(buf) + finally: + fdest.close() + finally: + fsrc.close() + + +def isimportable(name): + if name and (name[0].isalpha() or name[0] == "_"): + name = name.replace("_", "") + return not name or name.isalnum() + + +local = LocalPath diff --git a/micromamba_root/Lib/site-packages/_pytest/_version.py b/micromamba_root/Lib/site-packages/_pytest/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..0930b266b8883643205c8fdefc2af18ae936f19e --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/_version.py @@ -0,0 +1,34 @@ +# file generated by setuptools-scm +# don't change, don't track in version control + +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple + from typing import Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] + COMMIT_ID = Union[str, None] +else: + VERSION_TUPLE = object + COMMIT_ID = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE +commit_id: COMMIT_ID +__commit_id__: COMMIT_ID + +__version__ = version = '9.0.3' +__version_tuple__ = version_tuple = (9, 0, 3) + +__commit_id__ = commit_id = None diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/__init__.py b/micromamba_root/Lib/site-packages/_pytest/assertion/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..22f3ca8e258cc48effeb34154821f8b1e5cf151b --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/assertion/__init__.py @@ -0,0 +1,208 @@ +# mypy: allow-untyped-defs +"""Support for presenting detailed information in failing assertions.""" + +from __future__ import annotations + +from collections.abc import Generator +import sys +from typing import Any +from typing import Protocol +from typing import TYPE_CHECKING + +from _pytest.assertion import rewrite +from _pytest.assertion import truncate +from _pytest.assertion import util +from _pytest.assertion.rewrite import assertstate_key +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item + + +if TYPE_CHECKING: + from _pytest.main import Session + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--assert", + action="store", + dest="assertmode", + choices=("rewrite", "plain"), + default="rewrite", + metavar="MODE", + help=( + "Control assertion debugging tools.\n" + "'plain' performs no assertion debugging.\n" + "'rewrite' (the default) rewrites assert statements in test modules" + " on import to provide assert expression information." + ), + ) + parser.addini( + "enable_assertion_pass_hook", + type="bool", + default=False, + help="Enables the pytest_assertion_pass hook. " + "Make sure to delete any previously generated pyc cache files.", + ) + + parser.addini( + "truncation_limit_lines", + default=None, + help="Set threshold of LINES after which truncation will take effect", + ) + parser.addini( + "truncation_limit_chars", + default=None, + help=("Set threshold of CHARS after which truncation will take effect"), + ) + + Config._add_verbosity_ini( + parser, + Config.VERBOSITY_ASSERTIONS, + help=( + "Specify a verbosity level for assertions, overriding the main level. " + "Higher levels will provide more detailed explanation when an assertion fails." + ), + ) + + +def register_assert_rewrite(*names: str) -> None: + """Register one or more module names to be rewritten on import. + + This function will make sure that this module or all modules inside + the package will get their assert statements rewritten. + Thus you should make sure to call this before the module is + actually imported, usually in your __init__.py if you are a plugin + using a package. + + :param names: The module names to register. + """ + for name in names: + if not isinstance(name, str): + msg = "expected module names as *args, got {0} instead" # type: ignore[unreachable] + raise TypeError(msg.format(repr(names))) + rewrite_hook: RewriteHook + for hook in sys.meta_path: + if isinstance(hook, rewrite.AssertionRewritingHook): + rewrite_hook = hook + break + else: + rewrite_hook = DummyRewriteHook() + rewrite_hook.mark_rewrite(*names) + + +class RewriteHook(Protocol): + def mark_rewrite(self, *names: str) -> None: ... + + +class DummyRewriteHook: + """A no-op import hook for when rewriting is disabled.""" + + def mark_rewrite(self, *names: str) -> None: + pass + + +class AssertionState: + """State for the assertion plugin.""" + + def __init__(self, config: Config, mode) -> None: + self.mode = mode + self.trace = config.trace.root.get("assertion") + self.hook: rewrite.AssertionRewritingHook | None = None + + +def install_importhook(config: Config) -> rewrite.AssertionRewritingHook: + """Try to install the rewrite hook, raise SystemError if it fails.""" + config.stash[assertstate_key] = AssertionState(config, "rewrite") + config.stash[assertstate_key].hook = hook = rewrite.AssertionRewritingHook(config) + sys.meta_path.insert(0, hook) + config.stash[assertstate_key].trace("installed rewrite import hook") + + def undo() -> None: + hook = config.stash[assertstate_key].hook + if hook is not None and hook in sys.meta_path: + sys.meta_path.remove(hook) + + config.add_cleanup(undo) + return hook + + +def pytest_collection(session: Session) -> None: + # This hook is only called when test modules are collected + # so for example not in the managing process of pytest-xdist + # (which does not collect test modules). + assertstate = session.config.stash.get(assertstate_key, None) + if assertstate: + if assertstate.hook is not None: + assertstate.hook.set_session(session) + + +@hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + """Setup the pytest_assertrepr_compare and pytest_assertion_pass hooks. + + The rewrite module will use util._reprcompare if it exists to use custom + reporting via the pytest_assertrepr_compare hook. This sets up this custom + comparison for the test. + """ + ihook = item.ihook + + def callbinrepr(op, left: object, right: object) -> str | None: + """Call the pytest_assertrepr_compare hook and prepare the result. + + This uses the first result from the hook and then ensures the + following: + * Overly verbose explanations are truncated unless configured otherwise + (eg. if running in verbose mode). + * Embedded newlines are escaped to help util.format_explanation() + later. + * If the rewrite mode is used embedded %-characters are replaced + to protect later % formatting. + + The result can be formatted by util.format_explanation() for + pretty printing. + """ + hook_result = ihook.pytest_assertrepr_compare( + config=item.config, op=op, left=left, right=right + ) + for new_expl in hook_result: + if new_expl: + new_expl = truncate.truncate_if_required(new_expl, item) + new_expl = [line.replace("\n", "\\n") for line in new_expl] + res = "\n~".join(new_expl) + if item.config.getvalue("assertmode") == "rewrite": + res = res.replace("%", "%%") + return res + return None + + saved_assert_hooks = util._reprcompare, util._assertion_pass + util._reprcompare = callbinrepr + util._config = item.config + + if ihook.pytest_assertion_pass.get_hookimpls(): + + def call_assertion_pass_hook(lineno: int, orig: str, expl: str) -> None: + ihook.pytest_assertion_pass(item=item, lineno=lineno, orig=orig, expl=expl) + + util._assertion_pass = call_assertion_pass_hook + + try: + return (yield) + finally: + util._reprcompare, util._assertion_pass = saved_assert_hooks + util._config = None + + +def pytest_sessionfinish(session: Session) -> None: + assertstate = session.config.stash.get(assertstate_key, None) + if assertstate: + if assertstate.hook is not None: + assertstate.hook.set_session(None) + + +def pytest_assertrepr_compare( + config: Config, op: str, left: Any, right: Any +) -> list[str] | None: + return util.assertrepr_compare(config=config, op=op, left=left, right=right) diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a38e34c5cdafe702ee08afa5604026d41acca70 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/rewrite.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/rewrite.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d46b6c3ed34de3fcc20d8847c54baa0a5e78ba07 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/rewrite.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/truncate.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/truncate.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9abbe61b1dc84a2a2390b411968279164e136d60 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/truncate.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/util.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2417068eb0e39a18025f1a070d321a7c42d9f7c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/assertion/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/rewrite.py b/micromamba_root/Lib/site-packages/_pytest/assertion/rewrite.py new file mode 100644 index 0000000000000000000000000000000000000000..566549d66f25dfe9f144cb451f370da2635c1072 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/assertion/rewrite.py @@ -0,0 +1,1202 @@ +"""Rewrite assertion AST to produce nice error messages.""" + +from __future__ import annotations + +import ast +from collections import defaultdict +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Sequence +import errno +import functools +import importlib.abc +import importlib.machinery +import importlib.util +import io +import itertools +import marshal +import os +from pathlib import Path +from pathlib import PurePath +import struct +import sys +import tokenize +import types +from typing import IO +from typing import TYPE_CHECKING + + +if sys.version_info >= (3, 12): + from importlib.resources.abc import TraversableResources +else: + from importlib.abc import TraversableResources +if sys.version_info < (3, 11): + from importlib.readers import FileReader +else: + from importlib.resources.readers import FileReader + + +from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE +from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited +from _pytest._version import version +from _pytest.assertion import util +from _pytest.config import Config +from _pytest.fixtures import FixtureFunctionDefinition +from _pytest.main import Session +from _pytest.pathlib import absolutepath +from _pytest.pathlib import fnmatch_ex +from _pytest.stash import StashKey + + +# fmt: off +from _pytest.assertion.util import format_explanation as _format_explanation # noqa:F401, isort:skip +# fmt:on + +if TYPE_CHECKING: + from _pytest.assertion import AssertionState + + +class Sentinel: + pass + + +assertstate_key = StashKey["AssertionState"]() + +# pytest caches rewritten pycs in pycache dirs +PYTEST_TAG = f"{sys.implementation.cache_tag}-pytest-{version}" +PYC_EXT = ".py" + ((__debug__ and "c") or "o") +PYC_TAIL = "." + PYTEST_TAG + PYC_EXT + +# Special marker that denotes we have just left a scope definition +_SCOPE_END_MARKER = Sentinel() + + +class AssertionRewritingHook(importlib.abc.MetaPathFinder, importlib.abc.Loader): + """PEP302/PEP451 import hook which rewrites asserts.""" + + def __init__(self, config: Config) -> None: + self.config = config + try: + self.fnpats = config.getini("python_files") + except ValueError: + self.fnpats = ["test_*.py", "*_test.py"] + self.session: Session | None = None + self._rewritten_names: dict[str, Path] = {} + self._must_rewrite: set[str] = set() + # flag to guard against trying to rewrite a pyc file while we are already writing another pyc file, + # which might result in infinite recursion (#3506) + self._writing_pyc = False + self._basenames_to_check_rewrite = {"conftest"} + self._marked_for_rewrite_cache: dict[str, bool] = {} + self._session_paths_checked = False + + def set_session(self, session: Session | None) -> None: + self.session = session + self._session_paths_checked = False + + # Indirection so we can mock calls to find_spec originated from the hook during testing + _find_spec = importlib.machinery.PathFinder.find_spec + + def find_spec( + self, + name: str, + path: Sequence[str | bytes] | None = None, + target: types.ModuleType | None = None, + ) -> importlib.machinery.ModuleSpec | None: + if self._writing_pyc: + return None + state = self.config.stash[assertstate_key] + if self._early_rewrite_bailout(name, state): + return None + state.trace(f"find_module called for: {name}") + + # Type ignored because mypy is confused about the `self` binding here. + spec = self._find_spec(name, path) # type: ignore + + if spec is None and path is not None: + # With --import-mode=importlib, PathFinder cannot find spec without modifying `sys.path`, + # causing inability to assert rewriting (#12659). + # At this point, try using the file path to find the module spec. + for _path_str in path: + spec = importlib.util.spec_from_file_location(name, _path_str) + if spec is not None: + break + + if ( + # the import machinery could not find a file to import + spec is None + # this is a namespace package (without `__init__.py`) + # there's nothing to rewrite there + or spec.origin is None + # we can only rewrite source files + or not isinstance(spec.loader, importlib.machinery.SourceFileLoader) + # if the file doesn't exist, we can't rewrite it + or not os.path.exists(spec.origin) + ): + return None + else: + fn = spec.origin + + if not self._should_rewrite(name, fn, state): + return None + + return importlib.util.spec_from_file_location( + name, + fn, + loader=self, + submodule_search_locations=spec.submodule_search_locations, + ) + + def create_module( + self, spec: importlib.machinery.ModuleSpec + ) -> types.ModuleType | None: + return None # default behaviour is fine + + def exec_module(self, module: types.ModuleType) -> None: + assert module.__spec__ is not None + assert module.__spec__.origin is not None + fn = Path(module.__spec__.origin) + state = self.config.stash[assertstate_key] + + self._rewritten_names[module.__name__] = fn + + # The requested module looks like a test file, so rewrite it. This is + # the most magical part of the process: load the source, rewrite the + # asserts, and load the rewritten source. We also cache the rewritten + # module code in a special pyc. We must be aware of the possibility of + # concurrent pytest processes rewriting and loading pycs. To avoid + # tricky race conditions, we maintain the following invariant: The + # cached pyc is always a complete, valid pyc. Operations on it must be + # atomic. POSIX's atomic rename comes in handy. + write = not sys.dont_write_bytecode + cache_dir = get_cache_dir(fn) + if write: + ok = try_makedirs(cache_dir) + if not ok: + write = False + state.trace(f"read only directory: {cache_dir}") + + cache_name = fn.name[:-3] + PYC_TAIL + pyc = cache_dir / cache_name + # Notice that even if we're in a read-only directory, I'm going + # to check for a cached pyc. This may not be optimal... + co = _read_pyc(fn, pyc, state.trace) + if co is None: + state.trace(f"rewriting {fn!r}") + source_stat, co = _rewrite_test(fn, self.config) + if write: + self._writing_pyc = True + try: + _write_pyc(state, co, source_stat, pyc) + finally: + self._writing_pyc = False + else: + state.trace(f"found cached rewritten pyc for {fn}") + exec(co, module.__dict__) + + def _early_rewrite_bailout(self, name: str, state: AssertionState) -> bool: + """A fast way to get out of rewriting modules. + + Profiling has shown that the call to PathFinder.find_spec (inside of + the find_spec from this class) is a major slowdown, so, this method + tries to filter what we're sure won't be rewritten before getting to + it. + """ + if self.session is not None and not self._session_paths_checked: + self._session_paths_checked = True + for initial_path in self.session._initialpaths: + # Make something as c:/projects/my_project/path.py -> + # ['c:', 'projects', 'my_project', 'path.py'] + parts = str(initial_path).split(os.sep) + # add 'path' to basenames to be checked. + self._basenames_to_check_rewrite.add(os.path.splitext(parts[-1])[0]) + + # Note: conftest already by default in _basenames_to_check_rewrite. + parts = name.split(".") + if parts[-1] in self._basenames_to_check_rewrite: + return False + + # For matching the name it must be as if it was a filename. + path = PurePath(*parts).with_suffix(".py") + + for pat in self.fnpats: + # if the pattern contains subdirectories ("tests/**.py" for example) we can't bail out based + # on the name alone because we need to match against the full path + if os.path.dirname(pat): + return False + if fnmatch_ex(pat, path): + return False + + if self._is_marked_for_rewrite(name, state): + return False + + state.trace(f"early skip of rewriting module: {name}") + return True + + def _should_rewrite(self, name: str, fn: str, state: AssertionState) -> bool: + # always rewrite conftest files + if os.path.basename(fn) == "conftest.py": + state.trace(f"rewriting conftest file: {fn!r}") + return True + + if self.session is not None: + if self.session.isinitpath(absolutepath(fn)): + state.trace(f"matched test file (was specified on cmdline): {fn!r}") + return True + + # modules not passed explicitly on the command line are only + # rewritten if they match the naming convention for test files + fn_path = PurePath(fn) + for pat in self.fnpats: + if fnmatch_ex(pat, fn_path): + state.trace(f"matched test file {fn!r}") + return True + + return self._is_marked_for_rewrite(name, state) + + def _is_marked_for_rewrite(self, name: str, state: AssertionState) -> bool: + try: + return self._marked_for_rewrite_cache[name] + except KeyError: + for marked in self._must_rewrite: + if name == marked or name.startswith(marked + "."): + state.trace(f"matched marked file {name!r} (from {marked!r})") + self._marked_for_rewrite_cache[name] = True + return True + + self._marked_for_rewrite_cache[name] = False + return False + + def mark_rewrite(self, *names: str) -> None: + """Mark import names as needing to be rewritten. + + The named module or package as well as any nested modules will + be rewritten on import. + """ + already_imported = ( + set(names).intersection(sys.modules).difference(self._rewritten_names) + ) + for name in already_imported: + mod = sys.modules[name] + if not AssertionRewriter.is_rewrite_disabled( + mod.__doc__ or "" + ) and not isinstance(mod.__loader__, type(self)): + self._warn_already_imported(name) + self._must_rewrite.update(names) + self._marked_for_rewrite_cache.clear() + + def _warn_already_imported(self, name: str) -> None: + from _pytest.warning_types import PytestAssertRewriteWarning + + self.config.issue_config_time_warning( + PytestAssertRewriteWarning( + f"Module already imported so cannot be rewritten; {name}" + ), + stacklevel=5, + ) + + def get_data(self, pathname: str | bytes) -> bytes: + """Optional PEP302 get_data API.""" + with open(pathname, "rb") as f: + return f.read() + + def get_resource_reader(self, name: str) -> TraversableResources: + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) # type: ignore[arg-type] + + +def _write_pyc_fp( + fp: IO[bytes], source_stat: os.stat_result, co: types.CodeType +) -> None: + # Technically, we don't have to have the same pyc format as + # (C)Python, since these "pycs" should never be seen by builtin + # import. However, there's little reason to deviate. + fp.write(importlib.util.MAGIC_NUMBER) + # https://www.python.org/dev/peps/pep-0552/ + flags = b"\x00\x00\x00\x00" + fp.write(flags) + # as of now, bytecode header expects 32-bit numbers for size and mtime (#4903) + mtime = int(source_stat.st_mtime) & 0xFFFFFFFF + size = source_stat.st_size & 0xFFFFFFFF + # " bool: + proc_pyc = f"{pyc}.{os.getpid()}" + try: + with open(proc_pyc, "wb") as fp: + _write_pyc_fp(fp, source_stat, co) + except OSError as e: + state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") + return False + + try: + os.replace(proc_pyc, pyc) + except OSError as e: + state.trace(f"error writing pyc file at {pyc}: {e}") + # we ignore any failure to write the cache file + # there are many reasons, permission-denied, pycache dir being a + # file etc. + return False + return True + + +def _rewrite_test(fn: Path, config: Config) -> tuple[os.stat_result, types.CodeType]: + """Read and rewrite *fn* and return the code object.""" + stat = os.stat(fn) + source = fn.read_bytes() + strfn = str(fn) + tree = ast.parse(source, filename=strfn) + rewrite_asserts(tree, source, strfn, config) + co = compile(tree, strfn, "exec", dont_inherit=True) + return stat, co + + +def _read_pyc( + source: Path, pyc: Path, trace: Callable[[str], None] = lambda x: None +) -> types.CodeType | None: + """Possibly read a pytest pyc containing rewritten code. + + Return rewritten code if successful or None if not. + """ + try: + fp = open(pyc, "rb") + except OSError: + return None + with fp: + try: + stat_result = os.stat(source) + mtime = int(stat_result.st_mtime) + size = stat_result.st_size + data = fp.read(16) + except OSError as e: + trace(f"_read_pyc({source}): OSError {e}") + return None + # Check for invalid or out of date pyc file. + if len(data) != (16): + trace(f"_read_pyc({source}): invalid pyc (too short)") + return None + if data[:4] != importlib.util.MAGIC_NUMBER: + trace(f"_read_pyc({source}): invalid pyc (bad magic number)") + return None + if data[4:8] != b"\x00\x00\x00\x00": + trace(f"_read_pyc({source}): invalid pyc (unsupported flags)") + return None + mtime_data = data[8:12] + if int.from_bytes(mtime_data, "little") != mtime & 0xFFFFFFFF: + trace(f"_read_pyc({source}): out of date") + return None + size_data = data[12:16] + if int.from_bytes(size_data, "little") != size & 0xFFFFFFFF: + trace(f"_read_pyc({source}): invalid pyc (incorrect size)") + return None + try: + co = marshal.load(fp) + except Exception as e: + trace(f"_read_pyc({source}): marshal.load error {e}") + return None + if not isinstance(co, types.CodeType): + trace(f"_read_pyc({source}): not a code object") + return None + return co + + +def rewrite_asserts( + mod: ast.Module, + source: bytes, + module_path: str | None = None, + config: Config | None = None, +) -> None: + """Rewrite the assert statements in mod.""" + AssertionRewriter(module_path, config, source).run(mod) + + +def _saferepr(obj: object) -> str: + r"""Get a safe repr of an object for assertion error messages. + + The assertion formatting (util.format_explanation()) requires + newlines to be escaped since they are a special character for it. + Normally assertion.util.format_explanation() does this but for a + custom repr it is possible to contain one of the special escape + sequences, especially '\n{' and '\n}' are likely to be present in + JSON reprs. + """ + if isinstance(obj, types.MethodType): + # for bound methods, skip redundant information + return obj.__name__ + + maxsize = _get_maxsize_for_saferepr(util._config) + if not maxsize: + return saferepr_unlimited(obj).replace("\n", "\\n") + return saferepr(obj, maxsize=maxsize).replace("\n", "\\n") + + +def _get_maxsize_for_saferepr(config: Config | None) -> int | None: + """Get `maxsize` configuration for saferepr based on the given config object.""" + if config is None: + verbosity = 0 + else: + verbosity = config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + if verbosity >= 2: + return None + if verbosity >= 1: + return DEFAULT_REPR_MAX_SIZE * 10 + return DEFAULT_REPR_MAX_SIZE + + +def _format_assertmsg(obj: object) -> str: + r"""Format the custom assertion message given. + + For strings this simply replaces newlines with '\n~' so that + util.format_explanation() will preserve them instead of escaping + newlines. For other objects saferepr() is used first. + """ + # reprlib appears to have a bug which means that if a string + # contains a newline it gets escaped, however if an object has a + # .__repr__() which contains newlines it does not get escaped. + # However in either case we want to preserve the newline. + replaces = [("\n", "\n~"), ("%", "%%")] + if not isinstance(obj, str): + obj = saferepr(obj, _get_maxsize_for_saferepr(util._config)) + replaces.append(("\\n", "\n~")) + + for r1, r2 in replaces: + obj = obj.replace(r1, r2) + + return obj + + +def _should_repr_global_name(obj: object) -> bool: + if callable(obj): + # For pytest fixtures the __repr__ method provides more information than the function name. + return isinstance(obj, FixtureFunctionDefinition) + + try: + return not hasattr(obj, "__name__") + except Exception: + return True + + +def _format_boolop(explanations: Iterable[str], is_or: bool) -> str: + explanation = "(" + ((is_or and " or ") or " and ").join(explanations) + ")" + return explanation.replace("%", "%%") + + +def _call_reprcompare( + ops: Sequence[str], + results: Sequence[bool], + expls: Sequence[str], + each_obj: Sequence[object], +) -> str: + for i, res, expl in zip(range(len(ops)), results, expls, strict=True): + try: + done = not res + except Exception: + done = True + if done: + break + if util._reprcompare is not None: + custom = util._reprcompare(ops[i], each_obj[i], each_obj[i + 1]) + if custom is not None: + return custom + return expl + + +def _call_assertion_pass(lineno: int, orig: str, expl: str) -> None: + if util._assertion_pass is not None: + util._assertion_pass(lineno, orig, expl) + + +def _check_if_assertion_pass_impl() -> bool: + """Check if any plugins implement the pytest_assertion_pass hook + in order not to generate explanation unnecessarily (might be expensive).""" + return True if util._assertion_pass else False + + +UNARY_MAP = {ast.Not: "not %s", ast.Invert: "~%s", ast.USub: "-%s", ast.UAdd: "+%s"} + +BINOP_MAP = { + ast.BitOr: "|", + ast.BitXor: "^", + ast.BitAnd: "&", + ast.LShift: "<<", + ast.RShift: ">>", + ast.Add: "+", + ast.Sub: "-", + ast.Mult: "*", + ast.Div: "/", + ast.FloorDiv: "//", + ast.Mod: "%%", # escaped for string formatting + ast.Eq: "==", + ast.NotEq: "!=", + ast.Lt: "<", + ast.LtE: "<=", + ast.Gt: ">", + ast.GtE: ">=", + ast.Pow: "**", + ast.Is: "is", + ast.IsNot: "is not", + ast.In: "in", + ast.NotIn: "not in", + ast.MatMult: "@", +} + + +def traverse_node(node: ast.AST) -> Iterator[ast.AST]: + """Recursively yield node and all its children in depth-first order.""" + yield node + for child in ast.iter_child_nodes(node): + yield from traverse_node(child) + + +@functools.lru_cache(maxsize=1) +def _get_assertion_exprs(src: bytes) -> dict[int, str]: + """Return a mapping from {lineno: "assertion test expression"}.""" + ret: dict[int, str] = {} + + depth = 0 + lines: list[str] = [] + assert_lineno: int | None = None + seen_lines: set[int] = set() + + def _write_and_reset() -> None: + nonlocal depth, lines, assert_lineno, seen_lines + assert assert_lineno is not None + ret[assert_lineno] = "".join(lines).rstrip().rstrip("\\") + depth = 0 + lines = [] + assert_lineno = None + seen_lines = set() + + tokens = tokenize.tokenize(io.BytesIO(src).readline) + for tp, source, (lineno, offset), _, line in tokens: + if tp == tokenize.NAME and source == "assert": + assert_lineno = lineno + elif assert_lineno is not None: + # keep track of depth for the assert-message `,` lookup + if tp == tokenize.OP and source in "([{": + depth += 1 + elif tp == tokenize.OP and source in ")]}": + depth -= 1 + + if not lines: + lines.append(line[offset:]) + seen_lines.add(lineno) + # a non-nested comma separates the expression from the message + elif depth == 0 and tp == tokenize.OP and source == ",": + # one line assert with message + if lineno in seen_lines and len(lines) == 1: + offset_in_trimmed = offset + len(lines[-1]) - len(line) + lines[-1] = lines[-1][:offset_in_trimmed] + # multi-line assert with message + elif lineno in seen_lines: + lines[-1] = lines[-1][:offset] + # multi line assert with escaped newline before message + else: + lines.append(line[:offset]) + _write_and_reset() + elif tp in {tokenize.NEWLINE, tokenize.ENDMARKER}: + _write_and_reset() + elif lines and lineno not in seen_lines: + lines.append(line) + seen_lines.add(lineno) + + return ret + + +class AssertionRewriter(ast.NodeVisitor): + """Assertion rewriting implementation. + + The main entrypoint is to call .run() with an ast.Module instance, + this will then find all the assert statements and rewrite them to + provide intermediate values and a detailed assertion error. See + http://pybites.blogspot.be/2011/07/behind-scenes-of-pytests-new-assertion.html + for an overview of how this works. + + The entry point here is .run() which will iterate over all the + statements in an ast.Module and for each ast.Assert statement it + finds call .visit() with it. Then .visit_Assert() takes over and + is responsible for creating new ast statements to replace the + original assert statement: it rewrites the test of an assertion + to provide intermediate values and replace it with an if statement + which raises an assertion error with a detailed explanation in + case the expression is false and calls pytest_assertion_pass hook + if expression is true. + + For this .visit_Assert() uses the visitor pattern to visit all the + AST nodes of the ast.Assert.test field, each visit call returning + an AST node and the corresponding explanation string. During this + state is kept in several instance attributes: + + :statements: All the AST statements which will replace the assert + statement. + + :variables: This is populated by .variable() with each variable + used by the statements so that they can all be set to None at + the end of the statements. + + :variable_counter: Counter to create new unique variables needed + by statements. Variables are created using .variable() and + have the form of "@py_assert0". + + :expl_stmts: The AST statements which will be executed to get + data from the assertion. This is the code which will construct + the detailed assertion message that is used in the AssertionError + or for the pytest_assertion_pass hook. + + :explanation_specifiers: A dict filled by .explanation_param() + with %-formatting placeholders and their corresponding + expressions to use in the building of an assertion message. + This is used by .pop_format_context() to build a message. + + :stack: A stack of the explanation_specifiers dicts maintained by + .push_format_context() and .pop_format_context() which allows + to build another %-formatted string while already building one. + + :scope: A tuple containing the current scope used for variables_overwrite. + + :variables_overwrite: A dict filled with references to variables + that change value within an assert. This happens when a variable is + reassigned with the walrus operator + + This state, except the variables_overwrite, is reset on every new assert + statement visited and used by the other visitors. + """ + + def __init__( + self, module_path: str | None, config: Config | None, source: bytes + ) -> None: + super().__init__() + self.module_path = module_path + self.config = config + if config is not None: + self.enable_assertion_pass_hook = config.getini( + "enable_assertion_pass_hook" + ) + else: + self.enable_assertion_pass_hook = False + self.source = source + self.scope: tuple[ast.AST, ...] = () + self.variables_overwrite: defaultdict[tuple[ast.AST, ...], dict[str, str]] = ( + defaultdict(dict) + ) + + def run(self, mod: ast.Module) -> None: + """Find all assert statements in *mod* and rewrite them.""" + if not mod.body: + # Nothing to do. + return + + # We'll insert some special imports at the top of the module, but after any + # docstrings and __future__ imports, so first figure out where that is. + doc = getattr(mod, "docstring", None) + expect_docstring = doc is None + if doc is not None and self.is_rewrite_disabled(doc): + return + pos = 0 + for item in mod.body: + match item: + case ast.Expr(value=ast.Constant(value=str() as doc)) if ( + expect_docstring + ): + if self.is_rewrite_disabled(doc): + return + expect_docstring = False + case ast.ImportFrom(level=0, module="__future__"): + pass + case _: + break + pos += 1 + # Special case: for a decorated function, set the lineno to that of the + # first decorator, not the `def`. Issue #4984. + if isinstance(item, ast.FunctionDef) and item.decorator_list: + lineno = item.decorator_list[0].lineno + else: + lineno = item.lineno + # Now actually insert the special imports. + aliases = [ + ast.alias("builtins", "@py_builtins", lineno=lineno, col_offset=0), + ast.alias( + "_pytest.assertion.rewrite", + "@pytest_ar", + lineno=lineno, + col_offset=0, + ), + ] + imports = [ + ast.Import([alias], lineno=lineno, col_offset=0) for alias in aliases + ] + mod.body[pos:pos] = imports + + # Collect asserts. + self.scope = (mod,) + nodes: list[ast.AST | Sentinel] = [mod] + while nodes: + node = nodes.pop() + if isinstance(node, ast.FunctionDef | ast.AsyncFunctionDef | ast.ClassDef): + self.scope = tuple((*self.scope, node)) + nodes.append(_SCOPE_END_MARKER) + if node == _SCOPE_END_MARKER: + self.scope = self.scope[:-1] + continue + assert isinstance(node, ast.AST) + for name, field in ast.iter_fields(node): + if isinstance(field, list): + new: list[ast.AST] = [] + for i, child in enumerate(field): + if isinstance(child, ast.Assert): + # Transform assert. + new.extend(self.visit(child)) + else: + new.append(child) + if isinstance(child, ast.AST): + nodes.append(child) + setattr(node, name, new) + elif ( + isinstance(field, ast.AST) + # Don't recurse into expressions as they can't contain + # asserts. + and not isinstance(field, ast.expr) + ): + nodes.append(field) + + @staticmethod + def is_rewrite_disabled(docstring: str) -> bool: + return "PYTEST_DONT_REWRITE" in docstring + + def variable(self) -> str: + """Get a new variable.""" + # Use a character invalid in python identifiers to avoid clashing. + name = "@py_assert" + str(next(self.variable_counter)) + self.variables.append(name) + return name + + def assign(self, expr: ast.expr) -> ast.Name: + """Give *expr* a name.""" + name = self.variable() + self.statements.append(ast.Assign([ast.Name(name, ast.Store())], expr)) + return ast.copy_location(ast.Name(name, ast.Load()), expr) + + def display(self, expr: ast.expr) -> ast.expr: + """Call saferepr on the expression.""" + return self.helper("_saferepr", expr) + + def helper(self, name: str, *args: ast.expr) -> ast.expr: + """Call a helper in this module.""" + py_name = ast.Name("@pytest_ar", ast.Load()) + attr = ast.Attribute(py_name, name, ast.Load()) + return ast.Call(attr, list(args), []) + + def builtin(self, name: str) -> ast.Attribute: + """Return the builtin called *name*.""" + builtin_name = ast.Name("@py_builtins", ast.Load()) + return ast.Attribute(builtin_name, name, ast.Load()) + + def explanation_param(self, expr: ast.expr) -> str: + """Return a new named %-formatting placeholder for expr. + + This creates a %-formatting placeholder for expr in the + current formatting context, e.g. ``%(py0)s``. The placeholder + and expr are placed in the current format context so that it + can be used on the next call to .pop_format_context(). + """ + specifier = "py" + str(next(self.variable_counter)) + self.explanation_specifiers[specifier] = expr + return "%(" + specifier + ")s" + + def push_format_context(self) -> None: + """Create a new formatting context. + + The format context is used for when an explanation wants to + have a variable value formatted in the assertion message. In + this case the value required can be added using + .explanation_param(). Finally .pop_format_context() is used + to format a string of %-formatted values as added by + .explanation_param(). + """ + self.explanation_specifiers: dict[str, ast.expr] = {} + self.stack.append(self.explanation_specifiers) + + def pop_format_context(self, expl_expr: ast.expr) -> ast.Name: + """Format the %-formatted string with current format context. + + The expl_expr should be an str ast.expr instance constructed from + the %-placeholders created by .explanation_param(). This will + add the required code to format said string to .expl_stmts and + return the ast.Name instance of the formatted string. + """ + current = self.stack.pop() + if self.stack: + self.explanation_specifiers = self.stack[-1] + keys: list[ast.expr | None] = [ast.Constant(key) for key in current.keys()] + format_dict = ast.Dict(keys, list(current.values())) + form = ast.BinOp(expl_expr, ast.Mod(), format_dict) + name = "@py_format" + str(next(self.variable_counter)) + if self.enable_assertion_pass_hook: + self.format_variables.append(name) + self.expl_stmts.append(ast.Assign([ast.Name(name, ast.Store())], form)) + return ast.Name(name, ast.Load()) + + def generic_visit(self, node: ast.AST) -> tuple[ast.Name, str]: + """Handle expressions we don't have custom code for.""" + assert isinstance(node, ast.expr) + res = self.assign(node) + return res, self.explanation_param(self.display(res)) + + def visit_Assert(self, assert_: ast.Assert) -> list[ast.stmt]: + """Return the AST statements to replace the ast.Assert instance. + + This rewrites the test of an assertion to provide + intermediate values and replace it with an if statement which + raises an assertion error with a detailed explanation in case + the expression is false. + """ + if isinstance(assert_.test, ast.Tuple) and len(assert_.test.elts) >= 1: + import warnings + + from _pytest.warning_types import PytestAssertRewriteWarning + + # TODO: This assert should not be needed. + assert self.module_path is not None + warnings.warn_explicit( + PytestAssertRewriteWarning( + "assertion is always true, perhaps remove parentheses?" + ), + category=None, + filename=self.module_path, + lineno=assert_.lineno, + ) + + self.statements: list[ast.stmt] = [] + self.variables: list[str] = [] + self.variable_counter = itertools.count() + + if self.enable_assertion_pass_hook: + self.format_variables: list[str] = [] + + self.stack: list[dict[str, ast.expr]] = [] + self.expl_stmts: list[ast.stmt] = [] + self.push_format_context() + # Rewrite assert into a bunch of statements. + top_condition, explanation = self.visit(assert_.test) + + negation = ast.UnaryOp(ast.Not(), top_condition) + + if self.enable_assertion_pass_hook: # Experimental pytest_assertion_pass hook + msg = self.pop_format_context(ast.Constant(explanation)) + + # Failed + if assert_.msg: + assertmsg = self.helper("_format_assertmsg", assert_.msg) + gluestr = "\n>assert " + else: + assertmsg = ast.Constant("") + gluestr = "assert " + err_explanation = ast.BinOp(ast.Constant(gluestr), ast.Add(), msg) + err_msg = ast.BinOp(assertmsg, ast.Add(), err_explanation) + err_name = ast.Name("AssertionError", ast.Load()) + fmt = self.helper("_format_explanation", err_msg) + exc = ast.Call(err_name, [fmt], []) + raise_ = ast.Raise(exc, None) + statements_fail = [] + statements_fail.extend(self.expl_stmts) + statements_fail.append(raise_) + + # Passed + fmt_pass = self.helper("_format_explanation", msg) + orig = _get_assertion_exprs(self.source)[assert_.lineno] + hook_call_pass = ast.Expr( + self.helper( + "_call_assertion_pass", + ast.Constant(assert_.lineno), + ast.Constant(orig), + fmt_pass, + ) + ) + # If any hooks implement assert_pass hook + hook_impl_test = ast.If( + self.helper("_check_if_assertion_pass_impl"), + [*self.expl_stmts, hook_call_pass], + [], + ) + statements_pass: list[ast.stmt] = [hook_impl_test] + + # Test for assertion condition + main_test = ast.If(negation, statements_fail, statements_pass) + self.statements.append(main_test) + if self.format_variables: + variables: list[ast.expr] = [ + ast.Name(name, ast.Store()) for name in self.format_variables + ] + clear_format = ast.Assign(variables, ast.Constant(None)) + self.statements.append(clear_format) + + else: # Original assertion rewriting + # Create failure message. + body = self.expl_stmts + self.statements.append(ast.If(negation, body, [])) + if assert_.msg: + assertmsg = self.helper("_format_assertmsg", assert_.msg) + explanation = "\n>assert " + explanation + else: + assertmsg = ast.Constant("") + explanation = "assert " + explanation + template = ast.BinOp(assertmsg, ast.Add(), ast.Constant(explanation)) + msg = self.pop_format_context(template) + fmt = self.helper("_format_explanation", msg) + err_name = ast.Name("AssertionError", ast.Load()) + exc = ast.Call(err_name, [fmt], []) + raise_ = ast.Raise(exc, None) + + body.append(raise_) + + # Clear temporary variables by setting them to None. + if self.variables: + variables = [ast.Name(name, ast.Store()) for name in self.variables] + clear = ast.Assign(variables, ast.Constant(None)) + self.statements.append(clear) + # Fix locations (line numbers/column offsets). + for stmt in self.statements: + for node in traverse_node(stmt): + if getattr(node, "lineno", None) is None: + # apply the assertion location to all generated ast nodes without source location + # and preserve the location of existing nodes or generated nodes with an correct location. + ast.copy_location(node, assert_) + return self.statements + + def visit_NamedExpr(self, name: ast.NamedExpr) -> tuple[ast.NamedExpr, str]: + # This method handles the 'walrus operator' repr of the target + # name if it's a local variable or _should_repr_global_name() + # thinks it's acceptable. + locs = ast.Call(self.builtin("locals"), [], []) + target_id = name.target.id + inlocs = ast.Compare(ast.Constant(target_id), [ast.In()], [locs]) + dorepr = self.helper("_should_repr_global_name", name) + test = ast.BoolOp(ast.Or(), [inlocs, dorepr]) + expr = ast.IfExp(test, self.display(name), ast.Constant(target_id)) + return name, self.explanation_param(expr) + + def visit_Name(self, name: ast.Name) -> tuple[ast.Name, str]: + # Display the repr of the name if it's a local variable or + # _should_repr_global_name() thinks it's acceptable. + locs = ast.Call(self.builtin("locals"), [], []) + inlocs = ast.Compare(ast.Constant(name.id), [ast.In()], [locs]) + dorepr = self.helper("_should_repr_global_name", name) + test = ast.BoolOp(ast.Or(), [inlocs, dorepr]) + expr = ast.IfExp(test, self.display(name), ast.Constant(name.id)) + return name, self.explanation_param(expr) + + def visit_BoolOp(self, boolop: ast.BoolOp) -> tuple[ast.Name, str]: + res_var = self.variable() + expl_list = self.assign(ast.List([], ast.Load())) + app = ast.Attribute(expl_list, "append", ast.Load()) + is_or = int(isinstance(boolop.op, ast.Or)) + body = save = self.statements + fail_save = self.expl_stmts + levels = len(boolop.values) - 1 + self.push_format_context() + # Process each operand, short-circuiting if needed. + for i, v in enumerate(boolop.values): + if i: + fail_inner: list[ast.stmt] = [] + # cond is set in a prior loop iteration below + self.expl_stmts.append(ast.If(cond, fail_inner, [])) # noqa: F821 + self.expl_stmts = fail_inner + match v: + # Check if the left operand is an ast.NamedExpr and the value has already been visited + case ast.Compare( + left=ast.NamedExpr(target=ast.Name(id=target_id)) + ) if target_id in [ + e.id for e in boolop.values[:i] if hasattr(e, "id") + ]: + pytest_temp = self.variable() + self.variables_overwrite[self.scope][target_id] = v.left # type:ignore[assignment] + # mypy's false positive, we're checking that the 'target' attribute exists. + v.left.target.id = pytest_temp # type:ignore[attr-defined] + self.push_format_context() + res, expl = self.visit(v) + body.append(ast.Assign([ast.Name(res_var, ast.Store())], res)) + expl_format = self.pop_format_context(ast.Constant(expl)) + call = ast.Call(app, [expl_format], []) + self.expl_stmts.append(ast.Expr(call)) + if i < levels: + cond: ast.expr = res + if is_or: + cond = ast.UnaryOp(ast.Not(), cond) + inner: list[ast.stmt] = [] + self.statements.append(ast.If(cond, inner, [])) + self.statements = body = inner + self.statements = save + self.expl_stmts = fail_save + expl_template = self.helper("_format_boolop", expl_list, ast.Constant(is_or)) + expl = self.pop_format_context(expl_template) + return ast.Name(res_var, ast.Load()), self.explanation_param(expl) + + def visit_UnaryOp(self, unary: ast.UnaryOp) -> tuple[ast.Name, str]: + pattern = UNARY_MAP[unary.op.__class__] + operand_res, operand_expl = self.visit(unary.operand) + res = self.assign(ast.copy_location(ast.UnaryOp(unary.op, operand_res), unary)) + return res, pattern % (operand_expl,) + + def visit_BinOp(self, binop: ast.BinOp) -> tuple[ast.Name, str]: + symbol = BINOP_MAP[binop.op.__class__] + left_expr, left_expl = self.visit(binop.left) + right_expr, right_expl = self.visit(binop.right) + explanation = f"({left_expl} {symbol} {right_expl})" + res = self.assign( + ast.copy_location(ast.BinOp(left_expr, binop.op, right_expr), binop) + ) + return res, explanation + + def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]: + new_func, func_expl = self.visit(call.func) + arg_expls = [] + new_args = [] + new_kwargs = [] + for arg in call.args: + if isinstance(arg, ast.Name) and arg.id in self.variables_overwrite.get( + self.scope, {} + ): + arg = self.variables_overwrite[self.scope][arg.id] # type:ignore[assignment] + res, expl = self.visit(arg) + arg_expls.append(expl) + new_args.append(res) + for keyword in call.keywords: + match keyword.value: + case ast.Name(id=id) if id in self.variables_overwrite.get( + self.scope, {} + ): + keyword.value = self.variables_overwrite[self.scope][id] # type:ignore[assignment] + res, expl = self.visit(keyword.value) + new_kwargs.append(ast.keyword(keyword.arg, res)) + if keyword.arg: + arg_expls.append(keyword.arg + "=" + expl) + else: # **args have `arg` keywords with an .arg of None + arg_expls.append("**" + expl) + + expl = "{}({})".format(func_expl, ", ".join(arg_expls)) + new_call = ast.copy_location(ast.Call(new_func, new_args, new_kwargs), call) + res = self.assign(new_call) + res_expl = self.explanation_param(self.display(res)) + outer_expl = f"{res_expl}\n{{{res_expl} = {expl}\n}}" + return res, outer_expl + + def visit_Starred(self, starred: ast.Starred) -> tuple[ast.Starred, str]: + # A Starred node can appear in a function call. + res, expl = self.visit(starred.value) + new_starred = ast.Starred(res, starred.ctx) + return new_starred, "*" + expl + + def visit_Attribute(self, attr: ast.Attribute) -> tuple[ast.Name, str]: + if not isinstance(attr.ctx, ast.Load): + return self.generic_visit(attr) + value, value_expl = self.visit(attr.value) + res = self.assign( + ast.copy_location(ast.Attribute(value, attr.attr, ast.Load()), attr) + ) + res_expl = self.explanation_param(self.display(res)) + pat = "%s\n{%s = %s.%s\n}" + expl = pat % (res_expl, res_expl, value_expl, attr.attr) + return res, expl + + def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: + self.push_format_context() + # We first check if we have overwritten a variable in the previous assert + match comp.left: + case ast.Name(id=name_id) if name_id in self.variables_overwrite.get( + self.scope, {} + ): + comp.left = self.variables_overwrite[self.scope][name_id] # type: ignore[assignment] + case ast.NamedExpr(target=ast.Name(id=target_id)): + self.variables_overwrite[self.scope][target_id] = comp.left # type: ignore[assignment] + left_res, left_expl = self.visit(comp.left) + if isinstance(comp.left, ast.Compare | ast.BoolOp): + left_expl = f"({left_expl})" + res_variables = [self.variable() for i in range(len(comp.ops))] + load_names: list[ast.expr] = [ast.Name(v, ast.Load()) for v in res_variables] + store_names = [ast.Name(v, ast.Store()) for v in res_variables] + it = zip(range(len(comp.ops)), comp.ops, comp.comparators, strict=True) + expls: list[ast.expr] = [] + syms: list[ast.expr] = [] + results = [left_res] + for i, op, next_operand in it: + match (next_operand, left_res): + case ( + ast.NamedExpr(target=ast.Name(id=target_id)), + ast.Name(id=name_id), + ) if target_id == name_id: + next_operand.target.id = self.variable() + self.variables_overwrite[self.scope][name_id] = next_operand # type: ignore[assignment] + + next_res, next_expl = self.visit(next_operand) + if isinstance(next_operand, ast.Compare | ast.BoolOp): + next_expl = f"({next_expl})" + results.append(next_res) + sym = BINOP_MAP[op.__class__] + syms.append(ast.Constant(sym)) + expl = f"{left_expl} {sym} {next_expl}" + expls.append(ast.Constant(expl)) + res_expr = ast.copy_location(ast.Compare(left_res, [op], [next_res]), comp) + self.statements.append(ast.Assign([store_names[i]], res_expr)) + left_res, left_expl = next_res, next_expl + # Use pytest.assertion.util._reprcompare if that's available. + expl_call = self.helper( + "_call_reprcompare", + ast.Tuple(syms, ast.Load()), + ast.Tuple(load_names, ast.Load()), + ast.Tuple(expls, ast.Load()), + ast.Tuple(results, ast.Load()), + ) + if len(comp.ops) > 1: + res: ast.expr = ast.BoolOp(ast.And(), load_names) + else: + res = load_names[0] + + return res, self.explanation_param(self.pop_format_context(expl_call)) + + +def try_makedirs(cache_dir: Path) -> bool: + """Attempt to create the given directory and sub-directories exist. + + Returns True if successful or if it already exists. + """ + try: + os.makedirs(cache_dir, exist_ok=True) + except (FileNotFoundError, NotADirectoryError, FileExistsError): + # One of the path components was not a directory: + # - we're in a zip file + # - it is a file + return False + except PermissionError: + return False + except OSError as e: + # as of now, EROFS doesn't have an equivalent OSError-subclass + # + # squashfuse_ll returns ENOSYS "OSError: [Errno 38] Function not + # implemented" for a read-only error + if e.errno in {errno.EROFS, errno.ENOSYS}: + return False + raise + return True + + +def get_cache_dir(file_path: Path) -> Path: + """Return the cache directory to write .pyc files for the given .py file path.""" + if sys.pycache_prefix: + # given: + # prefix = '/tmp/pycs' + # path = '/home/user/proj/test_app.py' + # we want: + # '/tmp/pycs/home/user/proj' + return Path(sys.pycache_prefix) / Path(*file_path.parts[1:-1]) + else: + # classic pycache directory + return file_path.parent / "__pycache__" diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/truncate.py b/micromamba_root/Lib/site-packages/_pytest/assertion/truncate.py new file mode 100644 index 0000000000000000000000000000000000000000..5820e6e8a80e3ed2479fe54b018c85c5114dfbb4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/assertion/truncate.py @@ -0,0 +1,137 @@ +"""Utilities for truncating assertion output. + +Current default behaviour is to truncate assertion explanations at +terminal lines, unless running with an assertions verbosity level of at least 2 or running on CI. +""" + +from __future__ import annotations + +from _pytest.compat import running_on_ci +from _pytest.config import Config +from _pytest.nodes import Item + + +DEFAULT_MAX_LINES = 8 +DEFAULT_MAX_CHARS = DEFAULT_MAX_LINES * 80 +USAGE_MSG = "use '-vv' to show" + + +def truncate_if_required(explanation: list[str], item: Item) -> list[str]: + """Truncate this assertion explanation if the given test item is eligible.""" + should_truncate, max_lines, max_chars = _get_truncation_parameters(item) + if should_truncate: + return _truncate_explanation( + explanation, + max_lines=max_lines, + max_chars=max_chars, + ) + return explanation + + +def _get_truncation_parameters(item: Item) -> tuple[bool, int, int]: + """Return the truncation parameters related to the given item, as (should truncate, max lines, max chars).""" + # We do not need to truncate if one of conditions is met: + # 1. Verbosity level is 2 or more; + # 2. Test is being run in CI environment; + # 3. Both truncation_limit_lines and truncation_limit_chars + # .ini parameters are set to 0 explicitly. + max_lines = item.config.getini("truncation_limit_lines") + max_lines = int(max_lines if max_lines is not None else DEFAULT_MAX_LINES) + + max_chars = item.config.getini("truncation_limit_chars") + max_chars = int(max_chars if max_chars is not None else DEFAULT_MAX_CHARS) + + verbose = item.config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + + should_truncate = verbose < 2 and not running_on_ci() + should_truncate = should_truncate and (max_lines > 0 or max_chars > 0) + + return should_truncate, max_lines, max_chars + + +def _truncate_explanation( + input_lines: list[str], + max_lines: int, + max_chars: int, +) -> list[str]: + """Truncate given list of strings that makes up the assertion explanation. + + Truncates to either max_lines, or max_chars - whichever the input reaches + first, taking the truncation explanation into account. The remaining lines + will be replaced by a usage message. + """ + # Check if truncation required + input_char_count = len("".join(input_lines)) + # The length of the truncation explanation depends on the number of lines + # removed but is at least 68 characters: + # The real value is + # 64 (for the base message: + # '...\n...Full output truncated (1 line hidden), use '-vv' to show")' + # ) + # + 1 (for plural) + # + int(math.log10(len(input_lines) - max_lines)) (number of hidden line, at least 1) + # + 3 for the '...' added to the truncated line + # But if there's more than 100 lines it's very likely that we're going to + # truncate, so we don't need the exact value using log10. + tolerable_max_chars = ( + max_chars + 70 # 64 + 1 (for plural) + 2 (for '99') + 3 for '...' + ) + # The truncation explanation add two lines to the output + tolerable_max_lines = max_lines + 2 + if ( + len(input_lines) <= tolerable_max_lines + and input_char_count <= tolerable_max_chars + ): + return input_lines + # Truncate first to max_lines, and then truncate to max_chars if necessary + if max_lines > 0: + truncated_explanation = input_lines[:max_lines] + else: + truncated_explanation = input_lines + truncated_char = True + # We reevaluate the need to truncate chars following removal of some lines + if len("".join(truncated_explanation)) > tolerable_max_chars and max_chars > 0: + truncated_explanation = _truncate_by_char_count( + truncated_explanation, max_chars + ) + else: + truncated_char = False + + if truncated_explanation == input_lines: + # No truncation happened, so we do not need to add any explanations + return truncated_explanation + + truncated_line_count = len(input_lines) - len(truncated_explanation) + if truncated_explanation[-1]: + # Add ellipsis and take into account part-truncated final line + truncated_explanation[-1] = truncated_explanation[-1] + "..." + if truncated_char: + # It's possible that we did not remove any char from this line + truncated_line_count += 1 + else: + # Add proper ellipsis when we were able to fit a full line exactly + truncated_explanation[-1] = "..." + return [ + *truncated_explanation, + "", + f"...Full output truncated ({truncated_line_count} line" + f"{'' if truncated_line_count == 1 else 's'} hidden), {USAGE_MSG}", + ] + + +def _truncate_by_char_count(input_lines: list[str], max_chars: int) -> list[str]: + # Find point at which input length exceeds total allowed length + iterated_char_count = 0 + for iterated_index, input_line in enumerate(input_lines): + if iterated_char_count + len(input_line) > max_chars: + break + iterated_char_count += len(input_line) + + # Create truncated explanation with modified final line + truncated_result = input_lines[:iterated_index] + final_line = input_lines[iterated_index] + if final_line: + final_line_truncate_point = max_chars - iterated_char_count + final_line = final_line[:final_line_truncate_point] + truncated_result.append(final_line) + return truncated_result diff --git a/micromamba_root/Lib/site-packages/_pytest/assertion/util.py b/micromamba_root/Lib/site-packages/_pytest/assertion/util.py new file mode 100644 index 0000000000000000000000000000000000000000..f35d83a6fe4aa38acc747ff5dbdaf96adab51178 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/assertion/util.py @@ -0,0 +1,615 @@ +# mypy: allow-untyped-defs +"""Utilities for assertion debugging.""" + +from __future__ import annotations + +import collections.abc +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Mapping +from collections.abc import Sequence +from collections.abc import Set as AbstractSet +import pprint +from typing import Any +from typing import Literal +from typing import Protocol +from unicodedata import normalize + +from _pytest import outcomes +import _pytest._code +from _pytest._io.pprint import PrettyPrinter +from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited +from _pytest.compat import running_on_ci +from _pytest.config import Config + + +# The _reprcompare attribute on the util module is used by the new assertion +# interpretation code and assertion rewriter to detect this plugin was +# loaded and in turn call the hooks defined here as part of the +# DebugInterpreter. +_reprcompare: Callable[[str, object, object], str | None] | None = None + +# Works similarly as _reprcompare attribute. Is populated with the hook call +# when pytest_runtest_setup is called. +_assertion_pass: Callable[[int, str, str], None] | None = None + +# Config object which is assigned during pytest_runtest_protocol. +_config: Config | None = None + + +class _HighlightFunc(Protocol): + def __call__(self, source: str, lexer: Literal["diff", "python"] = "python") -> str: + """Apply highlighting to the given source.""" + + +def dummy_highlighter(source: str, lexer: Literal["diff", "python"] = "python") -> str: + """Dummy highlighter that returns the text unprocessed. + + Needed for _notin_text, as the diff gets post-processed to only show the "+" part. + """ + return source + + +def format_explanation(explanation: str) -> str: + r"""Format an explanation. + + Normally all embedded newlines are escaped, however there are + three exceptions: \n{, \n} and \n~. The first two are intended + cover nested explanations, see function and attribute explanations + for examples (.visit_Call(), visit_Attribute()). The last one is + for when one explanation needs to span multiple lines, e.g. when + displaying diffs. + """ + lines = _split_explanation(explanation) + result = _format_lines(lines) + return "\n".join(result) + + +def _split_explanation(explanation: str) -> list[str]: + r"""Return a list of individual lines in the explanation. + + This will return a list of lines split on '\n{', '\n}' and '\n~'. + Any other newlines will be escaped and appear in the line as the + literal '\n' characters. + """ + raw_lines = (explanation or "").split("\n") + lines = [raw_lines[0]] + for values in raw_lines[1:]: + if values and values[0] in ["{", "}", "~", ">"]: + lines.append(values) + else: + lines[-1] += "\\n" + values + return lines + + +def _format_lines(lines: Sequence[str]) -> list[str]: + """Format the individual lines. + + This will replace the '{', '}' and '~' characters of our mini formatting + language with the proper 'where ...', 'and ...' and ' + ...' text, taking + care of indentation along the way. + + Return a list of formatted lines. + """ + result = list(lines[:1]) + stack = [0] + stackcnt = [0] + for line in lines[1:]: + if line.startswith("{"): + if stackcnt[-1]: + s = "and " + else: + s = "where " + stack.append(len(result)) + stackcnt[-1] += 1 + stackcnt.append(0) + result.append(" +" + " " * (len(stack) - 1) + s + line[1:]) + elif line.startswith("}"): + stack.pop() + stackcnt.pop() + result[stack[-1]] += line[1:] + else: + assert line[0] in ["~", ">"] + stack[-1] += 1 + indent = len(stack) if line.startswith("~") else len(stack) - 1 + result.append(" " * indent + line[1:]) + assert len(stack) == 1 + return result + + +def issequence(x: Any) -> bool: + return isinstance(x, collections.abc.Sequence) and not isinstance(x, str) + + +def istext(x: Any) -> bool: + return isinstance(x, str) + + +def isdict(x: Any) -> bool: + return isinstance(x, dict) + + +def isset(x: Any) -> bool: + return isinstance(x, set | frozenset) + + +def isnamedtuple(obj: Any) -> bool: + return isinstance(obj, tuple) and getattr(obj, "_fields", None) is not None + + +def isdatacls(obj: Any) -> bool: + return getattr(obj, "__dataclass_fields__", None) is not None + + +def isattrs(obj: Any) -> bool: + return getattr(obj, "__attrs_attrs__", None) is not None + + +def isiterable(obj: Any) -> bool: + try: + iter(obj) + return not istext(obj) + except Exception: + return False + + +def has_default_eq( + obj: object, +) -> bool: + """Check if an instance of an object contains the default eq + + First, we check if the object's __eq__ attribute has __code__, + if so, we check the equally of the method code filename (__code__.co_filename) + to the default one generated by the dataclass and attr module + for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" + """ + # inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68 + if hasattr(obj.__eq__, "__code__") and hasattr(obj.__eq__.__code__, "co_filename"): + code_filename = obj.__eq__.__code__.co_filename + + if isattrs(obj): + return "attrs generated " in code_filename + + return code_filename == "" # data class + return True + + +def assertrepr_compare( + config, op: str, left: Any, right: Any, use_ascii: bool = False +) -> list[str] | None: + """Return specialised explanations for some operators/operands.""" + verbose = config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + + # Strings which normalize equal are often hard to distinguish when printed; use ascii() to make this easier. + # See issue #3246. + use_ascii = ( + isinstance(left, str) + and isinstance(right, str) + and normalize("NFD", left) == normalize("NFD", right) + ) + + if verbose > 1: + left_repr = saferepr_unlimited(left, use_ascii=use_ascii) + right_repr = saferepr_unlimited(right, use_ascii=use_ascii) + else: + # XXX: "15 chars indentation" is wrong + # ("E AssertionError: assert "); should use term width. + maxsize = ( + 80 - 15 - len(op) - 2 + ) // 2 # 15 chars indentation, 1 space around op + + left_repr = saferepr(left, maxsize=maxsize, use_ascii=use_ascii) + right_repr = saferepr(right, maxsize=maxsize, use_ascii=use_ascii) + + summary = f"{left_repr} {op} {right_repr}" + highlighter = config.get_terminal_writer()._highlight + + explanation = None + try: + if op == "==": + explanation = _compare_eq_any(left, right, highlighter, verbose) + elif op == "not in": + if istext(left) and istext(right): + explanation = _notin_text(left, right, verbose) + elif op == "!=": + if isset(left) and isset(right): + explanation = ["Both sets are equal"] + elif op == ">=": + if isset(left) and isset(right): + explanation = _compare_gte_set(left, right, highlighter, verbose) + elif op == "<=": + if isset(left) and isset(right): + explanation = _compare_lte_set(left, right, highlighter, verbose) + elif op == ">": + if isset(left) and isset(right): + explanation = _compare_gt_set(left, right, highlighter, verbose) + elif op == "<": + if isset(left) and isset(right): + explanation = _compare_lt_set(left, right, highlighter, verbose) + + except outcomes.Exit: + raise + except Exception: + repr_crash = _pytest._code.ExceptionInfo.from_current()._getreprcrash() + explanation = [ + f"(pytest_assertion plugin: representation of details failed: {repr_crash}.", + " Probably an object has a faulty __repr__.)", + ] + + if not explanation: + return None + + if explanation[0] != "": + explanation = ["", *explanation] + return [summary, *explanation] + + +def _compare_eq_any( + left: Any, right: Any, highlighter: _HighlightFunc, verbose: int = 0 +) -> list[str]: + explanation = [] + if istext(left) and istext(right): + explanation = _diff_text(left, right, highlighter, verbose) + else: + from _pytest.python_api import ApproxBase + + if isinstance(left, ApproxBase) or isinstance(right, ApproxBase): + # Although the common order should be obtained == expected, this ensures both ways + approx_side = left if isinstance(left, ApproxBase) else right + other_side = right if isinstance(left, ApproxBase) else left + + explanation = approx_side._repr_compare(other_side) + elif type(left) is type(right) and ( + isdatacls(left) or isattrs(left) or isnamedtuple(left) + ): + # Note: unlike dataclasses/attrs, namedtuples compare only the + # field values, not the type or field names. But this branch + # intentionally only handles the same-type case, which was often + # used in older code bases before dataclasses/attrs were available. + explanation = _compare_eq_cls(left, right, highlighter, verbose) + elif issequence(left) and issequence(right): + explanation = _compare_eq_sequence(left, right, highlighter, verbose) + elif isset(left) and isset(right): + explanation = _compare_eq_set(left, right, highlighter, verbose) + elif isdict(left) and isdict(right): + explanation = _compare_eq_dict(left, right, highlighter, verbose) + + if isiterable(left) and isiterable(right): + expl = _compare_eq_iterable(left, right, highlighter, verbose) + explanation.extend(expl) + + return explanation + + +def _diff_text( + left: str, right: str, highlighter: _HighlightFunc, verbose: int = 0 +) -> list[str]: + """Return the explanation for the diff between text. + + Unless --verbose is used this will skip leading and trailing + characters which are identical to keep the diff minimal. + """ + from difflib import ndiff + + explanation: list[str] = [] + + if verbose < 1: + i = 0 # just in case left or right has zero length + for i in range(min(len(left), len(right))): + if left[i] != right[i]: + break + if i > 42: + i -= 10 # Provide some context + explanation = [ + f"Skipping {i} identical leading characters in diff, use -v to show" + ] + left = left[i:] + right = right[i:] + if len(left) == len(right): + for i in range(len(left)): + if left[-i] != right[-i]: + break + if i > 42: + i -= 10 # Provide some context + explanation += [ + f"Skipping {i} identical trailing " + "characters in diff, use -v to show" + ] + left = left[:-i] + right = right[:-i] + keepends = True + if left.isspace() or right.isspace(): + left = repr(str(left)) + right = repr(str(right)) + explanation += ["Strings contain only whitespace, escaping them using repr()"] + # "right" is the expected base against which we compare "left", + # see https://github.com/pytest-dev/pytest/issues/3333 + explanation.extend( + highlighter( + "\n".join( + line.strip("\n") + for line in ndiff(right.splitlines(keepends), left.splitlines(keepends)) + ), + lexer="diff", + ).splitlines() + ) + return explanation + + +def _compare_eq_iterable( + left: Iterable[Any], + right: Iterable[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + if verbose <= 0 and not running_on_ci(): + return ["Use -v to get more diff"] + # dynamic import to speedup pytest + import difflib + + left_formatting = PrettyPrinter().pformat(left).splitlines() + right_formatting = PrettyPrinter().pformat(right).splitlines() + + explanation = ["", "Full diff:"] + # "right" is the expected base against which we compare "left", + # see https://github.com/pytest-dev/pytest/issues/3333 + explanation.extend( + highlighter( + "\n".join( + line.rstrip() + for line in difflib.ndiff(right_formatting, left_formatting) + ), + lexer="diff", + ).splitlines() + ) + return explanation + + +def _compare_eq_sequence( + left: Sequence[Any], + right: Sequence[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + comparing_bytes = isinstance(left, bytes) and isinstance(right, bytes) + explanation: list[str] = [] + len_left = len(left) + len_right = len(right) + for i in range(min(len_left, len_right)): + if left[i] != right[i]: + if comparing_bytes: + # when comparing bytes, we want to see their ascii representation + # instead of their numeric values (#5260) + # using a slice gives us the ascii representation: + # >>> s = b'foo' + # >>> s[0] + # 102 + # >>> s[0:1] + # b'f' + left_value = left[i : i + 1] + right_value = right[i : i + 1] + else: + left_value = left[i] + right_value = right[i] + + explanation.append( + f"At index {i} diff:" + f" {highlighter(repr(left_value))} != {highlighter(repr(right_value))}" + ) + break + + if comparing_bytes: + # when comparing bytes, it doesn't help to show the "sides contain one or more + # items" longer explanation, so skip it + + return explanation + + len_diff = len_left - len_right + if len_diff: + if len_diff > 0: + dir_with_more = "Left" + extra = saferepr(left[len_right]) + else: + len_diff = 0 - len_diff + dir_with_more = "Right" + extra = saferepr(right[len_left]) + + if len_diff == 1: + explanation += [ + f"{dir_with_more} contains one more item: {highlighter(extra)}" + ] + else: + explanation += [ + f"{dir_with_more} contains {len_diff} more items, first extra item: {highlighter(extra)}" + ] + return explanation + + +def _compare_eq_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = [] + explanation.extend(_set_one_sided_diff("left", left, right, highlighter)) + explanation.extend(_set_one_sided_diff("right", right, left, highlighter)) + return explanation + + +def _compare_gt_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = _compare_gte_set(left, right, highlighter) + if not explanation: + return ["Both sets are equal"] + return explanation + + +def _compare_lt_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = _compare_lte_set(left, right, highlighter) + if not explanation: + return ["Both sets are equal"] + return explanation + + +def _compare_gte_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + return _set_one_sided_diff("right", right, left, highlighter) + + +def _compare_lte_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + return _set_one_sided_diff("left", left, right, highlighter) + + +def _set_one_sided_diff( + posn: str, + set1: AbstractSet[Any], + set2: AbstractSet[Any], + highlighter: _HighlightFunc, +) -> list[str]: + explanation = [] + diff = set1 - set2 + if diff: + explanation.append(f"Extra items in the {posn} set:") + for item in diff: + explanation.append(highlighter(saferepr(item))) + return explanation + + +def _compare_eq_dict( + left: Mapping[Any, Any], + right: Mapping[Any, Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation: list[str] = [] + set_left = set(left) + set_right = set(right) + common = set_left.intersection(set_right) + same = {k: left[k] for k in common if left[k] == right[k]} + if same and verbose < 2: + explanation += [f"Omitting {len(same)} identical items, use -vv to show"] + elif same: + explanation += ["Common items:"] + explanation += highlighter(pprint.pformat(same)).splitlines() + diff = {k for k in common if left[k] != right[k]} + if diff: + explanation += ["Differing items:"] + for k in diff: + explanation += [ + highlighter(saferepr({k: left[k]})) + + " != " + + highlighter(saferepr({k: right[k]})) + ] + extra_left = set_left - set_right + len_extra_left = len(extra_left) + if len_extra_left: + explanation.append( + f"Left contains {len_extra_left} more item{'' if len_extra_left == 1 else 's'}:" + ) + explanation.extend( + highlighter(pprint.pformat({k: left[k] for k in extra_left})).splitlines() + ) + extra_right = set_right - set_left + len_extra_right = len(extra_right) + if len_extra_right: + explanation.append( + f"Right contains {len_extra_right} more item{'' if len_extra_right == 1 else 's'}:" + ) + explanation.extend( + highlighter(pprint.pformat({k: right[k] for k in extra_right})).splitlines() + ) + return explanation + + +def _compare_eq_cls( + left: Any, right: Any, highlighter: _HighlightFunc, verbose: int +) -> list[str]: + if not has_default_eq(left): + return [] + if isdatacls(left): + import dataclasses + + all_fields = dataclasses.fields(left) + fields_to_check = [info.name for info in all_fields if info.compare] + elif isattrs(left): + all_fields = left.__attrs_attrs__ + fields_to_check = [field.name for field in all_fields if getattr(field, "eq")] + elif isnamedtuple(left): + fields_to_check = left._fields + else: + assert False + + indent = " " + same = [] + diff = [] + for field in fields_to_check: + if getattr(left, field) == getattr(right, field): + same.append(field) + else: + diff.append(field) + + explanation = [] + if same or diff: + explanation += [""] + if same and verbose < 2: + explanation.append(f"Omitting {len(same)} identical items, use -vv to show") + elif same: + explanation += ["Matching attributes:"] + explanation += highlighter(pprint.pformat(same)).splitlines() + if diff: + explanation += ["Differing attributes:"] + explanation += highlighter(pprint.pformat(diff)).splitlines() + for field in diff: + field_left = getattr(left, field) + field_right = getattr(right, field) + explanation += [ + "", + f"Drill down into differing attribute {field}:", + f"{indent}{field}: {highlighter(repr(field_left))} != {highlighter(repr(field_right))}", + ] + explanation += [ + indent + line + for line in _compare_eq_any( + field_left, field_right, highlighter, verbose + ) + ] + return explanation + + +def _notin_text(term: str, text: str, verbose: int = 0) -> list[str]: + index = text.find(term) + head = text[:index] + tail = text[index + len(term) :] + correct_text = head + tail + diff = _diff_text(text, correct_text, dummy_highlighter, verbose) + newdiff = [f"{saferepr(term, maxsize=42)} is contained here:"] + for line in diff: + if line.startswith("Skipping"): + continue + if line.startswith("- "): + continue + if line.startswith("+ "): + newdiff.append(" " + line[2:]) + else: + newdiff.append(line) + return newdiff diff --git a/micromamba_root/Lib/site-packages/_pytest/cacheprovider.py b/micromamba_root/Lib/site-packages/_pytest/cacheprovider.py new file mode 100644 index 0000000000000000000000000000000000000000..4383f105af619b4c22ad486623cead4d79a44219 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/cacheprovider.py @@ -0,0 +1,646 @@ +# mypy: allow-untyped-defs +"""Implementation of the cache provider.""" + +# This plugin was not named "cache" to avoid conflicts with the external +# pytest-cache version. +from __future__ import annotations + +from collections.abc import Generator +from collections.abc import Iterable +import dataclasses +import errno +import json +import os +from pathlib import Path +import tempfile +from typing import final + +from .pathlib import resolve_from_str +from .pathlib import rm_rf +from .reports import CollectReport +from _pytest import nodes +from _pytest._io import TerminalWriter +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.nodes import Directory +from _pytest.nodes import File +from _pytest.reports import TestReport + + +README_CONTENT = """\ +# pytest cache directory # + +This directory contains data from the pytest's cache plugin, +which provides the `--lf` and `--ff` options, as well as the `cache` fixture. + +**Do not** commit this to version control. + +See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information. +""" + +CACHEDIR_TAG_CONTENT = b"""\ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by pytest. +# For information about cache directory tags, see: +# https://bford.info/cachedir/spec.html +""" + + +@final +@dataclasses.dataclass +class Cache: + """Instance of the `cache` fixture.""" + + _cachedir: Path = dataclasses.field(repr=False) + _config: Config = dataclasses.field(repr=False) + + # Sub-directory under cache-dir for directories created by `mkdir()`. + _CACHE_PREFIX_DIRS = "d" + + # Sub-directory under cache-dir for values created by `set()`. + _CACHE_PREFIX_VALUES = "v" + + def __init__( + self, cachedir: Path, config: Config, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + self._cachedir = cachedir + self._config = config + + @classmethod + def for_config(cls, config: Config, *, _ispytest: bool = False) -> Cache: + """Create the Cache instance for a Config. + + :meta private: + """ + check_ispytest(_ispytest) + cachedir = cls.cache_dir_from_config(config, _ispytest=True) + if config.getoption("cacheclear") and cachedir.is_dir(): + cls.clear_cache(cachedir, _ispytest=True) + return cls(cachedir, config, _ispytest=True) + + @classmethod + def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None: + """Clear the sub-directories used to hold cached directories and values. + + :meta private: + """ + check_ispytest(_ispytest) + for prefix in (cls._CACHE_PREFIX_DIRS, cls._CACHE_PREFIX_VALUES): + d = cachedir / prefix + if d.is_dir(): + rm_rf(d) + + @staticmethod + def cache_dir_from_config(config: Config, *, _ispytest: bool = False) -> Path: + """Get the path to the cache directory for a Config. + + :meta private: + """ + check_ispytest(_ispytest) + return resolve_from_str(config.getini("cache_dir"), config.rootpath) + + def warn(self, fmt: str, *, _ispytest: bool = False, **args: object) -> None: + """Issue a cache warning. + + :meta private: + """ + check_ispytest(_ispytest) + import warnings + + from _pytest.warning_types import PytestCacheWarning + + warnings.warn( + PytestCacheWarning(fmt.format(**args) if args else fmt), + self._config.hook, + stacklevel=3, + ) + + def _mkdir(self, path: Path) -> None: + self._ensure_cache_dir_and_supporting_files() + path.mkdir(exist_ok=True, parents=True) + + def mkdir(self, name: str) -> Path: + """Return a directory path object with the given name. + + If the directory does not yet exist, it will be created. You can use + it to manage files to e.g. store/retrieve database dumps across test + sessions. + + .. versionadded:: 7.0 + + :param name: + Must be a string not containing a ``/`` separator. + Make sure the name contains your plugin or application + identifiers to prevent clashes with other cache users. + """ + path = Path(name) + if len(path.parts) > 1: + raise ValueError("name is not allowed to contain path separators") + res = self._cachedir.joinpath(self._CACHE_PREFIX_DIRS, path) + self._mkdir(res) + return res + + def _getvaluepath(self, key: str) -> Path: + return self._cachedir.joinpath(self._CACHE_PREFIX_VALUES, Path(key)) + + def get(self, key: str, default): + """Return the cached value for the given key. + + If no value was yet cached or the value cannot be read, the specified + default is returned. + + :param key: + Must be a ``/`` separated value. Usually the first + name is the name of your plugin or your application. + :param default: + The value to return in case of a cache-miss or invalid cache value. + """ + path = self._getvaluepath(key) + try: + with path.open("r", encoding="UTF-8") as f: + return json.load(f) + except (ValueError, OSError): + return default + + def set(self, key: str, value: object) -> None: + """Save value for the given key. + + :param key: + Must be a ``/`` separated value. Usually the first + name is the name of your plugin or your application. + :param value: + Must be of any combination of basic python types, + including nested types like lists of dictionaries. + """ + path = self._getvaluepath(key) + try: + self._mkdir(path.parent) + except OSError as exc: + self.warn( + f"could not create cache path {path}: {exc}", + _ispytest=True, + ) + return + data = json.dumps(value, ensure_ascii=False, indent=2) + try: + f = path.open("w", encoding="UTF-8") + except OSError as exc: + self.warn( + f"cache could not write path {path}: {exc}", + _ispytest=True, + ) + else: + with f: + f.write(data) + + def _ensure_cache_dir_and_supporting_files(self) -> None: + """Create the cache dir and its supporting files.""" + if self._cachedir.is_dir(): + return + + self._cachedir.parent.mkdir(parents=True, exist_ok=True) + with tempfile.TemporaryDirectory( + prefix="pytest-cache-files-", + dir=self._cachedir.parent, + ) as newpath: + path = Path(newpath) + + # Reset permissions to the default, see #12308. + # Note: there's no way to get the current umask atomically, eek. + umask = os.umask(0o022) + os.umask(umask) + path.chmod(0o777 - umask) + + with open(path.joinpath("README.md"), "x", encoding="UTF-8") as f: + f.write(README_CONTENT) + with open(path.joinpath(".gitignore"), "x", encoding="UTF-8") as f: + f.write("# Created by pytest automatically.\n*\n") + with open(path.joinpath("CACHEDIR.TAG"), "xb") as f: + f.write(CACHEDIR_TAG_CONTENT) + + try: + path.rename(self._cachedir) + except OSError as e: + # If 2 concurrent pytests both race to the rename, the loser + # gets "Directory not empty" from the rename. In this case, + # everything is handled so just continue (while letting the + # temporary directory be cleaned up). + # On Windows, the error is a FileExistsError which translates to EEXIST. + if e.errno not in (errno.ENOTEMPTY, errno.EEXIST): + raise + else: + # Create a directory in place of the one we just moved so that + # `TemporaryDirectory`'s cleanup doesn't complain. + # + # TODO: pass ignore_cleanup_errors=True when we no longer support python < 3.10. + # See https://github.com/python/cpython/issues/74168. Note that passing + # delete=False would do the wrong thing in case of errors and isn't supported + # until python 3.12. + path.mkdir() + + +class LFPluginCollWrapper: + def __init__(self, lfplugin: LFPlugin) -> None: + self.lfplugin = lfplugin + self._collected_at_least_one_failure = False + + @hookimpl(wrapper=True) + def pytest_make_collect_report( + self, collector: nodes.Collector + ) -> Generator[None, CollectReport, CollectReport]: + res = yield + if isinstance(collector, Session | Directory): + # Sort any lf-paths to the beginning. + lf_paths = self.lfplugin._last_failed_paths + + # Use stable sort to prioritize last failed. + def sort_key(node: nodes.Item | nodes.Collector) -> bool: + return node.path in lf_paths + + res.result = sorted( + res.result, + key=sort_key, + reverse=True, + ) + + elif isinstance(collector, File): + if collector.path in self.lfplugin._last_failed_paths: + result = res.result + lastfailed = self.lfplugin.lastfailed + + # Only filter with known failures. + if not self._collected_at_least_one_failure: + if not any(x.nodeid in lastfailed for x in result): + return res + self.lfplugin.config.pluginmanager.register( + LFPluginCollSkipfiles(self.lfplugin), "lfplugin-collskip" + ) + self._collected_at_least_one_failure = True + + session = collector.session + result[:] = [ + x + for x in result + if x.nodeid in lastfailed + # Include any passed arguments (not trivial to filter). + or session.isinitpath(x.path) + # Keep all sub-collectors. + or isinstance(x, nodes.Collector) + ] + + return res + + +class LFPluginCollSkipfiles: + def __init__(self, lfplugin: LFPlugin) -> None: + self.lfplugin = lfplugin + + @hookimpl + def pytest_make_collect_report( + self, collector: nodes.Collector + ) -> CollectReport | None: + if isinstance(collector, File): + if collector.path not in self.lfplugin._last_failed_paths: + self.lfplugin._skipped_files += 1 + + return CollectReport( + collector.nodeid, "passed", longrepr=None, result=[] + ) + return None + + +class LFPlugin: + """Plugin which implements the --lf (run last-failing) option.""" + + def __init__(self, config: Config) -> None: + self.config = config + active_keys = "lf", "failedfirst" + self.active = any(config.getoption(key) for key in active_keys) + assert config.cache + self.lastfailed: dict[str, bool] = config.cache.get("cache/lastfailed", {}) + self._previously_failed_count: int | None = None + self._report_status: str | None = None + self._skipped_files = 0 # count skipped files during collection due to --lf + + if config.getoption("lf"): + self._last_failed_paths = self.get_last_failed_paths() + config.pluginmanager.register( + LFPluginCollWrapper(self), "lfplugin-collwrapper" + ) + + def get_last_failed_paths(self) -> set[Path]: + """Return a set with all Paths of the previously failed nodeids and + their parents.""" + rootpath = self.config.rootpath + result = set() + for nodeid in self.lastfailed: + path = rootpath / nodeid.split("::")[0] + result.add(path) + result.update(path.parents) + return {x for x in result if x.exists()} + + def pytest_report_collectionfinish(self) -> str | None: + if self.active and self.config.get_verbosity() >= 0: + return f"run-last-failure: {self._report_status}" + return None + + def pytest_runtest_logreport(self, report: TestReport) -> None: + if (report.when == "call" and report.passed) or report.skipped: + self.lastfailed.pop(report.nodeid, None) + elif report.failed: + self.lastfailed[report.nodeid] = True + + def pytest_collectreport(self, report: CollectReport) -> None: + passed = report.outcome in ("passed", "skipped") + if passed: + if report.nodeid in self.lastfailed: + self.lastfailed.pop(report.nodeid) + self.lastfailed.update((item.nodeid, True) for item in report.result) + else: + self.lastfailed[report.nodeid] = True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection_modifyitems( + self, config: Config, items: list[nodes.Item] + ) -> Generator[None]: + res = yield + + if not self.active: + return res + + if self.lastfailed: + previously_failed = [] + previously_passed = [] + for item in items: + if item.nodeid in self.lastfailed: + previously_failed.append(item) + else: + previously_passed.append(item) + self._previously_failed_count = len(previously_failed) + + if not previously_failed: + # Running a subset of all tests with recorded failures + # only outside of it. + self._report_status = ( + f"{len(self.lastfailed)} known failures not in selected tests" + ) + else: + if self.config.getoption("lf"): + items[:] = previously_failed + config.hook.pytest_deselected(items=previously_passed) + else: # --failedfirst + items[:] = previously_failed + previously_passed + + noun = "failure" if self._previously_failed_count == 1 else "failures" + suffix = " first" if self.config.getoption("failedfirst") else "" + self._report_status = ( + f"rerun previous {self._previously_failed_count} {noun}{suffix}" + ) + + if self._skipped_files > 0: + files_noun = "file" if self._skipped_files == 1 else "files" + self._report_status += f" (skipped {self._skipped_files} {files_noun})" + else: + self._report_status = "no previously failed tests, " + if self.config.getoption("last_failed_no_failures") == "none": + self._report_status += "deselecting all items." + config.hook.pytest_deselected(items=items[:]) + items[:] = [] + else: + self._report_status += "not deselecting items." + + return res + + def pytest_sessionfinish(self, session: Session) -> None: + config = self.config + if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + assert config.cache is not None + saved_lastfailed = config.cache.get("cache/lastfailed", {}) + if saved_lastfailed != self.lastfailed: + config.cache.set("cache/lastfailed", self.lastfailed) + + +class NFPlugin: + """Plugin which implements the --nf (run new-first) option.""" + + def __init__(self, config: Config) -> None: + self.config = config + self.active = config.option.newfirst + assert config.cache is not None + self.cached_nodeids = set(config.cache.get("cache/nodeids", [])) + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection_modifyitems(self, items: list[nodes.Item]) -> Generator[None]: + res = yield + + if self.active: + new_items: dict[str, nodes.Item] = {} + other_items: dict[str, nodes.Item] = {} + for item in items: + if item.nodeid not in self.cached_nodeids: + new_items[item.nodeid] = item + else: + other_items[item.nodeid] = item + + items[:] = self._get_increasing_order( + new_items.values() + ) + self._get_increasing_order(other_items.values()) + self.cached_nodeids.update(new_items) + else: + self.cached_nodeids.update(item.nodeid for item in items) + + return res + + def _get_increasing_order(self, items: Iterable[nodes.Item]) -> list[nodes.Item]: + return sorted(items, key=lambda item: item.path.stat().st_mtime, reverse=True) + + def pytest_sessionfinish(self) -> None: + config = self.config + if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + if config.getoption("collectonly"): + return + + assert config.cache is not None + config.cache.set("cache/nodeids", sorted(self.cached_nodeids)) + + +def pytest_addoption(parser: Parser) -> None: + """Add command-line options for cache functionality. + + :param parser: Parser object to add command-line options to. + """ + group = parser.getgroup("general") + group.addoption( + "--lf", + "--last-failed", + action="store_true", + dest="lf", + help="Rerun only the tests that failed at the last run (or all if none failed)", + ) + group.addoption( + "--ff", + "--failed-first", + action="store_true", + dest="failedfirst", + help="Run all tests, but run the last failures first. " + "This may re-order tests and thus lead to " + "repeated fixture setup/teardown.", + ) + group.addoption( + "--nf", + "--new-first", + action="store_true", + dest="newfirst", + help="Run tests from new files first, then the rest of the tests " + "sorted by file mtime", + ) + group.addoption( + "--cache-show", + action="append", + nargs="?", + dest="cacheshow", + help=( + "Show cache contents, don't perform collection or tests. " + "Optional argument: glob (default: '*')." + ), + ) + group.addoption( + "--cache-clear", + action="store_true", + dest="cacheclear", + help="Remove all cache contents at start of test run", + ) + cache_dir_default = ".pytest_cache" + if "TOX_ENV_DIR" in os.environ: + cache_dir_default = os.path.join(os.environ["TOX_ENV_DIR"], cache_dir_default) + parser.addini("cache_dir", default=cache_dir_default, help="Cache directory path") + group.addoption( + "--lfnf", + "--last-failed-no-failures", + action="store", + dest="last_failed_no_failures", + choices=("all", "none"), + default="all", + help="With ``--lf``, determines whether to execute tests when there " + "are no previously (known) failures or when no " + "cached ``lastfailed`` data was found. " + "``all`` (the default) runs the full test suite again. " + "``none`` just emits a message about no known failures and exits successfully.", + ) + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.cacheshow and not config.option.help: + from _pytest.main import wrap_session + + return wrap_session(config, cacheshow) + return None + + +@hookimpl(tryfirst=True) +def pytest_configure(config: Config) -> None: + """Configure cache system and register related plugins. + + Creates the Cache instance and registers the last-failed (LFPlugin) + and new-first (NFPlugin) plugins with the plugin manager. + + :param config: pytest configuration object. + """ + config.cache = Cache.for_config(config, _ispytest=True) + config.pluginmanager.register(LFPlugin(config), "lfplugin") + config.pluginmanager.register(NFPlugin(config), "nfplugin") + + +@fixture +def cache(request: FixtureRequest) -> Cache: + """Return a cache object that can persist state between testing sessions. + + cache.get(key, default) + cache.set(key, value) + + Keys must be ``/`` separated strings, where the first part is usually the + name of your plugin or application to avoid clashes with other cache users. + + Values can be any object handled by the json stdlib module. + """ + assert request.config.cache is not None + return request.config.cache + + +def pytest_report_header(config: Config) -> str | None: + """Display cachedir with --cache-show and if non-default.""" + if config.option.verbose > 0 or config.getini("cache_dir") != ".pytest_cache": + assert config.cache is not None + cachedir = config.cache._cachedir + # TODO: evaluate generating upward relative paths + # starting with .., ../.. if sensible + + try: + displaypath = cachedir.relative_to(config.rootpath) + except ValueError: + displaypath = cachedir + return f"cachedir: {displaypath}" + return None + + +def cacheshow(config: Config, session: Session) -> int: + """Display cache contents when --cache-show is used. + + Shows cached values and directories matching the specified glob pattern + (default: '*'). Displays cache location, cached test results, and + any cached directories created by plugins. + + :param config: pytest configuration object. + :param session: pytest session object. + :returns: Exit code (0 for success). + """ + from pprint import pformat + + assert config.cache is not None + + tw = TerminalWriter() + tw.line("cachedir: " + str(config.cache._cachedir)) + if not config.cache._cachedir.is_dir(): + tw.line("cache is empty") + return 0 + + glob = config.option.cacheshow[0] + if glob is None: + glob = "*" + + dummy = object() + basedir = config.cache._cachedir + vdir = basedir / Cache._CACHE_PREFIX_VALUES + tw.sep("-", f"cache values for {glob!r}") + for valpath in sorted(x for x in vdir.rglob(glob) if x.is_file()): + key = str(valpath.relative_to(vdir)) + val = config.cache.get(key, dummy) + if val is dummy: + tw.line(f"{key} contains unreadable content, will be ignored") + else: + tw.line(f"{key} contains:") + for line in pformat(val).splitlines(): + tw.line(" " + line) + + ddir = basedir / Cache._CACHE_PREFIX_DIRS + if ddir.is_dir(): + contents = sorted(ddir.rglob(glob)) + tw.sep("-", f"cache directories for {glob!r}") + for p in contents: + # if p.is_dir(): + # print("%s/" % p.relative_to(basedir)) + if p.is_file(): + key = str(p.relative_to(basedir)) + tw.line(f"{key} is a file of length {p.stat().st_size}") + return 0 diff --git a/micromamba_root/Lib/site-packages/_pytest/capture.py b/micromamba_root/Lib/site-packages/_pytest/capture.py new file mode 100644 index 0000000000000000000000000000000000000000..6d98676be5f20166929164e39fd0eeb17a24db20 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/capture.py @@ -0,0 +1,1144 @@ +# mypy: allow-untyped-defs +"""Per-test stdout/stderr capturing mechanism.""" + +from __future__ import annotations + +import abc +import collections +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Iterator +import contextlib +import io +from io import UnsupportedOperation +import os +import sys +from tempfile import TemporaryFile +from types import TracebackType +from typing import Any +from typing import AnyStr +from typing import BinaryIO +from typing import cast +from typing import Final +from typing import final +from typing import Generic +from typing import Literal +from typing import NamedTuple +from typing import TextIO +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: + from typing_extensions import Self + +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import SubRequest +from _pytest.nodes import Collector +from _pytest.nodes import File +from _pytest.nodes import Item +from _pytest.reports import CollectReport + + +_CaptureMethod = Literal["fd", "sys", "no", "tee-sys"] + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--capture", + action="store", + default="fd", + metavar="method", + choices=["fd", "sys", "no", "tee-sys"], + help="Per-test capturing method: one of fd|sys|no|tee-sys", + ) + group._addoption( # private to use reserved lower-case short option + "-s", + action="store_const", + const="no", + dest="capture", + help="Shortcut for --capture=no", + ) + + +def _colorama_workaround() -> None: + """Ensure colorama is imported so that it attaches to the correct stdio + handles on Windows. + + colorama uses the terminal on import time. So if something does the + first import of colorama while I/O capture is active, colorama will + fail in various ways. + """ + if sys.platform.startswith("win32"): + try: + import colorama # noqa: F401 + except ImportError: + pass + + +def _readline_workaround() -> None: + """Ensure readline is imported early so it attaches to the correct stdio handles. + + This isn't a problem with the default GNU readline implementation, but in + some configurations, Python uses libedit instead (on macOS, and for prebuilt + binaries such as used by uv). + + In theory this is only needed if readline.backend == "libedit", but the + workaround consists of importing readline here, so we already worked around + the issue by the time we could check if we need to. + """ + try: + import readline # noqa: F401 + except ImportError: + pass + + +def _windowsconsoleio_workaround(stream: TextIO) -> None: + """Workaround for Windows Unicode console handling. + + Python 3.6 implemented Unicode console handling for Windows. This works + by reading/writing to the raw console handle using + ``{Read,Write}ConsoleW``. + + The problem is that we are going to ``dup2`` over the stdio file + descriptors when doing ``FDCapture`` and this will ``CloseHandle`` the + handles used by Python to write to the console. Though there is still some + weirdness and the console handle seems to only be closed randomly and not + on the first call to ``CloseHandle``, or maybe it gets reopened with the + same handle value when we suspend capturing. + + The workaround in this case will reopen stdio with a different fd which + also means a different handle by replicating the logic in + "Py_lifecycle.c:initstdio/create_stdio". + + :param stream: + In practice ``sys.stdout`` or ``sys.stderr``, but given + here as parameter for unittesting purposes. + + See https://github.com/pytest-dev/py/issues/103. + """ + if not sys.platform.startswith("win32") or hasattr(sys, "pypy_version_info"): + return + + # Bail out if ``stream`` doesn't seem like a proper ``io`` stream (#2666). + if not hasattr(stream, "buffer"): # type: ignore[unreachable,unused-ignore] + return + + raw_stdout = stream.buffer.raw if hasattr(stream.buffer, "raw") else stream.buffer + + if not isinstance(raw_stdout, io._WindowsConsoleIO): # type: ignore[attr-defined,unused-ignore] + return + + def _reopen_stdio(f, mode): + if not hasattr(stream.buffer, "raw") and mode[0] == "w": + buffering = 0 + else: + buffering = -1 + + return io.TextIOWrapper( + open(os.dup(f.fileno()), mode, buffering), + f.encoding, + f.errors, + f.newlines, + f.line_buffering, + ) + + sys.stdin = _reopen_stdio(sys.stdin, "rb") + sys.stdout = _reopen_stdio(sys.stdout, "wb") + sys.stderr = _reopen_stdio(sys.stderr, "wb") + + +@hookimpl(wrapper=True) +def pytest_load_initial_conftests(early_config: Config) -> Generator[None]: + ns = early_config.known_args_namespace + if ns.capture == "fd": + _windowsconsoleio_workaround(sys.stdout) + _colorama_workaround() + _readline_workaround() + pluginmanager = early_config.pluginmanager + capman = CaptureManager(ns.capture) + pluginmanager.register(capman, "capturemanager") + + # Make sure that capturemanager is properly reset at final shutdown. + early_config.add_cleanup(capman.stop_global_capturing) + + # Finally trigger conftest loading but while capturing (issue #93). + capman.start_global_capturing() + try: + try: + yield + finally: + capman.suspend_global_capture() + except BaseException: + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stderr.write(err) + raise + + +# IO Helpers. + + +class EncodedFile(io.TextIOWrapper): + __slots__ = () + + @property + def name(self) -> str: + # Ensure that file.name is a string. Workaround for a Python bug + # fixed in >=3.7.4: https://bugs.python.org/issue36015 + return repr(self.buffer) + + @property + def mode(self) -> str: + # TextIOWrapper doesn't expose a mode, but at least some of our + # tests check it. + assert hasattr(self.buffer, "mode") + return cast(str, self.buffer.mode.replace("b", "")) + + +class CaptureIO(io.TextIOWrapper): + def __init__(self) -> None: + super().__init__(io.BytesIO(), encoding="UTF-8", newline="", write_through=True) + + def getvalue(self) -> str: + assert isinstance(self.buffer, io.BytesIO) + return self.buffer.getvalue().decode("UTF-8") + + +class TeeCaptureIO(CaptureIO): + def __init__(self, other: TextIO) -> None: + self._other = other + super().__init__() + + def write(self, s: str) -> int: + super().write(s) + return self._other.write(s) + + +class DontReadFromInput(TextIO): + @property + def encoding(self) -> str: + assert sys.__stdin__ is not None + return sys.__stdin__.encoding + + def read(self, size: int = -1) -> str: + raise OSError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) + + readline = read + + def __next__(self) -> str: + return self.readline() + + def readlines(self, hint: int | None = -1) -> list[str]: + raise OSError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) + + def __iter__(self) -> Iterator[str]: + return self + + def fileno(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no fileno()") + + def flush(self) -> None: + raise UnsupportedOperation("redirected stdin is pseudofile, has no flush()") + + def isatty(self) -> bool: + return False + + def close(self) -> None: + pass + + def readable(self) -> bool: + return False + + def seek(self, offset: int, whence: int = 0) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no seek(int)") + + def seekable(self) -> bool: + return False + + def tell(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no tell()") + + def truncate(self, size: int | None = None) -> int: + raise UnsupportedOperation("cannot truncate stdin") + + def write(self, data: str) -> int: + raise UnsupportedOperation("cannot write to stdin") + + def writelines(self, lines: Iterable[str]) -> None: + raise UnsupportedOperation("Cannot write to stdin") + + def writable(self) -> bool: + return False + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + type: type[BaseException] | None, + value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + pass + + @property + def buffer(self) -> BinaryIO: + # The str/bytes doesn't actually matter in this type, so OK to fake. + return self # type: ignore[return-value] + + +# Capture classes. + + +class CaptureBase(abc.ABC, Generic[AnyStr]): + EMPTY_BUFFER: AnyStr + + @abc.abstractmethod + def __init__(self, fd: int) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def start(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def done(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def suspend(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def resume(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def writeorg(self, data: AnyStr) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def snap(self) -> AnyStr: + raise NotImplementedError() + + +patchsysdict = {0: "stdin", 1: "stdout", 2: "stderr"} + + +class NoCapture(CaptureBase[str]): + EMPTY_BUFFER = "" + + def __init__(self, fd: int) -> None: + pass + + def start(self) -> None: + pass + + def done(self) -> None: + pass + + def suspend(self) -> None: + pass + + def resume(self) -> None: + pass + + def snap(self) -> str: + return "" + + def writeorg(self, data: str) -> None: + pass + + +class SysCaptureBase(CaptureBase[AnyStr]): + def __init__( + self, fd: int, tmpfile: TextIO | None = None, *, tee: bool = False + ) -> None: + name = patchsysdict[fd] + self._old: TextIO = getattr(sys, name) + self.name = name + if tmpfile is None: + if name == "stdin": + tmpfile = DontReadFromInput() + else: + tmpfile = CaptureIO() if not tee else TeeCaptureIO(self._old) + self.tmpfile = tmpfile + self._state = "initialized" + + def repr(self, class_name: str) -> str: + return "<{} {} _old={} _state={!r} tmpfile={!r}>".format( + class_name, + self.name, + (hasattr(self, "_old") and repr(self._old)) or "", + self._state, + self.tmpfile, + ) + + def __repr__(self) -> str: + return "<{} {} _old={} _state={!r} tmpfile={!r}>".format( + self.__class__.__name__, + self.name, + (hasattr(self, "_old") and repr(self._old)) or "", + self._state, + self.tmpfile, + ) + + def _assert_state(self, op: str, states: tuple[str, ...]) -> None: + assert self._state in states, ( + "cannot {} in state {!r}: expected one of {}".format( + op, self._state, ", ".join(states) + ) + ) + + def start(self) -> None: + self._assert_state("start", ("initialized",)) + setattr(sys, self.name, self.tmpfile) + self._state = "started" + + def done(self) -> None: + self._assert_state("done", ("initialized", "started", "suspended", "done")) + if self._state == "done": + return + setattr(sys, self.name, self._old) + del self._old + self.tmpfile.close() + self._state = "done" + + def suspend(self) -> None: + self._assert_state("suspend", ("started", "suspended")) + setattr(sys, self.name, self._old) + self._state = "suspended" + + def resume(self) -> None: + self._assert_state("resume", ("started", "suspended")) + if self._state == "started": + return + setattr(sys, self.name, self.tmpfile) + self._state = "started" + + +class SysCaptureBinary(SysCaptureBase[bytes]): + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: bytes) -> None: + self._assert_state("writeorg", ("started", "suspended")) + self._old.flush() + self._old.buffer.write(data) + self._old.buffer.flush() + + +class SysCapture(SysCaptureBase[str]): + EMPTY_BUFFER = "" + + def snap(self) -> str: + self._assert_state("snap", ("started", "suspended")) + assert isinstance(self.tmpfile, CaptureIO) + res = self.tmpfile.getvalue() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: str) -> None: + self._assert_state("writeorg", ("started", "suspended")) + self._old.write(data) + self._old.flush() + + +class FDCaptureBase(CaptureBase[AnyStr]): + def __init__(self, targetfd: int) -> None: + self.targetfd = targetfd + + try: + os.fstat(targetfd) + except OSError: + # FD capturing is conceptually simple -- create a temporary file, + # redirect the FD to it, redirect back when done. But when the + # target FD is invalid it throws a wrench into this lovely scheme. + # + # Tests themselves shouldn't care if the FD is valid, FD capturing + # should work regardless of external circumstances. So falling back + # to just sys capturing is not a good option. + # + # Further complications are the need to support suspend() and the + # possibility of FD reuse (e.g. the tmpfile getting the very same + # target FD). The following approach is robust, I believe. + self.targetfd_invalid: int | None = os.open(os.devnull, os.O_RDWR) + os.dup2(self.targetfd_invalid, targetfd) + else: + self.targetfd_invalid = None + self.targetfd_save = os.dup(targetfd) + + if targetfd == 0: + self.tmpfile = open(os.devnull, encoding="utf-8") + self.syscapture: CaptureBase[str] = SysCapture(targetfd) + else: + self.tmpfile = EncodedFile( + TemporaryFile(buffering=0), + encoding="utf-8", + errors="replace", + newline="", + write_through=True, + ) + if targetfd in patchsysdict: + self.syscapture = SysCapture(targetfd, self.tmpfile) + else: + self.syscapture = NoCapture(targetfd) + + self._state = "initialized" + + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} {self.targetfd} oldfd={self.targetfd_save} " + f"_state={self._state!r} tmpfile={self.tmpfile!r}>" + ) + + def _assert_state(self, op: str, states: tuple[str, ...]) -> None: + assert self._state in states, ( + "cannot {} in state {!r}: expected one of {}".format( + op, self._state, ", ".join(states) + ) + ) + + def start(self) -> None: + """Start capturing on targetfd using memorized tmpfile.""" + self._assert_state("start", ("initialized",)) + os.dup2(self.tmpfile.fileno(), self.targetfd) + self.syscapture.start() + self._state = "started" + + def done(self) -> None: + """Stop capturing, restore streams, return original capture file, + seeked to position zero.""" + self._assert_state("done", ("initialized", "started", "suspended", "done")) + if self._state == "done": + return + os.dup2(self.targetfd_save, self.targetfd) + os.close(self.targetfd_save) + if self.targetfd_invalid is not None: + if self.targetfd_invalid != self.targetfd: + os.close(self.targetfd) + os.close(self.targetfd_invalid) + self.syscapture.done() + self.tmpfile.close() + self._state = "done" + + def suspend(self) -> None: + self._assert_state("suspend", ("started", "suspended")) + if self._state == "suspended": + return + self.syscapture.suspend() + os.dup2(self.targetfd_save, self.targetfd) + self._state = "suspended" + + def resume(self) -> None: + self._assert_state("resume", ("started", "suspended")) + if self._state == "started": + return + self.syscapture.resume() + os.dup2(self.tmpfile.fileno(), self.targetfd) + self._state = "started" + + +class FDCaptureBinary(FDCaptureBase[bytes]): + """Capture IO to/from a given OS-level file descriptor. + + snap() produces `bytes`. + """ + + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res # type: ignore[return-value] + + def writeorg(self, data: bytes) -> None: + """Write to original file descriptor.""" + self._assert_state("writeorg", ("started", "suspended")) + os.write(self.targetfd_save, data) + + +class FDCapture(FDCaptureBase[str]): + """Capture IO to/from a given OS-level file descriptor. + + snap() produces text. + """ + + EMPTY_BUFFER = "" + + def snap(self) -> str: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: str) -> None: + """Write to original file descriptor.""" + self._assert_state("writeorg", ("started", "suspended")) + # XXX use encoding of original stream + os.write(self.targetfd_save, data.encode("utf-8")) + + +# MultiCapture + + +# Generic NamedTuple only supported since Python 3.11. +if sys.version_info >= (3, 11) or TYPE_CHECKING: + + @final + class CaptureResult(NamedTuple, Generic[AnyStr]): + """The result of :method:`caplog.readouterr() `.""" + + out: AnyStr + err: AnyStr + +else: + + class CaptureResult( + collections.namedtuple("CaptureResult", ["out", "err"]), # noqa: PYI024 + Generic[AnyStr], + ): + """The result of :method:`caplog.readouterr() `.""" + + __slots__ = () + + +class MultiCapture(Generic[AnyStr]): + _state = None + _in_suspended = False + + def __init__( + self, + in_: CaptureBase[AnyStr] | None, + out: CaptureBase[AnyStr] | None, + err: CaptureBase[AnyStr] | None, + ) -> None: + self.in_: CaptureBase[AnyStr] | None = in_ + self.out: CaptureBase[AnyStr] | None = out + self.err: CaptureBase[AnyStr] | None = err + + def __repr__(self) -> str: + return ( + f"" + ) + + def start_capturing(self) -> None: + self._state = "started" + if self.in_: + self.in_.start() + if self.out: + self.out.start() + if self.err: + self.err.start() + + def pop_outerr_to_orig(self) -> tuple[AnyStr, AnyStr]: + """Pop current snapshot out/err capture and flush to orig streams.""" + out, err = self.readouterr() + if out: + assert self.out is not None + self.out.writeorg(out) + if err: + assert self.err is not None + self.err.writeorg(err) + return out, err + + def suspend_capturing(self, in_: bool = False) -> None: + self._state = "suspended" + if self.out: + self.out.suspend() + if self.err: + self.err.suspend() + if in_ and self.in_: + self.in_.suspend() + self._in_suspended = True + + def resume_capturing(self) -> None: + self._state = "started" + if self.out: + self.out.resume() + if self.err: + self.err.resume() + if self._in_suspended: + assert self.in_ is not None + self.in_.resume() + self._in_suspended = False + + def stop_capturing(self) -> None: + """Stop capturing and reset capturing streams.""" + if self._state == "stopped": + raise ValueError("was already stopped") + self._state = "stopped" + if self.out: + self.out.done() + if self.err: + self.err.done() + if self.in_: + self.in_.done() + + def is_started(self) -> bool: + """Whether actively capturing -- not suspended or stopped.""" + return self._state == "started" + + def readouterr(self) -> CaptureResult[AnyStr]: + out = self.out.snap() if self.out else "" + err = self.err.snap() if self.err else "" + # TODO: This type error is real, need to fix. + return CaptureResult(out, err) # type: ignore[arg-type] + + +def _get_multicapture(method: _CaptureMethod) -> MultiCapture[str]: + if method == "fd": + return MultiCapture(in_=FDCapture(0), out=FDCapture(1), err=FDCapture(2)) + elif method == "sys": + return MultiCapture(in_=SysCapture(0), out=SysCapture(1), err=SysCapture(2)) + elif method == "no": + return MultiCapture(in_=None, out=None, err=None) + elif method == "tee-sys": + return MultiCapture( + in_=None, out=SysCapture(1, tee=True), err=SysCapture(2, tee=True) + ) + raise ValueError(f"unknown capturing method: {method!r}") + + +# CaptureManager and CaptureFixture + + +class CaptureManager: + """The capture plugin. + + Manages that the appropriate capture method is enabled/disabled during + collection and each test phase (setup, call, teardown). After each of + those points, the captured output is obtained and attached to the + collection/runtest report. + + There are two levels of capture: + + * global: enabled by default and can be suppressed by the ``-s`` + option. This is always enabled/disabled during collection and each test + phase. + + * fixture: when a test function or one of its fixture depend on the + ``capsys`` or ``capfd`` fixtures. In this case special handling is + needed to ensure the fixtures take precedence over the global capture. + """ + + def __init__(self, method: _CaptureMethod) -> None: + self._method: Final = method + self._global_capturing: MultiCapture[str] | None = None + self._capture_fixture: CaptureFixture[Any] | None = None + + def __repr__(self) -> str: + return ( + f"" + ) + + def is_capturing(self) -> str | bool: + if self.is_globally_capturing(): + return "global" + if self._capture_fixture: + return f"fixture {self._capture_fixture.request.fixturename}" + return False + + # Global capturing control + + def is_globally_capturing(self) -> bool: + return self._method != "no" + + def start_global_capturing(self) -> None: + assert self._global_capturing is None + self._global_capturing = _get_multicapture(self._method) + self._global_capturing.start_capturing() + + def stop_global_capturing(self) -> None: + if self._global_capturing is not None: + self._global_capturing.pop_outerr_to_orig() + self._global_capturing.stop_capturing() + self._global_capturing = None + + def resume_global_capture(self) -> None: + # During teardown of the python process, and on rare occasions, capture + # attributes can be `None` while trying to resume global capture. + if self._global_capturing is not None: + self._global_capturing.resume_capturing() + + def suspend_global_capture(self, in_: bool = False) -> None: + if self._global_capturing is not None: + self._global_capturing.suspend_capturing(in_=in_) + + def suspend(self, in_: bool = False) -> None: + # Need to undo local capsys-et-al if it exists before disabling global capture. + self.suspend_fixture() + self.suspend_global_capture(in_) + + def resume(self) -> None: + self.resume_global_capture() + self.resume_fixture() + + def read_global_capture(self) -> CaptureResult[str]: + assert self._global_capturing is not None + return self._global_capturing.readouterr() + + # Fixture Control + + def set_fixture(self, capture_fixture: CaptureFixture[Any]) -> None: + if self._capture_fixture: + current_fixture = self._capture_fixture.request.fixturename + requested_fixture = capture_fixture.request.fixturename + capture_fixture.request.raiseerror( + f"cannot use {requested_fixture} and {current_fixture} at the same time" + ) + self._capture_fixture = capture_fixture + + def unset_fixture(self) -> None: + self._capture_fixture = None + + def activate_fixture(self) -> None: + """If the current item is using ``capsys`` or ``capfd``, activate + them so they take precedence over the global capture.""" + if self._capture_fixture: + self._capture_fixture._start() + + def deactivate_fixture(self) -> None: + """Deactivate the ``capsys`` or ``capfd`` fixture of this item, if any.""" + if self._capture_fixture: + self._capture_fixture.close() + + def suspend_fixture(self) -> None: + if self._capture_fixture: + self._capture_fixture._suspend() + + def resume_fixture(self) -> None: + if self._capture_fixture: + self._capture_fixture._resume() + + # Helper context managers + + @contextlib.contextmanager + def global_and_fixture_disabled(self) -> Generator[None]: + """Context manager to temporarily disable global and current fixture capturing.""" + do_fixture = self._capture_fixture and self._capture_fixture._is_started() + if do_fixture: + self.suspend_fixture() + do_global = self._global_capturing and self._global_capturing.is_started() + if do_global: + self.suspend_global_capture() + try: + yield + finally: + if do_global: + self.resume_global_capture() + if do_fixture: + self.resume_fixture() + + @contextlib.contextmanager + def item_capture(self, when: str, item: Item) -> Generator[None]: + self.resume_global_capture() + self.activate_fixture() + try: + yield + finally: + self.deactivate_fixture() + self.suspend_global_capture(in_=False) + + out, err = self.read_global_capture() + item.add_report_section(when, "stdout", out) + item.add_report_section(when, "stderr", err) + + # Hooks + + @hookimpl(wrapper=True) + def pytest_make_collect_report( + self, collector: Collector + ) -> Generator[None, CollectReport, CollectReport]: + if isinstance(collector, File): + self.resume_global_capture() + try: + rep = yield + finally: + self.suspend_global_capture() + out, err = self.read_global_capture() + if out: + rep.sections.append(("Captured stdout", out)) + if err: + rep.sections.append(("Captured stderr", err)) + else: + rep = yield + return rep + + @hookimpl(wrapper=True) + def pytest_runtest_setup(self, item: Item) -> Generator[None]: + with self.item_capture("setup", item): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtest_call(self, item: Item) -> Generator[None]: + with self.item_capture("call", item): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtest_teardown(self, item: Item) -> Generator[None]: + with self.item_capture("teardown", item): + return (yield) + + @hookimpl(tryfirst=True) + def pytest_keyboard_interrupt(self) -> None: + self.stop_global_capturing() + + @hookimpl(tryfirst=True) + def pytest_internalerror(self) -> None: + self.stop_global_capturing() + + +class CaptureFixture(Generic[AnyStr]): + """Object returned by the :fixture:`capsys`, :fixture:`capsysbinary`, + :fixture:`capfd` and :fixture:`capfdbinary` fixtures.""" + + def __init__( + self, + captureclass: type[CaptureBase[AnyStr]], + request: SubRequest, + *, + config: dict[str, Any] | None = None, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self.captureclass: type[CaptureBase[AnyStr]] = captureclass + self.request = request + self._config = config if config else {} + self._capture: MultiCapture[AnyStr] | None = None + self._captured_out: AnyStr = self.captureclass.EMPTY_BUFFER + self._captured_err: AnyStr = self.captureclass.EMPTY_BUFFER + + def _start(self) -> None: + if self._capture is None: + self._capture = MultiCapture( + in_=None, + out=self.captureclass(1, **self._config), + err=self.captureclass(2, **self._config), + ) + self._capture.start_capturing() + + def close(self) -> None: + if self._capture is not None: + out, err = self._capture.pop_outerr_to_orig() + self._captured_out += out + self._captured_err += err + self._capture.stop_capturing() + self._capture = None + + def readouterr(self) -> CaptureResult[AnyStr]: + """Read and return the captured output so far, resetting the internal + buffer. + + :returns: + The captured content as a namedtuple with ``out`` and ``err`` + string attributes. + """ + captured_out, captured_err = self._captured_out, self._captured_err + if self._capture is not None: + out, err = self._capture.readouterr() + captured_out += out + captured_err += err + self._captured_out = self.captureclass.EMPTY_BUFFER + self._captured_err = self.captureclass.EMPTY_BUFFER + return CaptureResult(captured_out, captured_err) + + def _suspend(self) -> None: + """Suspend this fixture's own capturing temporarily.""" + if self._capture is not None: + self._capture.suspend_capturing() + + def _resume(self) -> None: + """Resume this fixture's own capturing temporarily.""" + if self._capture is not None: + self._capture.resume_capturing() + + def _is_started(self) -> bool: + """Whether actively capturing -- not disabled or closed.""" + if self._capture is not None: + return self._capture.is_started() + return False + + @contextlib.contextmanager + def disabled(self) -> Generator[None]: + """Temporarily disable capturing while inside the ``with`` block.""" + capmanager: CaptureManager = self.request.config.pluginmanager.getplugin( + "capturemanager" + ) + with capmanager.global_and_fixture_disabled(): + yield + + +# The fixtures. + + +@fixture +def capsys(request: SubRequest) -> Generator[CaptureFixture[str]]: + r"""Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(SysCapture, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capteesys(request: SubRequest) -> Generator[CaptureFixture[str]]: + r"""Enable simultaneous text capturing and pass-through of writes + to ``sys.stdout`` and ``sys.stderr`` as defined by ``--capture=``. + + + The captured output is made available via ``capteesys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + The output is also passed-through, allowing it to be "live-printed", + reported, or both as defined by ``--capture=``. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capteesys): + print("hello") + captured = capteesys.readouterr() + assert captured.out == "hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture( + SysCapture, request, config=dict(tee=True), _ispytest=True + ) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes]]: + r"""Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsysbinary.readouterr()`` + method calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``bytes`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(SysCaptureBinary, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capfd(request: SubRequest) -> Generator[CaptureFixture[str]]: + r"""Enable text capturing of writes to file descriptors ``1`` and ``2``. + + The captured output is made available via ``capfd.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(FDCapture, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes]]: + r"""Enable bytes capturing of writes to file descriptors ``1`` and ``2``. + + The captured output is made available via ``capfd.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``byte`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(FDCaptureBinary, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() diff --git a/micromamba_root/Lib/site-packages/_pytest/compat.py b/micromamba_root/Lib/site-packages/_pytest/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..72c3d0918fb1d18d7ab538e3e7309209730ece96 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/compat.py @@ -0,0 +1,314 @@ +# mypy: allow-untyped-defs +"""Python version compatibility code and random general utilities.""" + +from __future__ import annotations + +from collections.abc import Callable +import enum +import functools +import inspect +from inspect import Parameter +from inspect import Signature +import os +from pathlib import Path +import sys +from typing import Any +from typing import Final +from typing import NoReturn + +import py + + +if sys.version_info >= (3, 14): + from annotationlib import Format + + +#: constant to prepare valuing pylib path replacements/lazy proxies later on +# intended for removal in pytest 8.0 or 9.0 + +# fmt: off +# intentional space to create a fake difference for the verification +LEGACY_PATH = py.path. local +# fmt: on + + +def legacy_path(path: str | os.PathLike[str]) -> LEGACY_PATH: + """Internal wrapper to prepare lazy proxies for legacy_path instances""" + return LEGACY_PATH(path) + + +# fmt: off +# Singleton type for NOTSET, as described in: +# https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions +class NotSetType(enum.Enum): + token = 0 +NOTSET: Final = NotSetType.token +# fmt: on + + +def iscoroutinefunction(func: object) -> bool: + """Return True if func is a coroutine function (a function defined with async + def syntax, and doesn't contain yield), or a function decorated with + @asyncio.coroutine. + + Note: copied and modified from Python 3.5's builtin coroutines.py to avoid + importing asyncio directly, which in turns also initializes the "logging" + module as a side-effect (see issue #8). + """ + return inspect.iscoroutinefunction(func) or getattr(func, "_is_coroutine", False) + + +def is_async_function(func: object) -> bool: + """Return True if the given function seems to be an async function or + an async generator.""" + return iscoroutinefunction(func) or inspect.isasyncgenfunction(func) + + +def signature(obj: Callable[..., Any]) -> Signature: + """Return signature without evaluating annotations.""" + if sys.version_info >= (3, 14): + return inspect.signature(obj, annotation_format=Format.STRING) + return inspect.signature(obj) + + +def getlocation(function, curdir: str | os.PathLike[str] | None = None) -> str: + function = get_real_func(function) + fn = Path(inspect.getfile(function)) + lineno = function.__code__.co_firstlineno + if curdir is not None: + try: + relfn = fn.relative_to(curdir) + except ValueError: + pass + else: + return f"{relfn}:{lineno + 1}" + return f"{fn}:{lineno + 1}" + + +def num_mock_patch_args(function) -> int: + """Return number of arguments used up by mock arguments (if any).""" + patchings = getattr(function, "patchings", None) + if not patchings: + return 0 + + mock_sentinel = getattr(sys.modules.get("mock"), "DEFAULT", object()) + ut_mock_sentinel = getattr(sys.modules.get("unittest.mock"), "DEFAULT", object()) + + return len( + [ + p + for p in patchings + if not p.attribute_name + and (p.new is mock_sentinel or p.new is ut_mock_sentinel) + ] + ) + + +def getfuncargnames( + function: Callable[..., object], + *, + name: str = "", + cls: type | None = None, +) -> tuple[str, ...]: + """Return the names of a function's mandatory arguments. + + Should return the names of all function arguments that: + * Aren't bound to an instance or type as in instance or class methods. + * Don't have default values. + * Aren't bound with functools.partial. + * Aren't replaced with mocks. + + The cls arguments indicate that the function should be treated as a bound + method even though it's not unless the function is a static method. + + The name parameter should be the original name in which the function was collected. + """ + # TODO(RonnyPfannschmidt): This function should be refactored when we + # revisit fixtures. The fixture mechanism should ask the node for + # the fixture names, and not try to obtain directly from the + # function object well after collection has occurred. + + # The parameters attribute of a Signature object contains an + # ordered mapping of parameter names to Parameter instances. This + # creates a tuple of the names of the parameters that don't have + # defaults. + try: + parameters = signature(function).parameters.values() + except (ValueError, TypeError) as e: + from _pytest.outcomes import fail + + fail( + f"Could not determine arguments of {function!r}: {e}", + pytrace=False, + ) + + arg_names = tuple( + p.name + for p in parameters + if ( + p.kind is Parameter.POSITIONAL_OR_KEYWORD + or p.kind is Parameter.KEYWORD_ONLY + ) + and p.default is Parameter.empty + ) + if not name: + name = function.__name__ + + # If this function should be treated as a bound method even though + # it's passed as an unbound method or function, and its first parameter + # wasn't defined as positional only, remove the first parameter name. + if not any(p.kind is Parameter.POSITIONAL_ONLY for p in parameters) and ( + # Not using `getattr` because we don't want to resolve the staticmethod. + # Not using `cls.__dict__` because we want to check the entire MRO. + cls + and not isinstance( + inspect.getattr_static(cls, name, default=None), staticmethod + ) + ): + arg_names = arg_names[1:] + # Remove any names that will be replaced with mocks. + if hasattr(function, "__wrapped__"): + arg_names = arg_names[num_mock_patch_args(function) :] + return arg_names + + +def get_default_arg_names(function: Callable[..., Any]) -> tuple[str, ...]: + # Note: this code intentionally mirrors the code at the beginning of + # getfuncargnames, to get the arguments which were excluded from its result + # because they had default values. + return tuple( + p.name + for p in signature(function).parameters.values() + if p.kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY) + and p.default is not Parameter.empty + ) + + +_non_printable_ascii_translate_table = { + i: f"\\x{i:02x}" for i in range(128) if i not in range(32, 127) +} +_non_printable_ascii_translate_table.update( + {ord("\t"): "\\t", ord("\r"): "\\r", ord("\n"): "\\n"} +) + + +def ascii_escaped(val: bytes | str) -> str: + r"""If val is pure ASCII, return it as an str, otherwise, escape + bytes objects into a sequence of escaped bytes: + + b'\xc3\xb4\xc5\xd6' -> r'\xc3\xb4\xc5\xd6' + + and escapes strings into a sequence of escaped unicode ids, e.g.: + + r'4\nV\U00043efa\x0eMXWB\x1e\u3028\u15fd\xcd\U0007d944' + + Note: + The obvious "v.decode('unicode-escape')" will return + valid UTF-8 unicode if it finds them in bytes, but we + want to return escaped bytes for any byte, even if they match + a UTF-8 string. + """ + if isinstance(val, bytes): + ret = val.decode("ascii", "backslashreplace") + else: + ret = val.encode("unicode_escape").decode("ascii") + return ret.translate(_non_printable_ascii_translate_table) + + +def get_real_func(obj): + """Get the real function object of the (possibly) wrapped object by + :func:`functools.wraps`, or :func:`functools.partial`.""" + obj = inspect.unwrap(obj) + + if isinstance(obj, functools.partial): + obj = obj.func + return obj + + +def getimfunc(func): + try: + return func.__func__ + except AttributeError: + return func + + +def safe_getattr(object: Any, name: str, default: Any) -> Any: + """Like getattr but return default upon any Exception or any OutcomeException. + + Attribute access can potentially fail for 'evil' Python objects. + See issue #214. + It catches OutcomeException because of #2490 (issue #580), new outcomes + are derived from BaseException instead of Exception (for more details + check #2707). + """ + from _pytest.outcomes import TEST_OUTCOME + + try: + return getattr(object, name, default) + except TEST_OUTCOME: + return default + + +def safe_isclass(obj: object) -> bool: + """Ignore any exception via isinstance on Python 3.""" + try: + return inspect.isclass(obj) + except Exception: + return False + + +def get_user_id() -> int | None: + """Return the current process's real user id or None if it could not be + determined. + + :return: The user id or None if it could not be determined. + """ + # mypy follows the version and platform checking expectation of PEP 484: + # https://mypy.readthedocs.io/en/stable/common_issues.html?highlight=platform#python-version-and-system-platform-checks + # Containment checks are too complex for mypy v1.5.0 and cause failure. + if sys.platform == "win32" or sys.platform == "emscripten": + # win32 does not have a getuid() function. + # Emscripten has a return 0 stub. + return None + else: + # On other platforms, a return value of -1 is assumed to indicate that + # the current process's real user id could not be determined. + ERROR = -1 + uid = os.getuid() + return uid if uid != ERROR else None + + +if sys.version_info >= (3, 11): + from typing import assert_never +else: + + def assert_never(value: NoReturn) -> NoReturn: + assert False, f"Unhandled value: {value} ({type(value).__name__})" + + +class CallableBool: + """ + A bool-like object that can also be called, returning its true/false value. + + Used for backwards compatibility in cases where something was supposed to be a method + but was implemented as a simple attribute by mistake (see `TerminalReporter.isatty`). + + Do not use in new code. + """ + + def __init__(self, value: bool) -> None: + self._value = value + + def __bool__(self) -> bool: + return self._value + + def __call__(self) -> bool: + return self._value + + +def running_on_ci() -> bool: + """Check if we're currently running on a CI system.""" + # Only enable CI mode if one of these env variables is defined and non-empty. + # Note: review `regendoc` tox env in case this list is changed. + env_vars = ["CI", "BUILD_NUMBER"] + return any(os.environ.get(var) for var in env_vars) diff --git a/micromamba_root/Lib/site-packages/_pytest/config/__init__.py b/micromamba_root/Lib/site-packages/_pytest/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a027dbc02a4ff61efa535db1ca2688fd9ef37e4d --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/config/__init__.py @@ -0,0 +1,2203 @@ +# mypy: allow-untyped-defs +"""Command line options, config-file and conftest.py processing.""" + +from __future__ import annotations + +import argparse +import builtins +import collections.abc +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import MutableMapping +from collections.abc import Sequence +import contextlib +import copy +import dataclasses +import enum +from functools import lru_cache +import glob +import importlib.metadata +import inspect +import os +import pathlib +import re +import shlex +import sys +from textwrap import dedent +import types +from types import FunctionType +from typing import Any +from typing import cast +from typing import Final +from typing import final +from typing import IO +from typing import TextIO +from typing import TYPE_CHECKING +import warnings + +import pluggy +from pluggy import HookimplMarker +from pluggy import HookimplOpts +from pluggy import HookspecMarker +from pluggy import HookspecOpts +from pluggy import PluginManager + +from .compat import PathAwareHookProxy +from .exceptions import PrintHelp as PrintHelp +from .exceptions import UsageError as UsageError +from .findpaths import ConfigValue +from .findpaths import determine_setup +from _pytest import __version__ +import _pytest._code +from _pytest._code import ExceptionInfo +from _pytest._code import filter_traceback +from _pytest._code.code import TracebackStyle +from _pytest._io import TerminalWriter +from _pytest.compat import assert_never +from _pytest.config.argparsing import Argument +from _pytest.config.argparsing import FILE_OR_DIR +from _pytest.config.argparsing import Parser +import _pytest.deprecated +import _pytest.hookspec +from _pytest.outcomes import fail +from _pytest.outcomes import Skipped +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import import_path +from _pytest.pathlib import ImportMode +from _pytest.pathlib import resolve_package_path +from _pytest.pathlib import safe_exists +from _pytest.stash import Stash +from _pytest.warning_types import PytestConfigWarning +from _pytest.warning_types import warn_explicit_for + + +if TYPE_CHECKING: + from _pytest.assertion.rewrite import AssertionRewritingHook + from _pytest.cacheprovider import Cache + from _pytest.terminal import TerminalReporter + +_PluggyPlugin = object +"""A type to represent plugin objects. + +Plugins can be any namespace, so we can't narrow it down much, but we use an +alias to make the intent clear. + +Ideally this type would be provided by pluggy itself. +""" + + +hookimpl = HookimplMarker("pytest") +hookspec = HookspecMarker("pytest") + + +@final +class ExitCode(enum.IntEnum): + """Encodes the valid exit codes by pytest. + + Currently users and plugins may supply other exit codes as well. + + .. versionadded:: 5.0 + """ + + #: Tests passed. + OK = 0 + #: Tests failed. + TESTS_FAILED = 1 + #: pytest was interrupted. + INTERRUPTED = 2 + #: An internal error got in the way. + INTERNAL_ERROR = 3 + #: pytest was misused. + USAGE_ERROR = 4 + #: pytest couldn't find tests. + NO_TESTS_COLLECTED = 5 + + __module__ = "pytest" + + +class ConftestImportFailure(Exception): + def __init__( + self, + path: pathlib.Path, + *, + cause: Exception, + ) -> None: + self.path = path + self.cause = cause + + def __str__(self) -> str: + return f"{type(self.cause).__name__}: {self.cause} (from {self.path})" + + +def filter_traceback_for_conftest_import_failure( + entry: _pytest._code.TracebackEntry, +) -> bool: + """Filter tracebacks entries which point to pytest internals or importlib. + + Make a special case for importlib because we use it to import test modules and conftest files + in _pytest.pathlib.import_path. + """ + return filter_traceback(entry) and "importlib" not in str(entry.path).split(os.sep) + + +def print_conftest_import_error(e: ConftestImportFailure, file: TextIO) -> None: + exc_info = ExceptionInfo.from_exception(e.cause) + tw = TerminalWriter(file) + tw.line(f"ImportError while loading conftest '{e.path}'.", red=True) + exc_info.traceback = exc_info.traceback.filter( + filter_traceback_for_conftest_import_failure + ) + exc_repr = ( + exc_info.getrepr(style="short", chain=False) + if exc_info.traceback + else exc_info.exconly() + ) + formatted_tb = str(exc_repr) + for line in formatted_tb.splitlines(): + tw.line(line.rstrip(), red=True) + + +def print_usage_error(e: UsageError, file: TextIO) -> None: + tw = TerminalWriter(file) + for msg in e.args: + tw.line(f"ERROR: {msg}\n", red=True) + + +def main( + args: list[str] | os.PathLike[str] | None = None, + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> int | ExitCode: + """Perform an in-process test run. + + :param args: + List of command line arguments. If `None` or not given, defaults to reading + arguments directly from the process command line (:data:`sys.argv`). + :param plugins: List of plugin objects to be auto-registered during initialization. + + :returns: An exit code. + """ + # Handle a single `--version` argument early to avoid starting up the entire pytest infrastructure. + new_args = sys.argv[1:] if args is None else args + if isinstance(new_args, Sequence) and new_args.count("--version") == 1: + sys.stdout.write(f"pytest {__version__}\n") + return ExitCode.OK + + old_pytest_version = os.environ.get("PYTEST_VERSION") + try: + os.environ["PYTEST_VERSION"] = __version__ + try: + config = _prepareconfig(new_args, plugins) + except ConftestImportFailure as e: + print_conftest_import_error(e, file=sys.stderr) + return ExitCode.USAGE_ERROR + + try: + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + try: + return ExitCode(ret) + except ValueError: + return ret + finally: + config._ensure_unconfigure() + except UsageError as e: + print_usage_error(e, file=sys.stderr) + return ExitCode.USAGE_ERROR + finally: + if old_pytest_version is None: + os.environ.pop("PYTEST_VERSION", None) + else: + os.environ["PYTEST_VERSION"] = old_pytest_version + + +def console_main() -> int: + """The CLI entry point of pytest. + + This function is not meant for programmable use; use `main()` instead. + """ + # https://docs.python.org/3/library/signal.html#note-on-sigpipe + try: + code = main() + sys.stdout.flush() + return code + except BrokenPipeError: + # Python flushes standard streams on exit; redirect remaining output + # to devnull to avoid another BrokenPipeError at shutdown + devnull = os.open(os.devnull, os.O_WRONLY) + os.dup2(devnull, sys.stdout.fileno()) + return 1 # Python exits with error code 1 on EPIPE + + +class cmdline: # compatibility namespace + main = staticmethod(main) + + +def filename_arg(path: str, optname: str) -> str: + """Argparse type validator for filename arguments. + + :path: Path of filename. + :optname: Name of the option. + """ + if os.path.isdir(path): + raise UsageError(f"{optname} must be a filename, given: {path}") + return path + + +def directory_arg(path: str, optname: str) -> str: + """Argparse type validator for directory arguments. + + :path: Path of directory. + :optname: Name of the option. + """ + if not os.path.isdir(path): + raise UsageError(f"{optname} must be a directory, given: {path}") + return path + + +# Plugins that cannot be disabled via "-p no:X" currently. +essential_plugins = ( + "mark", + "main", + "runner", + "fixtures", + "helpconfig", # Provides -p. +) + +default_plugins = ( + *essential_plugins, + "python", + "terminal", + "debugging", + "unittest", + "capture", + "skipping", + "legacypath", + "tmpdir", + "monkeypatch", + "recwarn", + "pastebin", + "assertion", + "junitxml", + "doctest", + "cacheprovider", + "setuponly", + "setupplan", + "stepwise", + "unraisableexception", + "threadexception", + "warnings", + "logging", + "reports", + "faulthandler", + "subtests", +) + +builtin_plugins = { + *default_plugins, + "pytester", + "pytester_assertions", + "terminalprogress", +} + + +def get_config( + args: Iterable[str] | None = None, + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> Config: + # Subsequent calls to main will create a fresh instance. + pluginmanager = PytestPluginManager() + invocation_params = Config.InvocationParams( + args=args or (), + plugins=plugins, + dir=pathlib.Path.cwd(), + ) + config = Config(pluginmanager, invocation_params=invocation_params) + + if invocation_params.args: + # Handle any "-p no:plugin" args. + pluginmanager.consider_preparse(invocation_params.args, exclude_only=True) + + for spec in default_plugins: + pluginmanager.import_plugin(spec) + + return config + + +def get_plugin_manager() -> PytestPluginManager: + """Obtain a new instance of the + :py:class:`pytest.PytestPluginManager`, with default plugins + already loaded. + + This function can be used by integration with other tools, like hooking + into pytest to run tests into an IDE. + """ + return get_config().pluginmanager + + +def _prepareconfig( + args: list[str] | os.PathLike[str], + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> Config: + if isinstance(args, os.PathLike): + args = [os.fspath(args)] + elif not isinstance(args, list): + msg = ( # type:ignore[unreachable] + "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + ) + raise TypeError(msg.format(args, type(args))) + + initial_config = get_config(args, plugins) + pluginmanager = initial_config.pluginmanager + try: + if plugins: + for plugin in plugins: + if isinstance(plugin, str): + pluginmanager.consider_pluginarg(plugin) + else: + pluginmanager.register(plugin) + config: Config = pluginmanager.hook.pytest_cmdline_parse( + pluginmanager=pluginmanager, args=args + ) + return config + except BaseException: + initial_config._ensure_unconfigure() + raise + + +def _get_directory(path: pathlib.Path) -> pathlib.Path: + """Get the directory of a path - itself if already a directory.""" + if path.is_file(): + return path.parent + else: + return path + + +def _get_legacy_hook_marks( + method: Any, + hook_type: str, + opt_names: tuple[str, ...], +) -> dict[str, bool]: + if TYPE_CHECKING: + # abuse typeguard from importlib to avoid massive method type union that's lacking an alias + assert inspect.isroutine(method) + known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} + must_warn: list[str] = [] + opts: dict[str, bool] = {} + for opt_name in opt_names: + opt_attr = getattr(method, opt_name, AttributeError) + if opt_attr is not AttributeError: + must_warn.append(f"{opt_name}={opt_attr}") + opts[opt_name] = True + elif opt_name in known_marks: + must_warn.append(f"{opt_name}=True") + opts[opt_name] = True + else: + opts[opt_name] = False + if must_warn: + hook_opts = ", ".join(must_warn) + message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( + type=hook_type, + fullname=method.__qualname__, + hook_opts=hook_opts, + ) + warn_explicit_for(cast(FunctionType, method), message) + return opts + + +@final +class PytestPluginManager(PluginManager): + """A :py:class:`pluggy.PluginManager ` with + additional pytest-specific functionality: + + * Loading plugins from the command line, ``PYTEST_PLUGINS`` env variable and + ``pytest_plugins`` global variables found in plugins being loaded. + * ``conftest.py`` loading during start-up. + """ + + def __init__(self) -> None: + from _pytest.assertion import DummyRewriteHook + from _pytest.assertion import RewriteHook + + super().__init__("pytest") + + # -- State related to local conftest plugins. + # All loaded conftest modules. + self._conftest_plugins: set[types.ModuleType] = set() + # All conftest modules applicable for a directory. + # This includes the directory's own conftest modules as well + # as those of its parent directories. + self._dirpath2confmods: dict[pathlib.Path, list[types.ModuleType]] = {} + # Cutoff directory above which conftests are no longer discovered. + self._confcutdir: pathlib.Path | None = None + # If set, conftest loading is skipped. + self._noconftest = False + + # _getconftestmodules()'s call to _get_directory() causes a stat + # storm when it's called potentially thousands of times in a test + # session (#9478), often with the same path, so cache it. + self._get_directory = lru_cache(256)(_get_directory) + + # plugins that were explicitly skipped with pytest.skip + # list of (module name, skip reason) + # previously we would issue a warning when a plugin was skipped, but + # since we refactored warnings as first citizens of Config, they are + # just stored here to be used later. + self.skipped_plugins: list[tuple[str, str]] = [] + + self.add_hookspecs(_pytest.hookspec) + self.register(self) + if os.environ.get("PYTEST_DEBUG"): + err: IO[str] = sys.stderr + encoding: str = getattr(err, "encoding", "utf8") + try: + err = open( + os.dup(err.fileno()), + mode=err.mode, + buffering=1, + encoding=encoding, + ) + except Exception: + pass + self.trace.root.setwriter(err.write) + self.enable_tracing() + + # Config._consider_importhook will set a real object if required. + self.rewrite_hook: RewriteHook = DummyRewriteHook() + # Used to know when we are importing conftests after the pytest_configure stage. + self._configured = False + + def parse_hookimpl_opts( + self, plugin: _PluggyPlugin, name: str + ) -> HookimplOpts | None: + """:meta private:""" + # pytest hooks are always prefixed with "pytest_", + # so we avoid accessing possibly non-readable attributes + # (see issue #1073). + if not name.startswith("pytest_"): + return None + # Ignore names which cannot be hooks. + if name == "pytest_plugins": + return None + + opts = super().parse_hookimpl_opts(plugin, name) + if opts is not None: + return opts + + method = getattr(plugin, name) + # Consider only actual functions for hooks (#3775). + if not inspect.isroutine(method): + return None + # Collect unmarked hooks as long as they have the `pytest_' prefix. + legacy = _get_legacy_hook_marks( + method, "impl", ("tryfirst", "trylast", "optionalhook", "hookwrapper") + ) + return cast(HookimplOpts, legacy) + + def parse_hookspec_opts(self, module_or_class, name: str) -> HookspecOpts | None: + """:meta private:""" + opts = super().parse_hookspec_opts(module_or_class, name) + if opts is None: + method = getattr(module_or_class, name) + if name.startswith("pytest_"): + legacy = _get_legacy_hook_marks( + method, "spec", ("firstresult", "historic") + ) + opts = cast(HookspecOpts, legacy) + return opts + + def register(self, plugin: _PluggyPlugin, name: str | None = None) -> str | None: + if name in _pytest.deprecated.DEPRECATED_EXTERNAL_PLUGINS: + warnings.warn( + PytestConfigWarning( + "{} plugin has been merged into the core, " + "please remove it from your requirements.".format( + name.replace("_", "-") + ) + ) + ) + return None + plugin_name = super().register(plugin, name) + if plugin_name is not None: + self.hook.pytest_plugin_registered.call_historic( + kwargs=dict( + plugin=plugin, + plugin_name=plugin_name, + manager=self, + ) + ) + + if isinstance(plugin, types.ModuleType): + self.consider_module(plugin) + return plugin_name + + def getplugin(self, name: str): + # Support deprecated naming because plugins (xdist e.g.) use it. + plugin: _PluggyPlugin | None = self.get_plugin(name) + return plugin + + def hasplugin(self, name: str) -> bool: + """Return whether a plugin with the given name is registered.""" + return bool(self.get_plugin(name)) + + def pytest_configure(self, config: Config) -> None: + """:meta private:""" + # XXX now that the pluginmanager exposes hookimpl(tryfirst...) + # we should remove tryfirst/trylast as markers. + config.addinivalue_line( + "markers", + "tryfirst: mark a hook implementation function such that the " + "plugin machinery will try to call it first/as early as possible. " + "DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead.", + ) + config.addinivalue_line( + "markers", + "trylast: mark a hook implementation function such that the " + "plugin machinery will try to call it last/as late as possible. " + "DEPRECATED, use @pytest.hookimpl(trylast=True) instead.", + ) + self._configured = True + + # + # Internal API for local conftest plugin handling. + # + def _set_initial_conftests( + self, + args: Sequence[str | pathlib.Path], + pyargs: bool, + noconftest: bool, + rootpath: pathlib.Path, + confcutdir: pathlib.Path | None, + invocation_dir: pathlib.Path, + importmode: ImportMode | str, + *, + consider_namespace_packages: bool, + ) -> None: + """Load initial conftest files given a preparsed "namespace". + + As conftest files may add their own command line options which have + arguments ('--my-opt somepath') we might get some false positives. + All builtin and 3rd party plugins will have been loaded, however, so + common options will not confuse our logic here. + """ + self._confcutdir = ( + absolutepath(invocation_dir / confcutdir) if confcutdir else None + ) + self._noconftest = noconftest + self._using_pyargs = pyargs + foundanchor = False + for initial_path in args: + path = str(initial_path) + # remove node-id syntax + i = path.find("::") + if i != -1: + path = path[:i] + anchor = absolutepath(invocation_dir / path) + + # Ensure we do not break if what appears to be an anchor + # is in fact a very long option (#10169, #11394). + if safe_exists(anchor): + self._try_load_conftest( + anchor, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + foundanchor = True + if not foundanchor: + self._try_load_conftest( + invocation_dir, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + + def _is_in_confcutdir(self, path: pathlib.Path) -> bool: + """Whether to consider the given path to load conftests from.""" + if self._confcutdir is None: + return True + # The semantics here are literally: + # Do not load a conftest if it is found upwards from confcut dir. + # But this is *not* the same as: + # Load only conftests from confcutdir or below. + # At first glance they might seem the same thing, however we do support use cases where + # we want to load conftests that are not found in confcutdir or below, but are found + # in completely different directory hierarchies like packages installed + # in out-of-source trees. + # (see #9767 for a regression where the logic was inverted). + return path not in self._confcutdir.parents + + def _try_load_conftest( + self, + anchor: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> None: + self._loadconftestmodules( + anchor, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + # let's also consider test* subdirs + if anchor.is_dir(): + for x in anchor.glob("test*"): + if x.is_dir(): + self._loadconftestmodules( + x, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + + def _loadconftestmodules( + self, + path: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> None: + if self._noconftest: + return + + directory = self._get_directory(path) + + # Optimization: avoid repeated searches in the same directory. + # Assumes always called with same importmode and rootpath. + if directory in self._dirpath2confmods: + return + + clist = [] + for parent in reversed((directory, *directory.parents)): + if self._is_in_confcutdir(parent): + conftestpath = parent / "conftest.py" + if conftestpath.is_file(): + mod = self._importconftest( + conftestpath, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + clist.append(mod) + self._dirpath2confmods[directory] = clist + + def _getconftestmodules(self, path: pathlib.Path) -> Sequence[types.ModuleType]: + directory = self._get_directory(path) + return self._dirpath2confmods.get(directory, ()) + + def _rget_with_confmod( + self, + name: str, + path: pathlib.Path, + ) -> tuple[types.ModuleType, Any]: + modules = self._getconftestmodules(path) + for mod in reversed(modules): + try: + return mod, getattr(mod, name) + except AttributeError: + continue + raise KeyError(name) + + def _importconftest( + self, + conftestpath: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> types.ModuleType: + conftestpath_plugin_name = str(conftestpath) + existing = self.get_plugin(conftestpath_plugin_name) + if existing is not None: + return cast(types.ModuleType, existing) + + # conftest.py files there are not in a Python package all have module + # name "conftest", and thus conflict with each other. Clear the existing + # before loading the new one, otherwise the existing one will be + # returned from the module cache. + pkgpath = resolve_package_path(conftestpath) + if pkgpath is None: + try: + del sys.modules[conftestpath.stem] + except KeyError: + pass + + try: + mod = import_path( + conftestpath, + mode=importmode, + root=rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + except Exception as e: + assert e.__traceback__ is not None + raise ConftestImportFailure(conftestpath, cause=e) from e + + self._check_non_top_pytest_plugins(mod, conftestpath) + + self._conftest_plugins.add(mod) + dirpath = conftestpath.parent + if dirpath in self._dirpath2confmods: + for path, mods in self._dirpath2confmods.items(): + if dirpath in path.parents or path == dirpath: + if mod in mods: + raise AssertionError( + f"While trying to load conftest path {conftestpath!s}, " + f"found that the module {mod} is already loaded with path {mod.__file__}. " + "This is not supposed to happen. Please report this issue to pytest." + ) + mods.append(mod) + self.trace(f"loading conftestmodule {mod!r}") + self.consider_conftest(mod, registration_name=conftestpath_plugin_name) + return mod + + def _check_non_top_pytest_plugins( + self, + mod: types.ModuleType, + conftestpath: pathlib.Path, + ) -> None: + if ( + hasattr(mod, "pytest_plugins") + and self._configured + and not self._using_pyargs + ): + msg = ( + "Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:\n" + "It affects the entire test suite instead of just below the conftest as expected.\n" + " {}\n" + "Please move it to a top level conftest file at the rootdir:\n" + " {}\n" + "For more information, visit:\n" + " https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files" + ) + fail(msg.format(conftestpath, self._confcutdir), pytrace=False) + + # + # API for bootstrapping plugin loading + # + # + + def consider_preparse( + self, args: Sequence[str], *, exclude_only: bool = False + ) -> None: + """:meta private:""" + i = 0 + n = len(args) + while i < n: + opt = args[i] + i += 1 + if isinstance(opt, str): + if opt == "-p": + try: + parg = args[i] + except IndexError: + return + i += 1 + elif opt.startswith("-p"): + parg = opt[2:] + else: + continue + parg = parg.strip() + if exclude_only and not parg.startswith("no:"): + continue + self.consider_pluginarg(parg) + + def consider_pluginarg(self, arg: str) -> None: + """:meta private:""" + if arg.startswith("no:"): + name = arg[3:] + if name in essential_plugins: + raise UsageError(f"plugin {name} cannot be disabled") + + if name.endswith("conftest.py"): + raise UsageError( + f"Blocking conftest files using -p is not supported: -p no:{name}\n" + "conftest.py files are not plugins and cannot be disabled via -p.\n" + ) + + # PR #4304: remove stepwise if cacheprovider is blocked. + if name == "cacheprovider": + self.set_blocked("stepwise") + self.set_blocked("pytest_stepwise") + + self.set_blocked(name) + if not name.startswith("pytest_"): + self.set_blocked("pytest_" + name) + else: + name = arg + # Unblock the plugin. + self.unblock(name) + if not name.startswith("pytest_"): + self.unblock("pytest_" + name) + self.import_plugin(arg, consider_entry_points=True) + + def consider_conftest( + self, conftestmodule: types.ModuleType, registration_name: str + ) -> None: + """:meta private:""" + self.register(conftestmodule, name=registration_name) + + def consider_env(self) -> None: + """:meta private:""" + self._import_plugin_specs(os.environ.get("PYTEST_PLUGINS")) + + def consider_module(self, mod: types.ModuleType) -> None: + """:meta private:""" + self._import_plugin_specs(getattr(mod, "pytest_plugins", [])) + + def _import_plugin_specs( + self, spec: None | types.ModuleType | str | Sequence[str] + ) -> None: + plugins = _get_plugin_specs_as_list(spec) + for import_spec in plugins: + self.import_plugin(import_spec) + + def import_plugin(self, modname: str, consider_entry_points: bool = False) -> None: + """Import a plugin with ``modname``. + + If ``consider_entry_points`` is True, entry point names are also + considered to find a plugin. + """ + # Most often modname refers to builtin modules, e.g. "pytester", + # "terminal" or "capture". Those plugins are registered under their + # basename for historic purposes but must be imported with the + # _pytest prefix. + assert isinstance(modname, str), ( + f"module name as text required, got {modname!r}" + ) + if self.is_blocked(modname) or self.get_plugin(modname) is not None: + return + + importspec = "_pytest." + modname if modname in builtin_plugins else modname + self.rewrite_hook.mark_rewrite(importspec) + + if consider_entry_points: + loaded = self.load_setuptools_entrypoints("pytest11", name=modname) + if loaded: + return + + try: + __import__(importspec) + except ImportError as e: + raise ImportError( + f'Error importing plugin "{modname}": {e.args[0]}' + ).with_traceback(e.__traceback__) from e + + except Skipped as e: + self.skipped_plugins.append((modname, e.msg or "")) + else: + mod = sys.modules[importspec] + self.register(mod, modname) + + +def _get_plugin_specs_as_list( + specs: None | types.ModuleType | str | Sequence[str], +) -> list[str]: + """Parse a plugins specification into a list of plugin names.""" + # None means empty. + if specs is None: + return [] + # Workaround for #3899 - a submodule which happens to be called "pytest_plugins". + if isinstance(specs, types.ModuleType): + return [] + # Comma-separated list. + if isinstance(specs, str): + return specs.split(",") if specs else [] + # Direct specification. + if isinstance(specs, collections.abc.Sequence): + return list(specs) + raise UsageError( + f"Plugins may be specified as a sequence or a ','-separated string of plugin names. Got: {specs!r}" + ) + + +class Notset: + def __repr__(self): + return "" + + +notset = Notset() + + +def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: + """Given an iterable of file names in a source distribution, return the "names" that should + be marked for assertion rewrite. + + For example the package "pytest_mock/__init__.py" should be added as "pytest_mock" in + the assertion rewrite mechanism. + + This function has to deal with dist-info based distributions and egg based distributions + (which are still very much in use for "editable" installs). + + Here are the file names as seen in a dist-info based distribution: + + pytest_mock/__init__.py + pytest_mock/_version.py + pytest_mock/plugin.py + pytest_mock.egg-info/PKG-INFO + + Here are the file names as seen in an egg based distribution: + + src/pytest_mock/__init__.py + src/pytest_mock/_version.py + src/pytest_mock/plugin.py + src/pytest_mock.egg-info/PKG-INFO + LICENSE + setup.py + + We have to take in account those two distribution flavors in order to determine which + names should be considered for assertion rewriting. + + More information: + https://github.com/pytest-dev/pytest-mock/issues/167 + """ + package_files = list(package_files) + seen_some = False + for fn in package_files: + is_simple_module = "/" not in fn and fn.endswith(".py") + is_package = fn.count("/") == 1 and fn.endswith("__init__.py") + if is_simple_module: + module_name, _ = os.path.splitext(fn) + # we ignore "setup.py" at the root of the distribution + # as well as editable installation finder modules made by setuptools + if module_name != "setup" and not module_name.startswith("__editable__"): + seen_some = True + yield module_name + elif is_package: + package_name = os.path.dirname(fn) + seen_some = True + yield package_name + + if not seen_some: + # At this point we did not find any packages or modules suitable for assertion + # rewriting, so we try again by stripping the first path component (to account for + # "src" based source trees for example). + # This approach lets us have the common case continue to be fast, as egg-distributions + # are rarer. + new_package_files = [] + for fn in package_files: + parts = fn.split("/") + new_fn = "/".join(parts[1:]) + if new_fn: + new_package_files.append(new_fn) + if new_package_files: + yield from _iter_rewritable_modules(new_package_files) + + +class _DeprecatedInicfgProxy(MutableMapping[str, Any]): + """Compatibility proxy for the deprecated Config.inicfg.""" + + __slots__ = ("_config",) + + def __init__(self, config: Config) -> None: + self._config = config + + def __getitem__(self, key: str) -> Any: + return self._config._inicfg[key].value + + def __setitem__(self, key: str, value: Any) -> None: + self._config._inicfg[key] = ConfigValue(value, origin="override", mode="toml") + + def __delitem__(self, key: str) -> None: + del self._config._inicfg[key] + + def __iter__(self) -> Iterator[str]: + return iter(self._config._inicfg) + + def __len__(self) -> int: + return len(self._config._inicfg) + + +@final +class Config: + """Access to configuration values, pluginmanager and plugin hooks. + + :param PytestPluginManager pluginmanager: + A pytest PluginManager. + + :param InvocationParams invocation_params: + Object containing parameters regarding the :func:`pytest.main` + invocation. + """ + + @final + @dataclasses.dataclass(frozen=True) + class InvocationParams: + """Holds parameters passed during :func:`pytest.main`. + + The object attributes are read-only. + + .. versionadded:: 5.1 + + .. note:: + + Note that the environment variable ``PYTEST_ADDOPTS`` and the ``addopts`` + configuration option are handled by pytest, not being included in the ``args`` attribute. + + Plugins accessing ``InvocationParams`` must be aware of that. + """ + + args: tuple[str, ...] + """The command-line arguments as passed to :func:`pytest.main`.""" + plugins: Sequence[str | _PluggyPlugin] | None + """Extra plugins, might be `None`.""" + dir: pathlib.Path + """The directory from which :func:`pytest.main` was invoked.""" + + def __init__( + self, + *, + args: Iterable[str], + plugins: Sequence[str | _PluggyPlugin] | None, + dir: pathlib.Path, + ) -> None: + object.__setattr__(self, "args", tuple(args)) + object.__setattr__(self, "plugins", plugins) + object.__setattr__(self, "dir", dir) + + class ArgsSource(enum.Enum): + """Indicates the source of the test arguments. + + .. versionadded:: 7.2 + """ + + #: Command line arguments. + ARGS = enum.auto() + #: Invocation directory. + INVOCATION_DIR = enum.auto() + INCOVATION_DIR = INVOCATION_DIR # backwards compatibility alias + #: 'testpaths' configuration value. + TESTPATHS = enum.auto() + + # Set by cacheprovider plugin. + cache: Cache + + def __init__( + self, + pluginmanager: PytestPluginManager, + *, + invocation_params: InvocationParams | None = None, + ) -> None: + if invocation_params is None: + invocation_params = self.InvocationParams( + args=(), plugins=None, dir=pathlib.Path.cwd() + ) + + self.option = argparse.Namespace() + """Access to command line option as attributes. + + :type: argparse.Namespace + """ + + self.invocation_params = invocation_params + """The parameters with which pytest was invoked. + + :type: InvocationParams + """ + + self._parser = Parser( + usage=f"%(prog)s [options] [{FILE_OR_DIR}] [{FILE_OR_DIR}] [...]", + processopt=self._processopt, + _ispytest=True, + ) + self.pluginmanager = pluginmanager + """The plugin manager handles plugin registration and hook invocation. + + :type: PytestPluginManager + """ + + self.stash = Stash() + """A place where plugins can store information on the config for their + own use. + + :type: Stash + """ + # Deprecated alias. Was never public. Can be removed in a few releases. + self._store = self.stash + + self.trace = self.pluginmanager.trace.root.get("config") + self.hook: pluggy.HookRelay = PathAwareHookProxy(self.pluginmanager.hook) # type: ignore[assignment] + self._inicache: dict[str, Any] = {} + self._opt2dest: dict[str, str] = {} + self._cleanup_stack = contextlib.ExitStack() + self.pluginmanager.register(self, "pytestconfig") + self._configured = False + self.hook.pytest_addoption.call_historic( + kwargs=dict(parser=self._parser, pluginmanager=self.pluginmanager) + ) + self.args_source = Config.ArgsSource.ARGS + self.args: list[str] = [] + + @property + def inicfg(self) -> _DeprecatedInicfgProxy: + return _DeprecatedInicfgProxy(self) + + @property + def rootpath(self) -> pathlib.Path: + """The path to the :ref:`rootdir `. + + .. versionadded:: 6.1 + """ + return self._rootpath + + @property + def inipath(self) -> pathlib.Path | None: + """The path to the :ref:`configfile `. + + .. versionadded:: 6.1 + """ + return self._inipath + + def add_cleanup(self, func: Callable[[], None]) -> None: + """Add a function to be called when the config object gets out of + use (usually coinciding with pytest_unconfigure). + """ + self._cleanup_stack.callback(func) + + def _do_configure(self) -> None: + assert not self._configured + self._configured = True + self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) + + def _ensure_unconfigure(self) -> None: + try: + if self._configured: + self._configured = False + try: + self.hook.pytest_unconfigure(config=self) + finally: + self.hook.pytest_configure._call_history = [] + finally: + try: + self._cleanup_stack.close() + finally: + self._cleanup_stack = contextlib.ExitStack() + + def get_terminal_writer(self) -> TerminalWriter: + terminalreporter: TerminalReporter | None = self.pluginmanager.get_plugin( + "terminalreporter" + ) + assert terminalreporter is not None + return terminalreporter._tw + + def pytest_cmdline_parse( + self, pluginmanager: PytestPluginManager, args: list[str] + ) -> Config: + try: + self.parse(args) + except UsageError: + # Handle `--version --version` and `--help` here in a minimal fashion. + # This gets done via helpconfig normally, but its + # pytest_cmdline_main is not called in case of errors. + if getattr(self.option, "version", False) or "--version" in args: + from _pytest.helpconfig import show_version_verbose + + # Note that `--version` (single argument) is handled early by `Config.main()`, so the only + # way we are reaching this point is via `--version --version`. + show_version_verbose(self) + elif ( + getattr(self.option, "help", False) or "--help" in args or "-h" in args + ): + self._parser.optparser.print_help() + sys.stdout.write( + "\nNOTE: displaying only minimal help due to UsageError.\n\n" + ) + + raise + + return self + + def notify_exception( + self, + excinfo: ExceptionInfo[BaseException], + option: argparse.Namespace | None = None, + ) -> None: + if option and getattr(option, "fulltrace", False): + style: TracebackStyle = "long" + else: + style = "native" + excrepr = excinfo.getrepr( + funcargs=True, showlocals=getattr(option, "showlocals", False), style=style + ) + res = self.hook.pytest_internalerror(excrepr=excrepr, excinfo=excinfo) + if not any(res): + for line in str(excrepr).split("\n"): + sys.stderr.write(f"INTERNALERROR> {line}\n") + sys.stderr.flush() + + def cwd_relative_nodeid(self, nodeid: str) -> str: + # nodeid's are relative to the rootpath, compute relative to cwd. + if self.invocation_params.dir != self.rootpath: + base_path_part, *nodeid_part = nodeid.split("::") + # Only process path part + fullpath = self.rootpath / base_path_part + relative_path = bestrelpath(self.invocation_params.dir, fullpath) + + nodeid = "::".join([relative_path, *nodeid_part]) + return nodeid + + @classmethod + def fromdictargs(cls, option_dict: Mapping[str, Any], args: list[str]) -> Config: + """Constructor usable for subprocesses.""" + config = get_config(args) + config.option.__dict__.update(option_dict) + config.parse(args, addopts=False) + for x in config.option.plugins: + config.pluginmanager.consider_pluginarg(x) + return config + + def _processopt(self, opt: Argument) -> None: + for name in opt._short_opts + opt._long_opts: + self._opt2dest[name] = opt.dest + + if hasattr(opt, "default"): + if not hasattr(self.option, opt.dest): + setattr(self.option, opt.dest, opt.default) + + @hookimpl(trylast=True) + def pytest_load_initial_conftests(self, early_config: Config) -> None: + # We haven't fully parsed the command line arguments yet, so + # early_config.args it not set yet. But we need it for + # discovering the initial conftests. So "pre-run" the logic here. + # It will be done for real in `parse()`. + args, _args_source = early_config._decide_args( + args=early_config.known_args_namespace.file_or_dir, + pyargs=early_config.known_args_namespace.pyargs, + testpaths=early_config.getini("testpaths"), + invocation_dir=early_config.invocation_params.dir, + rootpath=early_config.rootpath, + warn=False, + ) + self.pluginmanager._set_initial_conftests( + args=args, + pyargs=early_config.known_args_namespace.pyargs, + noconftest=early_config.known_args_namespace.noconftest, + rootpath=early_config.rootpath, + confcutdir=early_config.known_args_namespace.confcutdir, + invocation_dir=early_config.invocation_params.dir, + importmode=early_config.known_args_namespace.importmode, + consider_namespace_packages=early_config.getini( + "consider_namespace_packages" + ), + ) + + def _consider_importhook(self) -> None: + """Install the PEP 302 import hook if using assertion rewriting. + + Needs to parse the --assert= option from the commandline + and find all the installed plugins to mark them for rewriting + by the importhook. + """ + mode = getattr(self.known_args_namespace, "assertmode", "plain") + + disable_autoload = getattr( + self.known_args_namespace, "disable_plugin_autoload", False + ) or bool(os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD")) + if mode == "rewrite": + import _pytest.assertion + + try: + hook = _pytest.assertion.install_importhook(self) + except SystemError: + mode = "plain" + else: + self._mark_plugins_for_rewrite(hook, disable_autoload) + self._warn_about_missing_assertion(mode) + + def _mark_plugins_for_rewrite( + self, hook: AssertionRewritingHook, disable_autoload: bool + ) -> None: + """Given an importhook, mark for rewrite any top-level + modules or packages in the distribution package for + all pytest plugins.""" + self.pluginmanager.rewrite_hook = hook + + if disable_autoload: + # We don't autoload from distribution package entry points, + # no need to continue. + return + + package_files = ( + str(file) + for dist in importlib.metadata.distributions() + if any(ep.group == "pytest11" for ep in dist.entry_points) + for file in dist.files or [] + ) + + for name in _iter_rewritable_modules(package_files): + hook.mark_rewrite(name) + + def _configure_python_path(self) -> None: + # `pythonpath = a b` will set `sys.path` to `[a, b, x, y, z, ...]` + for path in reversed(self.getini("pythonpath")): + sys.path.insert(0, str(path)) + self.add_cleanup(self._unconfigure_python_path) + + def _unconfigure_python_path(self) -> None: + for path in self.getini("pythonpath"): + path_str = str(path) + if path_str in sys.path: + sys.path.remove(path_str) + + def _validate_args(self, args: list[str], via: str) -> list[str]: + """Validate known args.""" + self._parser.extra_info["config source"] = via + try: + self._parser.parse_known_and_unknown_args( + args, namespace=copy.copy(self.option) + ) + finally: + self._parser.extra_info.pop("config source", None) + + return args + + def _decide_args( + self, + *, + args: list[str], + pyargs: bool, + testpaths: list[str], + invocation_dir: pathlib.Path, + rootpath: pathlib.Path, + warn: bool, + ) -> tuple[list[str], ArgsSource]: + """Decide the args (initial paths/nodeids) to use given the relevant inputs. + + :param warn: Whether can issue warnings. + + :returns: The args and the args source. Guaranteed to be non-empty. + """ + if args: + source = Config.ArgsSource.ARGS + result = args + else: + if invocation_dir == rootpath: + source = Config.ArgsSource.TESTPATHS + if pyargs: + result = testpaths + else: + result = [] + for path in testpaths: + result.extend(sorted(glob.iglob(path, recursive=True))) + if testpaths and not result: + if warn: + warning_text = ( + "No files were found in testpaths; " + "consider removing or adjusting your testpaths configuration. " + "Searching recursively from the current directory instead." + ) + self.issue_config_time_warning( + PytestConfigWarning(warning_text), stacklevel=3 + ) + else: + result = [] + if not result: + source = Config.ArgsSource.INVOCATION_DIR + result = [str(invocation_dir)] + return result, source + + @hookimpl(wrapper=True) + def pytest_collection(self) -> Generator[None, object, object]: + # Validate invalid configuration keys after collection is done so we + # take in account options added by late-loading conftest files. + try: + return (yield) + finally: + self._validate_config_options() + + def _checkversion(self) -> None: + import pytest + + minver_ini_value = self._inicfg.get("minversion", None) + minver = minver_ini_value.value if minver_ini_value is not None else None + if minver: + # Imported lazily to improve start-up time. + from packaging.version import Version + + if not isinstance(minver, str): + raise pytest.UsageError( + f"{self.inipath}: 'minversion' must be a single value" + ) + + if Version(minver) > Version(pytest.__version__): + raise pytest.UsageError( + f"{self.inipath}: 'minversion' requires pytest-{minver}, actual pytest-{pytest.__version__}'" + ) + + def _validate_config_options(self) -> None: + for key in sorted(self._get_unknown_ini_keys()): + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + + def _validate_plugins(self) -> None: + required_plugins = sorted(self.getini("required_plugins")) + if not required_plugins: + return + + # Imported lazily to improve start-up time. + from packaging.requirements import InvalidRequirement + from packaging.requirements import Requirement + from packaging.version import Version + + plugin_info = self.pluginmanager.list_plugin_distinfo() + plugin_dist_info = {dist.project_name: dist.version for _, dist in plugin_info} + + missing_plugins = [] + for required_plugin in required_plugins: + try: + req = Requirement(required_plugin) + except InvalidRequirement: + missing_plugins.append(required_plugin) + continue + + if req.name not in plugin_dist_info: + missing_plugins.append(required_plugin) + elif not req.specifier.contains( + Version(plugin_dist_info[req.name]), prereleases=True + ): + missing_plugins.append(required_plugin) + + if missing_plugins: + raise UsageError( + "Missing required plugins: {}".format(", ".join(missing_plugins)), + ) + + def _warn_or_fail_if_strict(self, message: str) -> None: + strict_config = self.getini("strict_config") + if strict_config is None: + strict_config = self.getini("strict") + if strict_config: + raise UsageError(message) + + self.issue_config_time_warning(PytestConfigWarning(message), stacklevel=3) + + def _get_unknown_ini_keys(self) -> set[str]: + known_keys = self._parser._inidict.keys() | self._parser._ini_aliases.keys() + return self._inicfg.keys() - known_keys + + def parse(self, args: list[str], addopts: bool = True) -> None: + # Parse given cmdline arguments into this config object. + assert self.args == [], ( + "can only parse cmdline args at most once per Config object" + ) + + self.hook.pytest_addhooks.call_historic( + kwargs=dict(pluginmanager=self.pluginmanager) + ) + + if addopts: + env_addopts = os.environ.get("PYTEST_ADDOPTS", "") + if len(env_addopts): + args[:] = ( + self._validate_args(shlex.split(env_addopts), "via PYTEST_ADDOPTS") + + args + ) + + ns = self._parser.parse_known_args(args, namespace=copy.copy(self.option)) + rootpath, inipath, inicfg, ignored_config_files = determine_setup( + inifile=ns.inifilename, + override_ini=ns.override_ini, + args=ns.file_or_dir, + rootdir_cmd_arg=ns.rootdir or None, + invocation_dir=self.invocation_params.dir, + ) + self._rootpath = rootpath + self._inipath = inipath + self._ignored_config_files = ignored_config_files + self._inicfg = inicfg + self._parser.extra_info["rootdir"] = str(self.rootpath) + self._parser.extra_info["inifile"] = str(self.inipath) + + self._parser.addini("addopts", "Extra command line options", "args") + self._parser.addini("minversion", "Minimally required pytest version") + self._parser.addini( + "pythonpath", type="paths", help="Add paths to sys.path", default=[] + ) + self._parser.addini( + "required_plugins", + "Plugins that must be present for pytest to run", + type="args", + default=[], + ) + + if addopts: + args[:] = ( + self._validate_args(self.getini("addopts"), "via addopts config") + args + ) + + self.known_args_namespace = self._parser.parse_known_args( + args, namespace=copy.copy(self.option) + ) + self._checkversion() + self._consider_importhook() + self._configure_python_path() + self.pluginmanager.consider_preparse(args, exclude_only=False) + if ( + not os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD") + and not self.known_args_namespace.disable_plugin_autoload + ): + # Autoloading from distribution package entry point has + # not been disabled. + self.pluginmanager.load_setuptools_entrypoints("pytest11") + # Otherwise only plugins explicitly specified in PYTEST_PLUGINS + # are going to be loaded. + self.pluginmanager.consider_env() + + self._parser.parse_known_args(args, namespace=self.known_args_namespace) + + self._validate_plugins() + self._warn_about_skipped_plugins() + + if self.known_args_namespace.confcutdir is None: + if self.inipath is not None: + confcutdir = str(self.inipath.parent) + else: + confcutdir = str(self.rootpath) + self.known_args_namespace.confcutdir = confcutdir + try: + self.hook.pytest_load_initial_conftests( + early_config=self, args=args, parser=self._parser + ) + except ConftestImportFailure as e: + if self.known_args_namespace.help or self.known_args_namespace.version: + # we don't want to prevent --help/--version to work + # so just let it pass and print a warning at the end + self.issue_config_time_warning( + PytestConfigWarning(f"could not load initial conftests: {e.path}"), + stacklevel=2, + ) + else: + raise + + try: + self._parser.parse(args, namespace=self.option) + except PrintHelp: + return + + self.args, self.args_source = self._decide_args( + args=getattr(self.option, FILE_OR_DIR), + pyargs=self.option.pyargs, + testpaths=self.getini("testpaths"), + invocation_dir=self.invocation_params.dir, + rootpath=self.rootpath, + warn=True, + ) + + def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None: + """Issue and handle a warning during the "configure" stage. + + During ``pytest_configure`` we can't capture warnings using the ``catch_warnings_for_item`` + function because it is not possible to have hook wrappers around ``pytest_configure``. + + This function is mainly intended for plugins that need to issue warnings during + ``pytest_configure`` (or similar stages). + + :param warning: The warning instance. + :param stacklevel: stacklevel forwarded to warnings.warn. + """ + if self.pluginmanager.is_blocked("warnings"): + return + + cmdline_filters = self.known_args_namespace.pythonwarnings or [] + config_filters = self.getini("filterwarnings") + + with warnings.catch_warnings(record=True) as records: + warnings.simplefilter("always", type(warning)) + apply_warning_filters(config_filters, cmdline_filters) + warnings.warn(warning, stacklevel=stacklevel) + + if records: + frame = sys._getframe(stacklevel - 1) + location = frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name + self.hook.pytest_warning_recorded.call_historic( + kwargs=dict( + warning_message=records[0], + when="config", + nodeid="", + location=location, + ) + ) + + def addinivalue_line(self, name: str, line: str) -> None: + """Add a line to a configuration option. The option must have been + declared but might not yet be set in which case the line becomes + the first line in its value.""" + x = self.getini(name) + assert isinstance(x, list) + x.append(line) # modifies the cached list inline + + def getini(self, name: str) -> Any: + """Return configuration value the an :ref:`configuration file `. + + If a configuration value is not defined in a + :ref:`configuration file `, then the ``default`` value + provided while registering the configuration through + :func:`parser.addini ` will be returned. + Please note that you can even provide ``None`` as a valid + default value. + + If ``default`` is not provided while registering using + :func:`parser.addini `, then a default value + based on the ``type`` parameter passed to + :func:`parser.addini ` will be returned. + The default values based on ``type`` are: + ``paths``, ``pathlist``, ``args`` and ``linelist`` : empty list ``[]`` + ``bool`` : ``False`` + ``string`` : empty string ``""`` + ``int`` : ``0`` + ``float`` : ``0.0`` + + If neither the ``default`` nor the ``type`` parameter is passed + while registering the configuration through + :func:`parser.addini `, then the configuration + is treated as a string and a default empty string '' is returned. + + If the specified name hasn't been registered through a prior + :func:`parser.addini ` call (usually from a + plugin), a ValueError is raised. + """ + canonical_name = self._parser._ini_aliases.get(name, name) + try: + return self._inicache[canonical_name] + except KeyError: + pass + self._inicache[canonical_name] = val = self._getini(canonical_name) + return val + + # Meant for easy monkeypatching by legacypath plugin. + # Can be inlined back (with no cover removed) once legacypath is gone. + def _getini_unknown_type(self, name: str, type: str, value: object): + msg = ( + f"Option {name} has unknown configuration type {type} with value {value!r}" + ) + raise ValueError(msg) # pragma: no cover + + def _getini(self, name: str): + # If this is an alias, resolve to canonical name. + canonical_name = self._parser._ini_aliases.get(name, name) + + try: + _description, type, default = self._parser._inidict[canonical_name] + except KeyError as e: + raise ValueError(f"unknown configuration value: {name!r}") from e + + # Collect all possible values (canonical name + aliases) from _inicfg. + # Each candidate is (ConfigValue, is_canonical). + candidates = [] + if canonical_name in self._inicfg: + candidates.append((self._inicfg[canonical_name], True)) + for alias, target in self._parser._ini_aliases.items(): + if target == canonical_name and alias in self._inicfg: + candidates.append((self._inicfg[alias], False)) + + if not candidates: + return default + + # Pick the best candidate based on precedence: + # 1. CLI override takes precedence over file, then + # 2. Canonical name takes precedence over alias. + selected = max(candidates, key=lambda x: (x[0].origin == "override", x[1]))[0] + value = selected.value + mode = selected.mode + + if mode == "ini": + # In ini mode, values are always str | list[str]. + assert isinstance(value, (str, list)) + return self._getini_ini(name, canonical_name, type, value, default) + elif mode == "toml": + return self._getini_toml(name, canonical_name, type, value, default) + else: + assert_never(mode) + + def _getini_ini( + self, + name: str, + canonical_name: str, + type: str, + value: str | list[str], + default: Any, + ): + """Handle config values read in INI mode. + + In INI mode, values are stored as str or list[str] only, and coerced + from string based on the registered type. + """ + # Note: some coercions are only required if we are reading from .ini + # files, because the file format doesn't contain type information, but + # when reading from toml (in ini mode) we will get either str or list of + # str values (see load_config_dict_from_file). For example: + # + # ini: + # a_line_list = "tests acceptance" + # + # in this case, we need to split the string to obtain a list of strings. + # + # toml (ini mode): + # a_line_list = ["tests", "acceptance"] + # + # in this case, we already have a list ready to use. + if type == "paths": + dp = ( + self.inipath.parent + if self.inipath is not None + else self.invocation_params.dir + ) + input_values = shlex.split(value) if isinstance(value, str) else value + return [dp / x for x in input_values] + elif type == "args": + return shlex.split(value) if isinstance(value, str) else value + elif type == "linelist": + if isinstance(value, str): + return [t for t in map(lambda x: x.strip(), value.split("\n")) if t] + else: + return value + elif type == "bool": + return _strtobool(str(value).strip()) + elif type == "string": + return value + elif type == "int": + if not isinstance(value, str): + raise TypeError( + f"Expected an int string for option {name} of type integer, but got: {value!r}" + ) from None + return int(value) + elif type == "float": + if not isinstance(value, str): + raise TypeError( + f"Expected a float string for option {name} of type float, but got: {value!r}" + ) from None + return float(value) + else: + return self._getini_unknown_type(name, type, value) + + def _getini_toml( + self, + name: str, + canonical_name: str, + type: str, + value: object, + default: Any, + ): + """Handle TOML config values with strict type validation and no coercion. + + In TOML mode, values already have native types from TOML parsing. + We validate types match expectations exactly, including list items. + """ + value_type = builtins.type(value).__name__ + if type == "paths": + # Expect a list of strings. + if not isinstance(value, list): + raise TypeError( + f"{self.inipath}: config option '{name}' expects a list for type 'paths', " + f"got {value_type}: {value!r}" + ) + for i, item in enumerate(value): + if not isinstance(item, str): + item_type = builtins.type(item).__name__ + raise TypeError( + f"{self.inipath}: config option '{name}' expects a list of strings, " + f"but item at index {i} is {item_type}: {item!r}" + ) + dp = ( + self.inipath.parent + if self.inipath is not None + else self.invocation_params.dir + ) + return [dp / x for x in value] + elif type in {"args", "linelist"}: + # Expect a list of strings. + if not isinstance(value, list): + raise TypeError( + f"{self.inipath}: config option '{name}' expects a list for type '{type}', " + f"got {value_type}: {value!r}" + ) + for i, item in enumerate(value): + if not isinstance(item, str): + item_type = builtins.type(item).__name__ + raise TypeError( + f"{self.inipath}: config option '{name}' expects a list of strings, " + f"but item at index {i} is {item_type}: {item!r}" + ) + return list(value) + elif type == "bool": + # Expect a boolean. + if not isinstance(value, bool): + raise TypeError( + f"{self.inipath}: config option '{name}' expects a bool, " + f"got {value_type}: {value!r}" + ) + return value + elif type == "int": + # Expect an integer (but not bool, which is a subclass of int). + if not isinstance(value, int) or isinstance(value, bool): + raise TypeError( + f"{self.inipath}: config option '{name}' expects an int, " + f"got {value_type}: {value!r}" + ) + return value + elif type == "float": + # Expect a float or integer only. + if not isinstance(value, (float, int)) or isinstance(value, bool): + raise TypeError( + f"{self.inipath}: config option '{name}' expects a float, " + f"got {value_type}: {value!r}" + ) + return value + elif type == "string": + # Expect a string. + if not isinstance(value, str): + raise TypeError( + f"{self.inipath}: config option '{name}' expects a string, " + f"got {value_type}: {value!r}" + ) + return value + else: + return self._getini_unknown_type(name, type, value) + + def _getconftest_pathlist( + self, name: str, path: pathlib.Path + ) -> list[pathlib.Path] | None: + try: + mod, relroots = self.pluginmanager._rget_with_confmod(name, path) + except KeyError: + return None + assert mod.__file__ is not None + modpath = pathlib.Path(mod.__file__).parent + values: list[pathlib.Path] = [] + for relroot in relroots: + if isinstance(relroot, os.PathLike): + relroot = pathlib.Path(relroot) + else: + relroot = relroot.replace("/", os.sep) + relroot = absolutepath(modpath / relroot) + values.append(relroot) + return values + + def getoption(self, name: str, default: Any = notset, skip: bool = False): + """Return command line option value. + + :param name: Name of the option. You may also specify + the literal ``--OPT`` option instead of the "dest" option name. + :param default: Fallback value if no option of that name is **declared** via :hook:`pytest_addoption`. + Note this parameter will be ignored when the option is **declared** even if the option's value is ``None``. + :param skip: If ``True``, raise :func:`pytest.skip` if option is undeclared or has a ``None`` value. + Note that even if ``True``, if a default was specified it will be returned instead of a skip. + """ + name = self._opt2dest.get(name, name) + try: + val = getattr(self.option, name) + if val is None and skip: + raise AttributeError(name) + return val + except AttributeError as e: + if default is not notset: + return default + if skip: + import pytest + + pytest.skip(f"no {name!r} option found") + raise ValueError(f"no option named {name!r}") from e + + def getvalue(self, name: str, path=None): + """Deprecated, use getoption() instead.""" + return self.getoption(name) + + def getvalueorskip(self, name: str, path=None): + """Deprecated, use getoption(skip=True) instead.""" + return self.getoption(name, skip=True) + + #: Verbosity type for failed assertions (see :confval:`verbosity_assertions`). + VERBOSITY_ASSERTIONS: Final = "assertions" + #: Verbosity type for test case execution (see :confval:`verbosity_test_cases`). + VERBOSITY_TEST_CASES: Final = "test_cases" + #: Verbosity type for failed subtests (see :confval:`verbosity_subtests`). + VERBOSITY_SUBTESTS: Final = "subtests" + + _VERBOSITY_INI_DEFAULT: Final = "auto" + + def get_verbosity(self, verbosity_type: str | None = None) -> int: + r"""Retrieve the verbosity level for a fine-grained verbosity type. + + :param verbosity_type: Verbosity type to get level for. If a level is + configured for the given type, that value will be returned. If the + given type is not a known verbosity type, the global verbosity + level will be returned. If the given type is None (default), the + global verbosity level will be returned. + + To configure a level for a fine-grained verbosity type, the + configuration file should have a setting for the configuration name + and a numeric value for the verbosity level. A special value of "auto" + can be used to explicitly use the global verbosity level. + + Example: + + .. tab:: toml + + .. code-block:: toml + + [tool.pytest] + verbosity_assertions = 2 + + .. tab:: ini + + .. code-block:: ini + + [pytest] + verbosity_assertions = 2 + + .. code-block:: console + + pytest -v + + .. code-block:: python + + print(config.get_verbosity()) # 1 + print(config.get_verbosity(Config.VERBOSITY_ASSERTIONS)) # 2 + """ + global_level = self.getoption("verbose", default=0) + assert isinstance(global_level, int) + if verbosity_type is None: + return global_level + + ini_name = Config._verbosity_ini_name(verbosity_type) + if ini_name not in self._parser._inidict: + return global_level + + level = self.getini(ini_name) + if level == Config._VERBOSITY_INI_DEFAULT: + return global_level + + return int(level) + + @staticmethod + def _verbosity_ini_name(verbosity_type: str) -> str: + return f"verbosity_{verbosity_type}" + + @staticmethod + def _add_verbosity_ini(parser: Parser, verbosity_type: str, help: str) -> None: + """Add a output verbosity configuration option for the given output type. + + :param parser: Parser for command line arguments and config-file values. + :param verbosity_type: Fine-grained verbosity category. + :param help: Description of the output this type controls. + + The value should be retrieved via a call to + :py:func:`config.get_verbosity(type) `. + """ + parser.addini( + Config._verbosity_ini_name(verbosity_type), + help=help, + type="string", + default=Config._VERBOSITY_INI_DEFAULT, + ) + + def _warn_about_missing_assertion(self, mode: str) -> None: + if not _assertion_supported(): + if mode == "plain": + warning_text = ( + "ASSERTIONS ARE NOT EXECUTED" + " and FAILING TESTS WILL PASS. Are you" + " using python -O?" + ) + else: + warning_text = ( + "assertions not in test modules or" + " plugins will be ignored" + " because assert statements are not executed " + "by the underlying Python interpreter " + "(are you using python -O?)\n" + ) + self.issue_config_time_warning( + PytestConfigWarning(warning_text), + stacklevel=3, + ) + + def _warn_about_skipped_plugins(self) -> None: + for module_name, msg in self.pluginmanager.skipped_plugins: + self.issue_config_time_warning( + PytestConfigWarning(f"skipped plugin {module_name!r}: {msg}"), + stacklevel=2, + ) + + +def _assertion_supported() -> bool: + try: + assert False + except AssertionError: + return True + else: + return False # type: ignore[unreachable] + + +def create_terminal_writer( + config: Config, file: TextIO | None = None +) -> TerminalWriter: + """Create a TerminalWriter instance configured according to the options + in the config object. + + Every code which requires a TerminalWriter object and has access to a + config object should use this function. + """ + tw = TerminalWriter(file=file) + + if config.option.color == "yes": + tw.hasmarkup = True + elif config.option.color == "no": + tw.hasmarkup = False + + if config.option.code_highlight == "yes": + tw.code_highlight = True + elif config.option.code_highlight == "no": + tw.code_highlight = False + + return tw + + +def _strtobool(val: str) -> bool: + """Convert a string representation of truth to True or False. + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + + .. note:: Copied from distutils.util. + """ + val = val.lower() + if val in ("y", "yes", "t", "true", "on", "1"): + return True + elif val in ("n", "no", "f", "false", "off", "0"): + return False + else: + raise ValueError(f"invalid truth value {val!r}") + + +@lru_cache(maxsize=50) +def parse_warning_filter( + arg: str, *, escape: bool +) -> tuple[warnings._ActionKind, str, type[Warning], str, int]: + """Parse a warnings filter string. + + This is copied from warnings._setoption with the following changes: + + * Does not apply the filter. + * Escaping is optional. + * Raises UsageError so we get nice error messages on failure. + """ + __tracebackhide__ = True + error_template = dedent( + f"""\ + while parsing the following warning configuration: + + {arg} + + This error occurred: + + {{error}} + """ + ) + + parts = arg.split(":") + if len(parts) > 5: + doc_url = ( + "https://docs.python.org/3/library/warnings.html#describing-warning-filters" + ) + error = dedent( + f"""\ + Too many fields ({len(parts)}), expected at most 5 separated by colons: + + action:message:category:module:line + + For more information please consult: {doc_url} + """ + ) + raise UsageError(error_template.format(error=error)) + + while len(parts) < 5: + parts.append("") + action_, message, category_, module, lineno_ = (s.strip() for s in parts) + try: + action: warnings._ActionKind = warnings._getaction(action_) # type: ignore[attr-defined] + except warnings._OptionError as e: + raise UsageError(error_template.format(error=str(e))) from None + try: + category: type[Warning] = _resolve_warning_category(category_) + except ImportError: + raise + except Exception: + exc_info = ExceptionInfo.from_current() + exception_text = exc_info.getrepr(style="native") + raise UsageError(error_template.format(error=exception_text)) from None + if message and escape: + message = re.escape(message) + if module and escape: + module = re.escape(module) + r"\Z" + if lineno_: + try: + lineno = int(lineno_) + if lineno < 0: + raise ValueError("number is negative") + except ValueError as e: + raise UsageError( + error_template.format(error=f"invalid lineno {lineno_!r}: {e}") + ) from None + else: + lineno = 0 + try: + re.compile(message) + re.compile(module) + except re.error as e: + raise UsageError( + error_template.format(error=f"Invalid regex {e.pattern!r}: {e}") + ) from None + return action, message, category, module, lineno + + +def _resolve_warning_category(category: str) -> type[Warning]: + """ + Copied from warnings._getcategory, but changed so it lets exceptions (specially ImportErrors) + propagate so we can get access to their tracebacks (#9218). + """ + __tracebackhide__ = True + if not category: + return Warning + + if "." not in category: + import builtins as m + + klass = category + else: + module, _, klass = category.rpartition(".") + m = __import__(module, None, None, [klass]) + cat = getattr(m, klass) + if not issubclass(cat, Warning): + raise UsageError(f"{cat} is not a Warning subclass") + return cast(type[Warning], cat) + + +def apply_warning_filters( + config_filters: Iterable[str], cmdline_filters: Iterable[str] +) -> None: + """Applies pytest-configured filters to the warnings module""" + # Filters should have this precedence: cmdline options, config. + # Filters should be applied in the inverse order of precedence. + for arg in config_filters: + try: + warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + except ImportError as e: + warnings.warn( + f"Failed to import filter module '{e.name}': {arg}", PytestConfigWarning + ) + continue + + for arg in cmdline_filters: + try: + warnings.filterwarnings(*parse_warning_filter(arg, escape=True)) + except ImportError as e: + warnings.warn( + f"Failed to import filter module '{e.name}': {arg}", PytestConfigWarning + ) + continue diff --git a/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/argparsing.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/argparsing.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8eb1b2e379e2f12e334e7a2eb346dff8e676a0c5 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/argparsing.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/compat.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/compat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1705a68fe8138b77202cc2c8e5e6c166b001d37 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/compat.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/exceptions.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..627a81b30a4388b8d36380ee5ccdac35225b1556 Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/exceptions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/findpaths.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/findpaths.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fa0f2896c89213aa2ae0a1d516c9cad38675c7e Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/config/__pycache__/findpaths.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/config/argparsing.py b/micromamba_root/Lib/site-packages/_pytest/config/argparsing.py new file mode 100644 index 0000000000000000000000000000000000000000..8216ad8b226a5fc086d68a0022413036dbb64b9a --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/config/argparsing.py @@ -0,0 +1,578 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import argparse +from collections.abc import Callable +from collections.abc import Mapping +from collections.abc import Sequence +import os +import sys +from typing import Any +from typing import final +from typing import Literal +from typing import NoReturn + +from .exceptions import UsageError +import _pytest._io +from _pytest.deprecated import check_ispytest + + +FILE_OR_DIR = "file_or_dir" + + +class NotSet: + def __repr__(self) -> str: + return "" + + +NOT_SET = NotSet() + + +@final +class Parser: + """Parser for command line arguments and config-file values. + + :ivar extra_info: Dict of generic param -> value to display in case + there's an error processing the command line arguments. + """ + + def __init__( + self, + usage: str | None = None, + processopt: Callable[[Argument], None] | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + + from _pytest._argcomplete import filescompleter + + self._processopt = processopt + self.extra_info: dict[str, Any] = {} + self.optparser = PytestArgumentParser(self, usage, self.extra_info) + anonymous_arggroup = self.optparser.add_argument_group("Custom options") + self._anonymous = OptionGroup( + anonymous_arggroup, "_anonymous", self, _ispytest=True + ) + self._groups = [self._anonymous] + file_or_dir_arg = self.optparser.add_argument(FILE_OR_DIR, nargs="*") + file_or_dir_arg.completer = filescompleter # type: ignore + + self._inidict: dict[str, tuple[str, str, Any]] = {} + # Maps alias -> canonical name. + self._ini_aliases: dict[str, str] = {} + + @property + def prog(self) -> str: + return self.optparser.prog + + @prog.setter + def prog(self, value: str) -> None: + self.optparser.prog = value + + def processoption(self, option: Argument) -> None: + if self._processopt: + if option.dest: + self._processopt(option) + + def getgroup( + self, name: str, description: str = "", after: str | None = None + ) -> OptionGroup: + """Get (or create) a named option Group. + + :param name: Name of the option group. + :param description: Long description for --help output. + :param after: Name of another group, used for ordering --help output. + :returns: The option group. + + The returned group object has an ``addoption`` method with the same + signature as :func:`parser.addoption ` but + will be shown in the respective group in the output of + ``pytest --help``. + """ + for group in self._groups: + if group.name == name: + return group + + arggroup = self.optparser.add_argument_group(description or name) + group = OptionGroup(arggroup, name, self, _ispytest=True) + i = 0 + for i, grp in enumerate(self._groups): + if grp.name == after: + break + self._groups.insert(i + 1, group) + # argparse doesn't provide a way to control `--help` order, so must + # access its internals ☹. + self.optparser._action_groups.insert(i + 1, self.optparser._action_groups.pop()) + return group + + def addoption(self, *opts: str, **attrs: Any) -> None: + """Register a command line option. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :meth:`add_argument() + ` function accepts. + + After command line parsing, options are available on the pytest config + object via ``config.option.NAME`` where ``NAME`` is usually set + by passing a ``dest`` attribute, for example + ``addoption("--long", dest="NAME", ...)``. + """ + self._anonymous.addoption(*opts, **attrs) + + def parse( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> argparse.Namespace: + """Parse the arguments. + + Unlike ``parse_known_args`` and ``parse_known_and_unknown_args``, + raises PrintHelp on `--help` and UsageError on unknown flags + + :meta private: + """ + from _pytest._argcomplete import try_argcomplete + + try_argcomplete(self.optparser) + strargs = [os.fspath(x) for x in args] + if namespace is None: + namespace = argparse.Namespace() + try: + namespace._raise_print_help = True + return self.optparser.parse_intermixed_args(strargs, namespace=namespace) + finally: + del namespace._raise_print_help + + def parse_known_args( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> argparse.Namespace: + """Parse the known arguments at this point. + + :returns: An argparse namespace object. + """ + return self.parse_known_and_unknown_args(args, namespace=namespace)[0] + + def parse_known_and_unknown_args( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> tuple[argparse.Namespace, list[str]]: + """Parse the known arguments at this point, and also return the + remaining unknown flag arguments. + + :returns: + A tuple containing an argparse namespace object for the known + arguments, and a list of unknown flag arguments. + """ + strargs = [os.fspath(x) for x in args] + if sys.version_info < (3, 12, 8) or (3, 13) <= sys.version_info < (3, 13, 1): + # Older argparse have a bugged parse_known_intermixed_args. + namespace, unknown = self.optparser.parse_known_args(strargs, namespace) + assert namespace is not None + file_or_dir = getattr(namespace, FILE_OR_DIR) + unknown_flags: list[str] = [] + for arg in unknown: + (unknown_flags if arg.startswith("-") else file_or_dir).append(arg) + return namespace, unknown_flags + else: + return self.optparser.parse_known_intermixed_args(strargs, namespace) + + def addini( + self, + name: str, + help: str, + type: Literal[ + "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" + ] + | None = None, + default: Any = NOT_SET, + *, + aliases: Sequence[str] = (), + ) -> None: + """Register a configuration file option. + + :param name: + Name of the configuration. + :param type: + Type of the configuration. Can be: + + * ``string``: a string + * ``bool``: a boolean + * ``args``: a list of strings, separated as in a shell + * ``linelist``: a list of strings, separated by line breaks + * ``paths``: a list of :class:`pathlib.Path`, separated as in a shell + * ``pathlist``: a list of ``py.path``, separated as in a shell + * ``int``: an integer + * ``float``: a floating-point number + + .. versionadded:: 8.4 + + The ``float`` and ``int`` types. + + For ``paths`` and ``pathlist`` types, they are considered relative to the config-file. + In case the execution is happening without a config-file defined, + they will be considered relative to the current working directory (for example with ``--override-ini``). + + .. versionadded:: 7.0 + The ``paths`` variable type. + + .. versionadded:: 8.1 + Use the current working directory to resolve ``paths`` and ``pathlist`` in the absence of a config-file. + + Defaults to ``string`` if ``None`` or not passed. + :param default: + Default value if no config-file option exists but is queried. + :param aliases: + Additional names by which this option can be referenced. + Aliases resolve to the canonical name. + + .. versionadded:: 9.0 + The ``aliases`` parameter. + + The value of configuration keys can be retrieved via a call to + :py:func:`config.getini(name) `. + """ + assert type in ( + None, + "string", + "paths", + "pathlist", + "args", + "linelist", + "bool", + "int", + "float", + ) + if type is None: + type = "string" + if default is NOT_SET: + default = get_ini_default_for_type(type) + + self._inidict[name] = (help, type, default) + + for alias in aliases: + if alias in self._inidict: + raise ValueError( + f"alias {alias!r} conflicts with existing configuration option" + ) + if (already := self._ini_aliases.get(alias)) is not None: + raise ValueError(f"{alias!r} is already an alias of {already!r}") + self._ini_aliases[alias] = name + + +def get_ini_default_for_type( + type: Literal[ + "string", "paths", "pathlist", "args", "linelist", "bool", "int", "float" + ], +) -> Any: + """ + Used by addini to get the default value for a given config option type, when + default is not supplied. + """ + if type in ("paths", "pathlist", "args", "linelist"): + return [] + elif type == "bool": + return False + elif type == "int": + return 0 + elif type == "float": + return 0.0 + else: + return "" + + +class ArgumentError(Exception): + """Raised if an Argument instance is created with invalid or + inconsistent arguments.""" + + def __init__(self, msg: str, option: Argument | str) -> None: + self.msg = msg + self.option_id = str(option) + + def __str__(self) -> str: + if self.option_id: + return f"option {self.option_id}: {self.msg}" + else: + return self.msg + + +class Argument: + """Class that mimics the necessary behaviour of optparse.Option. + + It's currently a least effort implementation and ignoring choices + and integer prefixes. + + https://docs.python.org/3/library/optparse.html#optparse-standard-option-types + """ + + def __init__(self, *names: str, **attrs: Any) -> None: + """Store params in private vars for use in add_argument.""" + self._attrs = attrs + self._short_opts: list[str] = [] + self._long_opts: list[str] = [] + try: + self.type = attrs["type"] + except KeyError: + pass + try: + # Attribute existence is tested in Config._processopt. + self.default = attrs["default"] + except KeyError: + pass + self._set_opt_strings(names) + dest: str | None = attrs.get("dest") + if dest: + self.dest = dest + elif self._long_opts: + self.dest = self._long_opts[0][2:].replace("-", "_") + else: + try: + self.dest = self._short_opts[0][1:] + except IndexError as e: + self.dest = "???" # Needed for the error repr. + raise ArgumentError("need a long or short option", self) from e + + def names(self) -> list[str]: + return self._short_opts + self._long_opts + + def attrs(self) -> Mapping[str, Any]: + # Update any attributes set by processopt. + for attr in ("default", "dest", "help", self.dest): + try: + self._attrs[attr] = getattr(self, attr) + except AttributeError: + pass + return self._attrs + + def _set_opt_strings(self, opts: Sequence[str]) -> None: + """Directly from optparse. + + Might not be necessary as this is passed to argparse later on. + """ + for opt in opts: + if len(opt) < 2: + raise ArgumentError( + f"invalid option string {opt!r}: " + "must be at least two characters long", + self, + ) + elif len(opt) == 2: + if not (opt[0] == "-" and opt[1] != "-"): + raise ArgumentError( + f"invalid short option string {opt!r}: " + "must be of the form -x, (x any non-dash char)", + self, + ) + self._short_opts.append(opt) + else: + if not (opt[0:2] == "--" and opt[2] != "-"): + raise ArgumentError( + f"invalid long option string {opt!r}: " + "must start with --, followed by non-dash", + self, + ) + self._long_opts.append(opt) + + def __repr__(self) -> str: + args: list[str] = [] + if self._short_opts: + args += ["_short_opts: " + repr(self._short_opts)] + if self._long_opts: + args += ["_long_opts: " + repr(self._long_opts)] + args += ["dest: " + repr(self.dest)] + if hasattr(self, "type"): + args += ["type: " + repr(self.type)] + if hasattr(self, "default"): + args += ["default: " + repr(self.default)] + return "Argument({})".format(", ".join(args)) + + +class OptionGroup: + """A group of options shown in its own section.""" + + def __init__( + self, + arggroup: argparse._ArgumentGroup, + name: str, + parser: Parser | None, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._arggroup = arggroup + self.name = name + self.options: list[Argument] = [] + self.parser = parser + + def addoption(self, *opts: str, **attrs: Any) -> None: + """Add an option to this group. + + If a shortened version of a long option is specified, it will + be suppressed in the help. ``addoption('--twowords', '--two-words')`` + results in help showing ``--two-words`` only, but ``--twowords`` gets + accepted **and** the automatic destination is in ``args.twowords``. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :meth:`add_argument() + ` function accepts. + """ + conflict = set(opts).intersection( + name for opt in self.options for name in opt.names() + ) + if conflict: + raise ValueError(f"option names {conflict} already added") + option = Argument(*opts, **attrs) + self._addoption_instance(option, shortupper=False) + + def _addoption(self, *opts: str, **attrs: Any) -> None: + option = Argument(*opts, **attrs) + self._addoption_instance(option, shortupper=True) + + def _addoption_instance(self, option: Argument, shortupper: bool = False) -> None: + if not shortupper: + for opt in option._short_opts: + if opt[0] == "-" and opt[1].islower(): + raise ValueError("lowercase shortoptions reserved") + + if self.parser: + self.parser.processoption(option) + + self._arggroup.add_argument(*option.names(), **option.attrs()) + self.options.append(option) + + +class PytestArgumentParser(argparse.ArgumentParser): + def __init__( + self, + parser: Parser, + usage: str | None, + extra_info: dict[str, str], + ) -> None: + self._parser = parser + super().__init__( + usage=usage, + add_help=False, + formatter_class=DropShorterLongHelpFormatter, + allow_abbrev=False, + fromfile_prefix_chars="@", + ) + # extra_info is a dict of (param -> value) to display if there's + # an usage error to provide more contextual information to the user. + self.extra_info = extra_info + + def error(self, message: str) -> NoReturn: + """Transform argparse error message into UsageError.""" + msg = f"{self.prog}: error: {message}" + if self.extra_info: + msg += "\n" + "\n".join( + f" {k}: {v}" for k, v in sorted(self.extra_info.items()) + ) + raise UsageError(self.format_usage() + msg) + + +class DropShorterLongHelpFormatter(argparse.HelpFormatter): + """Shorten help for long options that differ only in extra hyphens. + + - Collapse **long** options that are the same except for extra hyphens. + - Shortcut if there are only two options and one of them is a short one. + - Cache result on the action object as this is called at least 2 times. + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + # Use more accurate terminal width. + if "width" not in kwargs: + kwargs["width"] = _pytest._io.get_terminal_width() + super().__init__(*args, **kwargs) + + def _format_action_invocation(self, action: argparse.Action) -> str: + orgstr = super()._format_action_invocation(action) + if orgstr and orgstr[0] != "-": # only optional arguments + return orgstr + res: str | None = getattr(action, "_formatted_action_invocation", None) + if res: + return res + options = orgstr.split(", ") + if len(options) == 2 and (len(options[0]) == 2 or len(options[1]) == 2): + # a shortcut for '-h, --help' or '--abc', '-a' + action._formatted_action_invocation = orgstr # type: ignore + return orgstr + return_list = [] + short_long: dict[str, str] = {} + for option in options: + if len(option) == 2 or option[2] == " ": + continue + if not option.startswith("--"): + raise ArgumentError( + f'long optional argument without "--": [{option}]', option + ) + xxoption = option[2:] + shortened = xxoption.replace("-", "") + if shortened not in short_long or len(short_long[shortened]) < len( + xxoption + ): + short_long[shortened] = xxoption + # now short_long has been filled out to the longest with dashes + # **and** we keep the right option ordering from add_argument + for option in options: + if len(option) == 2 or option[2] == " ": + return_list.append(option) + if option[2:] == short_long.get(option.replace("-", "")): + return_list.append(option.replace(" ", "=", 1)) + formatted_action_invocation = ", ".join(return_list) + action._formatted_action_invocation = formatted_action_invocation # type: ignore + return formatted_action_invocation + + def _split_lines(self, text, width): + """Wrap lines after splitting on original newlines. + + This allows to have explicit line breaks in the help text. + """ + import textwrap + + lines = [] + for line in text.splitlines(): + lines.extend(textwrap.wrap(line.strip(), width)) + return lines + + +class OverrideIniAction(argparse.Action): + """Custom argparse action that makes a CLI flag equivalent to overriding an + option, in addition to behaving like `store_true`. + + This can simplify things since code only needs to inspect the config option + and not consider the CLI flag. + """ + + def __init__( + self, + option_strings: Sequence[str], + dest: str, + nargs: int | str | None = None, + *args, + ini_option: str, + ini_value: str, + **kwargs, + ) -> None: + super().__init__(option_strings, dest, 0, *args, **kwargs) + self.ini_option = ini_option + self.ini_value = ini_value + + def __call__( + self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + *args, + **kwargs, + ) -> None: + setattr(namespace, self.dest, True) + current_overrides = getattr(namespace, "override_ini", None) + if current_overrides is None: + current_overrides = [] + current_overrides.append(f"{self.ini_option}={self.ini_value}") + setattr(namespace, "override_ini", current_overrides) diff --git a/micromamba_root/Lib/site-packages/_pytest/config/compat.py b/micromamba_root/Lib/site-packages/_pytest/config/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..21eab4c7e47aa2af1690887716055943c0f99fdc --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/config/compat.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +import functools +from pathlib import Path +from typing import Any +import warnings + +import pluggy + +from ..compat import LEGACY_PATH +from ..compat import legacy_path +from ..deprecated import HOOK_LEGACY_PATH_ARG + + +# hookname: (Path, LEGACY_PATH) +imply_paths_hooks: Mapping[str, tuple[str, str]] = { + "pytest_ignore_collect": ("collection_path", "path"), + "pytest_collect_file": ("file_path", "path"), + "pytest_pycollect_makemodule": ("module_path", "path"), + "pytest_report_header": ("start_path", "startdir"), + "pytest_report_collectionfinish": ("start_path", "startdir"), +} + + +def _check_path(path: Path, fspath: LEGACY_PATH) -> None: + if Path(fspath) != path: + raise ValueError( + f"Path({fspath!r}) != {path!r}\n" + "if both path and fspath are given they need to be equal" + ) + + +class PathAwareHookProxy: + """ + this helper wraps around hook callers + until pluggy supports fixingcalls, this one will do + + it currently doesn't return full hook caller proxies for fixed hooks, + this may have to be changed later depending on bugs + """ + + def __init__(self, hook_relay: pluggy.HookRelay) -> None: + self._hook_relay = hook_relay + + def __dir__(self) -> list[str]: + return dir(self._hook_relay) + + def __getattr__(self, key: str) -> pluggy.HookCaller: + hook: pluggy.HookCaller = getattr(self._hook_relay, key) + if key not in imply_paths_hooks: + self.__dict__[key] = hook + return hook + else: + path_var, fspath_var = imply_paths_hooks[key] + + @functools.wraps(hook) + def fixed_hook(**kw: Any) -> Any: + path_value: Path | None = kw.pop(path_var, None) + fspath_value: LEGACY_PATH | None = kw.pop(fspath_var, None) + if fspath_value is not None: + warnings.warn( + HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg=fspath_var, pathlib_path_arg=path_var + ), + stacklevel=2, + ) + if path_value is not None: + if fspath_value is not None: + _check_path(path_value, fspath_value) + else: + fspath_value = legacy_path(path_value) + else: + assert fspath_value is not None + path_value = Path(fspath_value) + + kw[path_var] = path_value + kw[fspath_var] = fspath_value + return hook(**kw) + + fixed_hook.name = hook.name # type: ignore[attr-defined] + fixed_hook.spec = hook.spec # type: ignore[attr-defined] + fixed_hook.__name__ = key + self.__dict__[key] = fixed_hook + return fixed_hook # type: ignore[return-value] diff --git a/micromamba_root/Lib/site-packages/_pytest/config/exceptions.py b/micromamba_root/Lib/site-packages/_pytest/config/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..d84a9ea67e07f3d9591883360fb5ee0c92422787 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/config/exceptions.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from typing import final + + +@final +class UsageError(Exception): + """Error in pytest usage or invocation.""" + + __module__ = "pytest" + + +class PrintHelp(Exception): + """Raised when pytest should print its help to skip the rest of the + argument parsing and validation.""" diff --git a/micromamba_root/Lib/site-packages/_pytest/config/findpaths.py b/micromamba_root/Lib/site-packages/_pytest/config/findpaths.py new file mode 100644 index 0000000000000000000000000000000000000000..3c628a09c2da7c16db785b4add163a05893ecad0 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/config/findpaths.py @@ -0,0 +1,350 @@ +from __future__ import annotations + +from collections.abc import Iterable +from collections.abc import Sequence +from dataclasses import dataclass +from dataclasses import KW_ONLY +import os +from pathlib import Path +import sys +from typing import Literal +from typing import TypeAlias + +import iniconfig + +from .exceptions import UsageError +from _pytest.outcomes import fail +from _pytest.pathlib import absolutepath +from _pytest.pathlib import commonpath +from _pytest.pathlib import safe_exists + + +@dataclass(frozen=True) +class ConfigValue: + """Represents a configuration value with its origin and parsing mode. + + This allows tracking whether a value came from a configuration file + or from a CLI override (--override-ini), which is important for + determining precedence when dealing with ini option aliases. + + The mode tracks the parsing mode/data model used for the value: + - "ini": from INI files or [tool.pytest.ini_options], where the only + supported value types are `str` or `list[str]`. + - "toml": from TOML files (not in INI mode), where native TOML types + are preserved. + """ + + value: object + _: KW_ONLY + origin: Literal["file", "override"] + mode: Literal["ini", "toml"] + + +ConfigDict: TypeAlias = dict[str, ConfigValue] + + +def _parse_ini_config(path: Path) -> iniconfig.IniConfig: + """Parse the given generic '.ini' file using legacy IniConfig parser, returning + the parsed object. + + Raise UsageError if the file cannot be parsed. + """ + try: + return iniconfig.IniConfig(str(path)) + except iniconfig.ParseError as exc: + raise UsageError(str(exc)) from exc + + +def load_config_dict_from_file( + filepath: Path, +) -> ConfigDict | None: + """Load pytest configuration from the given file path, if supported. + + Return None if the file does not contain valid pytest configuration. + """ + # Configuration from ini files are obtained from the [pytest] section, if present. + if filepath.suffix == ".ini": + iniconfig = _parse_ini_config(filepath) + + if "pytest" in iniconfig: + return { + k: ConfigValue(v, origin="file", mode="ini") + for k, v in iniconfig["pytest"].items() + } + else: + # "pytest.ini" files are always the source of configuration, even if empty. + if filepath.name in {"pytest.ini", ".pytest.ini"}: + return {} + + # '.cfg' files are considered if they contain a "[tool:pytest]" section. + elif filepath.suffix == ".cfg": + iniconfig = _parse_ini_config(filepath) + + if "tool:pytest" in iniconfig.sections: + return { + k: ConfigValue(v, origin="file", mode="ini") + for k, v in iniconfig["tool:pytest"].items() + } + elif "pytest" in iniconfig.sections: + # If a setup.cfg contains a "[pytest]" section, we raise a failure to indicate users that + # plain "[pytest]" sections in setup.cfg files is no longer supported (#3086). + fail(CFG_PYTEST_SECTION.format(filename="setup.cfg"), pytrace=False) + + # '.toml' files are considered if they contain a [tool.pytest] table (toml mode) + # or [tool.pytest.ini_options] table (ini mode) for pyproject.toml, + # or [pytest] table (toml mode) for pytest.toml/.pytest.toml. + elif filepath.suffix == ".toml": + if sys.version_info >= (3, 11): + import tomllib + else: + import tomli as tomllib + + toml_text = filepath.read_text(encoding="utf-8") + try: + config = tomllib.loads(toml_text) + except tomllib.TOMLDecodeError as exc: + raise UsageError(f"{filepath}: {exc}") from exc + + # pytest.toml and .pytest.toml use [pytest] table directly. + if filepath.name in ("pytest.toml", ".pytest.toml"): + pytest_config = config.get("pytest", {}) + if pytest_config: + # TOML mode - preserve native TOML types. + return { + k: ConfigValue(v, origin="file", mode="toml") + for k, v in pytest_config.items() + } + # "pytest.toml" files are always the source of configuration, even if empty. + return {} + + # pyproject.toml uses [tool.pytest] or [tool.pytest.ini_options]. + else: + tool_pytest = config.get("tool", {}).get("pytest", {}) + + # Check for toml mode config: [tool.pytest] with content outside of ini_options. + toml_config = {k: v for k, v in tool_pytest.items() if k != "ini_options"} + # Check for ini mode config: [tool.pytest.ini_options]. + ini_config = tool_pytest.get("ini_options", None) + + if toml_config and ini_config: + raise UsageError( + f"{filepath}: Cannot use both [tool.pytest] (native TOML types) and " + "[tool.pytest.ini_options] (string-based INI format) simultaneously. " + "Please use [tool.pytest] with native TOML types (recommended) " + "or [tool.pytest.ini_options] for backwards compatibility." + ) + + if toml_config: + # TOML mode - preserve native TOML types. + return { + k: ConfigValue(v, origin="file", mode="toml") + for k, v in toml_config.items() + } + + elif ini_config is not None: + # INI mode - TOML supports richer data types than INI files, but we need to + # convert all scalar values to str for compatibility with the INI system. + def make_scalar(v: object) -> str | list[str]: + return v if isinstance(v, list) else str(v) + + return { + k: ConfigValue(make_scalar(v), origin="file", mode="ini") + for k, v in ini_config.items() + } + + return None + + +def locate_config( + invocation_dir: Path, + args: Iterable[Path], +) -> tuple[Path | None, Path | None, ConfigDict, Sequence[str]]: + """Search in the list of arguments for a valid ini-file for pytest, + and return a tuple of (rootdir, inifile, cfg-dict, ignored-config-files), where + ignored-config-files is a list of config basenames found that contain + pytest configuration but were ignored.""" + config_names = [ + "pytest.toml", + ".pytest.toml", + "pytest.ini", + ".pytest.ini", + "pyproject.toml", + "tox.ini", + "setup.cfg", + ] + args = [x for x in args if not str(x).startswith("-")] + if not args: + args = [invocation_dir] + found_pyproject_toml: Path | None = None + ignored_config_files: list[str] = [] + + for arg in args: + argpath = absolutepath(arg) + for base in (argpath, *argpath.parents): + for config_name in config_names: + p = base / config_name + if p.is_file(): + if p.name == "pyproject.toml" and found_pyproject_toml is None: + found_pyproject_toml = p + ini_config = load_config_dict_from_file(p) + if ini_config is not None: + index = config_names.index(config_name) + for remainder in config_names[index + 1 :]: + p2 = base / remainder + if ( + p2.is_file() + and load_config_dict_from_file(p2) is not None + ): + ignored_config_files.append(remainder) + return base, p, ini_config, ignored_config_files + if found_pyproject_toml is not None: + return found_pyproject_toml.parent, found_pyproject_toml, {}, [] + return None, None, {}, [] + + +def get_common_ancestor( + invocation_dir: Path, + paths: Iterable[Path], +) -> Path: + common_ancestor: Path | None = None + for path in paths: + if not path.exists(): + continue + if common_ancestor is None: + common_ancestor = path + else: + if common_ancestor in path.parents or path == common_ancestor: + continue + elif path in common_ancestor.parents: + common_ancestor = path + else: + shared = commonpath(path, common_ancestor) + if shared is not None: + common_ancestor = shared + if common_ancestor is None: + common_ancestor = invocation_dir + elif common_ancestor.is_file(): + common_ancestor = common_ancestor.parent + return common_ancestor + + +def get_dirs_from_args(args: Iterable[str]) -> list[Path]: + def is_option(x: str) -> bool: + return x.startswith("-") + + def get_file_part_from_node_id(x: str) -> str: + return x.split("::")[0] + + def get_dir_from_path(path: Path) -> Path: + if path.is_dir(): + return path + return path.parent + + # These look like paths but may not exist + possible_paths = ( + absolutepath(get_file_part_from_node_id(arg)) + for arg in args + if not is_option(arg) + ) + + return [get_dir_from_path(path) for path in possible_paths if safe_exists(path)] + + +def parse_override_ini(override_ini: Sequence[str] | None) -> ConfigDict: + """Parse the -o/--override-ini command line arguments and return the overrides. + + :raises UsageError: + If one of the values is malformed. + """ + overrides = {} + # override_ini is a list of "ini=value" options. + # Always use the last item if multiple values are set for same ini-name, + # e.g. -o foo=bar1 -o foo=bar2 will set foo to bar2. + for ini_config in override_ini or (): + try: + key, user_ini_value = ini_config.split("=", 1) + except ValueError as e: + raise UsageError( + f"-o/--override-ini expects option=value style (got: {ini_config!r})." + ) from e + else: + overrides[key] = ConfigValue(user_ini_value, origin="override", mode="ini") + return overrides + + +CFG_PYTEST_SECTION = "[pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead." + + +def determine_setup( + *, + inifile: str | None, + override_ini: Sequence[str] | None, + args: Sequence[str], + rootdir_cmd_arg: str | None, + invocation_dir: Path, +) -> tuple[Path, Path | None, ConfigDict, Sequence[str]]: + """Determine the rootdir, inifile and ini configuration values from the + command line arguments. + + :param inifile: + The `--inifile` command line argument, if given. + :param override_ini: + The -o/--override-ini command line arguments, if given. + :param args: + The free command line arguments. + :param rootdir_cmd_arg: + The `--rootdir` command line argument, if given. + :param invocation_dir: + The working directory when pytest was invoked. + + :raises UsageError: + """ + rootdir = None + dirs = get_dirs_from_args(args) + ignored_config_files: Sequence[str] = [] + + if inifile: + inipath_ = absolutepath(inifile) + inipath: Path | None = inipath_ + inicfg = load_config_dict_from_file(inipath_) or {} + if rootdir_cmd_arg is None: + rootdir = inipath_.parent + else: + ancestor = get_common_ancestor(invocation_dir, dirs) + rootdir, inipath, inicfg, ignored_config_files = locate_config( + invocation_dir, [ancestor] + ) + if rootdir is None and rootdir_cmd_arg is None: + for possible_rootdir in (ancestor, *ancestor.parents): + if (possible_rootdir / "setup.py").is_file(): + rootdir = possible_rootdir + break + else: + if dirs != [ancestor]: + rootdir, inipath, inicfg, _ = locate_config(invocation_dir, dirs) + if rootdir is None: + rootdir = get_common_ancestor( + invocation_dir, [invocation_dir, ancestor] + ) + if is_fs_root(rootdir): + rootdir = ancestor + if rootdir_cmd_arg: + rootdir = absolutepath(os.path.expandvars(rootdir_cmd_arg)) + if not rootdir.is_dir(): + raise UsageError( + f"Directory '{rootdir}' not found. Check your '--rootdir' option." + ) + + ini_overrides = parse_override_ini(override_ini) + inicfg.update(ini_overrides) + + assert rootdir is not None + return rootdir, inipath, inicfg, ignored_config_files + + +def is_fs_root(p: Path) -> bool: + r""" + Return True if the given path is pointing to the root of the + file system ("/" on Unix and "C:\\" on Windows for example). + """ + return os.path.splitdrive(str(p))[1] == os.sep diff --git a/micromamba_root/Lib/site-packages/_pytest/debugging.py b/micromamba_root/Lib/site-packages/_pytest/debugging.py new file mode 100644 index 0000000000000000000000000000000000000000..de1b2688f765a2982dbe10d86bffd9762f2f6512 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/debugging.py @@ -0,0 +1,407 @@ +# mypy: allow-untyped-defs +# ruff: noqa: T100 +"""Interactive debugging with PDB, the Python Debugger.""" + +from __future__ import annotations + +import argparse +from collections.abc import Callable +from collections.abc import Generator +import functools +import sys +import types +from typing import Any +import unittest + +from _pytest import outcomes +from _pytest._code import ExceptionInfo +from _pytest.capture import CaptureManager +from _pytest.config import Config +from _pytest.config import ConftestImportFailure +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.config.argparsing import Parser +from _pytest.config.exceptions import UsageError +from _pytest.nodes import Node +from _pytest.reports import BaseReport +from _pytest.runner import CallInfo + + +def _validate_usepdb_cls(value: str) -> tuple[str, str]: + """Validate syntax of --pdbcls option.""" + try: + modname, classname = value.split(":") + except ValueError as e: + raise argparse.ArgumentTypeError( + f"{value!r} is not in the format 'modname:classname'" + ) from e + return (modname, classname) + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--pdb", + dest="usepdb", + action="store_true", + help="Start the interactive Python debugger on errors or KeyboardInterrupt", + ) + group.addoption( + "--pdbcls", + dest="usepdb_cls", + metavar="modulename:classname", + type=_validate_usepdb_cls, + help="Specify a custom interactive Python debugger for use with --pdb." + "For example: --pdbcls=IPython.terminal.debugger:TerminalPdb", + ) + group.addoption( + "--trace", + dest="trace", + action="store_true", + help="Immediately break when running each test", + ) + + +def pytest_configure(config: Config) -> None: + import pdb + + if config.getvalue("trace"): + config.pluginmanager.register(PdbTrace(), "pdbtrace") + if config.getvalue("usepdb"): + config.pluginmanager.register(PdbInvoke(), "pdbinvoke") + + pytestPDB._saved.append( + (pdb.set_trace, pytestPDB._pluginmanager, pytestPDB._config) + ) + pdb.set_trace = pytestPDB.set_trace + pytestPDB._pluginmanager = config.pluginmanager + pytestPDB._config = config + + # NOTE: not using pytest_unconfigure, since it might get called although + # pytest_configure was not (if another plugin raises UsageError). + def fin() -> None: + ( + pdb.set_trace, + pytestPDB._pluginmanager, + pytestPDB._config, + ) = pytestPDB._saved.pop() + + config.add_cleanup(fin) + + +class pytestPDB: + """Pseudo PDB that defers to the real pdb.""" + + _pluginmanager: PytestPluginManager | None = None + _config: Config | None = None + _saved: list[ + tuple[Callable[..., None], PytestPluginManager | None, Config | None] + ] = [] + _recursive_debug = 0 + _wrapped_pdb_cls: tuple[type[Any], type[Any]] | None = None + + @classmethod + def _is_capturing(cls, capman: CaptureManager | None) -> str | bool: + if capman: + return capman.is_capturing() + return False + + @classmethod + def _import_pdb_cls(cls, capman: CaptureManager | None): + if not cls._config: + import pdb + + # Happens when using pytest.set_trace outside of a test. + return pdb.Pdb + + usepdb_cls = cls._config.getvalue("usepdb_cls") + + if cls._wrapped_pdb_cls and cls._wrapped_pdb_cls[0] == usepdb_cls: + return cls._wrapped_pdb_cls[1] + + if usepdb_cls: + modname, classname = usepdb_cls + + try: + __import__(modname) + mod = sys.modules[modname] + + # Handle --pdbcls=pdb:pdb.Pdb (useful e.g. with pdbpp). + parts = classname.split(".") + pdb_cls = getattr(mod, parts[0]) + for part in parts[1:]: + pdb_cls = getattr(pdb_cls, part) + except Exception as exc: + value = ":".join((modname, classname)) + raise UsageError( + f"--pdbcls: could not import {value!r}: {exc}" + ) from exc + else: + import pdb + + pdb_cls = pdb.Pdb + + wrapped_cls = cls._get_pdb_wrapper_class(pdb_cls, capman) + cls._wrapped_pdb_cls = (usepdb_cls, wrapped_cls) + return wrapped_cls + + @classmethod + def _get_pdb_wrapper_class(cls, pdb_cls, capman: CaptureManager | None): + import _pytest.config + + class PytestPdbWrapper(pdb_cls): + _pytest_capman = capman + _continued = False + + def do_debug(self, arg): + cls._recursive_debug += 1 + ret = super().do_debug(arg) + cls._recursive_debug -= 1 + return ret + + if hasattr(pdb_cls, "do_debug"): + do_debug.__doc__ = pdb_cls.do_debug.__doc__ + + def do_continue(self, arg): + ret = super().do_continue(arg) + if cls._recursive_debug == 0: + assert cls._config is not None + tw = _pytest.config.create_terminal_writer(cls._config) + tw.line() + + capman = self._pytest_capman + capturing = pytestPDB._is_capturing(capman) + if capturing: + if capturing == "global": + tw.sep(">", "PDB continue (IO-capturing resumed)") + else: + tw.sep( + ">", + f"PDB continue (IO-capturing resumed for {capturing})", + ) + assert capman is not None + capman.resume() + else: + tw.sep(">", "PDB continue") + assert cls._pluginmanager is not None + cls._pluginmanager.hook.pytest_leave_pdb(config=cls._config, pdb=self) + self._continued = True + return ret + + if hasattr(pdb_cls, "do_continue"): + do_continue.__doc__ = pdb_cls.do_continue.__doc__ + + do_c = do_cont = do_continue + + def do_quit(self, arg): + # Raise Exit outcome when quit command is used in pdb. + # + # This is a bit of a hack - it would be better if BdbQuit + # could be handled, but this would require to wrap the + # whole pytest run, and adjust the report etc. + ret = super().do_quit(arg) + + if cls._recursive_debug == 0: + outcomes.exit("Quitting debugger") + + return ret + + if hasattr(pdb_cls, "do_quit"): + do_quit.__doc__ = pdb_cls.do_quit.__doc__ + + do_q = do_quit + do_exit = do_quit + + def setup(self, f, tb): + """Suspend on setup(). + + Needed after do_continue resumed, and entering another + breakpoint again. + """ + ret = super().setup(f, tb) + if not ret and self._continued: + # pdb.setup() returns True if the command wants to exit + # from the interaction: do not suspend capturing then. + if self._pytest_capman: + self._pytest_capman.suspend_global_capture(in_=True) + return ret + + def get_stack(self, f, t): + stack, i = super().get_stack(f, t) + if f is None: + # Find last non-hidden frame. + i = max(0, len(stack) - 1) + while i and stack[i][0].f_locals.get("__tracebackhide__", False): + i -= 1 + return stack, i + + return PytestPdbWrapper + + @classmethod + def _init_pdb(cls, method, *args, **kwargs): + """Initialize PDB debugging, dropping any IO capturing.""" + import _pytest.config + + if cls._pluginmanager is None: + capman: CaptureManager | None = None + else: + capman = cls._pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend(in_=True) + + if cls._config: + tw = _pytest.config.create_terminal_writer(cls._config) + tw.line() + + if cls._recursive_debug == 0: + # Handle header similar to pdb.set_trace in py37+. + header = kwargs.pop("header", None) + if header is not None: + tw.sep(">", header) + else: + capturing = cls._is_capturing(capman) + if capturing == "global": + tw.sep(">", f"PDB {method} (IO-capturing turned off)") + elif capturing: + tw.sep( + ">", + f"PDB {method} (IO-capturing turned off for {capturing})", + ) + else: + tw.sep(">", f"PDB {method}") + + _pdb = cls._import_pdb_cls(capman)(**kwargs) + + if cls._pluginmanager: + cls._pluginmanager.hook.pytest_enter_pdb(config=cls._config, pdb=_pdb) + return _pdb + + @classmethod + def set_trace(cls, *args, **kwargs) -> None: + """Invoke debugging via ``Pdb.set_trace``, dropping any IO capturing.""" + frame = sys._getframe().f_back + _pdb = cls._init_pdb("set_trace", *args, **kwargs) + _pdb.set_trace(frame) + + +class PdbInvoke: + def pytest_exception_interact( + self, node: Node, call: CallInfo[Any], report: BaseReport + ) -> None: + capman = node.config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture(in_=True) + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stdout.write(err) + assert call.excinfo is not None + + if not isinstance(call.excinfo.value, unittest.SkipTest): + _enter_pdb(node, call.excinfo, report) + + def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None: + exc_or_tb = _postmortem_exc_or_tb(excinfo) + post_mortem(exc_or_tb) + + +class PdbTrace: + @hookimpl(wrapper=True) + def pytest_pyfunc_call(self, pyfuncitem) -> Generator[None, object, object]: + wrap_pytest_function_for_tracing(pyfuncitem) + return (yield) + + +def wrap_pytest_function_for_tracing(pyfuncitem) -> None: + """Change the Python function object of the given Function item by a + wrapper which actually enters pdb before calling the python function + itself, effectively leaving the user in the pdb prompt in the first + statement of the function.""" + _pdb = pytestPDB._init_pdb("runcall") + testfunction = pyfuncitem.obj + + # we can't just return `partial(pdb.runcall, testfunction)` because (on + # python < 3.7.4) runcall's first param is `func`, which means we'd get + # an exception if one of the kwargs to testfunction was called `func`. + @functools.wraps(testfunction) + def wrapper(*args, **kwargs) -> None: + func = functools.partial(testfunction, *args, **kwargs) + _pdb.runcall(func) + + pyfuncitem.obj = wrapper + + +def maybe_wrap_pytest_function_for_tracing(pyfuncitem) -> None: + """Wrap the given pytestfunct item for tracing support if --trace was given in + the command line.""" + if pyfuncitem.config.getvalue("trace"): + wrap_pytest_function_for_tracing(pyfuncitem) + + +def _enter_pdb( + node: Node, excinfo: ExceptionInfo[BaseException], rep: BaseReport +) -> BaseReport: + # XXX we reuse the TerminalReporter's terminalwriter + # because this seems to avoid some encoding related troubles + # for not completely clear reasons. + tw = node.config.pluginmanager.getplugin("terminalreporter")._tw + tw.line() + + showcapture = node.config.option.showcapture + + for sectionname, content in ( + ("stdout", rep.capstdout), + ("stderr", rep.capstderr), + ("log", rep.caplog), + ): + if showcapture in (sectionname, "all") and content: + tw.sep(">", "captured " + sectionname) + if content[-1:] == "\n": + content = content[:-1] + tw.line(content) + + tw.sep(">", "traceback") + rep.toterminal(tw) + tw.sep(">", "entering PDB") + tb_or_exc = _postmortem_exc_or_tb(excinfo) + rep._pdbshown = True # type: ignore[attr-defined] + post_mortem(tb_or_exc) + return rep + + +def _postmortem_exc_or_tb( + excinfo: ExceptionInfo[BaseException], +) -> types.TracebackType | BaseException: + from doctest import UnexpectedException + + get_exc = sys.version_info >= (3, 13) + if isinstance(excinfo.value, UnexpectedException): + # A doctest.UnexpectedException is not useful for post_mortem. + # Use the underlying exception instead: + underlying_exc = excinfo.value + if get_exc: + return underlying_exc.exc_info[1] + + return underlying_exc.exc_info[2] + elif isinstance(excinfo.value, ConftestImportFailure): + # A config.ConftestImportFailure is not useful for post_mortem. + # Use the underlying exception instead: + cause = excinfo.value.cause + if get_exc: + return cause + + assert cause.__traceback__ is not None + return cause.__traceback__ + else: + assert excinfo._excinfo is not None + if get_exc: + return excinfo._excinfo[1] + + return excinfo._excinfo[2] + + +def post_mortem(tb_or_exc: types.TracebackType | BaseException) -> None: + p = pytestPDB._init_pdb("post_mortem") + p.reset() + p.interaction(None, tb_or_exc) + if p.quitting: + outcomes.exit("Quitting debugger") diff --git a/micromamba_root/Lib/site-packages/_pytest/deprecated.py b/micromamba_root/Lib/site-packages/_pytest/deprecated.py new file mode 100644 index 0000000000000000000000000000000000000000..cb5d2e93e9347e52c85878b450f630e0a9bb80bd --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/deprecated.py @@ -0,0 +1,99 @@ +"""Deprecation messages and bits of code used elsewhere in the codebase that +is planned to be removed in the next pytest release. + +Keeping it in a central location makes it easy to track what is deprecated and should +be removed when the time comes. + +All constants defined in this module should be either instances of +:class:`PytestWarning`, or :class:`UnformattedWarning` +in case of warnings which need to format their messages. +""" + +from __future__ import annotations + +from warnings import warn + +from _pytest.warning_types import PytestDeprecationWarning +from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestRemovedIn10Warning +from _pytest.warning_types import UnformattedWarning + + +# set of plugins which have been integrated into the core; we use this list to ignore +# them during registration to avoid conflicts +DEPRECATED_EXTERNAL_PLUGINS = { + "pytest_catchlog", + "pytest_capturelog", + "pytest_faulthandler", + "pytest_subtests", +} + + +# This could have been removed pytest 8, but it's harmless and common, so no rush to remove. +YIELD_FIXTURE = PytestDeprecationWarning( + "@pytest.yield_fixture is deprecated.\n" + "Use @pytest.fixture instead; they are the same." +) + +# This deprecation is never really meant to be removed. +PRIVATE = PytestDeprecationWarning("A private pytest class or function was used.") + + +HOOK_LEGACY_PATH_ARG = UnformattedWarning( + PytestRemovedIn9Warning, + "The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n" + "see https://docs.pytest.org/en/latest/deprecations.html" + "#py-path-local-arguments-for-hooks-replaced-with-pathlib-path", +) + +NODE_CTOR_FSPATH_ARG = UnformattedWarning( + PytestRemovedIn9Warning, + "The (fspath: py.path.local) argument to {node_type_name} is deprecated. " + "Please use the (path: pathlib.Path) argument instead.\n" + "See https://docs.pytest.org/en/latest/deprecations.html" + "#fspath-argument-for-node-constructors-replaced-with-pathlib-path", +) + +HOOK_LEGACY_MARKING = UnformattedWarning( + PytestDeprecationWarning, + "The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n" + "Please use the pytest.hook{type}({hook_opts}) decorator instead\n" + " to configure the hooks.\n" + " See https://docs.pytest.org/en/latest/deprecations.html" + "#configuring-hook-specs-impls-using-markers", +) + +MARKED_FIXTURE = PytestRemovedIn9Warning( + "Marks applied to fixtures have no effect\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function" +) + +MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES = PytestRemovedIn10Warning( + "monkeypatch.syspath_prepend() called with pkg_resources legacy namespace packages detected.\n" + "Legacy namespace packages (using pkg_resources.declare_namespace) are deprecated.\n" + "Please use native namespace packages (PEP 420) instead.\n" + "See https://docs.pytest.org/en/stable/deprecations.html#monkeypatch-fixup-namespace-packages" +) + +# You want to make some `__init__` or function "private". +# +# def my_private_function(some, args): +# ... +# +# Do this: +# +# def my_private_function(some, args, *, _ispytest: bool = False): +# check_ispytest(_ispytest) +# ... +# +# Change all internal/allowed calls to +# +# my_private_function(some, args, _ispytest=True) +# +# All other calls will get the default _ispytest=False and trigger +# the warning (possibly error in the future). + + +def check_ispytest(ispytest: bool) -> None: + if not ispytest: + warn(PRIVATE, stacklevel=3) diff --git a/micromamba_root/Lib/site-packages/_pytest/doctest.py b/micromamba_root/Lib/site-packages/_pytest/doctest.py new file mode 100644 index 0000000000000000000000000000000000000000..cd255f5eeb6ec1e3506037e3a569a60d777bba8a --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/doctest.py @@ -0,0 +1,736 @@ +# mypy: allow-untyped-defs +"""Discover and run doctests in modules and test files.""" + +from __future__ import annotations + +import bdb +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Sequence +from contextlib import contextmanager +import functools +import inspect +import os +from pathlib import Path +import platform +import re +import sys +import traceback +import types +from typing import Any +from typing import TYPE_CHECKING +import warnings + +from _pytest import outcomes +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import ReprFileLocation +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.compat import safe_getattr +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.fixtures import fixture +from _pytest.fixtures import TopRequest +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import OutcomeException +from _pytest.outcomes import skip +from _pytest.pathlib import fnmatch_ex +from _pytest.python import Module +from _pytest.python_api import approx +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + import doctest + + from typing_extensions import Self + +DOCTEST_REPORT_CHOICE_NONE = "none" +DOCTEST_REPORT_CHOICE_CDIFF = "cdiff" +DOCTEST_REPORT_CHOICE_NDIFF = "ndiff" +DOCTEST_REPORT_CHOICE_UDIFF = "udiff" +DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE = "only_first_failure" + +DOCTEST_REPORT_CHOICES = ( + DOCTEST_REPORT_CHOICE_NONE, + DOCTEST_REPORT_CHOICE_CDIFF, + DOCTEST_REPORT_CHOICE_NDIFF, + DOCTEST_REPORT_CHOICE_UDIFF, + DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE, +) + +# Lazy definition of runner class +RUNNER_CLASS = None +# Lazy definition of output checker class +CHECKER_CLASS: type[doctest.OutputChecker] | None = None + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "doctest_optionflags", + "Option flags for doctests", + type="args", + default=["ELLIPSIS"], + ) + parser.addini( + "doctest_encoding", "Encoding used for doctest files", default="utf-8" + ) + group = parser.getgroup("collect") + group.addoption( + "--doctest-modules", + action="store_true", + default=False, + help="Run doctests in all .py modules", + dest="doctestmodules", + ) + group.addoption( + "--doctest-report", + type=str.lower, + default="udiff", + help="Choose another output format for diffs on doctest failure", + choices=DOCTEST_REPORT_CHOICES, + dest="doctestreport", + ) + group.addoption( + "--doctest-glob", + action="append", + default=[], + metavar="pat", + help="Doctests file matching pattern, default: test*.txt", + dest="doctestglob", + ) + group.addoption( + "--doctest-ignore-import-errors", + action="store_true", + default=False, + help="Ignore doctest collection errors", + dest="doctest_ignore_import_errors", + ) + group.addoption( + "--doctest-continue-on-failure", + action="store_true", + default=False, + help="For a given doctest, continue to run after the first failure", + dest="doctest_continue_on_failure", + ) + + +def pytest_unconfigure() -> None: + global RUNNER_CLASS + + RUNNER_CLASS = None + + +def pytest_collect_file( + file_path: Path, + parent: Collector, +) -> DoctestModule | DoctestTextfile | None: + config = parent.config + if file_path.suffix == ".py": + if config.option.doctestmodules and not any( + (_is_setup_py(file_path), _is_main_py(file_path)) + ): + return DoctestModule.from_parent(parent, path=file_path) + elif _is_doctest(config, file_path, parent): + return DoctestTextfile.from_parent(parent, path=file_path) + return None + + +def _is_setup_py(path: Path) -> bool: + if path.name != "setup.py": + return False + contents = path.read_bytes() + return b"setuptools" in contents or b"distutils" in contents + + +def _is_doctest(config: Config, path: Path, parent: Collector) -> bool: + if path.suffix in (".txt", ".rst") and parent.session.isinitpath(path): + return True + globs = config.getoption("doctestglob") or ["test*.txt"] + return any(fnmatch_ex(glob, path) for glob in globs) + + +def _is_main_py(path: Path) -> bool: + return path.name == "__main__.py" + + +class ReprFailDoctest(TerminalRepr): + def __init__( + self, reprlocation_lines: Sequence[tuple[ReprFileLocation, Sequence[str]]] + ) -> None: + self.reprlocation_lines = reprlocation_lines + + def toterminal(self, tw: TerminalWriter) -> None: + for reprlocation, lines in self.reprlocation_lines: + for line in lines: + tw.line(line) + reprlocation.toterminal(tw) + + +class MultipleDoctestFailures(Exception): + def __init__(self, failures: Sequence[doctest.DocTestFailure]) -> None: + super().__init__() + self.failures = failures + + +def _init_runner_class() -> type[doctest.DocTestRunner]: + import doctest + + class PytestDoctestRunner(doctest.DebugRunner): + """Runner to collect failures. + + Note that the out variable in this case is a list instead of a + stdout-like object. + """ + + def __init__( + self, + checker: doctest.OutputChecker | None = None, + verbose: bool | None = None, + optionflags: int = 0, + continue_on_failure: bool = True, + ) -> None: + super().__init__(checker=checker, verbose=verbose, optionflags=optionflags) + self.continue_on_failure = continue_on_failure + + def report_failure( + self, + out, + test: doctest.DocTest, + example: doctest.Example, + got: str, + ) -> None: + failure = doctest.DocTestFailure(test, example, got) + if self.continue_on_failure: + out.append(failure) + else: + raise failure + + def report_unexpected_exception( + self, + out, + test: doctest.DocTest, + example: doctest.Example, + exc_info: tuple[type[BaseException], BaseException, types.TracebackType], + ) -> None: + if isinstance(exc_info[1], OutcomeException): + raise exc_info[1] + if isinstance(exc_info[1], bdb.BdbQuit): + outcomes.exit("Quitting debugger") + failure = doctest.UnexpectedException(test, example, exc_info) + if self.continue_on_failure: + out.append(failure) + else: + raise failure + + return PytestDoctestRunner + + +def _get_runner( + checker: doctest.OutputChecker | None = None, + verbose: bool | None = None, + optionflags: int = 0, + continue_on_failure: bool = True, +) -> doctest.DocTestRunner: + # We need this in order to do a lazy import on doctest + global RUNNER_CLASS + if RUNNER_CLASS is None: + RUNNER_CLASS = _init_runner_class() + # Type ignored because the continue_on_failure argument is only defined on + # PytestDoctestRunner, which is lazily defined so can't be used as a type. + return RUNNER_CLASS( # type: ignore + checker=checker, + verbose=verbose, + optionflags=optionflags, + continue_on_failure=continue_on_failure, + ) + + +class DoctestItem(Item): + def __init__( + self, + name: str, + parent: DoctestTextfile | DoctestModule, + runner: doctest.DocTestRunner, + dtest: doctest.DocTest, + ) -> None: + super().__init__(name, parent) + self.runner = runner + self.dtest = dtest + + # Stuff needed for fixture support. + self.obj = None + fm = self.session._fixturemanager + fixtureinfo = fm.getfixtureinfo(node=self, func=None, cls=None) + self._fixtureinfo = fixtureinfo + self.fixturenames = fixtureinfo.names_closure + self._initrequest() + + @classmethod + def from_parent( # type: ignore[override] + cls, + parent: DoctestTextfile | DoctestModule, + *, + name: str, + runner: doctest.DocTestRunner, + dtest: doctest.DocTest, + ) -> Self: + # incompatible signature due to imposed limits on subclass + """The public named constructor.""" + return super().from_parent(name=name, parent=parent, runner=runner, dtest=dtest) + + def _initrequest(self) -> None: + self.funcargs: dict[str, object] = {} + self._request = TopRequest(self, _ispytest=True) # type: ignore[arg-type] + + def setup(self) -> None: + self._request._fillfixtures() + globs = dict(getfixture=self._request.getfixturevalue) + for name, value in self._request.getfixturevalue("doctest_namespace").items(): + globs[name] = value + self.dtest.globs.update(globs) + + def runtest(self) -> None: + _check_all_skipped(self.dtest) + self._disable_output_capturing_for_darwin() + failures: list[doctest.DocTestFailure] = [] + # Type ignored because we change the type of `out` from what + # doctest expects. + self.runner.run(self.dtest, out=failures) # type: ignore[arg-type] + if failures: + raise MultipleDoctestFailures(failures) + + def _disable_output_capturing_for_darwin(self) -> None: + """Disable output capturing. Otherwise, stdout is lost to doctest (#985).""" + if platform.system() != "Darwin": + return + capman = self.config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture(in_=True) + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stderr.write(err) + + # TODO: Type ignored -- breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, + excinfo: ExceptionInfo[BaseException], + ) -> str | TerminalRepr: + import doctest + + failures: ( + Sequence[doctest.DocTestFailure | doctest.UnexpectedException] | None + ) = None + if isinstance( + excinfo.value, doctest.DocTestFailure | doctest.UnexpectedException + ): + failures = [excinfo.value] + elif isinstance(excinfo.value, MultipleDoctestFailures): + failures = excinfo.value.failures + + if failures is None: + return super().repr_failure(excinfo) + + reprlocation_lines = [] + for failure in failures: + example = failure.example + test = failure.test + filename = test.filename + if test.lineno is None: + lineno = None + else: + lineno = test.lineno + example.lineno + 1 + message = type(failure).__name__ + # TODO: ReprFileLocation doesn't expect a None lineno. + reprlocation = ReprFileLocation(filename, lineno, message) # type: ignore[arg-type] + checker = _get_checker() + report_choice = _get_report_choice(self.config.getoption("doctestreport")) + if lineno is not None: + assert failure.test.docstring is not None + lines = failure.test.docstring.splitlines(False) + # add line numbers to the left of the error message + assert test.lineno is not None + lines = [ + f"{i + test.lineno + 1:03d} {x}" for (i, x) in enumerate(lines) + ] + # trim docstring error lines to 10 + lines = lines[max(example.lineno - 9, 0) : example.lineno + 1] + else: + lines = [ + "EXAMPLE LOCATION UNKNOWN, not showing all tests of that example" + ] + indent = ">>>" + for line in example.source.splitlines(): + lines.append(f"??? {indent} {line}") + indent = "..." + if isinstance(failure, doctest.DocTestFailure): + lines += checker.output_difference( + example, failure.got, report_choice + ).split("\n") + else: + inner_excinfo = ExceptionInfo.from_exc_info(failure.exc_info) + lines += [f"UNEXPECTED EXCEPTION: {inner_excinfo.value!r}"] + lines += [ + x.strip("\n") for x in traceback.format_exception(*failure.exc_info) + ] + reprlocation_lines.append((reprlocation, lines)) + return ReprFailDoctest(reprlocation_lines) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + return self.path, self.dtest.lineno, f"[doctest] {self.name}" + + +def _get_flag_lookup() -> dict[str, int]: + import doctest + + return dict( + DONT_ACCEPT_TRUE_FOR_1=doctest.DONT_ACCEPT_TRUE_FOR_1, + DONT_ACCEPT_BLANKLINE=doctest.DONT_ACCEPT_BLANKLINE, + NORMALIZE_WHITESPACE=doctest.NORMALIZE_WHITESPACE, + ELLIPSIS=doctest.ELLIPSIS, + IGNORE_EXCEPTION_DETAIL=doctest.IGNORE_EXCEPTION_DETAIL, + COMPARISON_FLAGS=doctest.COMPARISON_FLAGS, + ALLOW_UNICODE=_get_allow_unicode_flag(), + ALLOW_BYTES=_get_allow_bytes_flag(), + NUMBER=_get_number_flag(), + ) + + +def get_optionflags(config: Config) -> int: + optionflags_str = config.getini("doctest_optionflags") + flag_lookup_table = _get_flag_lookup() + flag_acc = 0 + for flag in optionflags_str: + flag_acc |= flag_lookup_table[flag] + return flag_acc + + +def _get_continue_on_failure(config: Config) -> bool: + continue_on_failure: bool = config.getvalue("doctest_continue_on_failure") + if continue_on_failure: + # We need to turn off this if we use pdb since we should stop at + # the first failure. + if config.getvalue("usepdb"): + continue_on_failure = False + return continue_on_failure + + +class DoctestTextfile(Module): + obj = None + + def collect(self) -> Iterable[DoctestItem]: + import doctest + + # Inspired by doctest.testfile; ideally we would use it directly, + # but it doesn't support passing a custom checker. + encoding = self.config.getini("doctest_encoding") + text = self.path.read_text(encoding) + filename = str(self.path) + name = self.path.name + globs = {"__name__": "__main__"} + + optionflags = get_optionflags(self.config) + + runner = _get_runner( + verbose=False, + optionflags=optionflags, + checker=_get_checker(), + continue_on_failure=_get_continue_on_failure(self.config), + ) + + parser = doctest.DocTestParser() + test = parser.get_doctest(text, globs, name, filename, 0) + if test.examples: + yield DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + + +def _check_all_skipped(test: doctest.DocTest) -> None: + """Raise pytest.skip() if all examples in the given DocTest have the SKIP + option set.""" + import doctest + + all_skipped = all(x.options.get(doctest.SKIP, False) for x in test.examples) + if all_skipped: + skip("all tests skipped by +SKIP option") + + +def _is_mocked(obj: object) -> bool: + """Return if an object is possibly a mock object by checking the + existence of a highly improbable attribute.""" + return ( + safe_getattr(obj, "pytest_mock_example_attribute_that_shouldnt_exist", None) + is not None + ) + + +@contextmanager +def _patch_unwrap_mock_aware() -> Generator[None]: + """Context manager which replaces ``inspect.unwrap`` with a version + that's aware of mock objects and doesn't recurse into them.""" + real_unwrap = inspect.unwrap + + def _mock_aware_unwrap( + func: Callable[..., Any], *, stop: Callable[[Any], Any] | None = None + ) -> Any: + try: + if stop is None or stop is _is_mocked: + return real_unwrap(func, stop=_is_mocked) + _stop = stop + return real_unwrap(func, stop=lambda obj: _is_mocked(obj) or _stop(func)) + except Exception as e: + warnings.warn( + f"Got {e!r} when unwrapping {func!r}. This is usually caused " + "by a violation of Python's object protocol; see e.g. " + "https://github.com/pytest-dev/pytest/issues/5080", + PytestWarning, + ) + raise + + inspect.unwrap = _mock_aware_unwrap + try: + yield + finally: + inspect.unwrap = real_unwrap + + +class DoctestModule(Module): + def collect(self) -> Iterable[DoctestItem]: + import doctest + + class MockAwareDocTestFinder(doctest.DocTestFinder): + py_ver_info_minor = sys.version_info[:2] + is_find_lineno_broken = ( + py_ver_info_minor < (3, 11) + or (py_ver_info_minor == (3, 11) and sys.version_info.micro < 9) + or (py_ver_info_minor == (3, 12) and sys.version_info.micro < 3) + ) + if is_find_lineno_broken: + + def _find_lineno(self, obj, source_lines): + """On older Pythons, doctest code does not take into account + `@property`. https://github.com/python/cpython/issues/61648 + + Moreover, wrapped Doctests need to be unwrapped so the correct + line number is returned. #8796 + """ + if isinstance(obj, property): + obj = getattr(obj, "fget", obj) + + if hasattr(obj, "__wrapped__"): + # Get the main obj in case of it being wrapped + obj = inspect.unwrap(obj) + + # Type ignored because this is a private function. + return super()._find_lineno( # type:ignore[misc] + obj, + source_lines, + ) + + if sys.version_info < (3, 13): + + def _from_module(self, module, object): + """`cached_property` objects are never considered a part + of the 'current module'. As such they are skipped by doctest. + Here we override `_from_module` to check the underlying + function instead. https://github.com/python/cpython/issues/107995 + """ + if isinstance(object, functools.cached_property): + object = object.func + + # Type ignored because this is a private function. + return super()._from_module(module, object) # type: ignore[misc] + + try: + module = self.obj + except Collector.CollectError: + if self.config.getvalue("doctest_ignore_import_errors"): + skip(f"unable to import module {self.path!r}") + else: + raise + + # While doctests currently don't support fixtures directly, we still + # need to pick up autouse fixtures. + self.session._fixturemanager.parsefactories(self) + + # Uses internal doctest module parsing mechanism. + finder = MockAwareDocTestFinder() + optionflags = get_optionflags(self.config) + runner = _get_runner( + verbose=False, + optionflags=optionflags, + checker=_get_checker(), + continue_on_failure=_get_continue_on_failure(self.config), + ) + + for test in finder.find(module, module.__name__): + if test.examples: # skip empty doctests + yield DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + + +def _init_checker_class() -> type[doctest.OutputChecker]: + import doctest + + class LiteralsOutputChecker(doctest.OutputChecker): + # Based on doctest_nose_plugin.py from the nltk project + # (https://github.com/nltk/nltk) and on the "numtest" doctest extension + # by Sebastien Boisgerault (https://github.com/boisgera/numtest). + + _unicode_literal_re = re.compile(r"(\W|^)[uU]([rR]?[\'\"])", re.UNICODE) + _bytes_literal_re = re.compile(r"(\W|^)[bB]([rR]?[\'\"])", re.UNICODE) + _number_re = re.compile( + r""" + (?P + (?P + (?P [+-]?\d*)\.(?P\d+) + | + (?P [+-]?\d+)\. + ) + (?: + [Ee] + (?P [+-]?\d+) + )? + | + (?P [+-]?\d+) + (?: + [Ee] + (?P [+-]?\d+) + ) + ) + """, + re.VERBOSE, + ) + + def check_output(self, want: str, got: str, optionflags: int) -> bool: + if super().check_output(want, got, optionflags): + return True + + allow_unicode = optionflags & _get_allow_unicode_flag() + allow_bytes = optionflags & _get_allow_bytes_flag() + allow_number = optionflags & _get_number_flag() + + if not allow_unicode and not allow_bytes and not allow_number: + return False + + def remove_prefixes(regex: re.Pattern[str], txt: str) -> str: + return re.sub(regex, r"\1\2", txt) + + if allow_unicode: + want = remove_prefixes(self._unicode_literal_re, want) + got = remove_prefixes(self._unicode_literal_re, got) + + if allow_bytes: + want = remove_prefixes(self._bytes_literal_re, want) + got = remove_prefixes(self._bytes_literal_re, got) + + if allow_number: + got = self._remove_unwanted_precision(want, got) + + return super().check_output(want, got, optionflags) + + def _remove_unwanted_precision(self, want: str, got: str) -> str: + wants = list(self._number_re.finditer(want)) + gots = list(self._number_re.finditer(got)) + if len(wants) != len(gots): + return got + offset = 0 + for w, g in zip(wants, gots, strict=True): + fraction: str | None = w.group("fraction") + exponent: str | None = w.group("exponent1") + if exponent is None: + exponent = w.group("exponent2") + precision = 0 if fraction is None else len(fraction) + if exponent is not None: + precision -= int(exponent) + if float(w.group()) == approx(float(g.group()), abs=10**-precision): + # They're close enough. Replace the text we actually + # got with the text we want, so that it will match when we + # check the string literally. + got = ( + got[: g.start() + offset] + w.group() + got[g.end() + offset :] + ) + offset += w.end() - w.start() - (g.end() - g.start()) + return got + + return LiteralsOutputChecker + + +def _get_checker() -> doctest.OutputChecker: + """Return a doctest.OutputChecker subclass that supports some + additional options: + + * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b'' + prefixes (respectively) in string literals. Useful when the same + doctest should run in Python 2 and Python 3. + + * NUMBER to ignore floating-point differences smaller than the + precision of the literal number in the doctest. + + An inner class is used to avoid importing "doctest" at the module + level. + """ + global CHECKER_CLASS + if CHECKER_CLASS is None: + CHECKER_CLASS = _init_checker_class() + return CHECKER_CLASS() + + +def _get_allow_unicode_flag() -> int: + """Register and return the ALLOW_UNICODE flag.""" + import doctest + + return doctest.register_optionflag("ALLOW_UNICODE") + + +def _get_allow_bytes_flag() -> int: + """Register and return the ALLOW_BYTES flag.""" + import doctest + + return doctest.register_optionflag("ALLOW_BYTES") + + +def _get_number_flag() -> int: + """Register and return the NUMBER flag.""" + import doctest + + return doctest.register_optionflag("NUMBER") + + +def _get_report_choice(key: str) -> int: + """Return the actual `doctest` module flag value. + + We want to do it as late as possible to avoid importing `doctest` and all + its dependencies when parsing options, as it adds overhead and breaks tests. + """ + import doctest + + return { + DOCTEST_REPORT_CHOICE_UDIFF: doctest.REPORT_UDIFF, + DOCTEST_REPORT_CHOICE_CDIFF: doctest.REPORT_CDIFF, + DOCTEST_REPORT_CHOICE_NDIFF: doctest.REPORT_NDIFF, + DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE: doctest.REPORT_ONLY_FIRST_FAILURE, + DOCTEST_REPORT_CHOICE_NONE: 0, + }[key] + + +@fixture(scope="session") +def doctest_namespace() -> dict[str, Any]: + """Fixture that returns a :py:class:`dict` that will be injected into the + namespace of doctests. + + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + """ + return dict() diff --git a/micromamba_root/Lib/site-packages/_pytest/faulthandler.py b/micromamba_root/Lib/site-packages/_pytest/faulthandler.py new file mode 100644 index 0000000000000000000000000000000000000000..080cf583813bf17efb7244e74711db30723af333 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/faulthandler.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Generator +import os +import sys + +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item +from _pytest.stash import StashKey +import pytest + + +fault_handler_original_stderr_fd_key = StashKey[int]() +fault_handler_stderr_fd_key = StashKey[int]() + + +def pytest_addoption(parser: Parser) -> None: + help_timeout = ( + "Dump the traceback of all threads if a test takes " + "more than TIMEOUT seconds to finish" + ) + help_exit_on_timeout = ( + "Exit the test process if a test takes more than " + "faulthandler_timeout seconds to finish" + ) + parser.addini("faulthandler_timeout", help_timeout, default=0.0) + parser.addini( + "faulthandler_exit_on_timeout", help_exit_on_timeout, type="bool", default=False + ) + + +def pytest_configure(config: Config) -> None: + import faulthandler + + # at teardown we want to restore the original faulthandler fileno + # but faulthandler has no api to return the original fileno + # so here we stash the stderr fileno to be used at teardown + # sys.stderr and sys.__stderr__ may be closed or patched during the session + # so we can't rely on their values being good at that point (#11572). + stderr_fileno = get_stderr_fileno() + if faulthandler.is_enabled(): + config.stash[fault_handler_original_stderr_fd_key] = stderr_fileno + config.stash[fault_handler_stderr_fd_key] = os.dup(stderr_fileno) + faulthandler.enable(file=config.stash[fault_handler_stderr_fd_key]) + + +def pytest_unconfigure(config: Config) -> None: + import faulthandler + + faulthandler.disable() + # Close the dup file installed during pytest_configure. + if fault_handler_stderr_fd_key in config.stash: + os.close(config.stash[fault_handler_stderr_fd_key]) + del config.stash[fault_handler_stderr_fd_key] + # Re-enable the faulthandler if it was originally enabled. + if fault_handler_original_stderr_fd_key in config.stash: + faulthandler.enable(config.stash[fault_handler_original_stderr_fd_key]) + del config.stash[fault_handler_original_stderr_fd_key] + + +def get_stderr_fileno() -> int: + try: + fileno = sys.stderr.fileno() + # The Twisted Logger will return an invalid file descriptor since it is not backed + # by an FD. So, let's also forward this to the same code path as with pytest-xdist. + if fileno == -1: + raise AttributeError() + return fileno + except (AttributeError, ValueError): + # pytest-xdist monkeypatches sys.stderr with an object that is not an actual file. + # https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors + # This is potentially dangerous, but the best we can do. + assert sys.__stderr__ is not None + return sys.__stderr__.fileno() + + +def get_timeout_config_value(config: Config) -> float: + return float(config.getini("faulthandler_timeout") or 0.0) + + +def get_exit_on_timeout_config_value(config: Config) -> bool: + exit_on_timeout = config.getini("faulthandler_exit_on_timeout") + assert isinstance(exit_on_timeout, bool) + return exit_on_timeout + + +@pytest.hookimpl(wrapper=True, trylast=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + timeout = get_timeout_config_value(item.config) + exit_on_timeout = get_exit_on_timeout_config_value(item.config) + if timeout > 0: + import faulthandler + + stderr = item.config.stash[fault_handler_stderr_fd_key] + faulthandler.dump_traceback_later(timeout, file=stderr, exit=exit_on_timeout) + try: + return (yield) + finally: + faulthandler.cancel_dump_traceback_later() + else: + return (yield) + + +@pytest.hookimpl(tryfirst=True) +def pytest_enter_pdb() -> None: + """Cancel any traceback dumping due to timeout before entering pdb.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() + + +@pytest.hookimpl(tryfirst=True) +def pytest_exception_interact() -> None: + """Cancel any traceback dumping due to an interactive exception being + raised.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() diff --git a/micromamba_root/Lib/site-packages/_pytest/fixtures.py b/micromamba_root/Lib/site-packages/_pytest/fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..27846db13a472a665105ebb6db1e20b683f30f93 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/fixtures.py @@ -0,0 +1,2047 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import abc +from collections import defaultdict +from collections import deque +from collections import OrderedDict +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import MutableMapping +from collections.abc import Sequence +from collections.abc import Set as AbstractSet +import dataclasses +import functools +import inspect +import os +from pathlib import Path +import sys +import types +from typing import Any +from typing import cast +from typing import Final +from typing import final +from typing import Generic +from typing import NoReturn +from typing import overload +from typing import TYPE_CHECKING +from typing import TypeVar +import warnings + +import _pytest +from _pytest import nodes +from _pytest._code import getfslineno +from _pytest._code import Source +from _pytest._code.code import FormattedExcinfo +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.compat import assert_never +from _pytest.compat import get_real_func +from _pytest.compat import getfuncargnames +from _pytest.compat import getimfunc +from _pytest.compat import getlocation +from _pytest.compat import NOTSET +from _pytest.compat import NotSetType +from _pytest.compat import safe_getattr +from _pytest.compat import safe_isclass +from _pytest.compat import signature +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.deprecated import MARKED_FIXTURE +from _pytest.deprecated import YIELD_FIXTURE +from _pytest.main import Session +from _pytest.mark import Mark +from _pytest.mark import ParameterSet +from _pytest.mark.structures import MarkDecorator +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import TEST_OUTCOME +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.scope import _ScopeName +from _pytest.scope import HIGH_SCOPES +from _pytest.scope import Scope +from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestWarning + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + + +if TYPE_CHECKING: + from _pytest.python import CallSpec2 + from _pytest.python import Function + from _pytest.python import Metafunc + + +# The value of the fixture -- return/yield of the fixture function (type variable). +FixtureValue = TypeVar("FixtureValue", covariant=True) +# The type of the fixture function (type variable). +FixtureFunction = TypeVar("FixtureFunction", bound=Callable[..., object]) +# The type of a fixture function (type alias generic in fixture value). +_FixtureFunc = Callable[..., FixtureValue] | Callable[..., Generator[FixtureValue]] +# The type of FixtureDef.cached_result (type alias generic in fixture value). +_FixtureCachedResult = ( + tuple[ + # The result. + FixtureValue, + # Cache key. + object, + None, + ] + | tuple[ + None, + # Cache key. + object, + # The exception and the original traceback. + tuple[BaseException, types.TracebackType | None], + ] +) + + +def pytest_sessionstart(session: Session) -> None: + session._fixturemanager = FixtureManager(session) + + +def get_scope_package( + node: nodes.Item, + fixturedef: FixtureDef[object], +) -> nodes.Node | None: + from _pytest.python import Package + + for parent in node.iter_parents(): + if isinstance(parent, Package) and parent.nodeid == fixturedef.baseid: + return parent + return node.session + + +def get_scope_node(node: nodes.Node, scope: Scope) -> nodes.Node | None: + """Get the closest parent node (including self) which matches the given + scope. + + If there is no parent node for the scope (e.g. asking for class scope on a + Module, or on a Function when not defined in a class), returns None. + """ + import _pytest.python + + if scope is Scope.Function: + # Type ignored because this is actually safe, see: + # https://github.com/python/mypy/issues/4717 + return node.getparent(nodes.Item) # type: ignore[type-abstract] + elif scope is Scope.Class: + return node.getparent(_pytest.python.Class) + elif scope is Scope.Module: + return node.getparent(_pytest.python.Module) + elif scope is Scope.Package: + return node.getparent(_pytest.python.Package) + elif scope is Scope.Session: + return node.getparent(_pytest.main.Session) + else: + assert_never(scope) + + +# TODO: Try to use FixtureFunctionDefinition instead of the marker +def getfixturemarker(obj: object) -> FixtureFunctionMarker | None: + """Return fixturemarker or None if it doesn't exist""" + if isinstance(obj, FixtureFunctionDefinition): + return obj._fixture_function_marker + return None + + +# Algorithm for sorting on a per-parametrized resource setup basis. +# It is called for Session scope first and performs sorting +# down to the lower scopes such as to minimize number of "high scope" +# setups and teardowns. + + +@dataclasses.dataclass(frozen=True) +class ParamArgKey: + """A key for a high-scoped parameter used by an item. + + For use as a hashable key in `reorder_items`. The combination of fields + is meant to uniquely identify a particular "instance" of a param, + potentially shared by multiple items in a scope. + """ + + #: The param name. + argname: str + param_index: int + #: For scopes Package, Module, Class, the path to the file (directory in + #: Package's case) of the package/module/class where the item is defined. + scoped_item_path: Path | None + #: For Class scope, the class where the item is defined. + item_cls: type | None + + +_V = TypeVar("_V") +OrderedSet = dict[_V, None] + + +def get_param_argkeys(item: nodes.Item, scope: Scope) -> Iterator[ParamArgKey]: + """Return all ParamArgKeys for item matching the specified high scope.""" + assert scope is not Scope.Function + + try: + callspec: CallSpec2 = item.callspec # type: ignore[attr-defined] + except AttributeError: + return + + item_cls = None + if scope is Scope.Session: + scoped_item_path = None + elif scope is Scope.Package: + # Package key = module's directory. + scoped_item_path = item.path.parent + elif scope is Scope.Module: + scoped_item_path = item.path + elif scope is Scope.Class: + scoped_item_path = item.path + item_cls = item.cls # type: ignore[attr-defined] + else: + assert_never(scope) + + for argname in callspec.indices: + if callspec._arg2scope[argname] != scope: + continue + param_index = callspec.indices[argname] + yield ParamArgKey(argname, param_index, scoped_item_path, item_cls) + + +def reorder_items(items: Sequence[nodes.Item]) -> list[nodes.Item]: + argkeys_by_item: dict[Scope, dict[nodes.Item, OrderedSet[ParamArgKey]]] = {} + items_by_argkey: dict[Scope, dict[ParamArgKey, OrderedDict[nodes.Item, None]]] = {} + for scope in HIGH_SCOPES: + scoped_argkeys_by_item = argkeys_by_item[scope] = {} + scoped_items_by_argkey = items_by_argkey[scope] = defaultdict(OrderedDict) + for item in items: + argkeys = dict.fromkeys(get_param_argkeys(item, scope)) + if argkeys: + scoped_argkeys_by_item[item] = argkeys + for argkey in argkeys: + scoped_items_by_argkey[argkey][item] = None + + items_set = dict.fromkeys(items) + return list( + reorder_items_atscope( + items_set, argkeys_by_item, items_by_argkey, Scope.Session + ) + ) + + +def reorder_items_atscope( + items: OrderedSet[nodes.Item], + argkeys_by_item: Mapping[Scope, Mapping[nodes.Item, OrderedSet[ParamArgKey]]], + items_by_argkey: Mapping[ + Scope, Mapping[ParamArgKey, OrderedDict[nodes.Item, None]] + ], + scope: Scope, +) -> OrderedSet[nodes.Item]: + if scope is Scope.Function or len(items) < 3: + return items + + scoped_items_by_argkey = items_by_argkey[scope] + scoped_argkeys_by_item = argkeys_by_item[scope] + + ignore: set[ParamArgKey] = set() + items_deque = deque(items) + items_done: OrderedSet[nodes.Item] = {} + while items_deque: + no_argkey_items: OrderedSet[nodes.Item] = {} + slicing_argkey = None + while items_deque: + item = items_deque.popleft() + if item in items_done or item in no_argkey_items: + continue + argkeys = dict.fromkeys( + k for k in scoped_argkeys_by_item.get(item, ()) if k not in ignore + ) + if not argkeys: + no_argkey_items[item] = None + else: + slicing_argkey, _ = argkeys.popitem() + # We don't have to remove relevant items from later in the + # deque because they'll just be ignored. + matching_items = [ + i for i in scoped_items_by_argkey[slicing_argkey] if i in items + ] + for i in reversed(matching_items): + items_deque.appendleft(i) + # Fix items_by_argkey order. + for other_scope in HIGH_SCOPES: + other_scoped_items_by_argkey = items_by_argkey[other_scope] + for argkey in argkeys_by_item[other_scope].get(i, ()): + argkey_dict = other_scoped_items_by_argkey[argkey] + if not hasattr(sys, "pypy_version_info"): + argkey_dict[i] = None + argkey_dict.move_to_end(i, last=False) + else: + # Work around a bug in PyPy: + # https://github.com/pypy/pypy/issues/5257 + # https://github.com/pytest-dev/pytest/issues/13312 + bkp = argkey_dict.copy() + argkey_dict.clear() + argkey_dict[i] = None + argkey_dict.update(bkp) + break + if no_argkey_items: + reordered_no_argkey_items = reorder_items_atscope( + no_argkey_items, argkeys_by_item, items_by_argkey, scope.next_lower() + ) + items_done.update(reordered_no_argkey_items) + if slicing_argkey is not None: + ignore.add(slicing_argkey) + return items_done + + +@dataclasses.dataclass(frozen=True) +class FuncFixtureInfo: + """Fixture-related information for a fixture-requesting item (e.g. test + function). + + This is used to examine the fixtures which an item requests statically + (known during collection). This includes autouse fixtures, fixtures + requested by the `usefixtures` marker, fixtures requested in the function + parameters, and the transitive closure of these. + + An item may also request fixtures dynamically (using `request.getfixturevalue`); + these are not reflected here. + """ + + __slots__ = ("argnames", "initialnames", "name2fixturedefs", "names_closure") + + # Fixture names that the item requests directly by function parameters. + argnames: tuple[str, ...] + # Fixture names that the item immediately requires. These include + # argnames + fixture names specified via usefixtures and via autouse=True in + # fixture definitions. + initialnames: tuple[str, ...] + # The transitive closure of the fixture names that the item requires. + # Note: can't include dynamic dependencies (`request.getfixturevalue` calls). + names_closure: list[str] + # A map from a fixture name in the transitive closure to the FixtureDefs + # matching the name which are applicable to this function. + # There may be multiple overriding fixtures with the same name. The + # sequence is ordered from furthest to closes to the function. + name2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] + + def prune_dependency_tree(self) -> None: + """Recompute names_closure from initialnames and name2fixturedefs. + + Can only reduce names_closure, which means that the new closure will + always be a subset of the old one. The order is preserved. + + This method is needed because direct parametrization may shadow some + of the fixtures that were included in the originally built dependency + tree. In this way the dependency tree can get pruned, and the closure + of argnames may get reduced. + """ + closure: set[str] = set() + working_set = set(self.initialnames) + while working_set: + argname = working_set.pop() + # Argname may be something not included in the original names_closure, + # in which case we ignore it. This currently happens with pseudo + # FixtureDefs which wrap 'get_direct_param_fixture_func(request)'. + # So they introduce the new dependency 'request' which might have + # been missing in the original tree (closure). + if argname not in closure and argname in self.names_closure: + closure.add(argname) + if argname in self.name2fixturedefs: + working_set.update(self.name2fixturedefs[argname][-1].argnames) + + self.names_closure[:] = sorted(closure, key=self.names_closure.index) + + +class FixtureRequest(abc.ABC): + """The type of the ``request`` fixture. + + A request object gives access to the requesting test context and has a + ``param`` attribute in case the fixture is parametrized. + """ + + def __init__( + self, + pyfuncitem: Function, + fixturename: str | None, + arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]], + fixture_defs: dict[str, FixtureDef[Any]], + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + #: Fixture for which this request is being performed. + self.fixturename: Final = fixturename + self._pyfuncitem: Final = pyfuncitem + # The FixtureDefs for each fixture name requested by this item. + # Starts from the statically-known fixturedefs resolved during + # collection. Dynamically requested fixtures (using + # `request.getfixturevalue("foo")`) are added dynamically. + self._arg2fixturedefs: Final = arg2fixturedefs + # The evaluated argnames so far, mapping to the FixtureDef they resolved + # to. + self._fixture_defs: Final = fixture_defs + # Notes on the type of `param`: + # -`request.param` is only defined in parametrized fixtures, and will raise + # AttributeError otherwise. Python typing has no notion of "undefined", so + # this cannot be reflected in the type. + # - Technically `param` is only (possibly) defined on SubRequest, not + # FixtureRequest, but the typing of that is still in flux so this cheats. + # - In the future we might consider using a generic for the param type, but + # for now just using Any. + self.param: Any + + @property + def _fixturemanager(self) -> FixtureManager: + return self._pyfuncitem.session._fixturemanager + + @property + @abc.abstractmethod + def _scope(self) -> Scope: + raise NotImplementedError() + + @property + def scope(self) -> _ScopeName: + """Scope string, one of "function", "class", "module", "package", "session".""" + return self._scope.value + + @abc.abstractmethod + def _check_scope( + self, + requested_fixturedef: FixtureDef[object], + requested_scope: Scope, + ) -> None: + raise NotImplementedError() + + @property + def fixturenames(self) -> list[str]: + """Names of all active fixtures in this request.""" + result = list(self._pyfuncitem.fixturenames) + result.extend(set(self._fixture_defs).difference(result)) + return result + + @property + @abc.abstractmethod + def node(self): + """Underlying collection node (depends on current request scope).""" + raise NotImplementedError() + + @property + def config(self) -> Config: + """The pytest config object associated with this request.""" + return self._pyfuncitem.config + + @property + def function(self): + """Test function object if the request has a per-function scope.""" + if self.scope != "function": + raise AttributeError( + f"function not available in {self.scope}-scoped context" + ) + return self._pyfuncitem.obj + + @property + def cls(self): + """Class (can be None) where the test function was collected.""" + if self.scope not in ("class", "function"): + raise AttributeError(f"cls not available in {self.scope}-scoped context") + clscol = self._pyfuncitem.getparent(_pytest.python.Class) + if clscol: + return clscol.obj + + @property + def instance(self): + """Instance (can be None) on which test function was collected.""" + if self.scope != "function": + return None + return getattr(self._pyfuncitem, "instance", None) + + @property + def module(self): + """Python module object where the test function was collected.""" + if self.scope not in ("function", "class", "module"): + raise AttributeError(f"module not available in {self.scope}-scoped context") + mod = self._pyfuncitem.getparent(_pytest.python.Module) + assert mod is not None + return mod.obj + + @property + def path(self) -> Path: + """Path where the test function was collected.""" + if self.scope not in ("function", "class", "module", "package"): + raise AttributeError(f"path not available in {self.scope}-scoped context") + return self._pyfuncitem.path + + @property + def keywords(self) -> MutableMapping[str, Any]: + """Keywords/markers dictionary for the underlying node.""" + node: nodes.Node = self.node + return node.keywords + + @property + def session(self) -> Session: + """Pytest session object.""" + return self._pyfuncitem.session + + @abc.abstractmethod + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" + raise NotImplementedError() + + def applymarker(self, marker: str | MarkDecorator) -> None: + """Apply a marker to a single test function invocation. + + This method is useful if you don't want to have a keyword/marker + on all function invocations. + + :param marker: + An object created by a call to ``pytest.mark.NAME(...)``. + """ + self.node.add_marker(marker) + + def raiseerror(self, msg: str | None) -> NoReturn: + """Raise a FixtureLookupError exception. + + :param msg: + An optional custom error message. + """ + raise FixtureLookupError(None, self, msg) + + def getfixturevalue(self, argname: str) -> Any: + """Dynamically run a named fixture function. + + Declaring fixtures via function argument is recommended where possible. + But if you can only decide whether to use another fixture at test + setup time, you may use this function to retrieve it inside a fixture + or test function body. + + This method can be used during the test setup phase or the test run + phase, but during the test teardown phase a fixture's value may not + be available. + + :param argname: + The fixture name. + :raises pytest.FixtureLookupError: + If the given fixture could not be found. + """ + # Note that in addition to the use case described in the docstring, + # getfixturevalue() is also called by pytest itself during item and fixture + # setup to evaluate the fixtures that are requested statically + # (using function parameters, autouse, etc). + + fixturedef = self._get_active_fixturedef(argname) + assert fixturedef.cached_result is not None, ( + f'The fixture value for "{argname}" is not available. ' + "This can happen when the fixture has already been torn down." + ) + return fixturedef.cached_result[0] + + def _iter_chain(self) -> Iterator[SubRequest]: + """Yield all SubRequests in the chain, from self up. + + Note: does *not* yield the TopRequest. + """ + current = self + while isinstance(current, SubRequest): + yield current + current = current._parent_request + + def _get_active_fixturedef(self, argname: str) -> FixtureDef[object]: + if argname == "request": + return RequestFixtureDef(self) + + # If we already finished computing a fixture by this name in this item, + # return it. + fixturedef = self._fixture_defs.get(argname) + if fixturedef is not None: + self._check_scope(fixturedef, fixturedef._scope) + return fixturedef + + # Find the appropriate fixturedef. + fixturedefs = self._arg2fixturedefs.get(argname, None) + if fixturedefs is None: + # We arrive here because of a dynamic call to + # getfixturevalue(argname) which was naturally + # not known at parsing/collection time. + fixturedefs = self._fixturemanager.getfixturedefs(argname, self._pyfuncitem) + if fixturedefs is not None: + self._arg2fixturedefs[argname] = fixturedefs + # No fixtures defined with this name. + if fixturedefs is None: + raise FixtureLookupError(argname, self) + # The are no fixtures with this name applicable for the function. + if not fixturedefs: + raise FixtureLookupError(argname, self) + + # A fixture may override another fixture with the same name, e.g. a + # fixture in a module can override a fixture in a conftest, a fixture in + # a class can override a fixture in the module, and so on. + # An overriding fixture can request its own name (possibly indirectly); + # in this case it gets the value of the fixture it overrides, one level + # up. + # Check how many `argname`s deep we are, and take the next one. + # `fixturedefs` is sorted from furthest to closest, so use negative + # indexing to go in reverse. + index = -1 + for request in self._iter_chain(): + if request.fixturename == argname: + index -= 1 + # If already consumed all of the available levels, fail. + if -index > len(fixturedefs): + raise FixtureLookupError(argname, self) + fixturedef = fixturedefs[index] + + # Prepare a SubRequest object for calling the fixture. + try: + callspec = self._pyfuncitem.callspec + except AttributeError: + callspec = None + if callspec is not None and argname in callspec.params: + param = callspec.params[argname] + param_index = callspec.indices[argname] + # The parametrize invocation scope overrides the fixture's scope. + scope = callspec._arg2scope[argname] + else: + param = NOTSET + param_index = 0 + scope = fixturedef._scope + self._check_fixturedef_without_param(fixturedef) + # The parametrize invocation scope only controls caching behavior while + # allowing wider-scoped fixtures to keep depending on the parametrized + # fixture. Scope control is enforced for parametrized fixtures + # by recreating the whole fixture tree on parameter change. + # Hence `fixturedef._scope`, not `scope`. + self._check_scope(fixturedef, fixturedef._scope) + subrequest = SubRequest( + self, scope, param, param_index, fixturedef, _ispytest=True + ) + + # Make sure the fixture value is cached, running it if it isn't + fixturedef.execute(request=subrequest) + + self._fixture_defs[argname] = fixturedef + return fixturedef + + def _check_fixturedef_without_param(self, fixturedef: FixtureDef[object]) -> None: + """Check that this request is allowed to execute this fixturedef without + a param.""" + funcitem = self._pyfuncitem + has_params = fixturedef.params is not None + fixtures_not_supported = getattr(funcitem, "nofuncargs", False) + if has_params and fixtures_not_supported: + msg = ( + f"{funcitem.name} does not support fixtures, maybe unittest.TestCase subclass?\n" + f"Node id: {funcitem.nodeid}\n" + f"Function type: {type(funcitem).__name__}" + ) + fail(msg, pytrace=False) + if has_params: + frame = inspect.stack()[3] + frameinfo = inspect.getframeinfo(frame[0]) + source_path = absolutepath(frameinfo.filename) + source_lineno = frameinfo.lineno + try: + source_path_str = str(source_path.relative_to(funcitem.config.rootpath)) + except ValueError: + source_path_str = str(source_path) + location = getlocation(fixturedef.func, funcitem.config.rootpath) + msg = ( + "The requested fixture has no parameter defined for test:\n" + f" {funcitem.nodeid}\n\n" + f"Requested fixture '{fixturedef.argname}' defined in:\n" + f"{location}\n\n" + f"Requested here:\n" + f"{source_path_str}:{source_lineno}" + ) + fail(msg, pytrace=False) + + def _get_fixturestack(self) -> list[FixtureDef[Any]]: + values = [request._fixturedef for request in self._iter_chain()] + values.reverse() + return values + + +@final +class TopRequest(FixtureRequest): + """The type of the ``request`` fixture in a test function.""" + + def __init__(self, pyfuncitem: Function, *, _ispytest: bool = False) -> None: + super().__init__( + fixturename=None, + pyfuncitem=pyfuncitem, + arg2fixturedefs=pyfuncitem._fixtureinfo.name2fixturedefs.copy(), + fixture_defs={}, + _ispytest=_ispytest, + ) + + @property + def _scope(self) -> Scope: + return Scope.Function + + def _check_scope( + self, + requested_fixturedef: FixtureDef[object], + requested_scope: Scope, + ) -> None: + # TopRequest always has function scope so always valid. + pass + + @property + def node(self): + return self._pyfuncitem + + def __repr__(self) -> str: + return f"" + + def _fillfixtures(self) -> None: + item = self._pyfuncitem + for argname in item.fixturenames: + if argname not in item.funcargs: + item.funcargs[argname] = self.getfixturevalue(argname) + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self.node.addfinalizer(finalizer) + + +@final +class SubRequest(FixtureRequest): + """The type of the ``request`` fixture in a fixture function requested + (transitively) by a test function.""" + + def __init__( + self, + request: FixtureRequest, + scope: Scope, + param: Any, + param_index: int, + fixturedef: FixtureDef[object], + *, + _ispytest: bool = False, + ) -> None: + super().__init__( + pyfuncitem=request._pyfuncitem, + fixturename=fixturedef.argname, + fixture_defs=request._fixture_defs, + arg2fixturedefs=request._arg2fixturedefs, + _ispytest=_ispytest, + ) + self._parent_request: Final[FixtureRequest] = request + self._scope_field: Final = scope + self._fixturedef: Final[FixtureDef[object]] = fixturedef + if param is not NOTSET: + self.param = param + self.param_index: Final = param_index + + def __repr__(self) -> str: + return f"" + + @property + def _scope(self) -> Scope: + return self._scope_field + + @property + def node(self): + scope = self._scope + if scope is Scope.Function: + # This might also be a non-function Item despite its attribute name. + node: nodes.Node | None = self._pyfuncitem + elif scope is Scope.Package: + node = get_scope_package(self._pyfuncitem, self._fixturedef) + else: + node = get_scope_node(self._pyfuncitem, scope) + if node is None and scope is Scope.Class: + # Fallback to function item itself. + node = self._pyfuncitem + assert node, ( + f'Could not obtain a node for scope "{scope}" for function {self._pyfuncitem!r}' + ) + return node + + def _check_scope( + self, + requested_fixturedef: FixtureDef[object], + requested_scope: Scope, + ) -> None: + if self._scope > requested_scope: + # Try to report something helpful. + argname = requested_fixturedef.argname + fixture_stack = "\n".join( + self._format_fixturedef_line(fixturedef) + for fixturedef in self._get_fixturestack() + ) + requested_fixture = self._format_fixturedef_line(requested_fixturedef) + fail( + f"ScopeMismatch: You tried to access the {requested_scope.value} scoped " + f"fixture {argname} with a {self._scope.value} scoped request object. " + f"Requesting fixture stack:\n{fixture_stack}\n" + f"Requested fixture:\n{requested_fixture}", + pytrace=False, + ) + + def _format_fixturedef_line(self, fixturedef: FixtureDef[object]) -> str: + factory = fixturedef.func + path, lineno = getfslineno(factory) + if isinstance(path, Path): + path = bestrelpath(self._pyfuncitem.session.path, path) + sig = signature(factory) + return f"{path}:{lineno + 1}: def {factory.__name__}{sig}" + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self._fixturedef.addfinalizer(finalizer) + + +@final +class FixtureLookupError(LookupError): + """Could not return a requested fixture (missing or invalid).""" + + def __init__( + self, argname: str | None, request: FixtureRequest, msg: str | None = None + ) -> None: + self.argname = argname + self.request = request + self.fixturestack = request._get_fixturestack() + self.msg = msg + + def formatrepr(self) -> FixtureLookupErrorRepr: + tblines: list[str] = [] + addline = tblines.append + stack = [self.request._pyfuncitem.obj] + stack.extend(map(lambda x: x.func, self.fixturestack)) + msg = self.msg + # This function currently makes an assumption that a non-None msg means we + # have a non-empty `self.fixturestack`. This is currently true, but if + # somebody at some point want to extend the use of FixtureLookupError to + # new cases it might break. + # Add the assert to make it clearer to developer that this will fail, otherwise + # it crashes because `fspath` does not get set due to `stack` being empty. + assert self.msg is None or self.fixturestack, ( + "formatrepr assumptions broken, rewrite it to handle it" + ) + if msg is not None: + # The last fixture raise an error, let's present + # it at the requesting side. + stack = stack[:-1] + for function in stack: + fspath, lineno = getfslineno(function) + try: + lines, _ = inspect.getsourcelines(get_real_func(function)) + except (OSError, IndexError, TypeError): + error_msg = "file %s, line %s: source code not available" + addline(error_msg % (fspath, lineno + 1)) + else: + addline(f"file {fspath}, line {lineno + 1}") + for i, line in enumerate(lines): + line = line.rstrip() + addline(" " + line) + if line.lstrip().startswith("def"): + break + + if msg is None: + fm = self.request._fixturemanager + available = set() + parent = self.request._pyfuncitem.parent + assert parent is not None + for name, fixturedefs in fm._arg2fixturedefs.items(): + faclist = list(fm._matchfactories(fixturedefs, parent)) + if faclist: + available.add(name) + if self.argname in available: + msg = ( + f" recursive dependency involving fixture '{self.argname}' detected" + ) + else: + msg = f"fixture '{self.argname}' not found" + msg += "\n available fixtures: {}".format(", ".join(sorted(available))) + msg += "\n use 'pytest --fixtures [testpath]' for help on them." + + return FixtureLookupErrorRepr(fspath, lineno, tblines, msg, self.argname) + + +class FixtureLookupErrorRepr(TerminalRepr): + def __init__( + self, + filename: str | os.PathLike[str], + firstlineno: int, + tblines: Sequence[str], + errorstring: str, + argname: str | None, + ) -> None: + self.tblines = tblines + self.errorstring = errorstring + self.filename = filename + self.firstlineno = firstlineno + self.argname = argname + + def toterminal(self, tw: TerminalWriter) -> None: + # tw.line("FixtureLookupError: %s" %(self.argname), red=True) + for tbline in self.tblines: + tw.line(tbline.rstrip()) + lines = self.errorstring.split("\n") + if lines: + tw.line( + f"{FormattedExcinfo.fail_marker} {lines[0].strip()}", + red=True, + ) + for line in lines[1:]: + tw.line( + f"{FormattedExcinfo.flow_marker} {line.strip()}", + red=True, + ) + tw.line() + tw.line(f"{os.fspath(self.filename)}:{self.firstlineno + 1}") + + +def call_fixture_func( + fixturefunc: _FixtureFunc[FixtureValue], request: FixtureRequest, kwargs +) -> FixtureValue: + if inspect.isgeneratorfunction(fixturefunc): + fixturefunc = cast(Callable[..., Generator[FixtureValue]], fixturefunc) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) + fixture_result = fixturefunc(**kwargs) + return fixture_result + + +def _teardown_yield_fixture(fixturefunc, it) -> None: + """Execute the teardown of a fixture function by advancing the iterator + after the yield and ensure the iteration ends (if not it means there is + more than one yield in the function).""" + try: + next(it) + except StopIteration: + pass + else: + fs, lineno = getfslineno(fixturefunc) + fail( + f"fixture function has more than one 'yield':\n\n" + f"{Source(fixturefunc).indent()}\n" + f"{fs}:{lineno + 1}", + pytrace=False, + ) + + +def _eval_scope_callable( + scope_callable: Callable[[str, Config], _ScopeName], + fixture_name: str, + config: Config, +) -> _ScopeName: + try: + # Type ignored because there is no typing mechanism to specify + # keyword arguments, currently. + result = scope_callable(fixture_name=fixture_name, config=config) # type: ignore[call-arg] + except Exception as e: + raise TypeError( + f"Error evaluating {scope_callable} while defining fixture '{fixture_name}'.\n" + "Expected a function with the signature (*, fixture_name, config)" + ) from e + if not isinstance(result, str): + fail( + f"Expected {scope_callable} to return a 'str' while defining fixture '{fixture_name}', but it returned:\n" + f"{result!r}", + pytrace=False, + ) + return result + + +class FixtureDef(Generic[FixtureValue]): + """A container for a fixture definition. + + Note: At this time, only explicitly documented fields and methods are + considered public stable API. + """ + + def __init__( + self, + config: Config, + baseid: str | None, + argname: str, + func: _FixtureFunc[FixtureValue], + scope: Scope | _ScopeName | Callable[[str, Config], _ScopeName] | None, + params: Sequence[object] | None, + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None, + *, + _ispytest: bool = False, + # only used in a deprecationwarning msg, can be removed in pytest9 + _autouse: bool = False, + ) -> None: + check_ispytest(_ispytest) + # The "base" node ID for the fixture. + # + # This is a node ID prefix. A fixture is only available to a node (e.g. + # a `Function` item) if the fixture's baseid is a nodeid of a parent of + # node. + # + # For a fixture found in a Collector's object (e.g. a `Module`s module, + # a `Class`'s class), the baseid is the Collector's nodeid. + # + # For a fixture found in a conftest plugin, the baseid is the conftest's + # directory path relative to the rootdir. + # + # For other plugins, the baseid is the empty string (always matches). + self.baseid: Final = baseid or "" + # Whether the fixture was found from a node or a conftest in the + # collection tree. Will be false for fixtures defined in non-conftest + # plugins. + self.has_location: Final = baseid is not None + # The fixture factory function. + self.func: Final = func + # The name by which the fixture may be requested. + self.argname: Final = argname + if scope is None: + scope = Scope.Function + elif callable(scope): + scope = _eval_scope_callable(scope, argname, config) + if isinstance(scope, str): + scope = Scope.from_user( + scope, descr=f"Fixture '{func.__name__}'", where=baseid + ) + self._scope: Final = scope + # If the fixture is directly parametrized, the parameter values. + self.params: Final = params + # If the fixture is directly parametrized, a tuple of explicit IDs to + # assign to the parameter values, or a callable to generate an ID given + # a parameter value. + self.ids: Final = ids + # The names requested by the fixtures. + self.argnames: Final = getfuncargnames(func, name=argname) + # If the fixture was executed, the current value of the fixture. + # Can change if the fixture is executed with different parameters. + self.cached_result: _FixtureCachedResult[FixtureValue] | None = None + self._finalizers: Final[list[Callable[[], object]]] = [] + + # only used to emit a deprecationwarning, can be removed in pytest9 + self._autouse = _autouse + + @property + def scope(self) -> _ScopeName: + """Scope string, one of "function", "class", "module", "package", "session".""" + return self._scope.value + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self._finalizers.append(finalizer) + + def finish(self, request: SubRequest) -> None: + exceptions: list[BaseException] = [] + while self._finalizers: + fin = self._finalizers.pop() + try: + fin() + except BaseException as e: + exceptions.append(e) + node = request.node + node.ihook.pytest_fixture_post_finalizer(fixturedef=self, request=request) + # Even if finalization fails, we invalidate the cached fixture + # value and remove all finalizers because they may be bound methods + # which will keep instances alive. + self.cached_result = None + self._finalizers.clear() + if len(exceptions) == 1: + raise exceptions[0] + elif len(exceptions) > 1: + msg = f'errors while tearing down fixture "{self.argname}" of {node}' + raise BaseExceptionGroup(msg, exceptions[::-1]) + + def execute(self, request: SubRequest) -> FixtureValue: + """Return the value of this fixture, executing it if not cached.""" + # Ensure that the dependent fixtures requested by this fixture are loaded. + # This needs to be done before checking if we have a cached value, since + # if a dependent fixture has their cache invalidated, e.g. due to + # parametrization, they finalize themselves and fixtures depending on it + # (which will likely include this fixture) setting `self.cached_result = None`. + # See #4871 + requested_fixtures_that_should_finalize_us = [] + for argname in self.argnames: + fixturedef = request._get_active_fixturedef(argname) + # Saves requested fixtures in a list so we later can add our finalizer + # to them, ensuring that if a requested fixture gets torn down we get torn + # down first. This is generally handled by SetupState, but still currently + # needed when this fixture is not parametrized but depends on a parametrized + # fixture. + requested_fixtures_that_should_finalize_us.append(fixturedef) + + # Check for (and return) cached value/exception. + if self.cached_result is not None: + request_cache_key = self.cache_key(request) + cache_key = self.cached_result[1] + try: + # Attempt to make a normal == check: this might fail for objects + # which do not implement the standard comparison (like numpy arrays -- #6497). + cache_hit = bool(request_cache_key == cache_key) + except (ValueError, RuntimeError): + # If the comparison raises, use 'is' as fallback. + cache_hit = request_cache_key is cache_key + + if cache_hit: + if self.cached_result[2] is not None: + exc, exc_tb = self.cached_result[2] + raise exc.with_traceback(exc_tb) + else: + return self.cached_result[0] + # We have a previous but differently parametrized fixture instance + # so we need to tear it down before creating a new one. + self.finish(request) + assert self.cached_result is None + + # Add finalizer to requested fixtures we saved previously. + # We make sure to do this after checking for cached value to avoid + # adding our finalizer multiple times. (#12135) + finalizer = functools.partial(self.finish, request=request) + for parent_fixture in requested_fixtures_that_should_finalize_us: + parent_fixture.addfinalizer(finalizer) + + ihook = request.node.ihook + try: + # Setup the fixture, run the code in it, and cache the value + # in self.cached_result. + result: FixtureValue = ihook.pytest_fixture_setup( + fixturedef=self, request=request + ) + finally: + # Schedule our finalizer, even if the setup failed. + request.node.addfinalizer(finalizer) + + return result + + def cache_key(self, request: SubRequest) -> object: + return getattr(request, "param", None) + + def __repr__(self) -> str: + return f"" + + +class RequestFixtureDef(FixtureDef[FixtureRequest]): + """A custom FixtureDef for the special "request" fixture. + + A new one is generated on-demand whenever "request" is requested. + """ + + def __init__(self, request: FixtureRequest) -> None: + super().__init__( + config=request.config, + baseid=None, + argname="request", + func=lambda: request, + scope=Scope.Function, + params=None, + _ispytest=True, + ) + self.cached_result = (request, [0], None) + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + pass + + +def resolve_fixture_function( + fixturedef: FixtureDef[FixtureValue], request: FixtureRequest +) -> _FixtureFunc[FixtureValue]: + """Get the actual callable that can be called to obtain the fixture + value.""" + fixturefunc = fixturedef.func + # The fixture function needs to be bound to the actual + # request.instance so that code working with "fixturedef" behaves + # as expected. + instance = request.instance + if instance is not None: + # Handle the case where fixture is defined not in a test class, but some other class + # (for example a plugin class with a fixture), see #2270. + if hasattr(fixturefunc, "__self__") and not isinstance( + instance, + fixturefunc.__self__.__class__, + ): + return fixturefunc + fixturefunc = getimfunc(fixturedef.func) + if fixturefunc != fixturedef.func: + fixturefunc = fixturefunc.__get__(instance) + return fixturefunc + + +def pytest_fixture_setup( + fixturedef: FixtureDef[FixtureValue], request: SubRequest +) -> FixtureValue: + """Execution of fixture setup.""" + kwargs = {} + for argname in fixturedef.argnames: + kwargs[argname] = request.getfixturevalue(argname) + + fixturefunc = resolve_fixture_function(fixturedef, request) + my_cache_key = fixturedef.cache_key(request) + + if inspect.isasyncgenfunction(fixturefunc) or inspect.iscoroutinefunction( + fixturefunc + ): + auto_str = " with autouse=True" if fixturedef._autouse else "" + + warnings.warn( + PytestRemovedIn9Warning( + f"{request.node.name!r} requested an async fixture " + f"{request.fixturename!r}{auto_str}, with no plugin or hook that " + "handled it. This is usually an error, as pytest does not natively " + "support it. " + "This will turn into an error in pytest 9.\n" + "See: https://docs.pytest.org/en/stable/deprecations.html#sync-test-depending-on-async-fixture" + ), + # no stacklevel will point at users code, so we just point here + stacklevel=1, + ) + + try: + result = call_fixture_func(fixturefunc, request, kwargs) + except TEST_OUTCOME as e: + if isinstance(e, skip.Exception): + # The test requested a fixture which caused a skip. + # Don't show the fixture as the skip location, as then the user + # wouldn't know which test skipped. + e._use_item_location = True + fixturedef.cached_result = (None, my_cache_key, (e, e.__traceback__)) + raise + fixturedef.cached_result = (result, my_cache_key, None) + return result + + +@final +@dataclasses.dataclass(frozen=True) +class FixtureFunctionMarker: + scope: _ScopeName | Callable[[str, Config], _ScopeName] + params: tuple[object, ...] | None + autouse: bool = False + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None + name: str | None = None + + _ispytest: dataclasses.InitVar[bool] = False + + def __post_init__(self, _ispytest: bool) -> None: + check_ispytest(_ispytest) + + def __call__(self, function: FixtureFunction) -> FixtureFunctionDefinition: + if inspect.isclass(function): + raise ValueError("class fixtures not supported (maybe in the future)") + + if isinstance(function, FixtureFunctionDefinition): + raise ValueError( + f"@pytest.fixture is being applied more than once to the same function {function.__name__!r}" + ) + + if hasattr(function, "pytestmark"): + warnings.warn(MARKED_FIXTURE, stacklevel=2) + + fixture_definition = FixtureFunctionDefinition( + function=function, fixture_function_marker=self, _ispytest=True + ) + + name = self.name or function.__name__ + if name == "request": + location = getlocation(function) + fail( + f"'request' is a reserved word for fixtures, use another name:\n {location}", + pytrace=False, + ) + + return fixture_definition + + +# TODO: paramspec/return type annotation tracking and storing +class FixtureFunctionDefinition: + def __init__( + self, + *, + function: Callable[..., Any], + fixture_function_marker: FixtureFunctionMarker, + instance: object | None = None, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self.name = fixture_function_marker.name or function.__name__ + # In order to show the function that this fixture contains in messages. + # Set the __name__ to be same as the function __name__ or the given fixture name. + self.__name__ = self.name + self._fixture_function_marker = fixture_function_marker + if instance is not None: + self._fixture_function = cast( + Callable[..., Any], function.__get__(instance) + ) + else: + self._fixture_function = function + functools.update_wrapper(self, function) + + def __repr__(self) -> str: + return f"" + + def __get__(self, instance, owner=None): + """Behave like a method if the function it was applied to was a method.""" + return FixtureFunctionDefinition( + function=self._fixture_function, + fixture_function_marker=self._fixture_function_marker, + instance=instance, + _ispytest=True, + ) + + def __call__(self, *args: Any, **kwds: Any) -> Any: + message = ( + f'Fixture "{self.name}" called directly. Fixtures are not meant to be called directly,\n' + "but are created automatically when test functions request them as parameters.\n" + "See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and\n" + "https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly" + ) + fail(message, pytrace=False) + + def _get_wrapped_function(self) -> Callable[..., Any]: + return self._fixture_function + + +@overload +def fixture( + fixture_function: Callable[..., object], + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = ..., + params: Iterable[object] | None = ..., + autouse: bool = ..., + ids: Sequence[object | None] | Callable[[Any], object | None] | None = ..., + name: str | None = ..., +) -> FixtureFunctionDefinition: ... + + +@overload +def fixture( + fixture_function: None = ..., + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = ..., + params: Iterable[object] | None = ..., + autouse: bool = ..., + ids: Sequence[object | None] | Callable[[Any], object | None] | None = ..., + name: str | None = None, +) -> FixtureFunctionMarker: ... + + +def fixture( + fixture_function: FixtureFunction | None = None, + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = "function", + params: Iterable[object] | None = None, + autouse: bool = False, + ids: Sequence[object | None] | Callable[[Any], object | None] | None = None, + name: str | None = None, +) -> FixtureFunctionMarker | FixtureFunctionDefinition: + """Decorator to mark a fixture factory function. + + This decorator can be used, with or without parameters, to define a + fixture function. + + The name of the fixture function can later be referenced to cause its + invocation ahead of running tests: test modules or classes can use the + ``pytest.mark.usefixtures(fixturename)`` marker. + + Test functions can directly use fixture names as input arguments in which + case the fixture instance returned from the fixture function will be + injected. + + Fixtures can provide their values to test functions using ``return`` or + ``yield`` statements. When using ``yield`` the code block after the + ``yield`` statement is executed as teardown code regardless of the test + outcome, and must yield exactly once. + + :param scope: + The scope for which this fixture is shared; one of ``"function"`` + (default), ``"class"``, ``"module"``, ``"package"`` or ``"session"``. + + This parameter may also be a callable which receives ``(fixture_name, config)`` + as parameters, and must return a ``str`` with one of the values mentioned above. + + See :ref:`dynamic scope` in the docs for more information. + + :param params: + An optional list of parameters which will cause multiple invocations + of the fixture function and all of the tests using it. The current + parameter is available in ``request.param``. + + :param autouse: + If True, the fixture func is activated for all tests that can see it. + If False (the default), an explicit reference is needed to activate + the fixture. + + :param ids: + Sequence of ids each corresponding to the params so that they are + part of the test id. If no ids are provided they will be generated + automatically from the params. + + :param name: + The name of the fixture. This defaults to the name of the decorated + function. If a fixture is used in the same module in which it is + defined, the function name of the fixture will be shadowed by the + function arg that requests the fixture; one way to resolve this is to + name the decorated function ``fixture_`` and then use + ``@pytest.fixture(name='')``. + """ + fixture_marker = FixtureFunctionMarker( + scope=scope, + params=tuple(params) if params is not None else None, + autouse=autouse, + ids=None if ids is None else ids if callable(ids) else tuple(ids), + name=name, + _ispytest=True, + ) + + # Direct decoration. + if fixture_function: + return fixture_marker(fixture_function) + + return fixture_marker + + +def yield_fixture( + fixture_function=None, + *args, + scope="function", + params=None, + autouse=False, + ids=None, + name=None, +): + """(Return a) decorator to mark a yield-fixture factory function. + + .. deprecated:: 3.0 + Use :py:func:`pytest.fixture` directly instead. + """ + warnings.warn(YIELD_FIXTURE, stacklevel=2) + return fixture( + fixture_function, + *args, + scope=scope, + params=params, + autouse=autouse, + ids=ids, + name=name, + ) + + +@fixture(scope="session") +def pytestconfig(request: FixtureRequest) -> Config: + """Session-scoped fixture that returns the session's :class:`pytest.Config` + object. + + Example:: + + def test_foo(pytestconfig): + if pytestconfig.get_verbosity() > 0: + ... + + """ + return request.config + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "usefixtures", + type="args", + default=[], + help="List of default fixtures to be used with this project", + ) + group = parser.getgroup("general") + group.addoption( + "--fixtures", + "--funcargs", + action="store_true", + dest="showfixtures", + default=False, + help="Show available fixtures, sorted by plugin appearance " + "(fixtures with leading '_' are only shown with '-v')", + ) + group.addoption( + "--fixtures-per-test", + action="store_true", + dest="show_fixtures_per_test", + default=False, + help="Show fixtures per test", + ) + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.showfixtures: + showfixtures(config) + return 0 + if config.option.show_fixtures_per_test: + show_fixtures_per_test(config) + return 0 + return None + + +def _get_direct_parametrize_args(node: nodes.Node) -> set[str]: + """Return all direct parametrization arguments of a node, so we don't + mistake them for fixtures. + + Check https://github.com/pytest-dev/pytest/issues/5036. + + These things are done later as well when dealing with parametrization + so this could be improved. + """ + parametrize_argnames: set[str] = set() + for marker in node.iter_markers(name="parametrize"): + if not marker.kwargs.get("indirect", False): + p_argnames, _ = ParameterSet._parse_parametrize_args( + *marker.args, **marker.kwargs + ) + parametrize_argnames.update(p_argnames) + return parametrize_argnames + + +def deduplicate_names(*seqs: Iterable[str]) -> tuple[str, ...]: + """De-duplicate the sequence of names while keeping the original order.""" + # Ideally we would use a set, but it does not preserve insertion order. + return tuple(dict.fromkeys(name for seq in seqs for name in seq)) + + +class FixtureManager: + """pytest fixture definitions and information is stored and managed + from this class. + + During collection fm.parsefactories() is called multiple times to parse + fixture function definitions into FixtureDef objects and internal + data structures. + + During collection of test functions, metafunc-mechanics instantiate + a FuncFixtureInfo object which is cached per node/func-name. + This FuncFixtureInfo object is later retrieved by Function nodes + which themselves offer a fixturenames attribute. + + The FuncFixtureInfo object holds information about fixtures and FixtureDefs + relevant for a particular function. An initial list of fixtures is + assembled like this: + + - config-defined usefixtures + - autouse-marked fixtures along the collection chain up from the function + - usefixtures markers at module/class/function level + - test function funcargs + + Subsequently the funcfixtureinfo.fixturenames attribute is computed + as the closure of the fixtures needed to setup the initial fixtures, + i.e. fixtures needed by fixture functions themselves are appended + to the fixturenames list. + + Upon the test-setup phases all fixturenames are instantiated, retrieved + by a lookup of their FuncFixtureInfo. + """ + + def __init__(self, session: Session) -> None: + self.session = session + self.config: Config = session.config + # Maps a fixture name (argname) to all of the FixtureDefs in the test + # suite/plugins defined with this name. Populated by parsefactories(). + # TODO: The order of the FixtureDefs list of each arg is significant, + # explain. + self._arg2fixturedefs: Final[dict[str, list[FixtureDef[Any]]]] = {} + self._holderobjseen: Final[set[object]] = set() + # A mapping from a nodeid to a list of autouse fixtures it defines. + self._nodeid_autousenames: Final[dict[str, list[str]]] = { + "": self.config.getini("usefixtures"), + } + session.config.pluginmanager.register(self, "funcmanage") + + def getfixtureinfo( + self, + node: nodes.Item, + func: Callable[..., object] | None, + cls: type | None, + ) -> FuncFixtureInfo: + """Calculate the :class:`FuncFixtureInfo` for an item. + + If ``func`` is None, or if the item sets an attribute + ``nofuncargs = True``, then ``func`` is not examined at all. + + :param node: + The item requesting the fixtures. + :param func: + The item's function. + :param cls: + If the function is a method, the method's class. + """ + if func is not None and not getattr(node, "nofuncargs", False): + argnames = getfuncargnames(func, name=node.name, cls=cls) + else: + argnames = () + usefixturesnames = self._getusefixturesnames(node) + autousenames = self._getautousenames(node) + initialnames = deduplicate_names(autousenames, usefixturesnames, argnames) + + direct_parametrize_args = _get_direct_parametrize_args(node) + + names_closure, arg2fixturedefs = self.getfixtureclosure( + parentnode=node, + initialnames=initialnames, + ignore_args=direct_parametrize_args, + ) + + return FuncFixtureInfo(argnames, initialnames, names_closure, arg2fixturedefs) + + def pytest_plugin_registered(self, plugin: _PluggyPlugin, plugin_name: str) -> None: + # Fixtures defined in conftest plugins are only visible to within the + # conftest's directory. This is unlike fixtures in non-conftest plugins + # which have global visibility. So for conftests, construct the base + # nodeid from the plugin name (which is the conftest path). + if plugin_name and plugin_name.endswith("conftest.py"): + # Note: we explicitly do *not* use `plugin.__file__` here -- The + # difference is that plugin_name has the correct capitalization on + # case-insensitive systems (Windows) and other normalization issues + # (issue #11816). + conftestpath = absolutepath(plugin_name) + try: + nodeid = str(conftestpath.parent.relative_to(self.config.rootpath)) + except ValueError: + nodeid = "" + if nodeid == ".": + nodeid = "" + if os.sep != nodes.SEP: + nodeid = nodeid.replace(os.sep, nodes.SEP) + else: + nodeid = None + + self.parsefactories(plugin, nodeid) + + def _getautousenames(self, node: nodes.Node) -> Iterator[str]: + """Return the names of autouse fixtures applicable to node.""" + for parentnode in node.listchain(): + basenames = self._nodeid_autousenames.get(parentnode.nodeid) + if basenames: + yield from basenames + + def _getusefixturesnames(self, node: nodes.Item) -> Iterator[str]: + """Return the names of usefixtures fixtures applicable to node.""" + for marker_node, mark in node.iter_markers_with_node(name="usefixtures"): + if not mark.args: + marker_node.warn( + PytestWarning( + f"usefixtures() in {node.nodeid} without arguments has no effect" + ) + ) + yield from mark.args + + def getfixtureclosure( + self, + parentnode: nodes.Node, + initialnames: tuple[str, ...], + ignore_args: AbstractSet[str], + ) -> tuple[list[str], dict[str, Sequence[FixtureDef[Any]]]]: + # Collect the closure of all fixtures, starting with the given + # fixturenames as the initial set. As we have to visit all + # factory definitions anyway, we also return an arg2fixturedefs + # mapping so that the caller can reuse it and does not have + # to re-discover fixturedefs again for each fixturename + # (discovering matching fixtures for a given name/node is expensive). + + fixturenames_closure = list(initialnames) + + arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] = {} + + # Track the index for each fixture name in the simulated stack. + # Needed for handling override chains correctly, similar to _get_active_fixturedef. + # Using negative indices: -1 is the most specific (last), -2 is second to last, etc. + current_indices: dict[str, int] = {} + + def process_argname(argname: str) -> None: + # Optimization: already processed this argname. + if current_indices.get(argname) == -1: + return + + if argname not in fixturenames_closure: + fixturenames_closure.append(argname) + + if argname in ignore_args: + return + + fixturedefs = arg2fixturedefs.get(argname) + if not fixturedefs: + fixturedefs = self.getfixturedefs(argname, parentnode) + if not fixturedefs: + # Fixture not defined or not visible (will error during runtest). + return + arg2fixturedefs[argname] = fixturedefs + + index = current_indices.get(argname, -1) + if -index > len(fixturedefs): + # Exhausted the override chain (will error during runtest). + return + fixturedef = fixturedefs[index] + + current_indices[argname] = index - 1 + for dep in fixturedef.argnames: + process_argname(dep) + current_indices[argname] = index + + for name in initialnames: + process_argname(name) + + def sort_by_scope(arg_name: str) -> Scope: + try: + fixturedefs = arg2fixturedefs[arg_name] + except KeyError: + return Scope.Function + else: + return fixturedefs[-1]._scope + + fixturenames_closure.sort(key=sort_by_scope, reverse=True) + return fixturenames_closure, arg2fixturedefs + + def pytest_generate_tests(self, metafunc: Metafunc) -> None: + """Generate new tests based on parametrized fixtures used by the given metafunc""" + + def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]: + args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs) + return args + + for argname in metafunc.fixturenames: + # Get the FixtureDefs for the argname. + fixture_defs = metafunc._arg2fixturedefs.get(argname) + if not fixture_defs: + # Will raise FixtureLookupError at setup time if not parametrized somewhere + # else (e.g @pytest.mark.parametrize) + continue + + # If the test itself parametrizes using this argname, give it + # precedence. + if any( + argname in get_parametrize_mark_argnames(mark) + for mark in metafunc.definition.iter_markers("parametrize") + ): + continue + + # In the common case we only look at the fixture def with the + # closest scope (last in the list). But if the fixture overrides + # another fixture, while requesting the super fixture, keep going + # in case the super fixture is parametrized (#1953). + for fixturedef in reversed(fixture_defs): + # Fixture is parametrized, apply it and stop. + if fixturedef.params is not None: + metafunc.parametrize( + argname, + fixturedef.params, + indirect=True, + scope=fixturedef.scope, + ids=fixturedef.ids, + ) + break + + # Not requesting the overridden super fixture, stop. + if argname not in fixturedef.argnames: + break + + # Try next super fixture, if any. + + def pytest_collection_modifyitems(self, items: list[nodes.Item]) -> None: + # Separate parametrized setups. + items[:] = reorder_items(items) + + def _register_fixture( + self, + *, + name: str, + func: _FixtureFunc[object], + nodeid: str | None, + scope: Scope | _ScopeName | Callable[[str, Config], _ScopeName] = "function", + params: Sequence[object] | None = None, + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None, + autouse: bool = False, + ) -> None: + """Register a fixture + + :param name: + The fixture's name. + :param func: + The fixture's implementation function. + :param nodeid: + The visibility of the fixture. The fixture will be available to the + node with this nodeid and its children in the collection tree. + None means that the fixture is visible to the entire collection tree, + e.g. a fixture defined for general use in a plugin. + :param scope: + The fixture's scope. + :param params: + The fixture's parametrization params. + :param ids: + The fixture's IDs. + :param autouse: + Whether this is an autouse fixture. + """ + fixture_def = FixtureDef( + config=self.config, + baseid=nodeid, + argname=name, + func=func, + scope=scope, + params=params, + ids=ids, + _ispytest=True, + _autouse=autouse, + ) + + faclist = self._arg2fixturedefs.setdefault(name, []) + if fixture_def.has_location: + faclist.append(fixture_def) + else: + # fixturedefs with no location are at the front + # so this inserts the current fixturedef after the + # existing fixturedefs from external plugins but + # before the fixturedefs provided in conftests. + i = len([f for f in faclist if not f.has_location]) + faclist.insert(i, fixture_def) + if autouse: + self._nodeid_autousenames.setdefault(nodeid or "", []).append(name) + + @overload + def parsefactories( + self, + node_or_obj: nodes.Node, + ) -> None: + raise NotImplementedError() + + @overload + def parsefactories( + self, + node_or_obj: object, + nodeid: str | None, + ) -> None: + raise NotImplementedError() + + def parsefactories( + self, + node_or_obj: nodes.Node | object, + nodeid: str | NotSetType | None = NOTSET, + ) -> None: + """Collect fixtures from a collection node or object. + + Found fixtures are parsed into `FixtureDef`s and saved. + + If `node_or_object` is a collection node (with an underlying Python + object), the node's object is traversed and the node's nodeid is used to + determine the fixtures' visibility. `nodeid` must not be specified in + this case. + + If `node_or_object` is an object (e.g. a plugin), the object is + traversed and the given `nodeid` is used to determine the fixtures' + visibility. `nodeid` must be specified in this case; None and "" mean + total visibility. + """ + if nodeid is not NOTSET: + holderobj = node_or_obj + else: + assert isinstance(node_or_obj, nodes.Node) + holderobj = cast(object, node_or_obj.obj) # type: ignore[attr-defined] + assert isinstance(node_or_obj.nodeid, str) + nodeid = node_or_obj.nodeid + if holderobj in self._holderobjseen: + return + + # Avoid accessing `@property` (and other descriptors) when iterating fixtures. + if not safe_isclass(holderobj) and not isinstance(holderobj, types.ModuleType): + holderobj_tp: object = type(holderobj) + else: + holderobj_tp = holderobj + + self._holderobjseen.add(holderobj) + for name in dir(holderobj): + # The attribute can be an arbitrary descriptor, so the attribute + # access below can raise. safe_getattr() ignores such exceptions. + obj_ub = safe_getattr(holderobj_tp, name, None) + if type(obj_ub) is FixtureFunctionDefinition: + marker = obj_ub._fixture_function_marker + if marker.name: + fixture_name = marker.name + else: + fixture_name = name + + # OK we know it is a fixture -- now safe to look up on the _instance_. + try: + obj = getattr(holderobj, name) + # if the fixture is named in the decorator we cannot find it in the module + except AttributeError: + obj = obj_ub + + func = obj._get_wrapped_function() + + self._register_fixture( + name=fixture_name, + nodeid=nodeid, + func=func, + scope=marker.scope, + params=marker.params, + ids=marker.ids, + autouse=marker.autouse, + ) + + def getfixturedefs( + self, argname: str, node: nodes.Node + ) -> Sequence[FixtureDef[Any]] | None: + """Get FixtureDefs for a fixture name which are applicable + to a given node. + + Returns None if there are no fixtures at all defined with the given + name. (This is different from the case in which there are fixtures + with the given name, but none applicable to the node. In this case, + an empty result is returned). + + :param argname: Name of the fixture to search for. + :param node: The requesting Node. + """ + try: + fixturedefs = self._arg2fixturedefs[argname] + except KeyError: + return None + return tuple(self._matchfactories(fixturedefs, node)) + + def _matchfactories( + self, fixturedefs: Iterable[FixtureDef[Any]], node: nodes.Node + ) -> Iterator[FixtureDef[Any]]: + parentnodeids = {n.nodeid for n in node.iter_parents()} + for fixturedef in fixturedefs: + if fixturedef.baseid in parentnodeids: + yield fixturedef + + +def show_fixtures_per_test(config: Config) -> int | ExitCode: + from _pytest.main import wrap_session + + return wrap_session(config, _show_fixtures_per_test) + + +_PYTEST_DIR = Path(_pytest.__file__).parent + + +def _pretty_fixture_path(invocation_dir: Path, func) -> str: + loc = Path(getlocation(func, invocation_dir)) + prefix = Path("...", "_pytest") + try: + return str(prefix / loc.relative_to(_PYTEST_DIR)) + except ValueError: + return bestrelpath(invocation_dir, loc) + + +def _show_fixtures_per_test(config: Config, session: Session) -> None: + import _pytest.config + + session.perform_collect() + invocation_dir = config.invocation_params.dir + tw = _pytest.config.create_terminal_writer(config) + verbose = config.get_verbosity() + + def get_best_relpath(func) -> str: + loc = getlocation(func, invocation_dir) + return bestrelpath(invocation_dir, Path(loc)) + + def write_fixture(fixture_def: FixtureDef[object]) -> None: + argname = fixture_def.argname + if verbose <= 0 and argname.startswith("_"): + return + prettypath = _pretty_fixture_path(invocation_dir, fixture_def.func) + tw.write(f"{argname}", green=True) + tw.write(f" -- {prettypath}", yellow=True) + tw.write("\n") + fixture_doc = inspect.getdoc(fixture_def.func) + if fixture_doc: + write_docstring( + tw, + fixture_doc.split("\n\n", maxsplit=1)[0] + if verbose <= 0 + else fixture_doc, + ) + else: + tw.line(" no docstring available", red=True) + + def write_item(item: nodes.Item) -> None: + # Not all items have _fixtureinfo attribute. + info: FuncFixtureInfo | None = getattr(item, "_fixtureinfo", None) + if info is None or not info.name2fixturedefs: + # This test item does not use any fixtures. + return + tw.line() + tw.sep("-", f"fixtures used by {item.name}") + # TODO: Fix this type ignore. + tw.sep("-", f"({get_best_relpath(item.function)})") # type: ignore[attr-defined] + # dict key not used in loop but needed for sorting. + for _, fixturedefs in sorted(info.name2fixturedefs.items()): + assert fixturedefs is not None + if not fixturedefs: + continue + # Last item is expected to be the one used by the test item. + write_fixture(fixturedefs[-1]) + + for session_item in session.items: + write_item(session_item) + + +def showfixtures(config: Config) -> int | ExitCode: + from _pytest.main import wrap_session + + return wrap_session(config, _showfixtures_main) + + +def _showfixtures_main(config: Config, session: Session) -> None: + import _pytest.config + + session.perform_collect() + invocation_dir = config.invocation_params.dir + tw = _pytest.config.create_terminal_writer(config) + verbose = config.get_verbosity() + + fm = session._fixturemanager + + available = [] + seen: set[tuple[str, str]] = set() + + for argname, fixturedefs in fm._arg2fixturedefs.items(): + assert fixturedefs is not None + if not fixturedefs: + continue + for fixturedef in fixturedefs: + loc = getlocation(fixturedef.func, invocation_dir) + if (fixturedef.argname, loc) in seen: + continue + seen.add((fixturedef.argname, loc)) + available.append( + ( + len(fixturedef.baseid), + fixturedef.func.__module__, + _pretty_fixture_path(invocation_dir, fixturedef.func), + fixturedef.argname, + fixturedef, + ) + ) + + available.sort() + currentmodule = None + for baseid, module, prettypath, argname, fixturedef in available: + if currentmodule != module: + if not module.startswith("_pytest."): + tw.line() + tw.sep("-", f"fixtures defined from {module}") + currentmodule = module + if verbose <= 0 and argname.startswith("_"): + continue + tw.write(f"{argname}", green=True) + if fixturedef.scope != "function": + tw.write(f" [{fixturedef.scope} scope]", cyan=True) + tw.write(f" -- {prettypath}", yellow=True) + tw.write("\n") + doc = inspect.getdoc(fixturedef.func) + if doc: + write_docstring( + tw, doc.split("\n\n", maxsplit=1)[0] if verbose <= 0 else doc + ) + else: + tw.line(" no docstring available", red=True) + tw.line() + + +def write_docstring(tw: TerminalWriter, doc: str, indent: str = " ") -> None: + for line in doc.split("\n"): + tw.line(indent + line) diff --git a/micromamba_root/Lib/site-packages/_pytest/freeze_support.py b/micromamba_root/Lib/site-packages/_pytest/freeze_support.py new file mode 100644 index 0000000000000000000000000000000000000000..959ff071d86be285aecf76a1c49c1e5de27c5cd2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/freeze_support.py @@ -0,0 +1,45 @@ +"""Provides a function to report all internal modules for using freezing +tools.""" + +from __future__ import annotations + +from collections.abc import Iterator +import types + + +def freeze_includes() -> list[str]: + """Return a list of module names used by pytest that should be + included by cx_freeze.""" + import _pytest + + result = list(_iter_all_modules(_pytest)) + return result + + +def _iter_all_modules( + package: str | types.ModuleType, + prefix: str = "", +) -> Iterator[str]: + """Iterate over the names of all modules that can be found in the given + package, recursively. + + >>> import _pytest + >>> list(_iter_all_modules(_pytest)) + ['_pytest._argcomplete', '_pytest._code.code', ...] + """ + import os + import pkgutil + + if isinstance(package, str): + path = package + else: + # Type ignored because typeshed doesn't define ModuleType.__path__ + # (only defined on packages). + package_path = package.__path__ + path, prefix = package_path[0], package.__name__ + "." + for _, name, is_package in pkgutil.iter_modules([path]): + if is_package: + for m in _iter_all_modules(os.path.join(path, name), prefix=name + "."): + yield prefix + m + else: + yield prefix + name diff --git a/micromamba_root/Lib/site-packages/_pytest/helpconfig.py b/micromamba_root/Lib/site-packages/_pytest/helpconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..6a22c9f58ac9b01197195f3cead4764af0adf349 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/helpconfig.py @@ -0,0 +1,293 @@ +# mypy: allow-untyped-defs +"""Version info, help messages, tracing configuration.""" + +from __future__ import annotations + +import argparse +from collections.abc import Generator +from collections.abc import Sequence +import os +import sys +from typing import Any + +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import PrintHelp +from _pytest.config.argparsing import Parser +from _pytest.terminal import TerminalReporter +import pytest + + +class HelpAction(argparse.Action): + """An argparse Action that will raise a PrintHelp exception in order to skip + the rest of the argument parsing when --help is passed. + + This prevents argparse from raising UsageError when `--help` is used along + with missing required arguments when any are defined, for example by + ``pytest_addoption``. This is similar to the way that the builtin argparse + --help option is implemented by raising SystemExit. + + To opt in to this behavior, the parse caller must set + `namespace._raise_print_help = True`. Otherwise it just sets the option. + """ + + def __init__( + self, option_strings: Sequence[str], dest: str, *, help: str | None = None + ) -> None: + super().__init__( + option_strings=option_strings, + dest=dest, + nargs=0, + const=True, + default=False, + help=help, + ) + + def __call__( + self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + values: str | Sequence[Any] | None, + option_string: str | None = None, + ) -> None: + setattr(namespace, self.dest, self.const) + + if getattr(namespace, "_raise_print_help", False): + raise PrintHelp + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--version", + "-V", + action="count", + default=0, + dest="version", + help="Display pytest version and information about plugins. " + "When given twice, also display information about plugins.", + ) + group._addoption( # private to use reserved lower-case short option + "-h", + "--help", + action=HelpAction, + dest="help", + help="Show help message and configuration info", + ) + group._addoption( # private to use reserved lower-case short option + "-p", + action="append", + dest="plugins", + default=[], + metavar="name", + help="Early-load given plugin module name or entry point (multi-allowed). " + "To avoid loading of plugins, use the `no:` prefix, e.g. " + "`no:doctest`. See also --disable-plugin-autoload.", + ) + group.addoption( + "--disable-plugin-autoload", + action="store_true", + default=False, + help="Disable plugin auto-loading through entry point packaging metadata. " + "Only plugins explicitly specified in -p or env var PYTEST_PLUGINS will be loaded.", + ) + group.addoption( + "--traceconfig", + "--trace-config", + action="store_true", + default=False, + help="Trace considerations of conftest.py files", + ) + group.addoption( + "--debug", + action="store", + nargs="?", + const="pytestdebug.log", + dest="debug", + metavar="DEBUG_FILE_NAME", + help="Store internal tracing debug information in this log file. " + "This file is opened with 'w' and truncated as a result, care advised. " + "Default: pytestdebug.log.", + ) + group._addoption( # private to use reserved lower-case short option + "-o", + "--override-ini", + dest="override_ini", + action="append", + help='Override configuration option with "option=value" style, ' + "e.g. `-o strict_xfail=True -o cache_dir=cache`.", + ) + + +@pytest.hookimpl(wrapper=True) +def pytest_cmdline_parse() -> Generator[None, Config, Config]: + config = yield + + if config.option.debug: + # --debug | --debug was provided. + path = config.option.debug + debugfile = open(path, "w", encoding="utf-8") + debugfile.write( + "versions pytest-{}, " + "python-{}\ninvocation_dir={}\ncwd={}\nargs={}\n\n".format( + pytest.__version__, + ".".join(map(str, sys.version_info)), + config.invocation_params.dir, + os.getcwd(), + config.invocation_params.args, + ) + ) + config.trace.root.setwriter(debugfile.write) + undo_tracing = config.pluginmanager.enable_tracing() + sys.stderr.write(f"writing pytest debug information to {path}\n") + + def unset_tracing() -> None: + debugfile.close() + sys.stderr.write(f"wrote pytest debug information to {debugfile.name}\n") + config.trace.root.setwriter(None) + undo_tracing() + + config.add_cleanup(unset_tracing) + + return config + + +def show_version_verbose(config: Config) -> None: + """Show verbose pytest version installation, including plugins.""" + sys.stdout.write( + f"This is pytest version {pytest.__version__}, imported from {pytest.__file__}\n" + ) + plugininfo = getpluginversioninfo(config) + if plugininfo: + for line in plugininfo: + sys.stdout.write(line + "\n") + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + # Note: a single `--version` argument is handled directly by `Config.main()` to avoid starting up the entire + # pytest infrastructure just to display the version (#13574). + if config.option.version > 1: + show_version_verbose(config) + return ExitCode.OK + elif config.option.help: + config._do_configure() + showhelp(config) + config._ensure_unconfigure() + return ExitCode.OK + return None + + +def showhelp(config: Config) -> None: + import textwrap + + reporter: TerminalReporter | None = config.pluginmanager.get_plugin( + "terminalreporter" + ) + assert reporter is not None + tw = reporter._tw + tw.write(config._parser.optparser.format_help()) + tw.line() + tw.line( + "[pytest] configuration options in the first " + "pytest.toml|pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:" + ) + tw.line() + + columns = tw.fullwidth # costly call + indent_len = 24 # based on argparse's max_help_position=24 + indent = " " * indent_len + for name in config._parser._inidict: + help, type, _default = config._parser._inidict[name] + if help is None: + raise TypeError(f"help argument cannot be None for {name}") + spec = f"{name} ({type}):" + tw.write(f" {spec}") + spec_len = len(spec) + if spec_len > (indent_len - 3): + # Display help starting at a new line. + tw.line() + helplines = textwrap.wrap( + help, + columns, + initial_indent=indent, + subsequent_indent=indent, + break_on_hyphens=False, + ) + + for line in helplines: + tw.line(line) + else: + # Display help starting after the spec, following lines indented. + tw.write(" " * (indent_len - spec_len - 2)) + wrapped = textwrap.wrap(help, columns - indent_len, break_on_hyphens=False) + + if wrapped: + tw.line(wrapped[0]) + for line in wrapped[1:]: + tw.line(indent + line) + + tw.line() + tw.line("Environment variables:") + vars = [ + ( + "CI", + "When set to a non-empty value, pytest knows it is running in a " + "CI process and does not truncate summary info", + ), + ("BUILD_NUMBER", "Equivalent to CI"), + ("PYTEST_ADDOPTS", "Extra command line options"), + ("PYTEST_PLUGINS", "Comma-separated plugins to load during startup"), + ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "Set to disable plugin auto-loading"), + ("PYTEST_DEBUG", "Set to enable debug tracing of pytest's internals"), + ("PYTEST_DEBUG_TEMPROOT", "Override the system temporary directory"), + ("PYTEST_THEME", "The Pygments style to use for code output"), + ("PYTEST_THEME_MODE", "Set the PYTEST_THEME to be either 'dark' or 'light'"), + ] + for name, help in vars: + tw.line(f" {name:<24} {help}") + tw.line() + tw.line() + + tw.line("to see available markers type: pytest --markers") + tw.line("to see available fixtures type: pytest --fixtures") + tw.line( + "(shown according to specified file_or_dir or current dir " + "if not specified; fixtures with leading '_' are only shown " + "with the '-v' option" + ) + + for warningreport in reporter.stats.get("warnings", []): + tw.line("warning : " + warningreport.message, red=True) + + +def getpluginversioninfo(config: Config) -> list[str]: + lines = [] + plugininfo = config.pluginmanager.list_plugin_distinfo() + if plugininfo: + lines.append("registered third-party plugins:") + for plugin, dist in plugininfo: + loc = getattr(plugin, "__file__", repr(plugin)) + content = f"{dist.project_name}-{dist.version} at {loc}" + lines.append(" " + content) + return lines + + +def pytest_report_header(config: Config) -> list[str]: + lines = [] + if config.option.debug or config.option.traceconfig: + lines.append(f"using: pytest-{pytest.__version__}") + + verinfo = getpluginversioninfo(config) + if verinfo: + lines.extend(verinfo) + + if config.option.traceconfig: + lines.append("active plugins:") + items = config.pluginmanager.list_name_plugin() + for name, plugin in items: + if hasattr(plugin, "__file__"): + r = plugin.__file__ + else: + r = repr(plugin) + lines.append(f" {name:<20}: {r}") + return lines diff --git a/micromamba_root/Lib/site-packages/_pytest/hookspec.py b/micromamba_root/Lib/site-packages/_pytest/hookspec.py new file mode 100644 index 0000000000000000000000000000000000000000..dab3fb698a2be9c8c9873910893430d9b5e67667 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/hookspec.py @@ -0,0 +1,1342 @@ +# mypy: allow-untyped-defs +# ruff: noqa: T100 +"""Hook specifications for pytest plugins which are invoked by pytest itself +and by builtin plugins.""" + +from __future__ import annotations + +from collections.abc import Mapping +from collections.abc import Sequence +from pathlib import Path +from typing import Any +from typing import TYPE_CHECKING + +from pluggy import HookspecMarker + +from .deprecated import HOOK_LEGACY_PATH_ARG + + +if TYPE_CHECKING: + import pdb + from typing import Literal + import warnings + + from _pytest._code.code import ExceptionInfo + from _pytest._code.code import ExceptionRepr + from _pytest.compat import LEGACY_PATH + from _pytest.config import _PluggyPlugin + from _pytest.config import Config + from _pytest.config import ExitCode + from _pytest.config import PytestPluginManager + from _pytest.config.argparsing import Parser + from _pytest.fixtures import FixtureDef + from _pytest.fixtures import SubRequest + from _pytest.main import Session + from _pytest.nodes import Collector + from _pytest.nodes import Item + from _pytest.outcomes import Exit + from _pytest.python import Class + from _pytest.python import Function + from _pytest.python import Metafunc + from _pytest.python import Module + from _pytest.reports import CollectReport + from _pytest.reports import TestReport + from _pytest.runner import CallInfo + from _pytest.terminal import TerminalReporter + from _pytest.terminal import TestShortLogReport + + +hookspec = HookspecMarker("pytest") + +# ------------------------------------------------------------------------- +# Initialization hooks called for every plugin +# ------------------------------------------------------------------------- + + +@hookspec(historic=True) +def pytest_addhooks(pluginmanager: PytestPluginManager) -> None: + """Called at plugin registration time to allow adding new hooks via a call to + :func:`pluginmanager.add_hookspecs(module_or_class, prefix) `. + + :param pluginmanager: The pytest plugin manager. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered. + """ + + +@hookspec(historic=True) +def pytest_plugin_registered( + plugin: _PluggyPlugin, + plugin_name: str, + manager: PytestPluginManager, +) -> None: + """A new pytest plugin got registered. + + :param plugin: The plugin module or instance. + :param plugin_name: The name by which the plugin is registered. + :param manager: The pytest plugin manager. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered, once for each plugin registered thus far + (including itself!), and for all plugins thereafter when they are + registered. + """ + + +@hookspec(historic=True) +def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None: + """Register argparse-style options and config-style config values, + called once at the beginning of a test run. + + :param parser: + To add command line options, call + :py:func:`parser.addoption(...) `. + To add config-file values call :py:func:`parser.addini(...) + `. + + :param pluginmanager: + The pytest plugin manager, which can be used to install :py:func:`~pytest.hookspec`'s + or :py:func:`~pytest.hookimpl`'s and allow one plugin to call another plugin's hooks + to change how command line options are added. + + Options can later be accessed through the + :py:class:`config ` object, respectively: + + - :py:func:`config.getoption(name) ` to + retrieve the value of a command line option. + + - :py:func:`config.getini(name) ` to retrieve + a value read from a configuration file. + + The config object is passed around on many internal objects via the ``.config`` + attribute or can be retrieved as the ``pytestconfig`` fixture. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered. + + This hook is only called for :ref:`initial conftests `. + """ + + +@hookspec(historic=True) +def pytest_configure(config: Config) -> None: + """Allow plugins and conftest files to perform initial configuration. + + .. note:: + This hook is incompatible with hook wrappers. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + This hook is called for every :ref:`initial conftest ` file + after command line options have been parsed. After that, the hook is called + for other conftest files as they are registered. + """ + + +# ------------------------------------------------------------------------- +# Bootstrapping hooks called for plugins registered early enough: +# internal and 3rd party plugins. +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_cmdline_parse( + pluginmanager: PytestPluginManager, args: list[str] +) -> Config | None: + """Return an initialized :class:`~pytest.Config`, parsing the specified args. + + Stops at first non-None result, see :ref:`firstresult`. + + .. note:: + This hook is only called for plugin classes passed to the + ``plugins`` arg when using `pytest.main`_ to perform an in-process + test run. + + :param pluginmanager: The pytest plugin manager. + :param args: List of arguments passed on the command line. + :returns: A pytest config object. + + Use in conftest plugins + ======================= + + This hook is not called for conftest files. + """ + + +def pytest_load_initial_conftests( + early_config: Config, parser: Parser, args: list[str] +) -> None: + """Called to implement the loading of :ref:`initial conftest files + ` ahead of command line option parsing. + + :param early_config: The pytest config object. + :param args: Arguments passed on the command line. + :param parser: To add command line options. + + Use in conftest plugins + ======================= + + This hook is not called for conftest files. + """ + + +@hookspec(firstresult=True) +def pytest_cmdline_main(config: Config) -> ExitCode | int | None: + """Called for performing the main command line action. + + The default implementation will invoke the configure hooks and + :hook:`pytest_runtestloop`. + + Stops at first non-None result, see :ref:`firstresult`. + + :param config: The pytest config object. + :returns: The exit code. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +# ------------------------------------------------------------------------- +# collection hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_collection(session: Session) -> object | None: + """Perform the collection phase for the given session. + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + The default collection phase is this (see individual hooks for full details): + + 1. Starting from ``session`` as the initial collector: + + 1. ``pytest_collectstart(collector)`` + 2. ``report = pytest_make_collect_report(collector)`` + 3. ``pytest_exception_interact(collector, call, report)`` if an interactive exception occurred + 4. For each collected node: + + 1. If an item, ``pytest_itemcollected(item)`` + 2. If a collector, recurse into it. + + 5. ``pytest_collectreport(report)`` + + 2. ``pytest_collection_modifyitems(session, config, items)`` + + 1. ``pytest_deselected(items)`` for any deselected items (may be called multiple times) + + 3. Set ``session.items`` to the list of collected items + 4. ``pytest_collection_finish(session)`` + 5. Set ``session.testscollected`` to the number of collected items + + You can implement this hook to only perform some action before collection, + for example the terminal plugin uses it to start displaying the collection + counter (and returns `None`). + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +def pytest_collection_modifyitems( + session: Session, config: Config, items: list[Item] +) -> None: + """Called after collection has been performed. May filter or re-order + the items in-place. + + When items are deselected (filtered out from ``items``), + the hook :hook:`pytest_deselected` must be called explicitly + with the deselected items to properly notify other plugins, + e.g. with ``config.hook.pytest_deselected(items=deselected_items)``. + + :param session: The pytest session object. + :param config: The pytest config object. + :param items: List of item objects. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_collection_finish(session: Session) -> None: + """Called after collection has been performed and modified. + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec( + firstresult=True, + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="collection_path" + ), + }, +) +def pytest_ignore_collect( + collection_path: Path, path: LEGACY_PATH, config: Config +) -> bool | None: + """Return ``True`` to ignore this path for collection. + + Return ``None`` to let other plugins ignore the path for collection. + + Returning ``False`` will forcefully *not* ignore this path for collection, + without giving a chance for other plugins to ignore this path. + + This hook is consulted for all files and directories prior to calling + more specific hooks. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collection_path: The path to analyze. + :type collection_path: pathlib.Path + :param path: The path to analyze (deprecated). + :param config: The pytest config object. + + .. versionchanged:: 7.0.0 + The ``collection_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. The ``path`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collection path, only + conftest files in parent directories of the collection path are consulted + (if the path is a directory, its own conftest file is *not* consulted - a + directory cannot ignore itself!). + """ + + +@hookspec(firstresult=True) +def pytest_collect_directory(path: Path, parent: Collector) -> Collector | None: + """Create a :class:`~pytest.Collector` for the given directory, or None if + not relevant. + + .. versionadded:: 8.0 + + For best results, the returned collector should be a subclass of + :class:`~pytest.Directory`, but this is not required. + + The new node needs to have the specified ``parent`` as a parent. + + Stops at first non-None result, see :ref:`firstresult`. + + :param path: The path to analyze. + :type path: pathlib.Path + + See :ref:`custom directory collectors` for a simple example of use of this + hook. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collection path, only + conftest files in parent directories of the collection path are consulted + (if the path is a directory, its own conftest file is *not* consulted - a + directory cannot collect itself!). + """ + + +@hookspec( + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="file_path" + ), + }, +) +def pytest_collect_file( + file_path: Path, path: LEGACY_PATH, parent: Collector +) -> Collector | None: + """Create a :class:`~pytest.Collector` for the given path, or None if not relevant. + + For best results, the returned collector should be a subclass of + :class:`~pytest.File`, but this is not required. + + The new node needs to have the specified ``parent`` as a parent. + + :param file_path: The path to analyze. + :type file_path: pathlib.Path + :param path: The path to collect (deprecated). + + .. versionchanged:: 7.0.0 + The ``file_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. The ``path`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given file path, only + conftest files in parent directories of the file path are consulted. + """ + + +# logging hooks for collection + + +def pytest_collectstart(collector: Collector) -> None: + """Collector starts collecting. + + :param collector: + The collector. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +def pytest_itemcollected(item: Item) -> None: + """We just collected a test item. + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_collectreport(report: CollectReport) -> None: + """Collector finished collecting. + + :param report: + The collect report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +def pytest_deselected(items: Sequence[Item]) -> None: + """Called for deselected test items, e.g. by keyword. + + Note that this hook has two integration aspects for plugins: + + - it can be *implemented* to be notified of deselected items + - it must be *called* from :hook:`pytest_collection_modifyitems` + implementations when items are deselected (to properly notify other plugins). + + May be called multiple times. + + :param items: + The items. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_make_collect_report(collector: Collector) -> CollectReport | None: + """Perform :func:`collector.collect() ` and return + a :class:`~pytest.CollectReport`. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The collector. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +# ------------------------------------------------------------------------- +# Python test function related hooks +# ------------------------------------------------------------------------- + + +@hookspec( + firstresult=True, + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="module_path" + ), + }, +) +def pytest_pycollect_makemodule( + module_path: Path, path: LEGACY_PATH, parent +) -> Module | None: + """Return a :class:`pytest.Module` collector or None for the given path. + + This hook will be called for each matching test module path. + The :hook:`pytest_collect_file` hook needs to be used if you want to + create test modules for files that do not match as a test module. + + Stops at first non-None result, see :ref:`firstresult`. + + :param module_path: The path of the module to collect. + :type module_path: pathlib.Path + :param path: The path of the module to collect (deprecated). + + .. versionchanged:: 7.0.0 + The ``module_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. + + The ``path`` parameter has been deprecated in favor of ``fspath``. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given parent collector, + only conftest files in the collector's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> None | Item | Collector | list[Item | Collector]: + """Return a custom item/collector for a Python object in a module, or None. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The module/class collector. + :param name: + The name of the object in the module/class. + :param obj: + The object. + :returns: + The created items/collectors. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: + """Call underlying test function. + + Stops at first non-None result, see :ref:`firstresult`. + + :param pyfuncitem: + The function item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only + conftest files in the item's directory and its parent directories + are consulted. + """ + + +def pytest_generate_tests(metafunc: Metafunc) -> None: + """Generate (multiple) parametrized calls to a test function. + + :param metafunc: + The :class:`~pytest.Metafunc` helper for the test function. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given function definition, + only conftest files in the functions's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_make_parametrize_id(config: Config, val: object, argname: str) -> str | None: + """Return a user-friendly string representation of the given ``val`` + that will be used by @pytest.mark.parametrize calls, or None if the hook + doesn't know about ``val``. + + The parameter name is available as ``argname``, if required. + + Stops at first non-None result, see :ref:`firstresult`. + + :param config: The pytest config object. + :param val: The parametrized value. + :param argname: The automatic parameter name produced by pytest. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +# ------------------------------------------------------------------------- +# runtest related hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_runtestloop(session: Session) -> object | None: + """Perform the main runtest loop (after collection finished). + + The default hook implementation performs the runtest protocol for all items + collected in the session (``session.items``), unless the collection failed + or the ``collectonly`` pytest option is set. + + If at any point :py:func:`pytest.exit` is called, the loop is + terminated immediately. + + If at any point ``session.shouldfail`` or ``session.shouldstop`` are set, the + loop is terminated after the runtest protocol for the current item is finished. + + :param session: The pytest session object. + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_runtest_protocol(item: Item, nextitem: Item | None) -> object | None: + """Perform the runtest protocol for a single test item. + + The default runtest protocol is this (see individual hooks for full details): + + - ``pytest_runtest_logstart(nodeid, location)`` + + - Setup phase: + - ``call = pytest_runtest_setup(item)`` (wrapped in ``CallInfo(when="setup")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - Call phase, if the setup passed and the ``setuponly`` pytest option is not set: + - ``call = pytest_runtest_call(item)`` (wrapped in ``CallInfo(when="call")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - Teardown phase: + - ``call = pytest_runtest_teardown(item, nextitem)`` (wrapped in ``CallInfo(when="teardown")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - ``pytest_runtest_logfinish(nodeid, location)`` + + :param item: Test item for which the runtest protocol is performed. + :param nextitem: The scheduled-to-be-next test item (or None if this is the end my friend). + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +def pytest_runtest_logstart(nodeid: str, location: tuple[str, int | None, str]) -> None: + """Called at the start of running the runtest protocol for a single item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param nodeid: Full node ID of the item. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_logfinish( + nodeid: str, location: tuple[str, int | None, str] +) -> None: + """Called at the end of running the runtest protocol for a single item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param nodeid: Full node ID of the item. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_setup(item: Item) -> None: + """Called to perform the setup phase for a test item. + + The default implementation runs ``setup()`` on ``item`` and all of its + parents (which haven't been setup yet). This includes obtaining the + values of fixtures required by the item (which haven't been obtained + yet). + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_call(item: Item) -> None: + """Called to run the test for test item (the call phase). + + The default implementation calls ``item.runtest()``. + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_teardown(item: Item, nextitem: Item | None) -> None: + """Called to perform the teardown phase for a test item. + + The default implementation runs the finalizers and calls ``teardown()`` + on ``item`` and all of its parents (which need to be torn down). This + includes running the teardown phase of fixtures required by the item (if + they go out of scope). + + :param item: + The item. + :param nextitem: + The scheduled-to-be-next test item (None if no further test item is + scheduled). This argument is used to perform exact teardowns, i.e. + calling just enough finalizers so that nextitem only needs to call + setup functions. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> TestReport | None: + """Called to create a :class:`~pytest.TestReport` for each of + the setup, call and teardown runtest phases of a test item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param item: The item. + :param call: The :class:`~pytest.CallInfo` for the phase. + + Stops at first non-None result, see :ref:`firstresult`. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_logreport(report: TestReport) -> None: + """Process the :class:`~pytest.TestReport` produced for each + of the setup, call and teardown runtest phases of an item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_report_to_serializable( + config: Config, + report: CollectReport | TestReport, +) -> dict[str, Any] | None: + """Serialize the given report object into a data structure suitable for + sending over the wire, e.g. converted to JSON. + + :param config: The pytest config object. + :param report: The report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. The exact details may depend + on the plugin which calls the hook. + """ + + +@hookspec(firstresult=True) +def pytest_report_from_serializable( + config: Config, + data: dict[str, Any], +) -> CollectReport | TestReport | None: + """Restore a report object previously serialized with + :hook:`pytest_report_to_serializable`. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. The exact details may depend + on the plugin which calls the hook. + """ + + +# ------------------------------------------------------------------------- +# Fixture related hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[Any], request: SubRequest +) -> object | None: + """Perform fixture setup execution. + + :param fixturedef: + The fixture definition object. + :param request: + The fixture request object. + :returns: + The return value of the call to the fixture function. + + Stops at first non-None result, see :ref:`firstresult`. + + .. note:: + If the fixture function returns None, other implementations of + this hook function will continue to be called, according to the + behavior of the :ref:`firstresult` option. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given fixture, only + conftest files in the fixture scope's directory and its parent directories + are consulted. + """ + + +def pytest_fixture_post_finalizer( + fixturedef: FixtureDef[Any], request: SubRequest +) -> None: + """Called after fixture teardown, but before the cache is cleared, so + the fixture result ``fixturedef.cached_result`` is still available (not + ``None``). + + :param fixturedef: + The fixture definition object. + :param request: + The fixture request object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given fixture, only + conftest files in the fixture scope's directory and its parent directories + are consulted. + """ + + +# ------------------------------------------------------------------------- +# test session related hooks +# ------------------------------------------------------------------------- + + +def pytest_sessionstart(session: Session) -> None: + """Called after the ``Session`` object has been created and before performing collection + and entering the run test loop. + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +def pytest_sessionfinish( + session: Session, + exitstatus: int | ExitCode, +) -> None: + """Called after whole test run finished, right before returning the exit status to the system. + + :param session: The pytest session object. + :param exitstatus: The status which pytest will return to the system. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +def pytest_unconfigure(config: Config) -> None: + """Called before test process is exited. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +# ------------------------------------------------------------------------- +# hooks for customizing the assert methods +# ------------------------------------------------------------------------- + + +def pytest_assertrepr_compare( + config: Config, op: str, left: object, right: object +) -> list[str] | None: + """Return explanation for comparisons in failing assert expressions. + + Return None for no custom explanation, otherwise return a list + of strings. The strings will be joined by newlines but any newlines + *in* a string will be escaped. Note that all but the first line will + be indented slightly, the intention is for the first line to be a summary. + + :param config: The pytest config object. + :param op: The operator, e.g. `"=="`, `"!="`, `"not in"`. + :param left: The left operand. + :param right: The right operand. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_assertion_pass(item: Item, lineno: int, orig: str, expl: str) -> None: + """Called whenever an assertion passes. + + .. versionadded:: 5.0 + + Use this hook to do some processing after a passing assertion. + The original assertion information is available in the `orig` string + and the pytest introspected assertion information is available in the + `expl` string. + + This hook must be explicitly enabled by the :confval:`enable_assertion_pass_hook` + configuration option: + + .. tab:: toml + + .. code-block:: toml + + [pytest] + enable_assertion_pass_hook = true + + .. tab:: ini + + .. code-block:: ini + + [pytest] + enable_assertion_pass_hook = true + + You need to **clean the .pyc** files in your project directory and interpreter libraries + when enabling this option, as assertions will require to be re-written. + + :param item: pytest item object of current test. + :param lineno: Line number of the assert statement. + :param orig: String with the original assertion. + :param expl: String with the assert explanation. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +# ------------------------------------------------------------------------- +# Hooks for influencing reporting (invoked from _pytest_terminal). +# ------------------------------------------------------------------------- + + +@hookspec( + warn_on_impl_args={ + "startdir": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="startdir", pathlib_path_arg="start_path" + ), + }, +) +def pytest_report_header( # type:ignore[empty-body] + config: Config, start_path: Path, startdir: LEGACY_PATH +) -> str | list[str]: + """Return a string or list of strings to be displayed as header info for terminal reporting. + + :param config: The pytest config object. + :param start_path: The starting dir. + :type start_path: pathlib.Path + :param startdir: The starting dir (deprecated). + + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. + + .. versionchanged:: 7.0.0 + The ``start_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``startdir`` parameter. The ``startdir`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +@hookspec( + warn_on_impl_args={ + "startdir": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="startdir", pathlib_path_arg="start_path" + ), + }, +) +def pytest_report_collectionfinish( # type:ignore[empty-body] + config: Config, + start_path: Path, + startdir: LEGACY_PATH, + items: Sequence[Item], +) -> str | list[str]: + """Return a string or list of strings to be displayed after collection + has finished successfully. + + These strings will be displayed after the standard "collected X items" message. + + .. versionadded:: 3.2 + + :param config: The pytest config object. + :param start_path: The starting dir. + :type start_path: pathlib.Path + :param startdir: The starting dir (deprecated). + :param items: List of pytest items that are going to be executed; this list should not be modified. + + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. + + .. versionchanged:: 7.0.0 + The ``start_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``startdir`` parameter. The ``startdir`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_report_teststatus( # type:ignore[empty-body] + report: CollectReport | TestReport, config: Config +) -> TestShortLogReport | tuple[str, str, str | tuple[str, Mapping[str, bool]]]: + """Return result-category, shortletter and verbose word for status + reporting. + + The result-category is a category in which to count the result, for + example "passed", "skipped", "error" or the empty string. + + The shortletter is shown as testing progresses, for example ".", "s", + "E" or the empty string. + + The verbose word is shown as testing progresses in verbose mode, for + example "PASSED", "SKIPPED", "ERROR" or the empty string. + + pytest may style these implicitly according to the report outcome. + To provide explicit styling, return a tuple for the verbose word, + for example ``"rerun", "R", ("RERUN", {"yellow": True})``. + + :param report: The report object whose status is to be returned. + :param config: The pytest config object. + :returns: The test status. + + Stops at first non-None result, see :ref:`firstresult`. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_terminal_summary( + terminalreporter: TerminalReporter, + exitstatus: ExitCode, + config: Config, +) -> None: + """Add a section to terminal summary reporting. + + :param terminalreporter: The internal terminal reporter object. + :param exitstatus: The exit status that will be reported back to the OS. + :param config: The pytest config object. + + .. versionadded:: 4.2 + The ``config`` parameter. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec(historic=True) +def pytest_warning_recorded( + warning_message: warnings.WarningMessage, + when: Literal["config", "collect", "runtest"], + nodeid: str, + location: tuple[str, int, str] | None, +) -> None: + """Process a warning captured by the internal pytest warnings plugin. + + :param warning_message: + The captured warning. This is the same object produced by :class:`warnings.catch_warnings`, + and contains the same attributes as the parameters of :py:func:`warnings.showwarning`. + + :param when: + Indicates when the warning was captured. Possible values: + + * ``"config"``: during pytest configuration/initialization stage. + * ``"collect"``: during test collection. + * ``"runtest"``: during test execution. + + :param nodeid: + Full id of the item. Empty string for warnings that are not specific to + a particular node. + + :param location: + When available, holds information about the execution context of the captured + warning (filename, linenumber, function). ``function`` evaluates to + when the execution context is at the module level. + + .. versionadded:: 6.0 + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. If the warning is specific to a + particular node, only conftest files in parent directories of the node are + consulted. + """ + + +# ------------------------------------------------------------------------- +# Hooks for influencing skipping +# ------------------------------------------------------------------------- + + +def pytest_markeval_namespace( # type:ignore[empty-body] + config: Config, +) -> dict[str, Any]: + """Called when constructing the globals dictionary used for + evaluating string conditions in xfail/skipif markers. + + This is useful when the condition for a marker requires + objects that are expensive or impossible to obtain during + collection time, which is required by normal boolean + conditions. + + .. versionadded:: 6.2 + + :param config: The pytest config object. + :returns: A dictionary of additional globals to add. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in parent directories of the item are consulted. + """ + + +# ------------------------------------------------------------------------- +# error handling and internal debugging hooks +# ------------------------------------------------------------------------- + + +def pytest_internalerror( + excrepr: ExceptionRepr, + excinfo: ExceptionInfo[BaseException], +) -> bool | None: + """Called for internal errors. + + Return True to suppress the fallback handling of printing an + INTERNALERROR message directly to sys.stderr. + + :param excrepr: The exception repr object. + :param excinfo: The exception info. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_keyboard_interrupt( + excinfo: ExceptionInfo[KeyboardInterrupt | Exit], +) -> None: + """Called for keyboard interrupt. + + :param excinfo: The exception info. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_exception_interact( + node: Item | Collector, + call: CallInfo[Any], + report: CollectReport | TestReport, +) -> None: + """Called when an exception was raised which can potentially be + interactively handled. + + May be called during collection (see :hook:`pytest_make_collect_report`), + in which case ``report`` is a :class:`~pytest.CollectReport`. + + May be called during runtest of an item (see :hook:`pytest_runtest_protocol`), + in which case ``report`` is a :class:`~pytest.TestReport`. + + This hook is not called if the exception that was raised is an internal + exception like ``skip.Exception``. + + :param node: + The item or collector. + :param call: + The call information. Contains the exception. + :param report: + The collection or test report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given node, only conftest + files in parent directories of the node are consulted. + """ + + +def pytest_enter_pdb(config: Config, pdb: pdb.Pdb) -> None: + """Called upon pdb.set_trace(). + + Can be used by plugins to take special action just before the python + debugger enters interactive mode. + + :param config: The pytest config object. + :param pdb: The Pdb instance. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_leave_pdb(config: Config, pdb: pdb.Pdb) -> None: + """Called when leaving pdb (e.g. with continue after pdb.set_trace()). + + Can be used by plugins to take special action just after the python + debugger leaves interactive mode. + + :param config: The pytest config object. + :param pdb: The Pdb instance. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ diff --git a/micromamba_root/Lib/site-packages/_pytest/junitxml.py b/micromamba_root/Lib/site-packages/_pytest/junitxml.py new file mode 100644 index 0000000000000000000000000000000000000000..ae8d2b94d3672077480b555ce0f03e9e3daa3860 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/junitxml.py @@ -0,0 +1,695 @@ +# mypy: allow-untyped-defs +"""Report test results in JUnit-XML format, for use with Jenkins and build +integration servers. + +Based on initial code from Ross Lawley. + +Output conforms to +https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd +""" + +from __future__ import annotations + +from collections.abc import Callable +import functools +import os +import platform +import re +import xml.etree.ElementTree as ET + +from _pytest import nodes +from _pytest import timing +from _pytest._code.code import ExceptionRepr +from _pytest._code.code import ReprFileLocation +from _pytest.config import Config +from _pytest.config import filename_arg +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureRequest +from _pytest.reports import TestReport +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter +import pytest + + +xml_key = StashKey["LogXML"]() + + +def bin_xml_escape(arg: object) -> str: + r"""Visually escape invalid XML characters. + + For example, transforms + 'hello\aworld\b' + into + 'hello#x07world#x08' + Note that the #xABs are *not* XML escapes - missing the ampersand «. + The idea is to escape visually for the user rather than for XML itself. + """ + + def repl(matchobj: re.Match[str]) -> str: + i = ord(matchobj.group()) + if i <= 0xFF: + return f"#x{i:02X}" + else: + return f"#x{i:04X}" + + # The spec range of valid chars is: + # Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + # For an unknown(?) reason, we disallow #x7F (DEL) as well. + illegal_xml_re = ( + "[^\u0009\u000a\u000d\u0020-\u007e\u0080-\ud7ff\ue000-\ufffd\u10000-\u10ffff]" + ) + return re.sub(illegal_xml_re, repl, str(arg)) + + +def merge_family(left, right) -> None: + result = {} + for kl, vl in left.items(): + for kr, vr in right.items(): + if not isinstance(vl, list): + raise TypeError(type(vl)) + result[kl] = vl + vr + left.update(result) + + +families = { # pylint: disable=dict-init-mutate + "_base": {"testcase": ["classname", "name"]}, + "_base_legacy": {"testcase": ["file", "line", "url"]}, +} +# xUnit 1.x inherits legacy attributes. +families["xunit1"] = families["_base"].copy() +merge_family(families["xunit1"], families["_base_legacy"]) + +# xUnit 2.x uses strict base attributes. +families["xunit2"] = families["_base"] + + +class _NodeReporter: + def __init__(self, nodeid: str | TestReport, xml: LogXML) -> None: + self.id = nodeid + self.xml = xml + self.add_stats = self.xml.add_stats + self.family = self.xml.family + self.duration = 0.0 + self.properties: list[tuple[str, str]] = [] + self.nodes: list[ET.Element] = [] + self.attrs: dict[str, str] = {} + + def append(self, node: ET.Element) -> None: + self.xml.add_stats(node.tag) + self.nodes.append(node) + + def add_property(self, name: str, value: object) -> None: + self.properties.append((str(name), bin_xml_escape(value))) + + def add_attribute(self, name: str, value: object) -> None: + self.attrs[str(name)] = bin_xml_escape(value) + + def make_properties_node(self) -> ET.Element | None: + """Return a Junit node containing custom properties, if any.""" + if self.properties: + properties = ET.Element("properties") + for name, value in self.properties: + properties.append(ET.Element("property", name=name, value=value)) + return properties + return None + + def record_testreport(self, testreport: TestReport) -> None: + names = mangle_test_address(testreport.nodeid) + existing_attrs = self.attrs + classnames = names[:-1] + if self.xml.prefix: + classnames.insert(0, self.xml.prefix) + attrs: dict[str, str] = { + "classname": ".".join(classnames), + "name": bin_xml_escape(names[-1]), + "file": testreport.location[0], + } + if testreport.location[1] is not None: + attrs["line"] = str(testreport.location[1]) + if hasattr(testreport, "url"): + attrs["url"] = testreport.url + self.attrs = attrs + self.attrs.update(existing_attrs) # Restore any user-defined attributes. + + # Preserve legacy testcase behavior. + if self.family == "xunit1": + return + + # Filter out attributes not permitted by this test family. + # Including custom attributes because they are not valid here. + temp_attrs = {} + for key in self.attrs: + if key in families[self.family]["testcase"]: + temp_attrs[key] = self.attrs[key] + self.attrs = temp_attrs + + def to_xml(self) -> ET.Element: + testcase = ET.Element("testcase", self.attrs, time=f"{self.duration:.3f}") + properties = self.make_properties_node() + if properties is not None: + testcase.append(properties) + testcase.extend(self.nodes) + return testcase + + def _add_simple(self, tag: str, message: str, data: str | None = None) -> None: + node = ET.Element(tag, message=message) + node.text = bin_xml_escape(data) + self.append(node) + + def write_captured_output(self, report: TestReport) -> None: + if not self.xml.log_passing_tests and report.passed: + return + + content_out = report.capstdout + content_log = report.caplog + content_err = report.capstderr + if self.xml.logging == "no": + return + content_all = "" + if self.xml.logging in ["log", "all"]: + content_all = self._prepare_content(content_log, " Captured Log ") + if self.xml.logging in ["system-out", "out-err", "all"]: + content_all += self._prepare_content(content_out, " Captured Out ") + self._write_content(report, content_all, "system-out") + content_all = "" + if self.xml.logging in ["system-err", "out-err", "all"]: + content_all += self._prepare_content(content_err, " Captured Err ") + self._write_content(report, content_all, "system-err") + content_all = "" + if content_all: + self._write_content(report, content_all, "system-out") + + def _prepare_content(self, content: str, header: str) -> str: + return "\n".join([header.center(80, "-"), content, ""]) + + def _write_content(self, report: TestReport, content: str, jheader: str) -> None: + tag = ET.Element(jheader) + tag.text = bin_xml_escape(content) + self.append(tag) + + def append_pass(self, report: TestReport) -> None: + self.add_stats("passed") + + def append_failure(self, report: TestReport) -> None: + # msg = str(report.longrepr.reprtraceback.extraline) + if hasattr(report, "wasxfail"): + self._add_simple("skipped", "xfail-marked test passes unexpectedly") + else: + assert report.longrepr is not None + reprcrash: ReprFileLocation | None = getattr( + report.longrepr, "reprcrash", None + ) + if reprcrash is not None: + message = reprcrash.message + else: + message = str(report.longrepr) + message = bin_xml_escape(message) + self._add_simple("failure", message, str(report.longrepr)) + + def append_collect_error(self, report: TestReport) -> None: + # msg = str(report.longrepr.reprtraceback.extraline) + assert report.longrepr is not None + self._add_simple("error", "collection failure", str(report.longrepr)) + + def append_collect_skipped(self, report: TestReport) -> None: + self._add_simple("skipped", "collection skipped", str(report.longrepr)) + + def append_error(self, report: TestReport) -> None: + assert report.longrepr is not None + reprcrash: ReprFileLocation | None = getattr(report.longrepr, "reprcrash", None) + if reprcrash is not None: + reason = reprcrash.message + else: + reason = str(report.longrepr) + + if report.when == "teardown": + msg = f'failed on teardown with "{reason}"' + else: + msg = f'failed on setup with "{reason}"' + self._add_simple("error", bin_xml_escape(msg), str(report.longrepr)) + + def append_skipped(self, report: TestReport) -> None: + if hasattr(report, "wasxfail"): + xfailreason = report.wasxfail + if xfailreason.startswith("reason: "): + xfailreason = xfailreason[8:] + xfailreason = bin_xml_escape(xfailreason) + skipped = ET.Element("skipped", type="pytest.xfail", message=xfailreason) + self.append(skipped) + else: + assert isinstance(report.longrepr, tuple) + filename, lineno, skipreason = report.longrepr + if skipreason.startswith("Skipped: "): + skipreason = skipreason[9:] + details = f"{filename}:{lineno}: {skipreason}" + + skipped = ET.Element( + "skipped", type="pytest.skip", message=bin_xml_escape(skipreason) + ) + skipped.text = bin_xml_escape(details) + self.append(skipped) + self.write_captured_output(report) + + def finalize(self) -> None: + data = self.to_xml() + self.__dict__.clear() + # Type ignored because mypy doesn't like overriding a method. + # Also the return value doesn't match... + self.to_xml = lambda: data # type: ignore[method-assign] + + +def _warn_incompatibility_with_xunit2( + request: FixtureRequest, fixture_name: str +) -> None: + """Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.""" + from _pytest.warning_types import PytestWarning + + xml = request.config.stash.get(xml_key, None) + if xml is not None and xml.family not in ("xunit1", "legacy"): + request.node.warn( + PytestWarning( + f"{fixture_name} is incompatible with junit_family '{xml.family}' (use 'legacy' or 'xunit1')" + ) + ) + + +@pytest.fixture +def record_property(request: FixtureRequest) -> Callable[[str, object], None]: + """Add extra properties to the calling test. + + User properties become part of the test report and are available to the + configured reporters, like JUnit XML. + + The fixture is callable with ``name, value``. The value is automatically + XML-encoded. + + Example:: + + def test_function(record_property): + record_property("example_key", 1) + """ + _warn_incompatibility_with_xunit2(request, "record_property") + + def append_property(name: str, value: object) -> None: + request.node.user_properties.append((name, value)) + + return append_property + + +@pytest.fixture +def record_xml_attribute(request: FixtureRequest) -> Callable[[str, object], None]: + """Add extra xml attributes to the tag for the calling test. + + The fixture is callable with ``name, value``. The value is + automatically XML-encoded. + """ + from _pytest.warning_types import PytestExperimentalApiWarning + + request.node.warn( + PytestExperimentalApiWarning("record_xml_attribute is an experimental feature") + ) + + _warn_incompatibility_with_xunit2(request, "record_xml_attribute") + + # Declare noop + def add_attr_noop(name: str, value: object) -> None: + pass + + attr_func = add_attr_noop + + xml = request.config.stash.get(xml_key, None) + if xml is not None: + node_reporter = xml.node_reporter(request.node.nodeid) + attr_func = node_reporter.add_attribute + + return attr_func + + +def _check_record_param_type(param: str, v: str) -> None: + """Used by record_testsuite_property to check that the given parameter name is of the proper + type.""" + __tracebackhide__ = True + if not isinstance(v, str): + msg = "{param} parameter needs to be a string, but {g} given" # type: ignore[unreachable] + raise TypeError(msg.format(param=param, g=type(v).__name__)) + + +@pytest.fixture(scope="session") +def record_testsuite_property(request: FixtureRequest) -> Callable[[str, object], None]: + """Record a new ```` tag as child of the root ````. + + This is suitable to writing global information regarding the entire test + suite, and is compatible with ``xunit2`` JUnit family. + + This is a ``session``-scoped fixture which is called with ``(name, value)``. Example: + + .. code-block:: python + + def test_foo(record_testsuite_property): + record_testsuite_property("ARCH", "PPC") + record_testsuite_property("STORAGE_TYPE", "CEPH") + + :param name: + The property name. + :param value: + The property value. Will be converted to a string. + + .. warning:: + + Currently this fixture **does not work** with the + `pytest-xdist `__ plugin. See + :issue:`7767` for details. + """ + __tracebackhide__ = True + + def record_func(name: str, value: object) -> None: + """No-op function in case --junit-xml was not passed in the command-line.""" + __tracebackhide__ = True + _check_record_param_type("name", name) + + xml = request.config.stash.get(xml_key, None) + if xml is not None: + record_func = xml.add_global_property + return record_func + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting") + group.addoption( + "--junitxml", + "--junit-xml", + action="store", + dest="xmlpath", + metavar="path", + type=functools.partial(filename_arg, optname="--junitxml"), + default=None, + help="Create junit-xml style report file at given path", + ) + group.addoption( + "--junitprefix", + "--junit-prefix", + action="store", + metavar="str", + default=None, + help="Prepend prefix to classnames in junit-xml output", + ) + parser.addini( + "junit_suite_name", "Test suite name for JUnit report", default="pytest" + ) + parser.addini( + "junit_logging", + "Write captured log messages to JUnit report: " + "one of no|log|system-out|system-err|out-err|all", + default="no", + ) + parser.addini( + "junit_log_passing_tests", + "Capture log information for passing tests to JUnit report: ", + type="bool", + default=True, + ) + parser.addini( + "junit_duration_report", + "Duration time to report: one of total|call", + default="total", + ) # choices=['total', 'call']) + parser.addini( + "junit_family", + "Emit XML for schema: one of legacy|xunit1|xunit2", + default="xunit2", + ) + + +def pytest_configure(config: Config) -> None: + xmlpath = config.option.xmlpath + # Prevent opening xmllog on worker nodes (xdist). + if xmlpath and not hasattr(config, "workerinput"): + junit_family = config.getini("junit_family") + config.stash[xml_key] = LogXML( + xmlpath, + config.option.junitprefix, + config.getini("junit_suite_name"), + config.getini("junit_logging"), + config.getini("junit_duration_report"), + junit_family, + config.getini("junit_log_passing_tests"), + ) + config.pluginmanager.register(config.stash[xml_key]) + + +def pytest_unconfigure(config: Config) -> None: + xml = config.stash.get(xml_key, None) + if xml: + del config.stash[xml_key] + config.pluginmanager.unregister(xml) + + +def mangle_test_address(address: str) -> list[str]: + path, possible_open_bracket, params = address.partition("[") + names = path.split("::") + # Convert file path to dotted path. + names[0] = names[0].replace(nodes.SEP, ".") + names[0] = re.sub(r"\.py$", "", names[0]) + # Put any params back. + names[-1] += possible_open_bracket + params + return names + + +class LogXML: + def __init__( + self, + logfile, + prefix: str | None, + suite_name: str = "pytest", + logging: str = "no", + report_duration: str = "total", + family="xunit1", + log_passing_tests: bool = True, + ) -> None: + logfile = os.path.expanduser(os.path.expandvars(logfile)) + self.logfile = os.path.normpath(os.path.abspath(logfile)) + self.prefix = prefix + self.suite_name = suite_name + self.logging = logging + self.log_passing_tests = log_passing_tests + self.report_duration = report_duration + self.family = family + self.stats: dict[str, int] = dict.fromkeys( + ["error", "passed", "failure", "skipped"], 0 + ) + self.node_reporters: dict[tuple[str | TestReport, object], _NodeReporter] = {} + self.node_reporters_ordered: list[_NodeReporter] = [] + self.global_properties: list[tuple[str, str]] = [] + + # List of reports that failed on call but teardown is pending. + self.open_reports: list[TestReport] = [] + self.cnt_double_fail_tests = 0 + + # Replaces convenience family with real family. + if self.family == "legacy": + self.family = "xunit1" + + def finalize(self, report: TestReport) -> None: + nodeid = getattr(report, "nodeid", report) + # Local hack to handle xdist report order. + workernode = getattr(report, "node", None) + reporter = self.node_reporters.pop((nodeid, workernode)) + + for propname, propvalue in report.user_properties: + reporter.add_property(propname, str(propvalue)) + + if reporter is not None: + reporter.finalize() + + def node_reporter(self, report: TestReport | str) -> _NodeReporter: + nodeid: str | TestReport = getattr(report, "nodeid", report) + # Local hack to handle xdist report order. + workernode = getattr(report, "node", None) + + key = nodeid, workernode + + if key in self.node_reporters: + # TODO: breaks for --dist=each + return self.node_reporters[key] + + reporter = _NodeReporter(nodeid, self) + + self.node_reporters[key] = reporter + self.node_reporters_ordered.append(reporter) + + return reporter + + def add_stats(self, key: str) -> None: + if key in self.stats: + self.stats[key] += 1 + + def _opentestcase(self, report: TestReport) -> _NodeReporter: + reporter = self.node_reporter(report) + reporter.record_testreport(report) + return reporter + + def pytest_runtest_logreport(self, report: TestReport) -> None: + """Handle a setup/call/teardown report, generating the appropriate + XML tags as necessary. + + Note: due to plugins like xdist, this hook may be called in interlaced + order with reports from other nodes. For example: + + Usual call order: + -> setup node1 + -> call node1 + -> teardown node1 + -> setup node2 + -> call node2 + -> teardown node2 + + Possible call order in xdist: + -> setup node1 + -> call node1 + -> setup node2 + -> call node2 + -> teardown node2 + -> teardown node1 + """ + close_report = None + if report.passed: + if report.when == "call": # ignore setup/teardown + reporter = self._opentestcase(report) + reporter.append_pass(report) + elif report.failed: + if report.when == "teardown": + # The following vars are needed when xdist plugin is used. + report_wid = getattr(report, "worker_id", None) + report_ii = getattr(report, "item_index", None) + close_report = next( + ( + rep + for rep in self.open_reports + if ( + rep.nodeid == report.nodeid + and getattr(rep, "item_index", None) == report_ii + and getattr(rep, "worker_id", None) == report_wid + ) + ), + None, + ) + if close_report: + # We need to open new testcase in case we have failure in + # call and error in teardown in order to follow junit + # schema. + self.finalize(close_report) + self.cnt_double_fail_tests += 1 + reporter = self._opentestcase(report) + if report.when == "call": + reporter.append_failure(report) + self.open_reports.append(report) + if not self.log_passing_tests: + reporter.write_captured_output(report) + else: + reporter.append_error(report) + elif report.skipped: + reporter = self._opentestcase(report) + reporter.append_skipped(report) + self.update_testcase_duration(report) + if report.when == "teardown": + reporter = self._opentestcase(report) + reporter.write_captured_output(report) + + self.finalize(report) + report_wid = getattr(report, "worker_id", None) + report_ii = getattr(report, "item_index", None) + close_report = next( + ( + rep + for rep in self.open_reports + if ( + rep.nodeid == report.nodeid + and getattr(rep, "item_index", None) == report_ii + and getattr(rep, "worker_id", None) == report_wid + ) + ), + None, + ) + if close_report: + self.open_reports.remove(close_report) + + def update_testcase_duration(self, report: TestReport) -> None: + """Accumulate total duration for nodeid from given report and update + the Junit.testcase with the new total if already created.""" + if self.report_duration in {"total", report.when}: + reporter = self.node_reporter(report) + reporter.duration += getattr(report, "duration", 0.0) + + def pytest_collectreport(self, report: TestReport) -> None: + if not report.passed: + reporter = self._opentestcase(report) + if report.failed: + reporter.append_collect_error(report) + else: + reporter.append_collect_skipped(report) + + def pytest_internalerror(self, excrepr: ExceptionRepr) -> None: + reporter = self.node_reporter("internal") + reporter.attrs.update(classname="pytest", name="internal") + reporter._add_simple("error", "internal error", str(excrepr)) + + def pytest_sessionstart(self) -> None: + self.suite_start = timing.Instant() + + def pytest_sessionfinish(self) -> None: + dirname = os.path.dirname(os.path.abspath(self.logfile)) + # exist_ok avoids filesystem race conditions between checking path existence and requesting creation + os.makedirs(dirname, exist_ok=True) + + with open(self.logfile, "w", encoding="utf-8") as logfile: + duration = self.suite_start.elapsed() + + numtests = ( + self.stats["passed"] + + self.stats["failure"] + + self.stats["skipped"] + + self.stats["error"] + - self.cnt_double_fail_tests + ) + logfile.write('') + + suite_node = ET.Element( + "testsuite", + name=self.suite_name, + errors=str(self.stats["error"]), + failures=str(self.stats["failure"]), + skipped=str(self.stats["skipped"]), + tests=str(numtests), + time=f"{duration.seconds:.3f}", + timestamp=self.suite_start.as_utc().astimezone().isoformat(), + hostname=platform.node(), + ) + global_properties = self._get_global_properties_node() + if global_properties is not None: + suite_node.append(global_properties) + for node_reporter in self.node_reporters_ordered: + suite_node.append(node_reporter.to_xml()) + testsuites = ET.Element("testsuites") + testsuites.set("name", "pytest tests") + testsuites.append(suite_node) + logfile.write(ET.tostring(testsuites, encoding="unicode")) + + def pytest_terminal_summary( + self, terminalreporter: TerminalReporter, config: pytest.Config + ) -> None: + if config.get_verbosity() >= 0: + terminalreporter.write_sep("-", f"generated xml file: {self.logfile}") + + def add_global_property(self, name: str, value: object) -> None: + __tracebackhide__ = True + _check_record_param_type("name", name) + self.global_properties.append((name, bin_xml_escape(value))) + + def _get_global_properties_node(self) -> ET.Element | None: + """Return a Junit node containing custom properties, if any.""" + if self.global_properties: + properties = ET.Element("properties") + for name, value in self.global_properties: + properties.append(ET.Element("property", name=name, value=value)) + return properties + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/legacypath.py b/micromamba_root/Lib/site-packages/_pytest/legacypath.py new file mode 100644 index 0000000000000000000000000000000000000000..59e8ef6e7427ed2f548c1da72c9acceb82ef31fa --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/legacypath.py @@ -0,0 +1,468 @@ +# mypy: allow-untyped-defs +"""Add backward compatibility support for the legacy py path type.""" + +from __future__ import annotations + +import dataclasses +from pathlib import Path +import shlex +import subprocess +from typing import Final +from typing import final +from typing import TYPE_CHECKING + +from iniconfig import SectionWrapper + +from _pytest.cacheprovider import Cache +from _pytest.compat import LEGACY_PATH +from _pytest.compat import legacy_path +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.pytester import HookRecorder +from _pytest.pytester import Pytester +from _pytest.pytester import RunResult +from _pytest.terminal import TerminalReporter +from _pytest.tmpdir import TempPathFactory + + +if TYPE_CHECKING: + import pexpect + + +@final +class Testdir: + """ + Similar to :class:`Pytester`, but this class works with legacy legacy_path objects instead. + + All methods just forward to an internal :class:`Pytester` instance, converting results + to `legacy_path` objects as necessary. + """ + + __test__ = False + + CLOSE_STDIN: Final = Pytester.CLOSE_STDIN + TimeoutExpired: Final = Pytester.TimeoutExpired + + def __init__(self, pytester: Pytester, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._pytester = pytester + + @property + def tmpdir(self) -> LEGACY_PATH: + """Temporary directory where tests are executed.""" + return legacy_path(self._pytester.path) + + @property + def test_tmproot(self) -> LEGACY_PATH: + return legacy_path(self._pytester._test_tmproot) + + @property + def request(self): + return self._pytester._request + + @property + def plugins(self): + return self._pytester.plugins + + @plugins.setter + def plugins(self, plugins): + self._pytester.plugins = plugins + + @property + def monkeypatch(self) -> MonkeyPatch: + return self._pytester._monkeypatch + + def make_hook_recorder(self, pluginmanager) -> HookRecorder: + """See :meth:`Pytester.make_hook_recorder`.""" + return self._pytester.make_hook_recorder(pluginmanager) + + def chdir(self) -> None: + """See :meth:`Pytester.chdir`.""" + return self._pytester.chdir() + + def finalize(self) -> None: + return self._pytester._finalize() + + def makefile(self, ext, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.makefile`.""" + if ext and not ext.startswith("."): + # pytester.makefile is going to throw a ValueError in a way that + # testdir.makefile did not, because + # pathlib.Path is stricter suffixes than py.path + # This ext arguments is likely user error, but since testdir has + # allowed this, we will prepend "." as a workaround to avoid breaking + # testdir usage that worked before + ext = "." + ext + return legacy_path(self._pytester.makefile(ext, *args, **kwargs)) + + def makeconftest(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makeconftest`.""" + return legacy_path(self._pytester.makeconftest(source)) + + def makeini(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makeini`.""" + return legacy_path(self._pytester.makeini(source)) + + def getinicfg(self, source: str) -> SectionWrapper: + """See :meth:`Pytester.getinicfg`.""" + return self._pytester.getinicfg(source) + + def makepyprojecttoml(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makepyprojecttoml`.""" + return legacy_path(self._pytester.makepyprojecttoml(source)) + + def makepyfile(self, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.makepyfile`.""" + return legacy_path(self._pytester.makepyfile(*args, **kwargs)) + + def maketxtfile(self, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.maketxtfile`.""" + return legacy_path(self._pytester.maketxtfile(*args, **kwargs)) + + def syspathinsert(self, path=None) -> None: + """See :meth:`Pytester.syspathinsert`.""" + return self._pytester.syspathinsert(path) + + def mkdir(self, name) -> LEGACY_PATH: + """See :meth:`Pytester.mkdir`.""" + return legacy_path(self._pytester.mkdir(name)) + + def mkpydir(self, name) -> LEGACY_PATH: + """See :meth:`Pytester.mkpydir`.""" + return legacy_path(self._pytester.mkpydir(name)) + + def copy_example(self, name=None) -> LEGACY_PATH: + """See :meth:`Pytester.copy_example`.""" + return legacy_path(self._pytester.copy_example(name)) + + def getnode(self, config: Config, arg) -> Item | Collector | None: + """See :meth:`Pytester.getnode`.""" + return self._pytester.getnode(config, arg) + + def getpathnode(self, path): + """See :meth:`Pytester.getpathnode`.""" + return self._pytester.getpathnode(path) + + def genitems(self, colitems: list[Item | Collector]) -> list[Item]: + """See :meth:`Pytester.genitems`.""" + return self._pytester.genitems(colitems) + + def runitem(self, source): + """See :meth:`Pytester.runitem`.""" + return self._pytester.runitem(source) + + def inline_runsource(self, source, *cmdlineargs): + """See :meth:`Pytester.inline_runsource`.""" + return self._pytester.inline_runsource(source, *cmdlineargs) + + def inline_genitems(self, *args): + """See :meth:`Pytester.inline_genitems`.""" + return self._pytester.inline_genitems(*args) + + def inline_run(self, *args, plugins=(), no_reraise_ctrlc: bool = False): + """See :meth:`Pytester.inline_run`.""" + return self._pytester.inline_run( + *args, plugins=plugins, no_reraise_ctrlc=no_reraise_ctrlc + ) + + def runpytest_inprocess(self, *args, **kwargs) -> RunResult: + """See :meth:`Pytester.runpytest_inprocess`.""" + return self._pytester.runpytest_inprocess(*args, **kwargs) + + def runpytest(self, *args, **kwargs) -> RunResult: + """See :meth:`Pytester.runpytest`.""" + return self._pytester.runpytest(*args, **kwargs) + + def parseconfig(self, *args) -> Config: + """See :meth:`Pytester.parseconfig`.""" + return self._pytester.parseconfig(*args) + + def parseconfigure(self, *args) -> Config: + """See :meth:`Pytester.parseconfigure`.""" + return self._pytester.parseconfigure(*args) + + def getitem(self, source, funcname="test_func"): + """See :meth:`Pytester.getitem`.""" + return self._pytester.getitem(source, funcname) + + def getitems(self, source): + """See :meth:`Pytester.getitems`.""" + return self._pytester.getitems(source) + + def getmodulecol(self, source, configargs=(), withinit=False): + """See :meth:`Pytester.getmodulecol`.""" + return self._pytester.getmodulecol( + source, configargs=configargs, withinit=withinit + ) + + def collect_by_name(self, modcol: Collector, name: str) -> Item | Collector | None: + """See :meth:`Pytester.collect_by_name`.""" + return self._pytester.collect_by_name(modcol, name) + + def popen( + self, + cmdargs, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=CLOSE_STDIN, + **kw, + ): + """See :meth:`Pytester.popen`.""" + return self._pytester.popen(cmdargs, stdout, stderr, stdin, **kw) + + def run(self, *cmdargs, timeout=None, stdin=CLOSE_STDIN) -> RunResult: + """See :meth:`Pytester.run`.""" + return self._pytester.run(*cmdargs, timeout=timeout, stdin=stdin) + + def runpython(self, script) -> RunResult: + """See :meth:`Pytester.runpython`.""" + return self._pytester.runpython(script) + + def runpython_c(self, command): + """See :meth:`Pytester.runpython_c`.""" + return self._pytester.runpython_c(command) + + def runpytest_subprocess(self, *args, timeout=None) -> RunResult: + """See :meth:`Pytester.runpytest_subprocess`.""" + return self._pytester.runpytest_subprocess(*args, timeout=timeout) + + def spawn_pytest(self, string: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """See :meth:`Pytester.spawn_pytest`.""" + return self._pytester.spawn_pytest(string, expect_timeout=expect_timeout) + + def spawn(self, cmd: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """See :meth:`Pytester.spawn`.""" + return self._pytester.spawn(cmd, expect_timeout=expect_timeout) + + def __repr__(self) -> str: + return f"" + + def __str__(self) -> str: + return str(self.tmpdir) + + +class LegacyTestdirPlugin: + @staticmethod + @fixture + def testdir(pytester: Pytester) -> Testdir: + """ + Identical to :fixture:`pytester`, and provides an instance whose methods return + legacy ``LEGACY_PATH`` objects instead when applicable. + + New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. + """ + return Testdir(pytester, _ispytest=True) + + +@final +@dataclasses.dataclass +class TempdirFactory: + """Backward compatibility wrapper that implements ``py.path.local`` + for :class:`TempPathFactory`. + + .. note:: + These days, it is preferred to use ``tmp_path_factory``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + """ + + _tmppath_factory: TempPathFactory + + def __init__( + self, tmppath_factory: TempPathFactory, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + self._tmppath_factory = tmppath_factory + + def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: + """Same as :meth:`TempPathFactory.mktemp`, but returns a ``py.path.local`` object.""" + return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) + + def getbasetemp(self) -> LEGACY_PATH: + """Same as :meth:`TempPathFactory.getbasetemp`, but returns a ``py.path.local`` object.""" + return legacy_path(self._tmppath_factory.getbasetemp().resolve()) + + +class LegacyTmpdirPlugin: + @staticmethod + @fixture(scope="session") + def tmpdir_factory(request: FixtureRequest) -> TempdirFactory: + """Return a :class:`pytest.TempdirFactory` instance for the test session.""" + # Set dynamically by pytest_configure(). + return request.config._tmpdirhandler # type: ignore + + @staticmethod + @fixture + def tmpdir(tmp_path: Path) -> LEGACY_PATH: + """Return a temporary directory (as `legacy_path`_ object) + which is unique to each test function invocation. + The temporary directory is created as a subdirectory + of the base temporary directory, with configurable retention, + as discussed in :ref:`temporary directory location and retention`. + + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html + """ + return legacy_path(tmp_path) + + +def Cache_makedir(self: Cache, name: str) -> LEGACY_PATH: + """Return a directory path object with the given name. + + Same as :func:`mkdir`, but returns a legacy py path instance. + """ + return legacy_path(self.mkdir(name)) + + +def FixtureRequest_fspath(self: FixtureRequest) -> LEGACY_PATH: + """(deprecated) The file system path of the test module which collected this test.""" + return legacy_path(self.path) + + +def TerminalReporter_startdir(self: TerminalReporter) -> LEGACY_PATH: + """The directory from which pytest was invoked. + + Prefer to use ``startpath`` which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(self.startpath) + + +def Config_invocation_dir(self: Config) -> LEGACY_PATH: + """The directory from which pytest was invoked. + + Prefer to use :attr:`invocation_params.dir `, + which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(str(self.invocation_params.dir)) + + +def Config_rootdir(self: Config) -> LEGACY_PATH: + """The path to the :ref:`rootdir `. + + Prefer to use :attr:`rootpath`, which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(str(self.rootpath)) + + +def Config_inifile(self: Config) -> LEGACY_PATH | None: + """The path to the :ref:`configfile `. + + Prefer to use :attr:`inipath`, which is a :class:`pathlib.Path`. + + :type: Optional[LEGACY_PATH] + """ + return legacy_path(str(self.inipath)) if self.inipath else None + + +def Session_startdir(self: Session) -> LEGACY_PATH: + """The path from which pytest was invoked. + + Prefer to use ``startpath`` which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(self.startpath) + + +def Config__getini_unknown_type(self, name: str, type: str, value: str | list[str]): + if type == "pathlist": + # TODO: This assert is probably not valid in all cases. + assert self.inipath is not None + dp = self.inipath.parent + input_values = shlex.split(value) if isinstance(value, str) else value + return [legacy_path(str(dp / x)) for x in input_values] + else: + raise ValueError(f"unknown configuration type: {type}", value) + + +def Node_fspath(self: Node) -> LEGACY_PATH: + """(deprecated) returns a legacy_path copy of self.path""" + return legacy_path(self.path) + + +def Node_fspath_set(self: Node, value: LEGACY_PATH) -> None: + self.path = Path(value) + + +@hookimpl(tryfirst=True) +def pytest_load_initial_conftests(early_config: Config) -> None: + """Monkeypatch legacy path attributes in several classes, as early as possible.""" + mp = MonkeyPatch() + early_config.add_cleanup(mp.undo) + + # Add Cache.makedir(). + mp.setattr(Cache, "makedir", Cache_makedir, raising=False) + + # Add FixtureRequest.fspath property. + mp.setattr(FixtureRequest, "fspath", property(FixtureRequest_fspath), raising=False) + + # Add TerminalReporter.startdir property. + mp.setattr( + TerminalReporter, "startdir", property(TerminalReporter_startdir), raising=False + ) + + # Add Config.{invocation_dir,rootdir,inifile} properties. + mp.setattr(Config, "invocation_dir", property(Config_invocation_dir), raising=False) + mp.setattr(Config, "rootdir", property(Config_rootdir), raising=False) + mp.setattr(Config, "inifile", property(Config_inifile), raising=False) + + # Add Session.startdir property. + mp.setattr(Session, "startdir", property(Session_startdir), raising=False) + + # Add pathlist configuration type. + mp.setattr(Config, "_getini_unknown_type", Config__getini_unknown_type) + + # Add Node.fspath property. + mp.setattr(Node, "fspath", property(Node_fspath, Node_fspath_set), raising=False) + + +@hookimpl +def pytest_configure(config: Config) -> None: + """Installs the LegacyTmpdirPlugin if the ``tmpdir`` plugin is also installed.""" + if config.pluginmanager.has_plugin("tmpdir"): + mp = MonkeyPatch() + config.add_cleanup(mp.undo) + # Create TmpdirFactory and attach it to the config object. + # + # This is to comply with existing plugins which expect the handler to be + # available at pytest_configure time, but ideally should be moved entirely + # to the tmpdir_factory session fixture. + try: + tmp_path_factory = config._tmp_path_factory # type: ignore[attr-defined] + except AttributeError: + # tmpdir plugin is blocked. + pass + else: + _tmpdirhandler = TempdirFactory(tmp_path_factory, _ispytest=True) + mp.setattr(config, "_tmpdirhandler", _tmpdirhandler, raising=False) + + config.pluginmanager.register(LegacyTmpdirPlugin, "legacypath-tmpdir") + + +@hookimpl +def pytest_plugin_registered(plugin: object, manager: PytestPluginManager) -> None: + # pytester is not loaded by default and is commonly loaded from a conftest, + # so checking for it in `pytest_configure` is not enough. + is_pytester = plugin is manager.get_plugin("pytester") + if is_pytester and not manager.is_registered(LegacyTestdirPlugin): + manager.register(LegacyTestdirPlugin, "legacypath-pytester") diff --git a/micromamba_root/Lib/site-packages/_pytest/logging.py b/micromamba_root/Lib/site-packages/_pytest/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..e4fed579d2161da981e1ad2f502577a7a1fe596e --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/logging.py @@ -0,0 +1,960 @@ +# mypy: allow-untyped-defs +"""Access and control log capturing.""" + +from __future__ import annotations + +from collections.abc import Generator +from collections.abc import Mapping +from collections.abc import Set as AbstractSet +from contextlib import contextmanager +from contextlib import nullcontext +from datetime import datetime +from datetime import timedelta +from datetime import timezone +import io +from io import StringIO +import logging +from logging import LogRecord +import os +from pathlib import Path +import re +from types import TracebackType +from typing import final +from typing import Generic +from typing import Literal +from typing import TYPE_CHECKING +from typing import TypeVar + +from _pytest import nodes +from _pytest._io import TerminalWriter +from _pytest.capture import CaptureManager +from _pytest.config import _strtobool +from _pytest.config import Config +from _pytest.config import create_terminal_writer +from _pytest.config import hookimpl +from _pytest.config import UsageError +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter + + +if TYPE_CHECKING: + logging_StreamHandler = logging.StreamHandler[StringIO] +else: + logging_StreamHandler = logging.StreamHandler + +DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s" +DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" +_ANSI_ESCAPE_SEQ = re.compile(r"\x1b\[[\d;]+m") +caplog_handler_key = StashKey["LogCaptureHandler"]() +caplog_records_key = StashKey[dict[str, list[logging.LogRecord]]]() + + +def _remove_ansi_escape_sequences(text: str) -> str: + return _ANSI_ESCAPE_SEQ.sub("", text) + + +class DatetimeFormatter(logging.Formatter): + """A logging formatter which formats record with + :func:`datetime.datetime.strftime` formatter instead of + :func:`time.strftime` in case of microseconds in format string. + """ + + def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: + if datefmt and "%f" in datefmt: + ct = self.converter(record.created) + tz = timezone(timedelta(seconds=ct.tm_gmtoff), ct.tm_zone) + # Construct `datetime.datetime` object from `struct_time` + # and msecs information from `record` + # Using int() instead of round() to avoid it exceeding 1_000_000 and causing a ValueError (#11861). + dt = datetime(*ct[0:6], microsecond=int(record.msecs * 1000), tzinfo=tz) + return dt.strftime(datefmt) + # Use `logging.Formatter` for non-microsecond formats + return super().formatTime(record, datefmt) + + +class ColoredLevelFormatter(DatetimeFormatter): + """A logging formatter which colorizes the %(levelname)..s part of the + log format passed to __init__.""" + + LOGLEVEL_COLOROPTS: Mapping[int, AbstractSet[str]] = { + logging.CRITICAL: {"red"}, + logging.ERROR: {"red", "bold"}, + logging.WARNING: {"yellow"}, + logging.WARN: {"yellow"}, + logging.INFO: {"green"}, + logging.DEBUG: {"purple"}, + logging.NOTSET: set(), + } + LEVELNAME_FMT_REGEX = re.compile(r"%\(levelname\)([+-.]?\d*(?:\.\d+)?s)") + + def __init__(self, terminalwriter: TerminalWriter, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self._terminalwriter = terminalwriter + self._original_fmt = self._style._fmt + self._level_to_fmt_mapping: dict[int, str] = {} + + for level, color_opts in self.LOGLEVEL_COLOROPTS.items(): + self.add_color_level(level, *color_opts) + + def add_color_level(self, level: int, *color_opts: str) -> None: + """Add or update color opts for a log level. + + :param level: + Log level to apply a style to, e.g. ``logging.INFO``. + :param color_opts: + ANSI escape sequence color options. Capitalized colors indicates + background color, i.e. ``'green', 'Yellow', 'bold'`` will give bold + green text on yellow background. + + .. warning:: + This is an experimental API. + """ + assert self._fmt is not None + levelname_fmt_match = self.LEVELNAME_FMT_REGEX.search(self._fmt) + if not levelname_fmt_match: + return + levelname_fmt = levelname_fmt_match.group() + + formatted_levelname = levelname_fmt % {"levelname": logging.getLevelName(level)} + + # add ANSI escape sequences around the formatted levelname + color_kwargs = {name: True for name in color_opts} + colorized_formatted_levelname = self._terminalwriter.markup( + formatted_levelname, **color_kwargs + ) + self._level_to_fmt_mapping[level] = self.LEVELNAME_FMT_REGEX.sub( + colorized_formatted_levelname, self._fmt + ) + + def format(self, record: logging.LogRecord) -> str: + fmt = self._level_to_fmt_mapping.get(record.levelno, self._original_fmt) + self._style._fmt = fmt + return super().format(record) + + +class PercentStyleMultiline(logging.PercentStyle): + """A logging style with special support for multiline messages. + + If the message of a record consists of multiple lines, this style + formats the message as if each line were logged separately. + """ + + def __init__(self, fmt: str, auto_indent: int | str | bool | None) -> None: + super().__init__(fmt) + self._auto_indent = self._get_auto_indent(auto_indent) + + @staticmethod + def _get_auto_indent(auto_indent_option: int | str | bool | None) -> int: + """Determine the current auto indentation setting. + + Specify auto indent behavior (on/off/fixed) by passing in + extra={"auto_indent": [value]} to the call to logging.log() or + using a --log-auto-indent [value] command line or the + log_auto_indent [value] config option. + + Default behavior is auto-indent off. + + Using the string "True" or "on" or the boolean True as the value + turns auto indent on, using the string "False" or "off" or the + boolean False or the int 0 turns it off, and specifying a + positive integer fixes the indentation position to the value + specified. + + Any other values for the option are invalid, and will silently be + converted to the default. + + :param None|bool|int|str auto_indent_option: + User specified option for indentation from command line, config + or extra kwarg. Accepts int, bool or str. str option accepts the + same range of values as boolean config options, as well as + positive integers represented in str form. + + :returns: + Indentation value, which can be + -1 (automatically determine indentation) or + 0 (auto-indent turned off) or + >0 (explicitly set indentation position). + """ + if auto_indent_option is None: + return 0 + elif isinstance(auto_indent_option, bool): + if auto_indent_option: + return -1 + else: + return 0 + elif isinstance(auto_indent_option, int): + return int(auto_indent_option) + elif isinstance(auto_indent_option, str): + try: + return int(auto_indent_option) + except ValueError: + pass + try: + if _strtobool(auto_indent_option): + return -1 + except ValueError: + return 0 + + return 0 + + def format(self, record: logging.LogRecord) -> str: + if "\n" in record.message: + if hasattr(record, "auto_indent"): + # Passed in from the "extra={}" kwarg on the call to logging.log(). + auto_indent = self._get_auto_indent(record.auto_indent) + else: + auto_indent = self._auto_indent + + if auto_indent: + lines = record.message.splitlines() + formatted = self._fmt % {**record.__dict__, "message": lines[0]} + + if auto_indent < 0: + indentation = _remove_ansi_escape_sequences(formatted).find( + lines[0] + ) + else: + # Optimizes logging by allowing a fixed indentation. + indentation = auto_indent + lines[0] = formatted + return ("\n" + " " * indentation).join(lines) + return self._fmt % record.__dict__ + + +def get_option_ini(config: Config, *names: str): + for name in names: + ret = config.getoption(name) # 'default' arg won't work as expected + if ret is None: + ret = config.getini(name) + if ret: + return ret + + +def pytest_addoption(parser: Parser) -> None: + """Add options to control log capturing.""" + group = parser.getgroup("logging") + + def add_option_ini(option, dest, default=None, type=None, **kwargs): + parser.addini( + dest, default=default, type=type, help="Default value for " + option + ) + group.addoption(option, dest=dest, **kwargs) + + add_option_ini( + "--log-level", + dest="log_level", + default=None, + metavar="LEVEL", + help=( + "Level of messages to catch/display." + " Not set by default, so it depends on the root/parent log handler's" + ' effective level, where it is "WARNING" by default.' + ), + ) + add_option_ini( + "--log-format", + dest="log_format", + default=DEFAULT_LOG_FORMAT, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-date-format", + dest="log_date_format", + default=DEFAULT_LOG_DATE_FORMAT, + help="Log date format used by the logging module", + ) + parser.addini( + "log_cli", + default=False, + type="bool", + help='Enable log display during test run (also known as "live logging")', + ) + add_option_ini( + "--log-cli-level", dest="log_cli_level", default=None, help="CLI logging level" + ) + add_option_ini( + "--log-cli-format", + dest="log_cli_format", + default=None, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-cli-date-format", + dest="log_cli_date_format", + default=None, + help="Log date format used by the logging module", + ) + add_option_ini( + "--log-file", + dest="log_file", + default=None, + help="Path to a file when logging will be written to", + ) + add_option_ini( + "--log-file-mode", + dest="log_file_mode", + default="w", + choices=["w", "a"], + help="Log file open mode", + ) + add_option_ini( + "--log-file-level", + dest="log_file_level", + default=None, + help="Log file logging level", + ) + add_option_ini( + "--log-file-format", + dest="log_file_format", + default=None, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-file-date-format", + dest="log_file_date_format", + default=None, + help="Log date format used by the logging module", + ) + add_option_ini( + "--log-auto-indent", + dest="log_auto_indent", + default=None, + help="Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.", + ) + group.addoption( + "--log-disable", + action="append", + default=[], + dest="logger_disable", + help="Disable a logger by name. Can be passed multiple times.", + ) + + +_HandlerType = TypeVar("_HandlerType", bound=logging.Handler) + + +# Not using @contextmanager for performance reasons. +class catching_logs(Generic[_HandlerType]): + """Context manager that prepares the whole logging machinery properly.""" + + __slots__ = ("handler", "level", "orig_level") + + def __init__(self, handler: _HandlerType, level: int | None = None) -> None: + self.handler = handler + self.level = level + + def __enter__(self) -> _HandlerType: + root_logger = logging.getLogger() + if self.level is not None: + self.handler.setLevel(self.level) + root_logger.addHandler(self.handler) + if self.level is not None: + self.orig_level = root_logger.level + root_logger.setLevel(min(self.orig_level, self.level)) + return self.handler + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + root_logger = logging.getLogger() + if self.level is not None: + root_logger.setLevel(self.orig_level) + root_logger.removeHandler(self.handler) + + +class LogCaptureHandler(logging_StreamHandler): + """A logging handler that stores log records and the log text.""" + + def __init__(self) -> None: + """Create a new log handler.""" + super().__init__(StringIO()) + self.records: list[logging.LogRecord] = [] + + def emit(self, record: logging.LogRecord) -> None: + """Keep the log records in a list in addition to the log text.""" + self.records.append(record) + super().emit(record) + + def reset(self) -> None: + self.records = [] + self.stream = StringIO() + + def clear(self) -> None: + self.records.clear() + self.stream = StringIO() + + def handleError(self, record: logging.LogRecord) -> None: + if logging.raiseExceptions: + # Fail the test if the log message is bad (emit failed). + # The default behavior of logging is to print "Logging error" + # to stderr with the call stack and some extra details. + # pytest wants to make such mistakes visible during testing. + raise # noqa: PLE0704 + + +@final +class LogCaptureFixture: + """Provides access and control of log capturing.""" + + def __init__(self, item: nodes.Node, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._item = item + self._initial_handler_level: int | None = None + # Dict of log name -> log level. + self._initial_logger_levels: dict[str | None, int] = {} + self._initial_disabled_logging_level: int | None = None + + def _finalize(self) -> None: + """Finalize the fixture. + + This restores the log levels and the disabled logging levels changed by :meth:`set_level`. + """ + # Restore log levels. + if self._initial_handler_level is not None: + self.handler.setLevel(self._initial_handler_level) + for logger_name, level in self._initial_logger_levels.items(): + logger = logging.getLogger(logger_name) + logger.setLevel(level) + # Disable logging at the original disabled logging level. + if self._initial_disabled_logging_level is not None: + logging.disable(self._initial_disabled_logging_level) + self._initial_disabled_logging_level = None + + @property + def handler(self) -> LogCaptureHandler: + """Get the logging handler used by the fixture.""" + return self._item.stash[caplog_handler_key] + + def get_records( + self, when: Literal["setup", "call", "teardown"] + ) -> list[logging.LogRecord]: + """Get the logging records for one of the possible test phases. + + :param when: + Which test phase to obtain the records from. + Valid values are: "setup", "call" and "teardown". + + :returns: The list of captured records at the given stage. + + .. versionadded:: 3.4 + """ + return self._item.stash[caplog_records_key].get(when, []) + + @property + def text(self) -> str: + """The formatted log text.""" + return _remove_ansi_escape_sequences(self.handler.stream.getvalue()) + + @property + def records(self) -> list[logging.LogRecord]: + """The list of log records.""" + return self.handler.records + + @property + def record_tuples(self) -> list[tuple[str, int, str]]: + """A list of a stripped down version of log records intended + for use in assertion comparison. + + The format of the tuple is: + + (logger_name, log_level, message) + """ + return [(r.name, r.levelno, r.getMessage()) for r in self.records] + + @property + def messages(self) -> list[str]: + """A list of format-interpolated log messages. + + Unlike 'records', which contains the format string and parameters for + interpolation, log messages in this list are all interpolated. + + Unlike 'text', which contains the output from the handler, log + messages in this list are unadorned with levels, timestamps, etc, + making exact comparisons more reliable. + + Note that traceback or stack info (from :func:`logging.exception` or + the `exc_info` or `stack_info` arguments to the logging functions) is + not included, as this is added by the formatter in the handler. + + .. versionadded:: 3.7 + """ + return [r.getMessage() for r in self.records] + + def clear(self) -> None: + """Reset the list of log records and the captured log text.""" + self.handler.clear() + + def _force_enable_logging( + self, level: int | str, logger_obj: logging.Logger + ) -> int: + """Enable the desired logging level if the global level was disabled via ``logging.disabled``. + + Only enables logging levels greater than or equal to the requested ``level``. + + Does nothing if the desired ``level`` wasn't disabled. + + :param level: + The logger level caplog should capture. + All logging is enabled if a non-standard logging level string is supplied. + Valid level strings are in :data:`logging._nameToLevel`. + :param logger_obj: The logger object to check. + + :return: The original disabled logging level. + """ + original_disable_level: int = logger_obj.manager.disable + + if isinstance(level, str): + # Try to translate the level string to an int for `logging.disable()` + level = logging.getLevelName(level) + + if not isinstance(level, int): + # The level provided was not valid, so just un-disable all logging. + logging.disable(logging.NOTSET) + elif not logger_obj.isEnabledFor(level): + # Each level is `10` away from other levels. + # https://docs.python.org/3/library/logging.html#logging-levels + disable_level = max(level - 10, logging.NOTSET) + logging.disable(disable_level) + + return original_disable_level + + def set_level(self, level: int | str, logger: str | None = None) -> None: + """Set the threshold level of a logger for the duration of a test. + + Logging messages which are less severe than this level will not be captured. + + .. versionchanged:: 3.4 + The levels of the loggers changed by this function will be + restored to their initial values at the end of the test. + + Will enable the requested logging level if it was disabled via :func:`logging.disable`. + + :param level: The level. + :param logger: The logger to update. If not given, the root logger. + """ + logger_obj = logging.getLogger(logger) + # Save the original log-level to restore it during teardown. + self._initial_logger_levels.setdefault(logger, logger_obj.level) + logger_obj.setLevel(level) + if self._initial_handler_level is None: + self._initial_handler_level = self.handler.level + self.handler.setLevel(level) + initial_disabled_logging_level = self._force_enable_logging(level, logger_obj) + if self._initial_disabled_logging_level is None: + self._initial_disabled_logging_level = initial_disabled_logging_level + + @contextmanager + def at_level(self, level: int | str, logger: str | None = None) -> Generator[None]: + """Context manager that sets the level for capturing of logs. After + the end of the 'with' statement the level is restored to its original + value. + + Will enable the requested logging level if it was disabled via :func:`logging.disable`. + + :param level: The level. + :param logger: The logger to update. If not given, the root logger. + """ + logger_obj = logging.getLogger(logger) + orig_level = logger_obj.level + logger_obj.setLevel(level) + handler_orig_level = self.handler.level + self.handler.setLevel(level) + original_disable_level = self._force_enable_logging(level, logger_obj) + try: + yield + finally: + logger_obj.setLevel(orig_level) + self.handler.setLevel(handler_orig_level) + logging.disable(original_disable_level) + + @contextmanager + def filtering(self, filter_: logging.Filter) -> Generator[None]: + """Context manager that temporarily adds the given filter to the caplog's + :meth:`handler` for the 'with' statement block, and removes that filter at the + end of the block. + + :param filter_: A custom :class:`logging.Filter` object. + + .. versionadded:: 7.5 + """ + self.handler.addFilter(filter_) + try: + yield + finally: + self.handler.removeFilter(filter_) + + +@fixture +def caplog(request: FixtureRequest) -> Generator[LogCaptureFixture]: + """Access and control log capturing. + + Captured logs are available through the following properties/methods:: + + * caplog.messages -> list of format-interpolated log messages + * caplog.text -> string containing formatted log output + * caplog.records -> list of logging.LogRecord instances + * caplog.record_tuples -> list of (logger_name, level, message) tuples + * caplog.clear() -> clear captured records and formatted log output string + """ + result = LogCaptureFixture(request.node, _ispytest=True) + yield result + result._finalize() + + +def get_log_level_for_setting(config: Config, *setting_names: str) -> int | None: + for setting_name in setting_names: + log_level = config.getoption(setting_name) + if log_level is None: + log_level = config.getini(setting_name) + if log_level: + break + else: + return None + + if isinstance(log_level, str): + log_level = log_level.upper() + try: + return int(getattr(logging, log_level, log_level)) + except ValueError as e: + # Python logging does not recognise this as a logging level + raise UsageError( + f"'{log_level}' is not recognized as a logging level name for " + f"'{setting_name}'. Please consider passing the " + "logging level num instead." + ) from e + + +# run after terminalreporter/capturemanager are configured +@hookimpl(trylast=True) +def pytest_configure(config: Config) -> None: + config.pluginmanager.register(LoggingPlugin(config), "logging-plugin") + + +class LoggingPlugin: + """Attaches to the logging module and captures log messages for each test.""" + + def __init__(self, config: Config) -> None: + """Create a new plugin to capture log messages. + + The formatter can be safely shared across all handlers so + create a single one for the entire test session here. + """ + self._config = config + + # Report logging. + self.formatter = self._create_formatter( + get_option_ini(config, "log_format"), + get_option_ini(config, "log_date_format"), + get_option_ini(config, "log_auto_indent"), + ) + self.log_level = get_log_level_for_setting(config, "log_level") + self.caplog_handler = LogCaptureHandler() + self.caplog_handler.setFormatter(self.formatter) + self.report_handler = LogCaptureHandler() + self.report_handler.setFormatter(self.formatter) + + # File logging. + self.log_file_level = get_log_level_for_setting( + config, "log_file_level", "log_level" + ) + log_file = get_option_ini(config, "log_file") or os.devnull + if log_file != os.devnull: + directory = os.path.dirname(os.path.abspath(log_file)) + if not os.path.isdir(directory): + os.makedirs(directory) + + self.log_file_mode = get_option_ini(config, "log_file_mode") or "w" + self.log_file_handler = _FileHandler( + log_file, mode=self.log_file_mode, encoding="UTF-8" + ) + log_file_format = get_option_ini(config, "log_file_format", "log_format") + log_file_date_format = get_option_ini( + config, "log_file_date_format", "log_date_format" + ) + + log_file_formatter = DatetimeFormatter( + log_file_format, datefmt=log_file_date_format + ) + self.log_file_handler.setFormatter(log_file_formatter) + + # CLI/live logging. + self.log_cli_level = get_log_level_for_setting( + config, "log_cli_level", "log_level" + ) + if self._log_cli_enabled(): + terminal_reporter = config.pluginmanager.get_plugin("terminalreporter") + # Guaranteed by `_log_cli_enabled()`. + assert terminal_reporter is not None + capture_manager = config.pluginmanager.get_plugin("capturemanager") + # if capturemanager plugin is disabled, live logging still works. + self.log_cli_handler: ( + _LiveLoggingStreamHandler | _LiveLoggingNullHandler + ) = _LiveLoggingStreamHandler(terminal_reporter, capture_manager) + else: + self.log_cli_handler = _LiveLoggingNullHandler() + log_cli_formatter = self._create_formatter( + get_option_ini(config, "log_cli_format", "log_format"), + get_option_ini(config, "log_cli_date_format", "log_date_format"), + get_option_ini(config, "log_auto_indent"), + ) + self.log_cli_handler.setFormatter(log_cli_formatter) + self._disable_loggers(loggers_to_disable=config.option.logger_disable) + + def _disable_loggers(self, loggers_to_disable: list[str]) -> None: + if not loggers_to_disable: + return + + for name in loggers_to_disable: + logger = logging.getLogger(name) + logger.disabled = True + + def _create_formatter(self, log_format, log_date_format, auto_indent): + # Color option doesn't exist if terminal plugin is disabled. + color = getattr(self._config.option, "color", "no") + if color != "no" and ColoredLevelFormatter.LEVELNAME_FMT_REGEX.search( + log_format + ): + formatter: logging.Formatter = ColoredLevelFormatter( + create_terminal_writer(self._config), log_format, log_date_format + ) + else: + formatter = DatetimeFormatter(log_format, log_date_format) + + formatter._style = PercentStyleMultiline( + formatter._style._fmt, auto_indent=auto_indent + ) + + return formatter + + def set_log_path(self, fname: str) -> None: + """Set the filename parameter for Logging.FileHandler(). + + Creates parent directory if it does not exist. + + .. warning:: + This is an experimental API. + """ + fpath = Path(fname) + + if not fpath.is_absolute(): + fpath = self._config.rootpath / fpath + + if not fpath.parent.exists(): + fpath.parent.mkdir(exist_ok=True, parents=True) + + # https://github.com/python/mypy/issues/11193 + stream: io.TextIOWrapper = fpath.open(mode=self.log_file_mode, encoding="UTF-8") # type: ignore[assignment] + old_stream = self.log_file_handler.setStream(stream) + if old_stream: + old_stream.close() + + def _log_cli_enabled(self) -> bool: + """Return whether live logging is enabled.""" + enabled = self._config.getoption( + "--log-cli-level" + ) is not None or self._config.getini("log_cli") + if not enabled: + return False + + terminal_reporter = self._config.pluginmanager.get_plugin("terminalreporter") + if terminal_reporter is None: + # terminal reporter is disabled e.g. by pytest-xdist. + return False + + return True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_sessionstart(self) -> Generator[None]: + self.log_cli_handler.set_when("sessionstart") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection(self) -> Generator[None]: + self.log_cli_handler.set_when("collection") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtestloop(self, session: Session) -> Generator[None, object, object]: + if session.config.option.collectonly: + return (yield) + + if self._log_cli_enabled() and self._config.get_verbosity() < 1: + # The verbose flag is needed to avoid messy test progress output. + self._config.option.verbose = 1 + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) # Run all the tests. + + @hookimpl + def pytest_runtest_logstart(self) -> None: + self.log_cli_handler.reset() + self.log_cli_handler.set_when("start") + + @hookimpl + def pytest_runtest_logreport(self) -> None: + self.log_cli_handler.set_when("logreport") + + @contextmanager + def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None]: + """Implement the internals of the pytest_runtest_xxx() hooks.""" + with ( + catching_logs( + self.caplog_handler, + level=self.log_level, + ) as caplog_handler, + catching_logs( + self.report_handler, + level=self.log_level, + ) as report_handler, + ): + caplog_handler.reset() + report_handler.reset() + item.stash[caplog_records_key][when] = caplog_handler.records + item.stash[caplog_handler_key] = caplog_handler + + try: + yield + finally: + log = report_handler.stream.getvalue().strip() + item.add_report_section(when, "log", log) + + @hookimpl(wrapper=True) + def pytest_runtest_setup(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("setup") + + empty: dict[str, list[logging.LogRecord]] = {} + item.stash[caplog_records_key] = empty + with self._runtest_for(item, "setup"): + yield + + @hookimpl(wrapper=True) + def pytest_runtest_call(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("call") + + with self._runtest_for(item, "call"): + yield + + @hookimpl(wrapper=True) + def pytest_runtest_teardown(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("teardown") + + try: + with self._runtest_for(item, "teardown"): + yield + finally: + del item.stash[caplog_records_key] + del item.stash[caplog_handler_key] + + @hookimpl + def pytest_runtest_logfinish(self) -> None: + self.log_cli_handler.set_when("finish") + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_sessionfinish(self) -> Generator[None]: + self.log_cli_handler.set_when("sessionfinish") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl + def pytest_unconfigure(self) -> None: + # Close the FileHandler explicitly. + # (logging.shutdown might have lost the weakref?!) + self.log_file_handler.close() + + +class _FileHandler(logging.FileHandler): + """A logging FileHandler with pytest tweaks.""" + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass + + +class _LiveLoggingStreamHandler(logging_StreamHandler): + """A logging StreamHandler used by the live logging feature: it will + write a newline before the first log message in each test. + + During live logging we must also explicitly disable stdout/stderr + capturing otherwise it will get captured and won't appear in the + terminal. + """ + + # Officially stream needs to be a IO[str], but TerminalReporter + # isn't. So force it. + stream: TerminalReporter = None # type: ignore + + def __init__( + self, + terminal_reporter: TerminalReporter, + capture_manager: CaptureManager | None, + ) -> None: + super().__init__(stream=terminal_reporter) # type: ignore[arg-type] + self.capture_manager = capture_manager + self.reset() + self.set_when(None) + self._test_outcome_written = False + + def reset(self) -> None: + """Reset the handler; should be called before the start of each test.""" + self._first_record_emitted = False + + def set_when(self, when: str | None) -> None: + """Prepare for the given test phase (setup/call/teardown).""" + self._when = when + self._section_name_shown = False + if when == "start": + self._test_outcome_written = False + + def emit(self, record: logging.LogRecord) -> None: + ctx_manager = ( + self.capture_manager.global_and_fixture_disabled() + if self.capture_manager + else nullcontext() + ) + with ctx_manager: + if not self._first_record_emitted: + self.stream.write("\n") + self._first_record_emitted = True + elif self._when in ("teardown", "finish"): + if not self._test_outcome_written: + self._test_outcome_written = True + self.stream.write("\n") + if not self._section_name_shown and self._when: + self.stream.section("live log " + self._when, sep="-", bold=True) + self._section_name_shown = True + super().emit(record) + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass + + +class _LiveLoggingNullHandler(logging.NullHandler): + """A logging handler used when live logging is disabled.""" + + def reset(self) -> None: + pass + + def set_when(self, when: str) -> None: + pass + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass diff --git a/micromamba_root/Lib/site-packages/_pytest/main.py b/micromamba_root/Lib/site-packages/_pytest/main.py new file mode 100644 index 0000000000000000000000000000000000000000..9bc930df8e86730cdb6eb35eba912dbdebb22e8b --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/main.py @@ -0,0 +1,1203 @@ +"""Core implementation of the testing process: init, session, runtest loop.""" + +from __future__ import annotations + +import argparse +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Sequence +from collections.abc import Set as AbstractSet +import dataclasses +import fnmatch +import functools +import importlib +import importlib.util +import os +from pathlib import Path +import sys +from typing import final +from typing import Literal +from typing import overload +from typing import TYPE_CHECKING +import warnings + +import pluggy + +from _pytest import nodes +import _pytest._code +from _pytest.config import Config +from _pytest.config import directory_arg +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.config import UsageError +from _pytest.config.argparsing import OverrideIniAction +from _pytest.config.argparsing import Parser +from _pytest.config.compat import PathAwareHookProxy +from _pytest.outcomes import exit +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import fnmatch_ex +from _pytest.pathlib import safe_exists +from _pytest.pathlib import samefile_nofollow +from _pytest.pathlib import scandir +from _pytest.reports import CollectReport +from _pytest.reports import TestReport +from _pytest.runner import collect_one_node +from _pytest.runner import SetupState +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + from _pytest.fixtures import FixtureManager + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group._addoption( # private to use reserved lower-case short option + "-x", + "--exitfirst", + action="store_const", + dest="maxfail", + const=1, + help="Exit instantly on first error or failed test", + ) + group.addoption( + "--maxfail", + metavar="num", + action="store", + type=int, + dest="maxfail", + default=0, + help="Exit after first num failures or errors", + ) + group.addoption( + "--strict-config", + action=OverrideIniAction, + ini_option="strict_config", + ini_value="true", + help="Enables the strict_config option", + ) + group.addoption( + "--strict-markers", + action=OverrideIniAction, + ini_option="strict_markers", + ini_value="true", + help="Enables the strict_markers option", + ) + group.addoption( + "--strict", + action=OverrideIniAction, + ini_option="strict", + ini_value="true", + help="Enables the strict option", + ) + parser.addini( + "strict_config", + "Any warnings encountered while parsing the `pytest` section of the " + "configuration file raise errors", + type="bool", + # None => fallback to `strict`. + default=None, + ) + parser.addini( + "strict_markers", + "Markers not registered in the `markers` section of the configuration " + "file raise errors", + type="bool", + # None => fallback to `strict`. + default=None, + ) + parser.addini( + "strict", + "Enables all strictness options, currently: " + "strict_config, strict_markers, strict_xfail, strict_parametrization_ids", + type="bool", + default=False, + ) + + group = parser.getgroup("pytest-warnings") + group.addoption( + "-W", + "--pythonwarnings", + action="append", + help="Set which warnings to report, see -W option of Python itself", + ) + parser.addini( + "filterwarnings", + type="linelist", + help="Each line specifies a pattern for " + "warnings.filterwarnings. " + "Processed after -W/--pythonwarnings.", + ) + + group = parser.getgroup("collect", "collection") + group.addoption( + "--collectonly", + "--collect-only", + "--co", + action="store_true", + help="Only collect tests, don't execute them", + ) + group.addoption( + "--pyargs", + action="store_true", + help="Try to interpret all arguments as Python packages", + ) + group.addoption( + "--ignore", + action="append", + metavar="path", + help="Ignore path during collection (multi-allowed)", + ) + group.addoption( + "--ignore-glob", + action="append", + metavar="path", + help="Ignore path pattern during collection (multi-allowed)", + ) + group.addoption( + "--deselect", + action="append", + metavar="nodeid_prefix", + help="Deselect item (via node id prefix) during collection (multi-allowed)", + ) + group.addoption( + "--confcutdir", + dest="confcutdir", + default=None, + metavar="dir", + type=functools.partial(directory_arg, optname="--confcutdir"), + help="Only load conftest.py's relative to specified dir", + ) + group.addoption( + "--noconftest", + action="store_true", + dest="noconftest", + default=False, + help="Don't load any conftest.py files", + ) + group.addoption( + "--keepduplicates", + "--keep-duplicates", + action="store_true", + dest="keepduplicates", + default=False, + help="Keep duplicate tests", + ) + group.addoption( + "--collect-in-virtualenv", + action="store_true", + dest="collect_in_virtualenv", + default=False, + help="Don't ignore tests in a local virtualenv directory", + ) + group.addoption( + "--continue-on-collection-errors", + action="store_true", + default=False, + dest="continue_on_collection_errors", + help="Force test execution even if collection errors occur", + ) + group.addoption( + "--import-mode", + default="prepend", + choices=["prepend", "append", "importlib"], + dest="importmode", + help="Prepend/append to sys.path when importing test modules and conftest " + "files. Default: prepend.", + ) + parser.addini( + "norecursedirs", + "Directory patterns to avoid for recursion", + type="args", + default=[ + "*.egg", + ".*", + "_darcs", + "build", + "CVS", + "dist", + "node_modules", + "venv", + "{arch}", + ], + ) + parser.addini( + "testpaths", + "Directories to search for tests when no files or directories are given on the " + "command line", + type="args", + default=[], + ) + parser.addini( + "collect_imported_tests", + "Whether to collect tests in imported modules outside `testpaths`", + type="bool", + default=True, + ) + parser.addini( + "consider_namespace_packages", + type="bool", + default=False, + help="Consider namespace packages when resolving module names during import", + ) + + group = parser.getgroup("debugconfig", "test session debugging and configuration") + group._addoption( # private to use reserved lower-case short option + "-c", + "--config-file", + metavar="FILE", + type=str, + dest="inifilename", + help="Load configuration from `FILE` instead of trying to locate one of the " + "implicit configuration files.", + ) + group.addoption( + "--rootdir", + action="store", + dest="rootdir", + help="Define root directory for tests. Can be relative path: 'root_dir', './root_dir', " + "'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: " + "'$HOME/root_dir'.", + ) + group.addoption( + "--basetemp", + dest="basetemp", + default=None, + type=validate_basetemp, + metavar="dir", + help=( + "Base temporary directory for this test run. " + "(Warning: this directory is removed if it exists.)" + ), + ) + + +def validate_basetemp(path: str) -> str: + # GH 7119 + msg = "basetemp must not be empty, the current working directory or any parent directory of it" + + # empty path + if not path: + raise argparse.ArgumentTypeError(msg) + + def is_ancestor(base: Path, query: Path) -> bool: + """Return whether query is an ancestor of base.""" + if base == query: + return True + return query in base.parents + + # check if path is an ancestor of cwd + if is_ancestor(Path.cwd(), Path(path).absolute()): + raise argparse.ArgumentTypeError(msg) + + # check symlinks for ancestors + if is_ancestor(Path.cwd().resolve(), Path(path).resolve()): + raise argparse.ArgumentTypeError(msg) + + return path + + +def wrap_session( + config: Config, doit: Callable[[Config, Session], int | ExitCode | None] +) -> int | ExitCode: + """Skeleton command line program.""" + session = Session.from_config(config) + session.exitstatus = ExitCode.OK + initstate = 0 + try: + try: + config._do_configure() + initstate = 1 + config.hook.pytest_sessionstart(session=session) + initstate = 2 + session.exitstatus = doit(config, session) or 0 + except UsageError: + session.exitstatus = ExitCode.USAGE_ERROR + raise + except Failed: + session.exitstatus = ExitCode.TESTS_FAILED + except (KeyboardInterrupt, exit.Exception): + excinfo = _pytest._code.ExceptionInfo.from_current() + exitstatus: int | ExitCode = ExitCode.INTERRUPTED + if isinstance(excinfo.value, exit.Exception): + if excinfo.value.returncode is not None: + exitstatus = excinfo.value.returncode + if initstate < 2: + sys.stderr.write(f"{excinfo.typename}: {excinfo.value.msg}\n") + config.hook.pytest_keyboard_interrupt(excinfo=excinfo) + session.exitstatus = exitstatus + except BaseException: + session.exitstatus = ExitCode.INTERNAL_ERROR + excinfo = _pytest._code.ExceptionInfo.from_current() + try: + config.notify_exception(excinfo, config.option) + except exit.Exception as exc: + if exc.returncode is not None: + session.exitstatus = exc.returncode + sys.stderr.write(f"{type(exc).__name__}: {exc}\n") + else: + if isinstance(excinfo.value, SystemExit): + sys.stderr.write("mainloop: caught unexpected SystemExit!\n") + + finally: + # Explicitly break reference cycle. + excinfo = None # type: ignore + os.chdir(session.startpath) + if initstate >= 2: + try: + config.hook.pytest_sessionfinish( + session=session, exitstatus=session.exitstatus + ) + except exit.Exception as exc: + if exc.returncode is not None: + session.exitstatus = exc.returncode + sys.stderr.write(f"{type(exc).__name__}: {exc}\n") + config._ensure_unconfigure() + return session.exitstatus + + +def pytest_cmdline_main(config: Config) -> int | ExitCode: + return wrap_session(config, _main) + + +def _main(config: Config, session: Session) -> int | ExitCode | None: + """Default command line protocol for initialization, session, + running tests and reporting.""" + config.hook.pytest_collection(session=session) + config.hook.pytest_runtestloop(session=session) + + if session.testsfailed: + return ExitCode.TESTS_FAILED + elif session.testscollected == 0: + return ExitCode.NO_TESTS_COLLECTED + return None + + +def pytest_collection(session: Session) -> None: + session.perform_collect() + + +def pytest_runtestloop(session: Session) -> bool: + if session.testsfailed and not session.config.option.continue_on_collection_errors: + raise session.Interrupted( + f"{session.testsfailed} error{'s' if session.testsfailed != 1 else ''} during collection" + ) + + if session.config.option.collectonly: + return True + + for i, item in enumerate(session.items): + nextitem = session.items[i + 1] if i + 1 < len(session.items) else None + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + if session.shouldfail: + raise session.Failed(session.shouldfail) + if session.shouldstop: + raise session.Interrupted(session.shouldstop) + return True + + +def _in_venv(path: Path) -> bool: + """Attempt to detect if ``path`` is the root of a Virtual Environment by + checking for the existence of the pyvenv.cfg file. + + [https://peps.python.org/pep-0405/] + + For regression protection we also check for conda environments that do not include pyenv.cfg yet -- + https://github.com/conda/conda/issues/13337 is the conda issue tracking adding pyenv.cfg. + + Checking for the `conda-meta/history` file per https://github.com/pytest-dev/pytest/issues/12652#issuecomment-2246336902. + + """ + try: + return ( + path.joinpath("pyvenv.cfg").is_file() + or path.joinpath("conda-meta", "history").is_file() + ) + except OSError: + return False + + +def pytest_ignore_collect(collection_path: Path, config: Config) -> bool | None: + if collection_path.name == "__pycache__": + return True + + ignore_paths = config._getconftest_pathlist( + "collect_ignore", path=collection_path.parent + ) + ignore_paths = ignore_paths or [] + excludeopt = config.getoption("ignore") + if excludeopt: + ignore_paths.extend(absolutepath(x) for x in excludeopt) + + if collection_path in ignore_paths: + return True + + ignore_globs = config._getconftest_pathlist( + "collect_ignore_glob", path=collection_path.parent + ) + ignore_globs = ignore_globs or [] + excludeglobopt = config.getoption("ignore_glob") + if excludeglobopt: + ignore_globs.extend(absolutepath(x) for x in excludeglobopt) + + if any(fnmatch.fnmatch(str(collection_path), str(glob)) for glob in ignore_globs): + return True + + allow_in_venv = config.getoption("collect_in_virtualenv") + if not allow_in_venv and _in_venv(collection_path): + return True + + if collection_path.is_dir(): + norecursepatterns = config.getini("norecursedirs") + if any(fnmatch_ex(pat, collection_path) for pat in norecursepatterns): + return True + + return None + + +def pytest_collect_directory( + path: Path, parent: nodes.Collector +) -> nodes.Collector | None: + return Dir.from_parent(parent, path=path) + + +def pytest_collection_modifyitems(items: list[nodes.Item], config: Config) -> None: + deselect_prefixes = tuple(config.getoption("deselect") or []) + if not deselect_prefixes: + return + + remaining = [] + deselected = [] + for colitem in items: + if colitem.nodeid.startswith(deselect_prefixes): + deselected.append(colitem) + else: + remaining.append(colitem) + + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +class FSHookProxy: + def __init__( + self, + pm: PytestPluginManager, + remove_mods: AbstractSet[object], + ) -> None: + self.pm = pm + self.remove_mods = remove_mods + + def __getattr__(self, name: str) -> pluggy.HookCaller: + x = self.pm.subset_hook_caller(name, remove_plugins=self.remove_mods) + self.__dict__[name] = x + return x + + +class Interrupted(KeyboardInterrupt): + """Signals that the test run was interrupted.""" + + __module__ = "builtins" # For py3. + + +class Failed(Exception): + """Signals a stop as failed test run.""" + + +@dataclasses.dataclass +class _bestrelpath_cache(dict[Path, str]): + __slots__ = ("path",) + + path: Path + + def __missing__(self, path: Path) -> str: + r = bestrelpath(self.path, path) + self[path] = r + return r + + +@final +class Dir(nodes.Directory): + """Collector of files in a file system directory. + + .. versionadded:: 8.0 + + .. note:: + + Python directories with an `__init__.py` file are instead collected by + :class:`~pytest.Package` by default. Both are :class:`~pytest.Directory` + collectors. + """ + + @classmethod + def from_parent( # type: ignore[override] + cls, + parent: nodes.Collector, + *, + path: Path, + ) -> Self: + """The public constructor. + + :param parent: The parent collector of this Dir. + :param path: The directory's path. + :type path: pathlib.Path + """ + return super().from_parent(parent=parent, path=path) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + config = self.config + col: nodes.Collector | None + cols: Sequence[nodes.Collector] + ihook = self.ihook + for direntry in scandir(self.path): + if direntry.is_dir(): + path = Path(direntry.path) + if not self.session.isinitpath(path, with_parents=True): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + col = ihook.pytest_collect_directory(path=path, parent=self) + if col is not None: + yield col + + elif direntry.is_file(): + path = Path(direntry.path) + if not self.session.isinitpath(path): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + cols = ihook.pytest_collect_file(file_path=path, parent=self) + yield from cols + + +@final +class Session(nodes.Collector): + """The root of the collection tree. + + ``Session`` collects the initial paths given as arguments to pytest. + """ + + Interrupted = Interrupted + Failed = Failed + # Set on the session by runner.pytest_sessionstart. + _setupstate: SetupState + # Set on the session by fixtures.pytest_sessionstart. + _fixturemanager: FixtureManager + exitstatus: int | ExitCode + + def __init__(self, config: Config) -> None: + super().__init__( + name="", + path=config.rootpath, + fspath=None, + parent=None, + config=config, + session=self, + nodeid="", + ) + self.testsfailed = 0 + self.testscollected = 0 + self._shouldstop: bool | str = False + self._shouldfail: bool | str = False + self.trace = config.trace.root.get("collection") + self._initialpaths: frozenset[Path] = frozenset() + self._initialpaths_with_parents: frozenset[Path] = frozenset() + self._notfound: list[tuple[str, Sequence[nodes.Collector]]] = [] + self._initial_parts: list[CollectionArgument] = [] + self._collection_cache: dict[nodes.Collector, CollectReport] = {} + self.items: list[nodes.Item] = [] + + self._bestrelpathcache: dict[Path, str] = _bestrelpath_cache(config.rootpath) + + self.config.pluginmanager.register(self, name="session") + + @classmethod + def from_config(cls, config: Config) -> Session: + session: Session = cls._create(config=config) + return session + + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} {self.name} " + f"exitstatus=%r " + f"testsfailed={self.testsfailed} " + f"testscollected={self.testscollected}>" + ) % getattr(self, "exitstatus", "") + + @property + def shouldstop(self) -> bool | str: + return self._shouldstop + + @shouldstop.setter + def shouldstop(self, value: bool | str) -> None: + # The runner checks shouldfail and assumes that if it is set we are + # definitely stopping, so prevent unsetting it. + if value is False and self._shouldstop: + warnings.warn( + PytestWarning( + "session.shouldstop cannot be unset after it has been set; ignoring." + ), + stacklevel=2, + ) + return + self._shouldstop = value + + @property + def shouldfail(self) -> bool | str: + return self._shouldfail + + @shouldfail.setter + def shouldfail(self, value: bool | str) -> None: + # The runner checks shouldfail and assumes that if it is set we are + # definitely stopping, so prevent unsetting it. + if value is False and self._shouldfail: + warnings.warn( + PytestWarning( + "session.shouldfail cannot be unset after it has been set; ignoring." + ), + stacklevel=2, + ) + return + self._shouldfail = value + + @property + def startpath(self) -> Path: + """The path from which pytest was invoked. + + .. versionadded:: 7.0.0 + """ + return self.config.invocation_params.dir + + def _node_location_to_relpath(self, node_path: Path) -> str: + # bestrelpath is a quite slow function. + return self._bestrelpathcache[node_path] + + @hookimpl(tryfirst=True) + def pytest_collectstart(self) -> None: + if self.shouldfail: + raise self.Failed(self.shouldfail) + if self.shouldstop: + raise self.Interrupted(self.shouldstop) + + @hookimpl(tryfirst=True) + def pytest_runtest_logreport(self, report: TestReport | CollectReport) -> None: + if report.failed and not hasattr(report, "wasxfail"): + self.testsfailed += 1 + maxfail = self.config.getvalue("maxfail") + if maxfail and self.testsfailed >= maxfail: + self.shouldfail = f"stopping after {self.testsfailed} failures" + + pytest_collectreport = pytest_runtest_logreport + + def isinitpath( + self, + path: str | os.PathLike[str], + *, + with_parents: bool = False, + ) -> bool: + """Is path an initial path? + + An initial path is a path explicitly given to pytest on the command + line. + + :param with_parents: + If set, also return True if the path is a parent of an initial path. + + .. versionchanged:: 8.0 + Added the ``with_parents`` parameter. + """ + # Optimization: Path(Path(...)) is much slower than isinstance. + path_ = path if isinstance(path, Path) else Path(path) + if with_parents: + return path_ in self._initialpaths_with_parents + else: + return path_ in self._initialpaths + + def gethookproxy(self, fspath: os.PathLike[str]) -> pluggy.HookRelay: + # Optimization: Path(Path(...)) is much slower than isinstance. + path = fspath if isinstance(fspath, Path) else Path(fspath) + pm = self.config.pluginmanager + # Check if we have the common case of running + # hooks with all conftest.py files. + my_conftestmodules = pm._getconftestmodules(path) + remove_mods = pm._conftest_plugins.difference(my_conftestmodules) + proxy: pluggy.HookRelay + if remove_mods: + # One or more conftests are not in use at this path. + proxy = PathAwareHookProxy(FSHookProxy(pm, remove_mods)) # type: ignore[arg-type,assignment] + else: + # All plugins are active for this fspath. + proxy = self.config.hook + return proxy + + def _collect_path( + self, + path: Path, + path_cache: dict[Path, Sequence[nodes.Collector]], + ) -> Sequence[nodes.Collector]: + """Create a Collector for the given path. + + `path_cache` makes it so the same Collectors are returned for the same + path. + """ + if path in path_cache: + return path_cache[path] + + if path.is_dir(): + ihook = self.gethookproxy(path.parent) + col: nodes.Collector | None = ihook.pytest_collect_directory( + path=path, parent=self + ) + cols: Sequence[nodes.Collector] = (col,) if col is not None else () + + elif path.is_file(): + ihook = self.gethookproxy(path) + cols = ihook.pytest_collect_file(file_path=path, parent=self) + + else: + # Broken symlink or invalid/missing file. + cols = () + + path_cache[path] = cols + return cols + + @overload + def perform_collect( + self, args: Sequence[str] | None = ..., genitems: Literal[True] = ... + ) -> Sequence[nodes.Item]: ... + + @overload + def perform_collect( + self, args: Sequence[str] | None = ..., genitems: bool = ... + ) -> Sequence[nodes.Item | nodes.Collector]: ... + + def perform_collect( + self, args: Sequence[str] | None = None, genitems: bool = True + ) -> Sequence[nodes.Item | nodes.Collector]: + """Perform the collection phase for this session. + + This is called by the default :hook:`pytest_collection` hook + implementation; see the documentation of this hook for more details. + For testing purposes, it may also be called directly on a fresh + ``Session``. + + This function normally recursively expands any collectors collected + from the session to their items, and only items are returned. For + testing purposes, this may be suppressed by passing ``genitems=False``, + in which case the return value contains these collectors unexpanded, + and ``session.items`` is empty. + """ + if args is None: + args = self.config.args + + self.trace("perform_collect", self, args) + self.trace.root.indent += 1 + + hook = self.config.hook + + self._notfound = [] + self._initial_parts = [] + self._collection_cache = {} + self.items = [] + items: Sequence[nodes.Item | nodes.Collector] = self.items + consider_namespace_packages: bool = self.config.getini( + "consider_namespace_packages" + ) + try: + initialpaths: list[Path] = [] + initialpaths_with_parents: list[Path] = [] + + collection_args = [ + resolve_collection_argument( + self.config.invocation_params.dir, + arg, + i, + as_pypath=self.config.option.pyargs, + consider_namespace_packages=consider_namespace_packages, + ) + for i, arg in enumerate(args) + ] + + if not self.config.getoption("keepduplicates"): + # Normalize the collection arguments -- remove duplicates and overlaps. + self._initial_parts = normalize_collection_arguments(collection_args) + else: + self._initial_parts = collection_args + + for collection_argument in self._initial_parts: + initialpaths.append(collection_argument.path) + initialpaths_with_parents.append(collection_argument.path) + initialpaths_with_parents.extend(collection_argument.path.parents) + self._initialpaths = frozenset(initialpaths) + self._initialpaths_with_parents = frozenset(initialpaths_with_parents) + + rep = collect_one_node(self) + self.ihook.pytest_collectreport(report=rep) + self.trace.root.indent -= 1 + if self._notfound: + errors = [] + for arg, collectors in self._notfound: + if collectors: + errors.append( + f"not found: {arg}\n(no match in any of {collectors!r})" + ) + else: + errors.append(f"found no collectors for {arg}") + + raise UsageError(*errors) + + if not genitems: + items = rep.result + else: + if rep.passed: + for node in rep.result: + self.items.extend(self.genitems(node)) + + self.config.pluginmanager.check_pending() + hook.pytest_collection_modifyitems( + session=self, config=self.config, items=items + ) + finally: + self._notfound = [] + self._initial_parts = [] + self._collection_cache = {} + hook.pytest_collection_finish(session=self) + + if genitems: + self.testscollected = len(items) + + return items + + def _collect_one_node( + self, + node: nodes.Collector, + handle_dupes: bool = True, + ) -> tuple[CollectReport, bool]: + if node in self._collection_cache and handle_dupes: + rep = self._collection_cache[node] + return rep, True + else: + rep = collect_one_node(node) + self._collection_cache[node] = rep + return rep, False + + def collect(self) -> Iterator[nodes.Item | nodes.Collector]: + # This is a cache for the root directories of the initial paths. + # We can't use collection_cache for Session because of its special + # role as the bootstrapping collector. + path_cache: dict[Path, Sequence[nodes.Collector]] = {} + + pm = self.config.pluginmanager + + for collection_argument in self._initial_parts: + self.trace("processing argument", collection_argument) + self.trace.root.indent += 1 + + argpath = collection_argument.path + names = collection_argument.parts + parametrization = collection_argument.parametrization + module_name = collection_argument.module_name + + # resolve_collection_argument() ensures this. + if argpath.is_dir(): + assert not names, f"invalid arg {(argpath, names)!r}" + + paths = [argpath] + # Add relevant parents of the path, from the root, e.g. + # /a/b/c.py -> [/, /a, /a/b, /a/b/c.py] + if module_name is None: + # Paths outside of the confcutdir should not be considered. + for path in argpath.parents: + if not pm._is_in_confcutdir(path): + break + paths.insert(0, path) + else: + # For --pyargs arguments, only consider paths matching the module + # name. Paths beyond the package hierarchy are not included. + module_name_parts = module_name.split(".") + for i, path in enumerate(argpath.parents, 2): + if i > len(module_name_parts) or path.stem != module_name_parts[-i]: + break + paths.insert(0, path) + + # Start going over the parts from the root, collecting each level + # and discarding all nodes which don't match the level's part. + any_matched_in_initial_part = False + notfound_collectors = [] + work: list[tuple[nodes.Collector | nodes.Item, list[Path | str]]] = [ + (self, [*paths, *names]) + ] + while work: + matchnode, matchparts = work.pop() + + # Pop'd all of the parts, this is a match. + if not matchparts: + yield matchnode + any_matched_in_initial_part = True + continue + + # Should have been matched by now, discard. + if not isinstance(matchnode, nodes.Collector): + continue + + # Collect this level of matching. + # Collecting Session (self) is done directly to avoid endless + # recursion to this function. + subnodes: Sequence[nodes.Collector | nodes.Item] + if isinstance(matchnode, Session): + assert isinstance(matchparts[0], Path) + subnodes = matchnode._collect_path(matchparts[0], path_cache) + else: + # For backward compat, files given directly multiple + # times on the command line should not be deduplicated. + handle_dupes = not ( + len(matchparts) == 1 + and isinstance(matchparts[0], Path) + and matchparts[0].is_file() + ) + rep, duplicate = self._collect_one_node(matchnode, handle_dupes) + if not duplicate and not rep.passed: + # Report collection failures here to avoid failing to + # run some test specified in the command line because + # the module could not be imported (#134). + matchnode.ihook.pytest_collectreport(report=rep) + if not rep.passed: + continue + subnodes = rep.result + + # Prune this level. + any_matched_in_collector = False + for node in reversed(subnodes): + # Path part e.g. `/a/b/` in `/a/b/test_file.py::TestIt::test_it`. + if isinstance(matchparts[0], Path): + is_match = node.path == matchparts[0] + if sys.platform == "win32" and not is_match: + # In case the file paths do not match, fallback to samefile() to + # account for short-paths on Windows (#11895). But use a version + # which doesn't resolve symlinks, otherwise we might match the + # same file more than once (#12039). + is_match = samefile_nofollow(node.path, matchparts[0]) + + # Name part e.g. `TestIt` in `/a/b/test_file.py::TestIt::test_it`. + else: + if len(matchparts) == 1: + # This the last part, one parametrization goes. + if parametrization is not None: + # A parametrized arg must match exactly. + is_match = node.name == matchparts[0] + parametrization + else: + # A non-parameterized arg matches all parametrizations (if any). + # TODO: Remove the hacky split once the collection structure + # contains parametrization. + is_match = node.name.split("[")[0] == matchparts[0] + else: + is_match = node.name == matchparts[0] + if is_match: + work.append((node, matchparts[1:])) + any_matched_in_collector = True + + if not any_matched_in_collector: + notfound_collectors.append(matchnode) + + if not any_matched_in_initial_part: + report_arg = "::".join((str(argpath), *names)) + self._notfound.append((report_arg, notfound_collectors)) + + self.trace.root.indent -= 1 + + def genitems(self, node: nodes.Item | nodes.Collector) -> Iterator[nodes.Item]: + self.trace("genitems", node) + if isinstance(node, nodes.Item): + node.ihook.pytest_itemcollected(item=node) + yield node + else: + assert isinstance(node, nodes.Collector) + # For backward compat, dedup only applies to files. + handle_dupes = not isinstance(node, nodes.File) + rep, duplicate = self._collect_one_node(node, handle_dupes) + if rep.passed: + for subnode in rep.result: + yield from self.genitems(subnode) + if not duplicate: + node.ihook.pytest_collectreport(report=rep) + + +def search_pypath( + module_name: str, *, consider_namespace_packages: bool = False +) -> str | None: + """Search sys.path for the given a dotted module name, and return its file + system path if found.""" + try: + spec = importlib.util.find_spec(module_name) + # AttributeError: looks like package module, but actually filename + # ImportError: module does not exist + # ValueError: not a module name + except (AttributeError, ImportError, ValueError): + return None + + if spec is None: + return None + + if ( + spec.submodule_search_locations is None + or len(spec.submodule_search_locations) == 0 + ): + # Must be a simple module. + return spec.origin + + if consider_namespace_packages: + # If submodule_search_locations is set, it's a package (regular or namespace). + # Typically there is a single entry, but documentation claims it can be empty too + # (e.g. if the package has no physical location). + return spec.submodule_search_locations[0] + + if spec.origin is None: + # This is only the case for namespace packages + return None + + return os.path.dirname(spec.origin) + + +@dataclasses.dataclass(frozen=True) +class CollectionArgument: + """A resolved collection argument.""" + + path: Path + parts: Sequence[str] + parametrization: str | None + module_name: str | None + original_index: int + + +def resolve_collection_argument( + invocation_path: Path, + arg: str, + arg_index: int, + *, + as_pypath: bool = False, + consider_namespace_packages: bool = False, +) -> CollectionArgument: + """Parse path arguments optionally containing selection parts and return (fspath, names). + + Command-line arguments can point to files and/or directories, and optionally contain + parts for specific tests selection, for example: + + "pkg/tests/test_foo.py::TestClass::test_foo" + + This function ensures the path exists, and returns a resolved `CollectionArgument`: + + CollectionArgument( + path=Path("/full/path/to/pkg/tests/test_foo.py"), + parts=["TestClass", "test_foo"], + module_name=None, + ) + + When as_pypath is True, expects that the command-line argument actually contains + module paths instead of file-system paths: + + "pkg.tests.test_foo::TestClass::test_foo[a,b]" + + In which case we search sys.path for a matching module, and then return the *path* to the + found module, which may look like this: + + CollectionArgument( + path=Path("/home/u/myvenv/lib/site-packages/pkg/tests/test_foo.py"), + parts=["TestClass", "test_foo"], + parametrization="[a,b]", + module_name="pkg.tests.test_foo", + ) + + If the path doesn't exist, raise UsageError. + If the path is a directory and selection parts are present, raise UsageError. + """ + base, squacket, rest = arg.partition("[") + strpath, *parts = base.split("::") + if squacket and not parts: + raise UsageError(f"path cannot contain [] parametrization: {arg}") + parametrization = f"{squacket}{rest}" if squacket else None + module_name = None + if as_pypath: + pyarg_strpath = search_pypath( + strpath, consider_namespace_packages=consider_namespace_packages + ) + if pyarg_strpath is not None: + module_name = strpath + strpath = pyarg_strpath + fspath = invocation_path / strpath + fspath = absolutepath(fspath) + if not safe_exists(fspath): + msg = ( + "module or package not found: {arg} (missing __init__.py?)" + if as_pypath + else "file or directory not found: {arg}" + ) + raise UsageError(msg.format(arg=arg)) + if parts and fspath.is_dir(): + msg = ( + "package argument cannot contain :: selection parts: {arg}" + if as_pypath + else "directory argument cannot contain :: selection parts: {arg}" + ) + raise UsageError(msg.format(arg=arg)) + return CollectionArgument( + path=fspath, + parts=parts, + parametrization=parametrization, + module_name=module_name, + original_index=arg_index, + ) + + +def is_collection_argument_subsumed_by( + arg: CollectionArgument, by: CollectionArgument +) -> bool: + """Check if `arg` is subsumed (contained) by `by`.""" + # First check path subsumption. + if by.path != arg.path: + # `by` subsumes `arg` if `by` is a parent directory of `arg` and has no + # parts (collects everything in that directory). + if not by.parts: + return arg.path.is_relative_to(by.path) + return False + # Paths are equal, check parts. + # For example: ("TestClass",) is a prefix of ("TestClass", "test_method"). + if len(by.parts) > len(arg.parts) or arg.parts[: len(by.parts)] != by.parts: + return False + # Paths and parts are equal, check parametrization. + # A `by` without parametrization (None) matches everything, e.g. + # `pytest x.py::test_it` matches `x.py::test_it[0]`. Otherwise must be + # exactly equal. + if by.parametrization is not None and by.parametrization != arg.parametrization: + return False + return True + + +def normalize_collection_arguments( + collection_args: Sequence[CollectionArgument], +) -> list[CollectionArgument]: + """Normalize collection arguments to eliminate overlapping paths and parts. + + Detects when collection arguments overlap in either paths or parts and only + keeps the shorter prefix, or the earliest argument if duplicate, preserving + order. The result is prefix-free. + """ + # A quadratic algorithm is not acceptable since large inputs are possible. + # So this uses an O(n*log(n)) algorithm which takes advantage of the + # property that after sorting, a collection argument will immediately + # precede collection arguments it subsumes. An O(n) algorithm is not worth + # it. + collection_args_sorted = sorted( + collection_args, + key=lambda arg: (arg.path, arg.parts, arg.parametrization or ""), + ) + normalized: list[CollectionArgument] = [] + last_kept = None + for arg in collection_args_sorted: + if last_kept is None or not is_collection_argument_subsumed_by(arg, last_kept): + normalized.append(arg) + last_kept = arg + normalized.sort(key=lambda arg: arg.original_index) + return normalized diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/__init__.py b/micromamba_root/Lib/site-packages/_pytest/mark/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..841d7811fddbb96a7ac7615e998602b834ba091a --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/mark/__init__.py @@ -0,0 +1,301 @@ +"""Generic mechanism for marking and selecting python functions.""" + +from __future__ import annotations + +import collections +from collections.abc import Collection +from collections.abc import Iterable +from collections.abc import Set as AbstractSet +import dataclasses +from typing import TYPE_CHECKING + +from .expression import Expression +from .structures import _HiddenParam +from .structures import EMPTY_PARAMETERSET_OPTION +from .structures import get_empty_parameterset_mark +from .structures import HIDDEN_PARAM +from .structures import Mark +from .structures import MARK_GEN +from .structures import MarkDecorator +from .structures import MarkGenerator +from .structures import ParameterSet +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import UsageError +from _pytest.config.argparsing import NOT_SET +from _pytest.config.argparsing import Parser +from _pytest.stash import StashKey + + +if TYPE_CHECKING: + from _pytest.nodes import Item + + +__all__ = [ + "HIDDEN_PARAM", + "MARK_GEN", + "Mark", + "MarkDecorator", + "MarkGenerator", + "ParameterSet", + "get_empty_parameterset_mark", +] + + +old_mark_config_key = StashKey[Config | None]() + + +def param( + *values: object, + marks: MarkDecorator | Collection[MarkDecorator | Mark] = (), + id: str | _HiddenParam | None = None, +) -> ParameterSet: + """Specify a parameter in `pytest.mark.parametrize`_ calls or + :ref:`parametrized fixtures `. + + .. code-block:: python + + @pytest.mark.parametrize( + "test_input,expected", + [ + ("3+5", 8), + pytest.param("6*9", 42, marks=pytest.mark.xfail), + ], + ) + def test_eval(test_input, expected): + assert eval(test_input) == expected + + :param values: Variable args of the values of the parameter set, in order. + + :param marks: + A single mark or a list of marks to be applied to this parameter set. + + :ref:`pytest.mark.usefixtures ` cannot be added via this parameter. + + :type id: str | Literal[pytest.HIDDEN_PARAM] | None + :param id: + The id to attribute to this parameter set. + + .. versionadded:: 8.4 + :ref:`hidden-param` means to hide the parameter set + from the test name. Can only be used at most 1 time, as + test names need to be unique. + """ + return ParameterSet.param(*values, marks=marks, id=id) + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group._addoption( # private to use reserved lower-case short option + "-k", + action="store", + dest="keyword", + default="", + metavar="EXPRESSION", + help="Only run tests which match the given substring expression. " + "An expression is a Python evaluable expression " + "where all names are substring-matched against test names " + "and their parent classes. Example: -k 'test_method or test_" + "other' matches all test functions and classes whose name " + "contains 'test_method' or 'test_other', while -k 'not test_method' " + "matches those that don't contain 'test_method' in their names. " + "-k 'not test_method and not test_other' will eliminate the matches. " + "Additionally keywords are matched to classes and functions " + "containing extra names in their 'extra_keyword_matches' set, " + "as well as functions which have names assigned directly to them. " + "The matching is case-insensitive.", + ) + + group._addoption( # private to use reserved lower-case short option + "-m", + action="store", + dest="markexpr", + default="", + metavar="MARKEXPR", + help="Only run tests matching given mark expression. " + "For example: -m 'mark1 and not mark2'.", + ) + + group.addoption( + "--markers", + action="store_true", + help="show markers (builtin, plugin and per-project ones).", + ) + + parser.addini("markers", "Register new markers for test functions", "linelist") + parser.addini(EMPTY_PARAMETERSET_OPTION, "Default marker for empty parametersets") + + +@hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + import _pytest.config + + if config.option.markers: + config._do_configure() + tw = _pytest.config.create_terminal_writer(config) + for line in config.getini("markers"): + parts = line.split(":", 1) + name = parts[0] + rest = parts[1] if len(parts) == 2 else "" + tw.write(f"@pytest.mark.{name}:", bold=True) + tw.line(rest) + tw.line() + config._ensure_unconfigure() + return 0 + + return None + + +@dataclasses.dataclass +class KeywordMatcher: + """A matcher for keywords. + + Given a list of names, matches any substring of one of these names. The + string inclusion check is case-insensitive. + + Will match on the name of colitem, including the names of its parents. + Only matches names of items which are either a :class:`Class` or a + :class:`Function`. + + Additionally, matches on names in the 'extra_keyword_matches' set of + any item, as well as names directly assigned to test functions. + """ + + __slots__ = ("_names",) + + _names: AbstractSet[str] + + @classmethod + def from_item(cls, item: Item) -> KeywordMatcher: + mapped_names = set() + + # Add the names of the current item and any parent items, + # except the Session and root Directory's which are not + # interesting for matching. + import pytest + + for node in item.listchain(): + if isinstance(node, pytest.Session): + continue + if isinstance(node, pytest.Directory) and isinstance( + node.parent, pytest.Session + ): + continue + mapped_names.add(node.name) + + # Add the names added as extra keywords to current or parent items. + mapped_names.update(item.listextrakeywords()) + + # Add the names attached to the current function through direct assignment. + function_obj = getattr(item, "function", None) + if function_obj: + mapped_names.update(function_obj.__dict__) + + # Add the markers to the keywords as we no longer handle them correctly. + mapped_names.update(mark.name for mark in item.iter_markers()) + + return cls(mapped_names) + + def __call__(self, subname: str, /, **kwargs: str | int | bool | None) -> bool: + if kwargs: + raise UsageError("Keyword expressions do not support call parameters.") + subname = subname.lower() + return any(subname in name.lower() for name in self._names) + + +def deselect_by_keyword(items: list[Item], config: Config) -> None: + keywordexpr = config.option.keyword.lstrip() + if not keywordexpr: + return + + expr = _parse_expression(keywordexpr, "Wrong expression passed to '-k'") + + remaining = [] + deselected = [] + for colitem in items: + if not expr.evaluate(KeywordMatcher.from_item(colitem)): + deselected.append(colitem) + else: + remaining.append(colitem) + + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +@dataclasses.dataclass +class MarkMatcher: + """A matcher for markers which are present. + + Tries to match on any marker names, attached to the given colitem. + """ + + __slots__ = ("own_mark_name_mapping",) + + own_mark_name_mapping: dict[str, list[Mark]] + + @classmethod + def from_markers(cls, markers: Iterable[Mark]) -> MarkMatcher: + mark_name_mapping = collections.defaultdict(list) + for mark in markers: + mark_name_mapping[mark.name].append(mark) + return cls(mark_name_mapping) + + def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool: + if not (matches := self.own_mark_name_mapping.get(name, [])): + return False + + for mark in matches: # pylint: disable=consider-using-any-or-all + if all(mark.kwargs.get(k, NOT_SET) == v for k, v in kwargs.items()): + return True + return False + + +def deselect_by_mark(items: list[Item], config: Config) -> None: + matchexpr = config.option.markexpr + if not matchexpr: + return + + expr = _parse_expression(matchexpr, "Wrong expression passed to '-m'") + remaining: list[Item] = [] + deselected: list[Item] = [] + for item in items: + if expr.evaluate(MarkMatcher.from_markers(item.iter_markers())): + remaining.append(item) + else: + deselected.append(item) + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +def _parse_expression(expr: str, exc_message: str) -> Expression: + try: + return Expression.compile(expr) + except SyntaxError as e: + raise UsageError( + f"{exc_message}: {e.text}: at column {e.offset}: {e.msg}" + ) from None + + +def pytest_collection_modifyitems(items: list[Item], config: Config) -> None: + deselect_by_keyword(items, config) + deselect_by_mark(items, config) + + +def pytest_configure(config: Config) -> None: + config.stash[old_mark_config_key] = MARK_GEN._config + MARK_GEN._config = config + + empty_parameterset = config.getini(EMPTY_PARAMETERSET_OPTION) + + if empty_parameterset not in ("skip", "xfail", "fail_at_collect", None, ""): + raise UsageError( + f"{EMPTY_PARAMETERSET_OPTION!s} must be one of skip, xfail or fail_at_collect" + f" but it is {empty_parameterset!r}" + ) + + +def pytest_unconfigure(config: Config) -> None: + MARK_GEN._config = config.stash.get(old_mark_config_key, None) diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fd70621030b0c41d107b2ea1aa2d46088b267cd Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/expression.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/expression.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f81d1555e2f49245af0f5c686c197316ff79a59c Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/expression.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/structures.cpython-314.pyc b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/structures.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b805fc31e9f32f68aa0765442395c9e58917a3ff Binary files /dev/null and b/micromamba_root/Lib/site-packages/_pytest/mark/__pycache__/structures.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/expression.py b/micromamba_root/Lib/site-packages/_pytest/mark/expression.py new file mode 100644 index 0000000000000000000000000000000000000000..3bdbd03c2b55ca20aba1c56d49056a9cf13d4953 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/mark/expression.py @@ -0,0 +1,353 @@ +r"""Evaluate match expressions, as used by `-k` and `-m`. + +The grammar is: + +expression: expr? EOF +expr: and_expr ('or' and_expr)* +and_expr: not_expr ('and' not_expr)* +not_expr: 'not' not_expr | '(' expr ')' | ident kwargs? + +ident: (\w|:|\+|-|\.|\[|\]|\\|/)+ +kwargs: ('(' name '=' value ( ', ' name '=' value )* ')') +name: a valid ident, but not a reserved keyword +value: (unescaped) string literal | (-)?[0-9]+ | 'False' | 'True' | 'None' + +The semantics are: + +- Empty expression evaluates to False. +- ident evaluates to True or False according to a provided matcher function. +- ident with parentheses and keyword arguments evaluates to True or False according to a provided matcher function. +- or/and/not evaluate according to the usual boolean semantics. +""" + +from __future__ import annotations + +import ast +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import Sequence +import dataclasses +import enum +import keyword +import re +import types +from typing import Final +from typing import final +from typing import Literal +from typing import NoReturn +from typing import overload +from typing import Protocol + + +__all__ = [ + "Expression", + "ExpressionMatcher", +] + + +FILE_NAME: Final = "" + + +class TokenType(enum.Enum): + LPAREN = "left parenthesis" + RPAREN = "right parenthesis" + OR = "or" + AND = "and" + NOT = "not" + IDENT = "identifier" + EOF = "end of input" + EQUAL = "=" + STRING = "string literal" + COMMA = "," + + +@dataclasses.dataclass(frozen=True) +class Token: + __slots__ = ("pos", "type", "value") + type: TokenType + value: str + pos: int + + +class Scanner: + __slots__ = ("current", "input", "tokens") + + def __init__(self, input: str) -> None: + self.input = input + self.tokens = self.lex(input) + self.current = next(self.tokens) + + def lex(self, input: str) -> Iterator[Token]: + pos = 0 + while pos < len(input): + if input[pos] in (" ", "\t"): + pos += 1 + elif input[pos] == "(": + yield Token(TokenType.LPAREN, "(", pos) + pos += 1 + elif input[pos] == ")": + yield Token(TokenType.RPAREN, ")", pos) + pos += 1 + elif input[pos] == "=": + yield Token(TokenType.EQUAL, "=", pos) + pos += 1 + elif input[pos] == ",": + yield Token(TokenType.COMMA, ",", pos) + pos += 1 + elif (quote_char := input[pos]) in ("'", '"'): + end_quote_pos = input.find(quote_char, pos + 1) + if end_quote_pos == -1: + raise SyntaxError( + f'closing quote "{quote_char}" is missing', + (FILE_NAME, 1, pos + 1, input), + ) + value = input[pos : end_quote_pos + 1] + if (backslash_pos := input.find("\\")) != -1: + raise SyntaxError( + r'escaping with "\" not supported in marker expression', + (FILE_NAME, 1, backslash_pos + 1, input), + ) + yield Token(TokenType.STRING, value, pos) + pos += len(value) + else: + match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\|/)+", input[pos:]) + if match: + value = match.group(0) + if value == "or": + yield Token(TokenType.OR, value, pos) + elif value == "and": + yield Token(TokenType.AND, value, pos) + elif value == "not": + yield Token(TokenType.NOT, value, pos) + else: + yield Token(TokenType.IDENT, value, pos) + pos += len(value) + else: + raise SyntaxError( + f'unexpected character "{input[pos]}"', + (FILE_NAME, 1, pos + 1, input), + ) + yield Token(TokenType.EOF, "", pos) + + @overload + def accept(self, type: TokenType, *, reject: Literal[True]) -> Token: ... + + @overload + def accept( + self, type: TokenType, *, reject: Literal[False] = False + ) -> Token | None: ... + + def accept(self, type: TokenType, *, reject: bool = False) -> Token | None: + if self.current.type is type: + token = self.current + if token.type is not TokenType.EOF: + self.current = next(self.tokens) + return token + if reject: + self.reject((type,)) + return None + + def reject(self, expected: Sequence[TokenType]) -> NoReturn: + raise SyntaxError( + "expected {}; got {}".format( + " OR ".join(type.value for type in expected), + self.current.type.value, + ), + (FILE_NAME, 1, self.current.pos + 1, self.input), + ) + + +# True, False and None are legal match expression identifiers, +# but illegal as Python identifiers. To fix this, this prefix +# is added to identifiers in the conversion to Python AST. +IDENT_PREFIX = "$" + + +def expression(s: Scanner) -> ast.Expression: + if s.accept(TokenType.EOF): + ret: ast.expr = ast.Constant(False) + else: + ret = expr(s) + s.accept(TokenType.EOF, reject=True) + return ast.fix_missing_locations(ast.Expression(ret)) + + +def expr(s: Scanner) -> ast.expr: + ret = and_expr(s) + while s.accept(TokenType.OR): + rhs = and_expr(s) + ret = ast.BoolOp(ast.Or(), [ret, rhs]) + return ret + + +def and_expr(s: Scanner) -> ast.expr: + ret = not_expr(s) + while s.accept(TokenType.AND): + rhs = not_expr(s) + ret = ast.BoolOp(ast.And(), [ret, rhs]) + return ret + + +def not_expr(s: Scanner) -> ast.expr: + if s.accept(TokenType.NOT): + return ast.UnaryOp(ast.Not(), not_expr(s)) + if s.accept(TokenType.LPAREN): + ret = expr(s) + s.accept(TokenType.RPAREN, reject=True) + return ret + ident = s.accept(TokenType.IDENT) + if ident: + name = ast.Name(IDENT_PREFIX + ident.value, ast.Load()) + if s.accept(TokenType.LPAREN): + ret = ast.Call(func=name, args=[], keywords=all_kwargs(s)) + s.accept(TokenType.RPAREN, reject=True) + else: + ret = name + return ret + + s.reject((TokenType.NOT, TokenType.LPAREN, TokenType.IDENT)) + + +BUILTIN_MATCHERS = {"True": True, "False": False, "None": None} + + +def single_kwarg(s: Scanner) -> ast.keyword: + keyword_name = s.accept(TokenType.IDENT, reject=True) + if not keyword_name.value.isidentifier(): + raise SyntaxError( + f"not a valid python identifier {keyword_name.value}", + (FILE_NAME, 1, keyword_name.pos + 1, s.input), + ) + if keyword.iskeyword(keyword_name.value): + raise SyntaxError( + f"unexpected reserved python keyword `{keyword_name.value}`", + (FILE_NAME, 1, keyword_name.pos + 1, s.input), + ) + s.accept(TokenType.EQUAL, reject=True) + + if value_token := s.accept(TokenType.STRING): + value: str | int | bool | None = value_token.value[1:-1] # strip quotes + else: + value_token = s.accept(TokenType.IDENT, reject=True) + if (number := value_token.value).isdigit() or ( + number.startswith("-") and number[1:].isdigit() + ): + value = int(number) + elif value_token.value in BUILTIN_MATCHERS: + value = BUILTIN_MATCHERS[value_token.value] + else: + raise SyntaxError( + f'unexpected character/s "{value_token.value}"', + (FILE_NAME, 1, value_token.pos + 1, s.input), + ) + + ret = ast.keyword(keyword_name.value, ast.Constant(value)) + return ret + + +def all_kwargs(s: Scanner) -> list[ast.keyword]: + ret = [single_kwarg(s)] + while s.accept(TokenType.COMMA): + ret.append(single_kwarg(s)) + return ret + + +class ExpressionMatcher(Protocol): + """A callable which, given an identifier and optional kwargs, should return + whether it matches in an :class:`Expression` evaluation. + + Should be prepared to handle arbitrary strings as input. + + If no kwargs are provided, the expression of the form `foo`. + If kwargs are provided, the expression is of the form `foo(1, b=True, "s")`. + + If the expression is not supported (e.g. don't want to accept the kwargs + syntax variant), should raise :class:`~pytest.UsageError`. + + Example:: + + def matcher(name: str, /, **kwargs: str | int | bool | None) -> bool: + # Match `cat`. + if name == "cat" and not kwargs: + return True + # Match `dog(barks=True)`. + if name == "dog" and kwargs == {"barks": False}: + return True + return False + """ + + def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool: ... + + +@dataclasses.dataclass +class MatcherNameAdapter: + matcher: ExpressionMatcher + name: str + + def __bool__(self) -> bool: + return self.matcher(self.name) + + def __call__(self, **kwargs: str | int | bool | None) -> bool: + return self.matcher(self.name, **kwargs) + + +class MatcherAdapter(Mapping[str, MatcherNameAdapter]): + """Adapts a matcher function to a locals mapping as required by eval().""" + + def __init__(self, matcher: ExpressionMatcher) -> None: + self.matcher = matcher + + def __getitem__(self, key: str) -> MatcherNameAdapter: + return MatcherNameAdapter(matcher=self.matcher, name=key[len(IDENT_PREFIX) :]) + + def __iter__(self) -> Iterator[str]: + raise NotImplementedError() + + def __len__(self) -> int: + raise NotImplementedError() + + +@final +class Expression: + """A compiled match expression as used by -k and -m. + + The expression can be evaluated against different matchers. + """ + + __slots__ = ("_code", "input") + + def __init__(self, input: str, code: types.CodeType) -> None: + #: The original input line, as a string. + self.input: Final = input + self._code: Final = code + + @classmethod + def compile(cls, input: str) -> Expression: + """Compile a match expression. + + :param input: The input expression - one line. + + :raises SyntaxError: If the expression is malformed. + """ + astexpr = expression(Scanner(input)) + code = compile( + astexpr, + filename="", + mode="eval", + ) + return Expression(input, code) + + def evaluate(self, matcher: ExpressionMatcher) -> bool: + """Evaluate the match expression. + + :param matcher: + A callback which determines whether an identifier matches or not. + See the :class:`ExpressionMatcher` protocol for details and example. + + :returns: Whether the expression matches or not. + + :raises UsageError: + If the matcher doesn't support the expression. Cannot happen if the + matcher supports all expressions. + """ + return bool(eval(self._code, {"__builtins__": {}}, MatcherAdapter(matcher))) diff --git a/micromamba_root/Lib/site-packages/_pytest/mark/structures.py b/micromamba_root/Lib/site-packages/_pytest/mark/structures.py new file mode 100644 index 0000000000000000000000000000000000000000..97842fc57049feba02e3f9f2cd81b3fb116bfb57 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/mark/structures.py @@ -0,0 +1,664 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import collections.abc +from collections.abc import Callable +from collections.abc import Collection +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import MutableMapping +from collections.abc import Sequence +import dataclasses +import enum +import inspect +from typing import Any +from typing import final +from typing import NamedTuple +from typing import overload +from typing import TYPE_CHECKING +from typing import TypeVar +import warnings + +from .._code import getfslineno +from ..compat import NOTSET +from ..compat import NotSetType +from _pytest.config import Config +from _pytest.deprecated import check_ispytest +from _pytest.deprecated import MARKED_FIXTURE +from _pytest.outcomes import fail +from _pytest.raises import AbstractRaises +from _pytest.scope import _ScopeName +from _pytest.warning_types import PytestUnknownMarkWarning + + +if TYPE_CHECKING: + from ..nodes import Node + + +EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark" + + +# Singleton type for HIDDEN_PARAM, as described in: +# https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions +class _HiddenParam(enum.Enum): + token = 0 + + +#: Can be used as a parameter set id to hide it from the test name. +HIDDEN_PARAM = _HiddenParam.token + + +def istestfunc(func) -> bool: + return callable(func) and getattr(func, "__name__", "") != "" + + +def get_empty_parameterset_mark( + config: Config, argnames: Sequence[str], func +) -> MarkDecorator: + from ..nodes import Collector + + argslisting = ", ".join(argnames) + + _fs, lineno = getfslineno(func) + reason = f"got empty parameter set for ({argslisting})" + requested_mark = config.getini(EMPTY_PARAMETERSET_OPTION) + if requested_mark in ("", None, "skip"): + mark = MARK_GEN.skip(reason=reason) + elif requested_mark == "xfail": + mark = MARK_GEN.xfail(reason=reason, run=False) + elif requested_mark == "fail_at_collect": + raise Collector.CollectError( + f"Empty parameter set in '{func.__name__}' at line {lineno + 1}" + ) + else: + raise LookupError(requested_mark) + return mark + + +class ParameterSet(NamedTuple): + """A set of values for a set of parameters along with associated marks and + an optional ID for the set. + + Examples:: + + pytest.param(1, 2, 3) + # ParameterSet(values=(1, 2, 3), marks=(), id=None) + + pytest.param("hello", id="greeting") + # ParameterSet(values=("hello",), marks=(), id="greeting") + + # Parameter set with marks + pytest.param(42, marks=pytest.mark.xfail) + # ParameterSet(values=(42,), marks=(MarkDecorator(...),), id=None) + + # From parametrize mark (parameter names + list of parameter sets) + pytest.mark.parametrize( + ("a", "b", "expected"), + [ + (1, 2, 3), + pytest.param(40, 2, 42, id="everything"), + ], + ) + # ParameterSet(values=(1, 2, 3), marks=(), id=None) + # ParameterSet(values=(40, 2, 42), marks=(), id="everything") + """ + + values: Sequence[object | NotSetType] + marks: Collection[MarkDecorator | Mark] + id: str | _HiddenParam | None + + @classmethod + def param( + cls, + *values: object, + marks: MarkDecorator | Collection[MarkDecorator | Mark] = (), + id: str | _HiddenParam | None = None, + ) -> ParameterSet: + if isinstance(marks, MarkDecorator): + marks = (marks,) + else: + assert isinstance(marks, collections.abc.Collection) + if any(i.name == "usefixtures" for i in marks): + raise ValueError( + "pytest.param cannot add pytest.mark.usefixtures; see " + "https://docs.pytest.org/en/stable/reference/reference.html#pytest-param" + ) + + if id is not None: + if not isinstance(id, str) and id is not HIDDEN_PARAM: + raise TypeError( + "Expected id to be a string or a `pytest.HIDDEN_PARAM` sentinel, " + f"got {type(id)}: {id!r}", + ) + return cls(values, marks, id) + + @classmethod + def extract_from( + cls, + parameterset: ParameterSet | Sequence[object] | object, + force_tuple: bool = False, + ) -> ParameterSet: + """Extract from an object or objects. + + :param parameterset: + A legacy style parameterset that may or may not be a tuple, + and may or may not be wrapped into a mess of mark objects. + + :param force_tuple: + Enforce tuple wrapping so single argument tuple values + don't get decomposed and break tests. + """ + if isinstance(parameterset, cls): + return parameterset + if force_tuple: + return cls.param(parameterset) + else: + # TODO: Refactor to fix this type-ignore. Currently the following + # passes type-checking but crashes: + # + # @pytest.mark.parametrize(('x', 'y'), [1, 2]) + # def test_foo(x, y): pass + return cls(parameterset, marks=[], id=None) # type: ignore[arg-type] + + @staticmethod + def _parse_parametrize_args( + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + *args, + **kwargs, + ) -> tuple[Sequence[str], bool]: + if isinstance(argnames, str): + argnames = [x.strip() for x in argnames.split(",") if x.strip()] + force_tuple = len(argnames) == 1 + else: + force_tuple = False + return argnames, force_tuple + + @staticmethod + def _parse_parametrize_parameters( + argvalues: Iterable[ParameterSet | Sequence[object] | object], + force_tuple: bool, + ) -> list[ParameterSet]: + return [ + ParameterSet.extract_from(x, force_tuple=force_tuple) for x in argvalues + ] + + @classmethod + def _for_parametrize( + cls, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + func, + config: Config, + nodeid: str, + ) -> tuple[Sequence[str], list[ParameterSet]]: + argnames, force_tuple = cls._parse_parametrize_args(argnames, argvalues) + parameters = cls._parse_parametrize_parameters(argvalues, force_tuple) + del argvalues + + if parameters: + # Check all parameter sets have the correct number of values. + for param in parameters: + if len(param.values) != len(argnames): + msg = ( + '{nodeid}: in "parametrize" the number of names ({names_len}):\n' + " {names}\n" + "must be equal to the number of values ({values_len}):\n" + " {values}" + ) + fail( + msg.format( + nodeid=nodeid, + values=param.values, + names=argnames, + names_len=len(argnames), + values_len=len(param.values), + ), + pytrace=False, + ) + else: + # Empty parameter set (likely computed at runtime): create a single + # parameter set with NOTSET values, with the "empty parameter set" mark applied to it. + mark = get_empty_parameterset_mark(config, argnames, func) + parameters.append( + ParameterSet( + values=(NOTSET,) * len(argnames), marks=[mark], id="NOTSET" + ) + ) + return argnames, parameters + + +@final +@dataclasses.dataclass(frozen=True) +class Mark: + """A pytest mark.""" + + #: Name of the mark. + name: str + #: Positional arguments of the mark decorator. + args: tuple[Any, ...] + #: Keyword arguments of the mark decorator. + kwargs: Mapping[str, Any] + + #: Source Mark for ids with parametrize Marks. + _param_ids_from: Mark | None = dataclasses.field(default=None, repr=False) + #: Resolved/generated ids with parametrize Marks. + _param_ids_generated: Sequence[str] | None = dataclasses.field( + default=None, repr=False + ) + + def __init__( + self, + name: str, + args: tuple[Any, ...], + kwargs: Mapping[str, Any], + param_ids_from: Mark | None = None, + param_ids_generated: Sequence[str] | None = None, + *, + _ispytest: bool = False, + ) -> None: + """:meta private:""" + check_ispytest(_ispytest) + # Weirdness to bypass frozen=True. + object.__setattr__(self, "name", name) + object.__setattr__(self, "args", args) + object.__setattr__(self, "kwargs", kwargs) + object.__setattr__(self, "_param_ids_from", param_ids_from) + object.__setattr__(self, "_param_ids_generated", param_ids_generated) + + def _has_param_ids(self) -> bool: + return "ids" in self.kwargs or len(self.args) >= 4 + + def combined_with(self, other: Mark) -> Mark: + """Return a new Mark which is a combination of this + Mark and another Mark. + + Combines by appending args and merging kwargs. + + :param Mark other: The mark to combine with. + :rtype: Mark + """ + assert self.name == other.name + + # Remember source of ids with parametrize Marks. + param_ids_from: Mark | None = None + if self.name == "parametrize": + if other._has_param_ids(): + param_ids_from = other + elif self._has_param_ids(): + param_ids_from = self + + return Mark( + self.name, + self.args + other.args, + dict(self.kwargs, **other.kwargs), + param_ids_from=param_ids_from, + _ispytest=True, + ) + + +# A generic parameter designating an object to which a Mark may +# be applied -- a test function (callable) or class. +# Note: a lambda is not allowed, but this can't be represented. +Markable = TypeVar("Markable", bound=Callable[..., object] | type) + + +@dataclasses.dataclass +class MarkDecorator: + """A decorator for applying a mark on test functions and classes. + + ``MarkDecorators`` are created with ``pytest.mark``:: + + mark1 = pytest.mark.NAME # Simple MarkDecorator + mark2 = pytest.mark.NAME(name1=value) # Parametrized MarkDecorator + + and can then be applied as decorators to test functions:: + + @mark2 + def test_function(): + pass + + When a ``MarkDecorator`` is called, it does the following: + + 1. If called with a single class as its only positional argument and no + additional keyword arguments, it attaches the mark to the class so it + gets applied automatically to all test cases found in that class. + + 2. If called with a single function as its only positional argument and + no additional keyword arguments, it attaches the mark to the function, + containing all the arguments already stored internally in the + ``MarkDecorator``. + + 3. When called in any other case, it returns a new ``MarkDecorator`` + instance with the original ``MarkDecorator``'s content updated with + the arguments passed to this call. + + Note: The rules above prevent a ``MarkDecorator`` from storing only a + single function or class reference as its positional argument with no + additional keyword or positional arguments. You can work around this by + using `with_args()`. + """ + + mark: Mark + + def __init__(self, mark: Mark, *, _ispytest: bool = False) -> None: + """:meta private:""" + check_ispytest(_ispytest) + self.mark = mark + + @property + def name(self) -> str: + """Alias for mark.name.""" + return self.mark.name + + @property + def args(self) -> tuple[Any, ...]: + """Alias for mark.args.""" + return self.mark.args + + @property + def kwargs(self) -> Mapping[str, Any]: + """Alias for mark.kwargs.""" + return self.mark.kwargs + + @property + def markname(self) -> str: + """:meta private:""" + return self.name # for backward-compat (2.4.1 had this attr) + + def with_args(self, *args: object, **kwargs: object) -> MarkDecorator: + """Return a MarkDecorator with extra arguments added. + + Unlike calling the MarkDecorator, with_args() can be used even + if the sole argument is a callable/class. + """ + mark = Mark(self.name, args, kwargs, _ispytest=True) + return MarkDecorator(self.mark.combined_with(mark), _ispytest=True) + + # Type ignored because the overloads overlap with an incompatible + # return type. Not much we can do about that. Thankfully mypy picks + # the first match so it works out even if we break the rules. + @overload + def __call__(self, arg: Markable) -> Markable: # type: ignore[overload-overlap] + pass + + @overload + def __call__(self, *args: object, **kwargs: object) -> MarkDecorator: + pass + + def __call__(self, *args: object, **kwargs: object): + """Call the MarkDecorator.""" + if args and not kwargs: + func = args[0] + is_class = inspect.isclass(func) + # For staticmethods/classmethods, the marks are eventually fetched from the + # function object, not the descriptor, so unwrap. + unwrapped_func = func + if isinstance(func, staticmethod | classmethod): + unwrapped_func = func.__func__ + if len(args) == 1 and (istestfunc(unwrapped_func) or is_class): + store_mark(unwrapped_func, self.mark, stacklevel=3) + return func + return self.with_args(*args, **kwargs) + + +def get_unpacked_marks( + obj: object | type, + *, + consider_mro: bool = True, +) -> list[Mark]: + """Obtain the unpacked marks that are stored on an object. + + If obj is a class and consider_mro is true, return marks applied to + this class and all of its super-classes in MRO order. If consider_mro + is false, only return marks applied directly to this class. + """ + if isinstance(obj, type): + if not consider_mro: + mark_lists = [obj.__dict__.get("pytestmark", [])] + else: + mark_lists = [ + x.__dict__.get("pytestmark", []) for x in reversed(obj.__mro__) + ] + mark_list = [] + for item in mark_lists: + if isinstance(item, list): + mark_list.extend(item) + else: + mark_list.append(item) + else: + mark_attribute = getattr(obj, "pytestmark", []) + if isinstance(mark_attribute, list): + mark_list = mark_attribute + else: + mark_list = [mark_attribute] + return list(normalize_mark_list(mark_list)) + + +def normalize_mark_list( + mark_list: Iterable[Mark | MarkDecorator], +) -> Iterable[Mark]: + """ + Normalize an iterable of Mark or MarkDecorator objects into a list of marks + by retrieving the `mark` attribute on MarkDecorator instances. + + :param mark_list: marks to normalize + :returns: A new list of the extracted Mark objects + """ + for mark in mark_list: + mark_obj = getattr(mark, "mark", mark) + if not isinstance(mark_obj, Mark): + raise TypeError(f"got {mark_obj!r} instead of Mark") + yield mark_obj + + +def store_mark(obj, mark: Mark, *, stacklevel: int = 2) -> None: + """Store a Mark on an object. + + This is used to implement the Mark declarations/decorators correctly. + """ + assert isinstance(mark, Mark), mark + + from ..fixtures import getfixturemarker + + if getfixturemarker(obj) is not None: + warnings.warn(MARKED_FIXTURE, stacklevel=stacklevel) + + # Always reassign name to avoid updating pytestmark in a reference that + # was only borrowed. + obj.pytestmark = [*get_unpacked_marks(obj, consider_mro=False), mark] + + +# Typing for builtin pytest marks. This is cheating; it gives builtin marks +# special privilege, and breaks modularity. But practicality beats purity... +if TYPE_CHECKING: + + class _SkipMarkDecorator(MarkDecorator): + @overload # type: ignore[override,no-overload-impl] + def __call__(self, arg: Markable) -> Markable: ... + + @overload + def __call__(self, reason: str = ...) -> MarkDecorator: ... + + class _SkipifMarkDecorator(MarkDecorator): + def __call__( # type: ignore[override] + self, + condition: str | bool = ..., + *conditions: str | bool, + reason: str = ..., + ) -> MarkDecorator: ... + + class _XfailMarkDecorator(MarkDecorator): + @overload # type: ignore[override,no-overload-impl] + def __call__(self, arg: Markable) -> Markable: ... + + @overload + def __call__( + self, + condition: str | bool = True, + *conditions: str | bool, + reason: str = ..., + run: bool = ..., + raises: None + | type[BaseException] + | tuple[type[BaseException], ...] + | AbstractRaises[BaseException] = ..., + strict: bool = ..., + ) -> MarkDecorator: ... + + class _ParametrizeMarkDecorator(MarkDecorator): + def __call__( # type: ignore[override] + self, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + *, + indirect: bool | Sequence[str] = ..., + ids: Iterable[None | str | float | int | bool] + | Callable[[Any], object | None] + | None = ..., + scope: _ScopeName | None = ..., + ) -> MarkDecorator: ... + + class _UsefixturesMarkDecorator(MarkDecorator): + def __call__(self, *fixtures: str) -> MarkDecorator: # type: ignore[override] + ... + + class _FilterwarningsMarkDecorator(MarkDecorator): + def __call__(self, *filters: str) -> MarkDecorator: # type: ignore[override] + ... + + +@final +class MarkGenerator: + """Factory for :class:`MarkDecorator` objects - exposed as + a ``pytest.mark`` singleton instance. + + Example:: + + import pytest + + + @pytest.mark.slowtest + def test_function(): + pass + + applies a 'slowtest' :class:`Mark` on ``test_function``. + """ + + # See TYPE_CHECKING above. + if TYPE_CHECKING: + skip: _SkipMarkDecorator + skipif: _SkipifMarkDecorator + xfail: _XfailMarkDecorator + parametrize: _ParametrizeMarkDecorator + usefixtures: _UsefixturesMarkDecorator + filterwarnings: _FilterwarningsMarkDecorator + + def __init__(self, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._config: Config | None = None + self._markers: set[str] = set() + + def __getattr__(self, name: str) -> MarkDecorator: + """Generate a new :class:`MarkDecorator` with the given name.""" + if name[0] == "_": + raise AttributeError("Marker name must NOT start with underscore") + + if self._config is not None: + # We store a set of markers as a performance optimisation - if a mark + # name is in the set we definitely know it, but a mark may be known and + # not in the set. We therefore start by updating the set! + if name not in self._markers: + for line in self._config.getini("markers"): + # example lines: "skipif(condition): skip the given test if..." + # or "hypothesis: tests which use Hypothesis", so to get the + # marker name we split on both `:` and `(`. + marker = line.split(":")[0].split("(")[0].strip() + self._markers.add(marker) + + # If the name is not in the set of known marks after updating, + # then it really is time to issue a warning or an error. + if name not in self._markers: + # Raise a specific error for common misspellings of "parametrize". + if name in ["parameterize", "parametrise", "parameterise"]: + __tracebackhide__ = True + fail(f"Unknown '{name}' mark, did you mean 'parametrize'?") + + strict_markers = self._config.getini("strict_markers") + if strict_markers is None: + strict_markers = self._config.getini("strict") + if strict_markers: + fail( + f"{name!r} not found in `markers` configuration option", + pytrace=False, + ) + + warnings.warn( + f"Unknown pytest.mark.{name} - is this a typo? You can register " + "custom marks to avoid this warning - for details, see " + "https://docs.pytest.org/en/stable/how-to/mark.html", + PytestUnknownMarkWarning, + 2, + ) + + return MarkDecorator(Mark(name, (), {}, _ispytest=True), _ispytest=True) + + +MARK_GEN = MarkGenerator(_ispytest=True) + + +@final +class NodeKeywords(MutableMapping[str, Any]): + __slots__ = ("_markers", "node", "parent") + + def __init__(self, node: Node) -> None: + self.node = node + self.parent = node.parent + self._markers = {node.name: True} + + def __getitem__(self, key: str) -> Any: + try: + return self._markers[key] + except KeyError: + if self.parent is None: + raise + return self.parent.keywords[key] + + def __setitem__(self, key: str, value: Any) -> None: + self._markers[key] = value + + # Note: we could've avoided explicitly implementing some of the methods + # below and use the collections.abc fallback, but that would be slow. + + def __contains__(self, key: object) -> bool: + return key in self._markers or ( + self.parent is not None and key in self.parent.keywords + ) + + def update( # type: ignore[override] + self, + other: Mapping[str, Any] | Iterable[tuple[str, Any]] = (), + **kwds: Any, + ) -> None: + self._markers.update(other) + self._markers.update(kwds) + + def __delitem__(self, key: str) -> None: + raise ValueError("cannot delete key in keywords dict") + + def __iter__(self) -> Iterator[str]: + # Doesn't need to be fast. + yield from self._markers + if self.parent is not None: + for keyword in self.parent.keywords: + # self._marks and self.parent.keywords can have duplicates. + if keyword not in self._markers: + yield keyword + + def __len__(self) -> int: + # Doesn't need to be fast. + return sum(1 for keyword in self) + + def __repr__(self) -> str: + return f"" diff --git a/micromamba_root/Lib/site-packages/_pytest/monkeypatch.py b/micromamba_root/Lib/site-packages/_pytest/monkeypatch.py new file mode 100644 index 0000000000000000000000000000000000000000..07cc3fc4b0f520553aa4786d18436b6c080b60c8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/monkeypatch.py @@ -0,0 +1,435 @@ +# mypy: allow-untyped-defs +"""Monkeypatching and mocking functionality.""" + +from __future__ import annotations + +from collections.abc import Generator +from collections.abc import Mapping +from collections.abc import MutableMapping +from contextlib import contextmanager +import os +from pathlib import Path +import re +import sys +from typing import Any +from typing import final +from typing import overload +from typing import TypeVar +import warnings + +from _pytest.deprecated import MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES +from _pytest.fixtures import fixture +from _pytest.warning_types import PytestWarning + + +RE_IMPORT_ERROR_NAME = re.compile(r"^No module named (.*)$") + + +K = TypeVar("K") +V = TypeVar("V") + + +@fixture +def monkeypatch() -> Generator[MonkeyPatch]: + """A convenient fixture for monkey-patching. + + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: + + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` + + All modifications will be undone after the requesting test function or + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. + """ + mpatch = MonkeyPatch() + yield mpatch + mpatch.undo() + + +def resolve(name: str) -> object: + # Simplified from zope.dottedname. + parts = name.split(".") + + used = parts.pop(0) + found: object = __import__(used) + for part in parts: + used += "." + part + try: + found = getattr(found, part) + except AttributeError: + pass + else: + continue + # We use explicit un-nesting of the handling block in order + # to avoid nested exceptions. + try: + __import__(used) + except ImportError as ex: + expected = str(ex).split()[-1] + if expected == used: + raise + else: + raise ImportError(f"import error in {used}: {ex}") from ex + found = annotated_getattr(found, part, used) + return found + + +def annotated_getattr(obj: object, name: str, ann: str) -> object: + try: + obj = getattr(obj, name) + except AttributeError as e: + raise AttributeError( + f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}" + ) from e + return obj + + +def derive_importpath(import_path: str, raising: bool) -> tuple[str, object]: + if not isinstance(import_path, str) or "." not in import_path: + raise TypeError(f"must be absolute import path string, not {import_path!r}") + module, attr = import_path.rsplit(".", 1) + target = resolve(module) + if raising: + annotated_getattr(target, attr, ann=module) + return attr, target + + +class Notset: + def __repr__(self) -> str: + return "" + + +notset = Notset() + + +@final +class MonkeyPatch: + """Helper to conveniently monkeypatch attributes/items/environment + variables/syspath. + + Returned by the :fixture:`monkeypatch` fixture. + + .. versionchanged:: 6.2 + Can now also be used directly as `pytest.MonkeyPatch()`, for when + the fixture is not available. In this case, use + :meth:`with MonkeyPatch.context() as mp: ` or remember to call + :meth:`undo` explicitly. + """ + + def __init__(self) -> None: + self._setattr: list[tuple[object, str, object]] = [] + self._setitem: list[tuple[Mapping[Any, Any], object, object]] = [] + self._cwd: str | None = None + self._savesyspath: list[str] | None = None + + @classmethod + @contextmanager + def context(cls) -> Generator[MonkeyPatch]: + """Context manager that returns a new :class:`MonkeyPatch` object + which undoes any patching done inside the ``with`` block upon exit. + + Example: + + .. code-block:: python + + import functools + + + def test_partial(monkeypatch): + with monkeypatch.context() as m: + m.setattr(functools, "partial", 3) + + Useful in situations where it is desired to undo some patches before the test ends, + such as mocking ``stdlib`` functions that might break pytest itself if mocked (for examples + of this see :issue:`3290`). + """ + m = cls() + try: + yield m + finally: + m.undo() + + @overload + def setattr( + self, + target: str, + name: object, + value: Notset = ..., + raising: bool = ..., + ) -> None: ... + + @overload + def setattr( + self, + target: object, + name: str, + value: object, + raising: bool = ..., + ) -> None: ... + + def setattr( + self, + target: str | object, + name: object | str, + value: object = notset, + raising: bool = True, + ) -> None: + """ + Set attribute value on target, memorizing the old value. + + For example: + + .. code-block:: python + + import os + + monkeypatch.setattr(os, "getcwd", lambda: "/") + + The code above replaces the :func:`os.getcwd` function by a ``lambda`` which + always returns ``"/"``. + + For convenience, you can specify a string as ``target`` which + will be interpreted as a dotted import path, with the last part + being the attribute name: + + .. code-block:: python + + monkeypatch.setattr("os.getcwd", lambda: "/") + + Raises :class:`AttributeError` if the attribute does not exist, unless + ``raising`` is set to False. + + **Where to patch** + + ``monkeypatch.setattr`` works by (temporarily) changing the object that a name points to with another one. + There can be many names pointing to any individual object, so for patching to work you must ensure + that you patch the name used by the system under test. + + See the section :ref:`Where to patch ` in the :mod:`unittest.mock` + docs for a complete explanation, which is meant for :func:`unittest.mock.patch` but + applies to ``monkeypatch.setattr`` as well. + """ + __tracebackhide__ = True + import inspect + + if isinstance(value, Notset): + if not isinstance(target, str): + raise TypeError( + "use setattr(target, name, value) or " + "setattr(target, value) with target being a dotted " + "import string" + ) + value = name + name, target = derive_importpath(target, raising) + else: + if not isinstance(name, str): + raise TypeError( + "use setattr(target, name, value) with name being a string or " + "setattr(target, value) with target being a dotted " + "import string" + ) + + oldval = getattr(target, name, notset) + if raising and oldval is notset: + raise AttributeError(f"{target!r} has no attribute {name!r}") + + # avoid class descriptors like staticmethod/classmethod + if inspect.isclass(target): + oldval = target.__dict__.get(name, notset) + self._setattr.append((target, name, oldval)) + setattr(target, name, value) + + def delattr( + self, + target: object | str, + name: str | Notset = notset, + raising: bool = True, + ) -> None: + """Delete attribute ``name`` from ``target``. + + If no ``name`` is specified and ``target`` is a string + it will be interpreted as a dotted import path with the + last part being the attribute name. + + Raises AttributeError it the attribute does not exist, unless + ``raising`` is set to False. + """ + __tracebackhide__ = True + import inspect + + if isinstance(name, Notset): + if not isinstance(target, str): + raise TypeError( + "use delattr(target, name) or " + "delattr(target) with target being a dotted " + "import string" + ) + name, target = derive_importpath(target, raising) + + if not hasattr(target, name): + if raising: + raise AttributeError(name) + else: + oldval = getattr(target, name, notset) + # Avoid class descriptors like staticmethod/classmethod. + if inspect.isclass(target): + oldval = target.__dict__.get(name, notset) + self._setattr.append((target, name, oldval)) + delattr(target, name) + + def setitem(self, dic: Mapping[K, V], name: K, value: V) -> None: + """Set dictionary entry ``name`` to value.""" + self._setitem.append((dic, name, dic.get(name, notset))) + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + dic[name] = value # type: ignore[index] + + def delitem(self, dic: Mapping[K, V], name: K, raising: bool = True) -> None: + """Delete ``name`` from dict. + + Raises ``KeyError`` if it doesn't exist, unless ``raising`` is set to + False. + """ + if name not in dic: + if raising: + raise KeyError(name) + else: + self._setitem.append((dic, name, dic.get(name, notset))) + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + del dic[name] # type: ignore[attr-defined] + + def setenv(self, name: str, value: str, prepend: str | None = None) -> None: + """Set environment variable ``name`` to ``value``. + + If ``prepend`` is a character, read the current environment variable + value and prepend the ``value`` adjoined with the ``prepend`` + character. + """ + if not isinstance(value, str): + warnings.warn( # type: ignore[unreachable] + PytestWarning( + f"Value of environment variable {name} type should be str, but got " + f"{value!r} (type: {type(value).__name__}); converted to str implicitly" + ), + stacklevel=2, + ) + value = str(value) + if prepend and name in os.environ: + value = value + prepend + os.environ[name] + self.setitem(os.environ, name, value) + + def delenv(self, name: str, raising: bool = True) -> None: + """Delete ``name`` from the environment. + + Raises ``KeyError`` if it does not exist, unless ``raising`` is set to + False. + """ + environ: MutableMapping[str, str] = os.environ + self.delitem(environ, name, raising=raising) + + def syspath_prepend(self, path) -> None: + """Prepend ``path`` to ``sys.path`` list of import locations.""" + if self._savesyspath is None: + self._savesyspath = sys.path[:] + sys.path.insert(0, str(path)) + + # https://github.com/pypa/setuptools/blob/d8b901bc/docs/pkg_resources.txt#L162-L171 + # this is only needed when pkg_resources was already loaded by the namespace package + if "pkg_resources" in sys.modules: + import pkg_resources + from pkg_resources import fixup_namespace_packages + + # Only issue deprecation warning if this call would actually have an + # effect for this specific path. + if ( + hasattr(pkg_resources, "_namespace_packages") + and pkg_resources._namespace_packages + ): + path_obj = Path(str(path)) + for ns_pkg in pkg_resources._namespace_packages: + if ns_pkg is None: + continue + ns_pkg_path = path_obj / ns_pkg.replace(".", os.sep) + if ns_pkg_path.is_dir(): + warnings.warn( + MONKEYPATCH_LEGACY_NAMESPACE_PACKAGES, stacklevel=2 + ) + break + + fixup_namespace_packages(str(path)) + + # A call to syspathinsert() usually means that the caller wants to + # import some dynamically created files, thus with python3 we + # invalidate its import caches. + # This is especially important when any namespace package is in use, + # since then the mtime based FileFinder cache (that gets created in + # this case already) gets not invalidated when writing the new files + # quickly afterwards. + from importlib import invalidate_caches + + invalidate_caches() + + def chdir(self, path: str | os.PathLike[str]) -> None: + """Change the current working directory to the specified path. + + :param path: + The path to change into. + """ + if self._cwd is None: + self._cwd = os.getcwd() + os.chdir(path) + + def undo(self) -> None: + """Undo previous changes. + + This call consumes the undo stack. Calling it a second time has no + effect unless you do more monkeypatching after the undo call. + + There is generally no need to call `undo()`, since it is + called automatically during tear-down. + + .. note:: + The same `monkeypatch` fixture is used across a + single test function invocation. If `monkeypatch` is used both by + the test function itself and one of the test fixtures, + calling `undo()` will undo all of the changes made in + both functions. + + Prefer to use :meth:`context() ` instead. + """ + for obj, name, value in reversed(self._setattr): + if value is not notset: + setattr(obj, name, value) + else: + delattr(obj, name) + self._setattr[:] = [] + for dictionary, key, value in reversed(self._setitem): + if value is notset: + try: + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + del dictionary[key] # type: ignore[attr-defined] + except KeyError: + pass # Was already deleted, so we have the desired state. + else: + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + dictionary[key] = value # type: ignore[index] + self._setitem[:] = [] + if self._savesyspath is not None: + sys.path[:] = self._savesyspath + self._savesyspath = None + + if self._cwd is not None: + os.chdir(self._cwd) + self._cwd = None diff --git a/micromamba_root/Lib/site-packages/_pytest/nodes.py b/micromamba_root/Lib/site-packages/_pytest/nodes.py new file mode 100644 index 0000000000000000000000000000000000000000..6690f6ab1f814671d3342e5f14d85fbc39d7b083 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/nodes.py @@ -0,0 +1,772 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import abc +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import MutableMapping +from functools import cached_property +from functools import lru_cache +import os +import pathlib +from pathlib import Path +from typing import Any +from typing import cast +from typing import NoReturn +from typing import overload +from typing import TYPE_CHECKING +from typing import TypeVar +import warnings + +import pluggy + +import _pytest._code +from _pytest._code import getfslineno +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest._code.code import Traceback +from _pytest._code.code import TracebackStyle +from _pytest.compat import LEGACY_PATH +from _pytest.compat import signature +from _pytest.config import Config +from _pytest.config import ConftestImportFailure +from _pytest.config.compat import _check_path +from _pytest.deprecated import NODE_CTOR_FSPATH_ARG +from _pytest.mark.structures import Mark +from _pytest.mark.structures import MarkDecorator +from _pytest.mark.structures import NodeKeywords +from _pytest.outcomes import fail +from _pytest.pathlib import absolutepath +from _pytest.stash import Stash +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + # Imported here due to circular import. + from _pytest.main import Session + + +SEP = "/" + +tracebackcutdir = Path(_pytest.__file__).parent + + +_T = TypeVar("_T") + + +def _imply_path( + node_type: type[Node], + path: Path | None, + fspath: LEGACY_PATH | None, +) -> Path: + if fspath is not None: + warnings.warn( + NODE_CTOR_FSPATH_ARG.format( + node_type_name=node_type.__name__, + ), + stacklevel=6, + ) + if path is not None: + if fspath is not None: + _check_path(path, fspath) + return path + else: + assert fspath is not None + return Path(fspath) + + +_NodeType = TypeVar("_NodeType", bound="Node") + + +class NodeMeta(abc.ABCMeta): + """Metaclass used by :class:`Node` to enforce that direct construction raises + :class:`Failed`. + + This behaviour supports the indirection introduced with :meth:`Node.from_parent`, + the named constructor to be used instead of direct construction. The design + decision to enforce indirection with :class:`NodeMeta` was made as a + temporary aid for refactoring the collection tree, which was diagnosed to + have :class:`Node` objects whose creational patterns were overly entangled. + Once the refactoring is complete, this metaclass can be removed. + + See https://github.com/pytest-dev/pytest/projects/3 for an overview of the + progress on detangling the :class:`Node` classes. + """ + + def __call__(cls, *k, **kw) -> NoReturn: + msg = ( + "Direct construction of {name} has been deprecated, please use {name}.from_parent.\n" + "See " + "https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent" + " for more details." + ).format(name=f"{cls.__module__}.{cls.__name__}") + fail(msg, pytrace=False) + + def _create(cls: type[_T], *k, **kw) -> _T: + try: + return super().__call__(*k, **kw) # type: ignore[no-any-return,misc] + except TypeError: + sig = signature(getattr(cls, "__init__")) + known_kw = {k: v for k, v in kw.items() if k in sig.parameters} + from .warning_types import PytestDeprecationWarning + + warnings.warn( + PytestDeprecationWarning( + f"{cls} is not using a cooperative constructor and only takes {set(known_kw)}.\n" + "See https://docs.pytest.org/en/stable/deprecations.html" + "#constructors-of-custom-pytest-node-subclasses-should-take-kwargs " + "for more details." + ) + ) + + return super().__call__(*k, **known_kw) # type: ignore[no-any-return,misc] + + +class Node(abc.ABC, metaclass=NodeMeta): + r"""Base class of :class:`Collector` and :class:`Item`, the components of + the test collection tree. + + ``Collector``\'s are the internal nodes of the tree, and ``Item``\'s are the + leaf nodes. + """ + + # Implemented in the legacypath plugin. + #: A ``LEGACY_PATH`` copy of the :attr:`path` attribute. Intended for usage + #: for methods not migrated to ``pathlib.Path`` yet, such as + #: :meth:`Item.reportinfo `. Will be deprecated in + #: a future release, prefer using :attr:`path` instead. + fspath: LEGACY_PATH + + # Use __slots__ to make attribute access faster. + # Note that __dict__ is still available. + __slots__ = ( + "__dict__", + "_nodeid", + "_store", + "config", + "name", + "parent", + "path", + "session", + ) + + def __init__( + self, + name: str, + parent: Node | None = None, + config: Config | None = None, + session: Session | None = None, + fspath: LEGACY_PATH | None = None, + path: Path | None = None, + nodeid: str | None = None, + ) -> None: + #: A unique name within the scope of the parent node. + self.name: str = name + + #: The parent collector node. + self.parent = parent + + if config: + #: The pytest config object. + self.config: Config = config + else: + if not parent: + raise TypeError("config or parent must be provided") + self.config = parent.config + + if session: + #: The pytest session this node is part of. + self.session: Session = session + else: + if not parent: + raise TypeError("session or parent must be provided") + self.session = parent.session + + if path is None and fspath is None: + path = getattr(parent, "path", None) + #: Filesystem path where this node was collected from (can be None). + self.path: pathlib.Path = _imply_path(type(self), path, fspath=fspath) + + # The explicit annotation is to avoid publicly exposing NodeKeywords. + #: Keywords/markers collected from all scopes. + self.keywords: MutableMapping[str, Any] = NodeKeywords(self) + + #: The marker objects belonging to this node. + self.own_markers: list[Mark] = [] + + #: Allow adding of extra keywords to use for matching. + self.extra_keyword_matches: set[str] = set() + + if nodeid is not None: + assert "::()" not in nodeid + self._nodeid = nodeid + else: + if not self.parent: + raise TypeError("nodeid or parent must be provided") + self._nodeid = self.parent.nodeid + "::" + self.name + + #: A place where plugins can store information on the node for their + #: own use. + self.stash: Stash = Stash() + # Deprecated alias. Was never public. Can be removed in a few releases. + self._store = self.stash + + @classmethod + def from_parent(cls, parent: Node, **kw) -> Self: + """Public constructor for Nodes. + + This indirection got introduced in order to enable removing + the fragile logic from the node constructors. + + Subclasses can use ``super().from_parent(...)`` when overriding the + construction. + + :param parent: The parent node of this Node. + """ + if "config" in kw: + raise TypeError("config is not a valid argument for from_parent") + if "session" in kw: + raise TypeError("session is not a valid argument for from_parent") + return cls._create(parent=parent, **kw) + + @property + def ihook(self) -> pluggy.HookRelay: + """fspath-sensitive hook proxy used to call pytest hooks.""" + return self.session.gethookproxy(self.path) + + def __repr__(self) -> str: + return "<{} {}>".format(self.__class__.__name__, getattr(self, "name", None)) + + def warn(self, warning: Warning) -> None: + """Issue a warning for this Node. + + Warnings will be displayed after the test session, unless explicitly suppressed. + + :param Warning warning: + The warning instance to issue. + + :raises ValueError: If ``warning`` instance is not a subclass of Warning. + + Example usage: + + .. code-block:: python + + node.warn(PytestWarning("some message")) + node.warn(UserWarning("some message")) + + .. versionchanged:: 6.2 + Any subclass of :class:`Warning` is now accepted, rather than only + :class:`PytestWarning ` subclasses. + """ + # enforce type checks here to avoid getting a generic type error later otherwise. + if not isinstance(warning, Warning): + raise ValueError( + f"warning must be an instance of Warning or subclass, got {warning!r}" + ) + path, lineno = get_fslocation_from_item(self) + assert lineno is not None + warnings.warn_explicit( + warning, + category=None, + filename=str(path), + lineno=lineno + 1, + ) + + # Methods for ordering nodes. + + @property + def nodeid(self) -> str: + """A ::-separated string denoting its collection tree address.""" + return self._nodeid + + def __hash__(self) -> int: + return hash(self._nodeid) + + def setup(self) -> None: + pass + + def teardown(self) -> None: + pass + + def iter_parents(self) -> Iterator[Node]: + """Iterate over all parent collectors starting from and including self + up to the root of the collection tree. + + .. versionadded:: 8.1 + """ + parent: Node | None = self + while parent is not None: + yield parent + parent = parent.parent + + def listchain(self) -> list[Node]: + """Return a list of all parent collectors starting from the root of the + collection tree down to and including self.""" + chain = [] + item: Node | None = self + while item is not None: + chain.append(item) + item = item.parent + chain.reverse() + return chain + + def add_marker(self, marker: str | MarkDecorator, append: bool = True) -> None: + """Dynamically add a marker object to the node. + + :param marker: + The marker. + :param append: + Whether to append the marker, or prepend it. + """ + from _pytest.mark import MARK_GEN + + if isinstance(marker, MarkDecorator): + marker_ = marker + elif isinstance(marker, str): + marker_ = getattr(MARK_GEN, marker) + else: + raise ValueError("is not a string or pytest.mark.* Marker") + self.keywords[marker_.name] = marker_ + if append: + self.own_markers.append(marker_.mark) + else: + self.own_markers.insert(0, marker_.mark) + + def iter_markers(self, name: str | None = None) -> Iterator[Mark]: + """Iterate over all markers of the node. + + :param name: If given, filter the results by the name attribute. + :returns: An iterator of the markers of the node. + """ + return (x[1] for x in self.iter_markers_with_node(name=name)) + + def iter_markers_with_node( + self, name: str | None = None + ) -> Iterator[tuple[Node, Mark]]: + """Iterate over all markers of the node. + + :param name: If given, filter the results by the name attribute. + :returns: An iterator of (node, mark) tuples. + """ + for node in self.iter_parents(): + for mark in node.own_markers: + if name is None or getattr(mark, "name", None) == name: + yield node, mark + + @overload + def get_closest_marker(self, name: str) -> Mark | None: ... + + @overload + def get_closest_marker(self, name: str, default: Mark) -> Mark: ... + + def get_closest_marker(self, name: str, default: Mark | None = None) -> Mark | None: + """Return the first marker matching the name, from closest (for + example function) to farther level (for example module level). + + :param default: Fallback return value if no marker was found. + :param name: Name to filter by. + """ + return next(self.iter_markers(name=name), default) + + def listextrakeywords(self) -> set[str]: + """Return a set of all extra keywords in self and any parents.""" + extra_keywords: set[str] = set() + for item in self.listchain(): + extra_keywords.update(item.extra_keyword_matches) + return extra_keywords + + def listnames(self) -> list[str]: + return [x.name for x in self.listchain()] + + def addfinalizer(self, fin: Callable[[], object]) -> None: + """Register a function to be called without arguments when this node is + finalized. + + This method can only be called when this node is active + in a setup chain, for example during self.setup(). + """ + self.session._setupstate.addfinalizer(fin, self) + + def getparent(self, cls: type[_NodeType]) -> _NodeType | None: + """Get the closest parent node (including self) which is an instance of + the given class. + + :param cls: The node class to search for. + :returns: The node, if found. + """ + for node in self.iter_parents(): + if isinstance(node, cls): + return node + return None + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + return excinfo.traceback + + def _repr_failure_py( + self, + excinfo: ExceptionInfo[BaseException], + style: TracebackStyle | None = None, + ) -> TerminalRepr: + from _pytest.fixtures import FixtureLookupError + + if isinstance(excinfo.value, ConftestImportFailure): + excinfo = ExceptionInfo.from_exception(excinfo.value.cause) + if isinstance(excinfo.value, fail.Exception): + if not excinfo.value.pytrace: + style = "value" + if isinstance(excinfo.value, FixtureLookupError): + return excinfo.value.formatrepr() + + tbfilter: bool | Callable[[ExceptionInfo[BaseException]], Traceback] + if self.config.getoption("fulltrace", False): + style = "long" + tbfilter = False + else: + tbfilter = self._traceback_filter + if style == "auto": + style = "long" + # XXX should excinfo.getrepr record all data and toterminal() process it? + if style is None: + if self.config.getoption("tbstyle", "auto") == "short": + style = "short" + else: + style = "long" + + if self.config.get_verbosity() > 1: + truncate_locals = False + else: + truncate_locals = True + + truncate_args = False if self.config.get_verbosity() > 2 else True + + # excinfo.getrepr() formats paths relative to the CWD if `abspath` is False. + # It is possible for a fixture/test to change the CWD while this code runs, which + # would then result in the user seeing confusing paths in the failure message. + # To fix this, if the CWD changed, always display the full absolute path. + # It will be better to just always display paths relative to invocation_dir, but + # this requires a lot of plumbing (#6428). + try: + abspath = Path(os.getcwd()) != self.config.invocation_params.dir + except OSError: + abspath = True + + return excinfo.getrepr( + funcargs=True, + abspath=abspath, + showlocals=self.config.getoption("showlocals", False), + style=style, + tbfilter=tbfilter, + truncate_locals=truncate_locals, + truncate_args=truncate_args, + ) + + def repr_failure( + self, + excinfo: ExceptionInfo[BaseException], + style: TracebackStyle | None = None, + ) -> str | TerminalRepr: + """Return a representation of a collection or test failure. + + .. seealso:: :ref:`non-python tests` + + :param excinfo: Exception information for the failure. + """ + return self._repr_failure_py(excinfo, style) + + +def get_fslocation_from_item(node: Node) -> tuple[str | Path, int | None]: + """Try to extract the actual location from a node, depending on available attributes: + + * "location": a pair (path, lineno) + * "obj": a Python object that the node wraps. + * "path": just a path + + :rtype: A tuple of (str|Path, int) with filename and 0-based line number. + """ + # See Item.location. + location: tuple[str, int | None, str] | None = getattr(node, "location", None) + if location is not None: + return location[:2] + obj = getattr(node, "obj", None) + if obj is not None: + return getfslineno(obj) + return getattr(node, "path", "unknown location"), -1 + + +class Collector(Node, abc.ABC): + """Base class of all collectors. + + Collector create children through `collect()` and thus iteratively build + the collection tree. + """ + + class CollectError(Exception): + """An error during collection, contains a custom message.""" + + @abc.abstractmethod + def collect(self) -> Iterable[Item | Collector]: + """Collect children (items and collectors) for this collector.""" + raise NotImplementedError("abstract") + + # TODO: This omits the style= parameter which breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, excinfo: ExceptionInfo[BaseException] + ) -> str | TerminalRepr: + """Return a representation of a collection failure. + + :param excinfo: Exception information for the failure. + """ + if isinstance(excinfo.value, self.CollectError) and not self.config.getoption( + "fulltrace", False + ): + exc = excinfo.value + return str(exc.args[0]) + + # Respect explicit tbstyle option, but default to "short" + # (_repr_failure_py uses "long" with "fulltrace" option always). + tbstyle = self.config.getoption("tbstyle", "auto") + if tbstyle == "auto": + tbstyle = "short" + + return self._repr_failure_py(excinfo, style=tbstyle) + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + if hasattr(self, "path"): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=self.path) + if ntraceback == traceback: + ntraceback = ntraceback.cut(excludepath=tracebackcutdir) + return ntraceback.filter(excinfo) + return excinfo.traceback + + +@lru_cache(maxsize=1000) +def _check_initialpaths_for_relpath( + initial_paths: frozenset[Path], path: Path +) -> str | None: + if path in initial_paths: + return "" + + for parent in path.parents: + if parent in initial_paths: + return str(path.relative_to(parent)) + + return None + + +class FSCollector(Collector, abc.ABC): + """Base class for filesystem collectors.""" + + def __init__( + self, + fspath: LEGACY_PATH | None = None, + path_or_parent: Path | Node | None = None, + path: Path | None = None, + name: str | None = None, + parent: Node | None = None, + config: Config | None = None, + session: Session | None = None, + nodeid: str | None = None, + ) -> None: + if path_or_parent: + if isinstance(path_or_parent, Node): + assert parent is None + parent = cast(FSCollector, path_or_parent) + elif isinstance(path_or_parent, Path): + assert path is None + path = path_or_parent + + path = _imply_path(type(self), path, fspath=fspath) + if name is None: + name = path.name + if parent is not None and parent.path != path: + try: + rel = path.relative_to(parent.path) + except ValueError: + pass + else: + name = str(rel) + name = name.replace(os.sep, SEP) + self.path = path + + if session is None: + assert parent is not None + session = parent.session + + if nodeid is None: + try: + nodeid = str(self.path.relative_to(session.config.rootpath)) + except ValueError: + nodeid = _check_initialpaths_for_relpath(session._initialpaths, path) + + if nodeid and os.sep != SEP: + nodeid = nodeid.replace(os.sep, SEP) + + super().__init__( + name=name, + parent=parent, + config=config, + session=session, + nodeid=nodeid, + path=path, + ) + + @classmethod + def from_parent( + cls, + parent, + *, + fspath: LEGACY_PATH | None = None, + path: Path | None = None, + **kw, + ) -> Self: + """The public constructor.""" + return super().from_parent(parent=parent, fspath=fspath, path=path, **kw) + + +class File(FSCollector, abc.ABC): + """Base class for collecting tests from a file. + + :ref:`non-python tests`. + """ + + +class Directory(FSCollector, abc.ABC): + """Base class for collecting files from a directory. + + A basic directory collector does the following: goes over the files and + sub-directories in the directory and creates collectors for them by calling + the hooks :hook:`pytest_collect_directory` and :hook:`pytest_collect_file`, + after checking that they are not ignored using + :hook:`pytest_ignore_collect`. + + The default directory collectors are :class:`~pytest.Dir` and + :class:`~pytest.Package`. + + .. versionadded:: 8.0 + + :ref:`custom directory collectors`. + """ + + +class Item(Node, abc.ABC): + """Base class of all test invocation items. + + Note that for a single function there might be multiple test invocation items. + """ + + nextitem = None + + def __init__( + self, + name, + parent=None, + config: Config | None = None, + session: Session | None = None, + nodeid: str | None = None, + **kw, + ) -> None: + # The first two arguments are intentionally passed positionally, + # to keep plugins who define a node type which inherits from + # (pytest.Item, pytest.File) working (see issue #8435). + # They can be made kwargs when the deprecation above is done. + super().__init__( + name, + parent, + config=config, + session=session, + nodeid=nodeid, + **kw, + ) + self._report_sections: list[tuple[str, str, str]] = [] + + #: A list of tuples (name, value) that holds user defined properties + #: for this test. + self.user_properties: list[tuple[str, object]] = [] + + self._check_item_and_collector_diamond_inheritance() + + def _check_item_and_collector_diamond_inheritance(self) -> None: + """ + Check if the current type inherits from both File and Collector + at the same time, emitting a warning accordingly (#8447). + """ + cls = type(self) + + # We inject an attribute in the type to avoid issuing this warning + # for the same class more than once, which is not helpful. + # It is a hack, but was deemed acceptable in order to avoid + # flooding the user in the common case. + attr_name = "_pytest_diamond_inheritance_warning_shown" + if getattr(cls, attr_name, False): + return + setattr(cls, attr_name, True) + + problems = ", ".join( + base.__name__ for base in cls.__bases__ if issubclass(base, Collector) + ) + if problems: + warnings.warn( + f"{cls.__name__} is an Item subclass and should not be a collector, " + f"however its bases {problems} are collectors.\n" + "Please split the Collectors and the Item into separate node types.\n" + "Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html\n" + "example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/", + PytestWarning, + ) + + @abc.abstractmethod + def runtest(self) -> None: + """Run the test case for this item. + + Must be implemented by subclasses. + + .. seealso:: :ref:`non-python tests` + """ + raise NotImplementedError("runtest must be implemented by Item subclass") + + def add_report_section(self, when: str, key: str, content: str) -> None: + """Add a new report section, similar to what's done internally to add + stdout and stderr captured output:: + + item.add_report_section("call", "stdout", "report section contents") + + :param str when: + One of the possible capture states, ``"setup"``, ``"call"``, ``"teardown"``. + :param str key: + Name of the section, can be customized at will. Pytest uses ``"stdout"`` and + ``"stderr"`` internally. + :param str content: + The full contents as a string. + """ + if content: + self._report_sections.append((when, key, content)) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + """Get location information for this item for test reports. + + Returns a tuple with three elements: + + - The path of the test (default ``self.path``) + - The 0-based line number of the test (default ``None``) + - A name of the test to be shown (default ``""``) + + .. seealso:: :ref:`non-python tests` + """ + return self.path, None, "" + + @cached_property + def location(self) -> tuple[str, int | None, str]: + """ + Returns a tuple of ``(relfspath, lineno, testname)`` for this item + where ``relfspath`` is file path relative to ``config.rootpath`` + and lineno is a 0-based line number. + """ + location = self.reportinfo() + path = absolutepath(location[0]) + relfspath = self.session._node_location_to_relpath(path) + assert type(location[2]) is str + return (relfspath, location[1], location[2]) diff --git a/micromamba_root/Lib/site-packages/_pytest/outcomes.py b/micromamba_root/Lib/site-packages/_pytest/outcomes.py new file mode 100644 index 0000000000000000000000000000000000000000..766be95c0f75567498d7cccfab549b24035239bc --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/outcomes.py @@ -0,0 +1,308 @@ +"""Exception classes and constants handling test outcomes as well as +functions creating them.""" + +from __future__ import annotations + +import sys +from typing import Any +from typing import ClassVar +from typing import NoReturn + +from .warning_types import PytestDeprecationWarning + + +class OutcomeException(BaseException): + """OutcomeException and its subclass instances indicate and contain info + about test and collection outcomes.""" + + def __init__(self, msg: str | None = None, pytrace: bool = True) -> None: + if msg is not None and not isinstance(msg, str): + error_msg = ( # type: ignore[unreachable] + "{} expected string as 'msg' parameter, got '{}' instead.\n" + "Perhaps you meant to use a mark?" + ) + raise TypeError(error_msg.format(type(self).__name__, type(msg).__name__)) + super().__init__(msg) + self.msg = msg + self.pytrace = pytrace + + def __repr__(self) -> str: + if self.msg is not None: + return self.msg + return f"<{self.__class__.__name__} instance>" + + __str__ = __repr__ + + +TEST_OUTCOME = (OutcomeException, Exception) + + +class Skipped(OutcomeException): + # XXX hackish: on 3k we fake to live in the builtins + # in order to have Skipped exception printing shorter/nicer + __module__ = "builtins" + + def __init__( + self, + msg: str | None = None, + pytrace: bool = True, + allow_module_level: bool = False, + *, + _use_item_location: bool = False, + ) -> None: + super().__init__(msg=msg, pytrace=pytrace) + self.allow_module_level = allow_module_level + # If true, the skip location is reported as the item's location, + # instead of the place that raises the exception/calls skip(). + self._use_item_location = _use_item_location + + +class Failed(OutcomeException): + """Raised from an explicit call to pytest.fail().""" + + __module__ = "builtins" + + +class Exit(Exception): + """Raised for immediate program exits (no tracebacks/summaries).""" + + def __init__( + self, msg: str = "unknown reason", returncode: int | None = None + ) -> None: + self.msg = msg + self.returncode = returncode + super().__init__(msg) + + +class XFailed(Failed): + """Raised from an explicit call to pytest.xfail().""" + + +class _Exit: + """Exit testing process. + + :param reason: + The message to show as the reason for exiting pytest. reason has a default value + only because `msg` is deprecated. + + :param returncode: + Return code to be used when exiting pytest. None means the same as ``0`` (no error), + same as :func:`sys.exit`. + + :raises pytest.exit.Exception: + The exception that is raised. + """ + + Exception: ClassVar[type[Exit]] = Exit + + def __call__(self, reason: str = "", returncode: int | None = None) -> NoReturn: + __tracebackhide__ = True + raise Exit(msg=reason, returncode=returncode) + + +exit: _Exit = _Exit() + + +class _Skip: + """Skip an executing test with the given message. + + This function should be called only during testing (setup, call or teardown) or + during collection by using the ``allow_module_level`` flag. This function can + be called in doctests as well. + + :param reason: + The message to show the user as reason for the skip. + + :param allow_module_level: + Allows this function to be called at module level. + Raising the skip exception at module level will stop + the execution of the module and prevent the collection of all tests in the module, + even those defined before the `skip` call. + + Defaults to False. + + :raises pytest.skip.Exception: + The exception that is raised. + + .. note:: + It is better to use the :ref:`pytest.mark.skipif ref` marker when + possible to declare a test to be skipped under certain conditions + like mismatching platforms or dependencies. + Similarly, use the ``# doctest: +SKIP`` directive (see :py:data:`doctest.SKIP`) + to skip a doctest statically. + """ + + Exception: ClassVar[type[Skipped]] = Skipped + + def __call__(self, reason: str = "", allow_module_level: bool = False) -> NoReturn: + __tracebackhide__ = True + raise Skipped(msg=reason, allow_module_level=allow_module_level) + + +skip: _Skip = _Skip() + + +class _Fail: + """Explicitly fail an executing test with the given message. + + :param reason: + The message to show the user as reason for the failure. + + :param pytrace: + If False, msg represents the full failure information and no + python traceback will be reported. + + :raises pytest.fail.Exception: + The exception that is raised. + """ + + Exception: ClassVar[type[Failed]] = Failed + + def __call__(self, reason: str = "", pytrace: bool = True) -> NoReturn: + __tracebackhide__ = True + raise Failed(msg=reason, pytrace=pytrace) + + +fail: _Fail = _Fail() + + +class _XFail: + """Imperatively xfail an executing test or setup function with the given reason. + + This function should be called only during testing (setup, call or teardown). + + No other code is executed after using ``xfail()`` (it is implemented + internally by raising an exception). + + :param reason: + The message to show the user as reason for the xfail. + + .. note:: + It is better to use the :ref:`pytest.mark.xfail ref` marker when + possible to declare a test to be xfailed under certain conditions + like known bugs or missing features. + + :raises pytest.xfail.Exception: + The exception that is raised. + """ + + Exception: ClassVar[type[XFailed]] = XFailed + + def __call__(self, reason: str = "") -> NoReturn: + __tracebackhide__ = True + raise XFailed(msg=reason) + + +xfail: _XFail = _XFail() + + +def importorskip( + modname: str, + minversion: str | None = None, + reason: str | None = None, + *, + exc_type: type[ImportError] | None = None, +) -> Any: + """Import and return the requested module ``modname``, or skip the + current test if the module cannot be imported. + + :param modname: + The name of the module to import. + :param minversion: + If given, the imported module's ``__version__`` attribute must be at + least this minimal version, otherwise the test is still skipped. + :param reason: + If given, this reason is shown as the message when the module cannot + be imported. + :param exc_type: + The exception that should be captured in order to skip modules. + Must be :py:class:`ImportError` or a subclass. + + If the module can be imported but raises :class:`ImportError`, pytest will + issue a warning to the user, as often users expect the module not to be + found (which would raise :class:`ModuleNotFoundError` instead). + + This warning can be suppressed by passing ``exc_type=ImportError`` explicitly. + + See :ref:`import-or-skip-import-error` for details. + + + :returns: + The imported module. This should be assigned to its canonical name. + + :raises pytest.skip.Exception: + If the module cannot be imported. + + Example:: + + docutils = pytest.importorskip("docutils") + + .. versionadded:: 8.2 + + The ``exc_type`` parameter. + """ + import warnings + + __tracebackhide__ = True + compile(modname, "", "eval") # to catch syntaxerrors + + # Until pytest 9.1, we will warn the user if we catch ImportError (instead of ModuleNotFoundError), + # as this might be hiding an installation/environment problem, which is not usually what is intended + # when using importorskip() (#11523). + # In 9.1, to keep the function signature compatible, we just change the code below to: + # 1. Use `exc_type = ModuleNotFoundError` if `exc_type` is not given. + # 2. Remove `warn_on_import` and the warning handling. + if exc_type is None: + exc_type = ImportError + warn_on_import_error = True + else: + warn_on_import_error = False + + skipped: Skipped | None = None + warning: Warning | None = None + + with warnings.catch_warnings(): + # Make sure to ignore ImportWarnings that might happen because + # of existing directories with the same name we're trying to + # import but without a __init__.py file. + warnings.simplefilter("ignore") + + try: + __import__(modname) + except exc_type as exc: + # Do not raise or issue warnings inside the catch_warnings() block. + if reason is None: + reason = f"could not import {modname!r}: {exc}" + skipped = Skipped(reason, allow_module_level=True) + + if warn_on_import_error and not isinstance(exc, ModuleNotFoundError): + lines = [ + "", + f"Module '{modname}' was found, but when imported by pytest it raised:", + f" {exc!r}", + "In pytest 9.1 this warning will become an error by default.", + "You can fix the underlying problem, or alternatively overwrite this behavior and silence this " + "warning by passing exc_type=ImportError explicitly.", + "See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror", + ] + warning = PytestDeprecationWarning("\n".join(lines)) + + if warning: + warnings.warn(warning, stacklevel=2) + if skipped: + raise skipped + + mod = sys.modules[modname] + if minversion is None: + return mod + verattr = getattr(mod, "__version__", None) + if minversion is not None: + # Imported lazily to improve start-up time. + from packaging.version import Version + + if verattr is None or Version(verattr) < Version(minversion): + raise Skipped( + f"module {modname!r} has __version__ {verattr!r}, required is: {minversion!r}", + allow_module_level=True, + ) + return mod diff --git a/micromamba_root/Lib/site-packages/_pytest/pastebin.py b/micromamba_root/Lib/site-packages/_pytest/pastebin.py new file mode 100644 index 0000000000000000000000000000000000000000..c7b39d96f029c31d00a6a85125a77f4314fc97a5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/pastebin.py @@ -0,0 +1,117 @@ +# mypy: allow-untyped-defs +"""Submit failure or test session information to a pastebin service.""" + +from __future__ import annotations + +from io import StringIO +import tempfile +from typing import IO + +from _pytest.config import Config +from _pytest.config import create_terminal_writer +from _pytest.config.argparsing import Parser +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter +import pytest + + +pastebinfile_key = StashKey[IO[bytes]]() + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting") + group.addoption( + "--pastebin", + metavar="mode", + action="store", + dest="pastebin", + default=None, + choices=["failed", "all"], + help="Send failed|all info to bpaste.net pastebin service", + ) + + +@pytest.hookimpl(trylast=True) +def pytest_configure(config: Config) -> None: + if config.option.pastebin == "all": + tr = config.pluginmanager.getplugin("terminalreporter") + # If no terminal reporter plugin is present, nothing we can do here; + # this can happen when this function executes in a worker node + # when using pytest-xdist, for example. + if tr is not None: + # pastebin file will be UTF-8 encoded binary file. + config.stash[pastebinfile_key] = tempfile.TemporaryFile("w+b") + oldwrite = tr._tw.write + + def tee_write(s, **kwargs): + oldwrite(s, **kwargs) + if isinstance(s, str): + s = s.encode("utf-8") + config.stash[pastebinfile_key].write(s) + + tr._tw.write = tee_write + + +def pytest_unconfigure(config: Config) -> None: + if pastebinfile_key in config.stash: + pastebinfile = config.stash[pastebinfile_key] + # Get terminal contents and delete file. + pastebinfile.seek(0) + sessionlog = pastebinfile.read() + pastebinfile.close() + del config.stash[pastebinfile_key] + # Undo our patching in the terminal reporter. + tr = config.pluginmanager.getplugin("terminalreporter") + del tr._tw.__dict__["write"] + # Write summary. + tr.write_sep("=", "Sending information to Paste Service") + pastebinurl = create_new_paste(sessionlog) + tr.write_line(f"pastebin session-log: {pastebinurl}\n") + + +def create_new_paste(contents: str | bytes) -> str: + """Create a new paste using the bpaste.net service. + + :contents: Paste contents string. + :returns: URL to the pasted contents, or an error message. + """ + import re + from urllib.error import HTTPError + from urllib.parse import urlencode + from urllib.request import urlopen + + params = {"code": contents, "lexer": "text", "expiry": "1week"} + url = "https://bpa.st" + try: + response: str = ( + urlopen(url, data=urlencode(params).encode("ascii")).read().decode("utf-8") + ) + except HTTPError as e: + with e: # HTTPErrors are also http responses that must be closed! + return f"bad response: {e}" + except OSError as e: # eg urllib.error.URLError + return f"bad response: {e}" + m = re.search(r'href="/raw/(\w+)"', response) + if m: + return f"{url}/show/{m.group(1)}" + else: + return "bad response: invalid format ('" + response + "')" + + +def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None: + if terminalreporter.config.option.pastebin != "failed": + return + if "failed" in terminalreporter.stats: + terminalreporter.write_sep("=", "Sending information to Paste Service") + for rep in terminalreporter.stats["failed"]: + try: + msg = rep.longrepr.reprtraceback.reprentries[-1].reprfileloc + except AttributeError: + msg = terminalreporter._getfailureheadline(rep) + file = StringIO() + tw = create_terminal_writer(terminalreporter.config, file) + rep.toterminal(tw) + s = file.getvalue() + assert len(s) + pastebinurl = create_new_paste(s) + terminalreporter.write_line(f"{msg} --> {pastebinurl}") diff --git a/micromamba_root/Lib/site-packages/_pytest/pathlib.py b/micromamba_root/Lib/site-packages/_pytest/pathlib.py new file mode 100644 index 0000000000000000000000000000000000000000..cd15434605dcec1b6c29b7222dcbfb7a78b18af1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/pathlib.py @@ -0,0 +1,1063 @@ +from __future__ import annotations + +import atexit +from collections.abc import Callable +from collections.abc import Iterable +from collections.abc import Iterator +import contextlib +from enum import Enum +from errno import EBADF +from errno import ELOOP +from errno import ENOENT +from errno import ENOTDIR +import fnmatch +from functools import partial +from importlib.machinery import ModuleSpec +from importlib.machinery import PathFinder +import importlib.util +import itertools +import os +from os.path import expanduser +from os.path import expandvars +from os.path import isabs +from os.path import sep +from pathlib import Path +from pathlib import PurePath +from posixpath import sep as posix_sep +import shutil +import sys +import types +from types import ModuleType +from typing import Any +from typing import TypeVar +import uuid +import warnings + +from _pytest.compat import assert_never +from _pytest.outcomes import skip +from _pytest.warning_types import PytestWarning + + +if sys.version_info < (3, 11): + from importlib._bootstrap_external import _NamespaceLoader as NamespaceLoader +else: + from importlib.machinery import NamespaceLoader + +LOCK_TIMEOUT = 60 * 60 * 24 * 3 + +_AnyPurePath = TypeVar("_AnyPurePath", bound=PurePath) + +# The following function, variables and comments were +# copied from cpython 3.9 Lib/pathlib.py file. + +# EBADF - guard against macOS `stat` throwing EBADF +_IGNORED_ERRORS = (ENOENT, ENOTDIR, EBADF, ELOOP) + +_IGNORED_WINERRORS = ( + 21, # ERROR_NOT_READY - drive exists but is not accessible + 1921, # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself +) + + +def _ignore_error(exception: Exception) -> bool: + return ( + getattr(exception, "errno", None) in _IGNORED_ERRORS + or getattr(exception, "winerror", None) in _IGNORED_WINERRORS + ) + + +def get_lock_path(path: _AnyPurePath) -> _AnyPurePath: + return path.joinpath(".lock") + + +def on_rm_rf_error( + func: Callable[..., Any] | None, + path: str, + excinfo: BaseException + | tuple[type[BaseException], BaseException, types.TracebackType | None], + *, + start_path: Path, +) -> bool: + """Handle known read-only errors during rmtree. + + The returned value is used only by our own tests. + """ + if isinstance(excinfo, BaseException): + exc = excinfo + else: + exc = excinfo[1] + + # Another process removed the file in the middle of the "rm_rf" (xdist for example). + # More context: https://github.com/pytest-dev/pytest/issues/5974#issuecomment-543799018 + if isinstance(exc, FileNotFoundError): + return False + + if not isinstance(exc, PermissionError): + warnings.warn( + PytestWarning(f"(rm_rf) error removing {path}\n{type(exc)}: {exc}") + ) + return False + + if func not in (os.rmdir, os.remove, os.unlink): + if func not in (os.open,): + warnings.warn( + PytestWarning( + f"(rm_rf) unknown function {func} when removing {path}:\n{type(exc)}: {exc}" + ) + ) + return False + + # Chmod + retry. + import stat + + def chmod_rw(p: str) -> None: + mode = os.stat(p).st_mode + os.chmod(p, mode | stat.S_IRUSR | stat.S_IWUSR) + + # For files, we need to recursively go upwards in the directories to + # ensure they all are also writable. + p = Path(path) + if p.is_file(): + for parent in p.parents: + chmod_rw(str(parent)) + # Stop when we reach the original path passed to rm_rf. + if parent == start_path: + break + chmod_rw(str(path)) + + func(path) + return True + + +def ensure_extended_length_path(path: Path) -> Path: + """Get the extended-length version of a path (Windows). + + On Windows, by default, the maximum length of a path (MAX_PATH) is 260 + characters, and operations on paths longer than that fail. But it is possible + to overcome this by converting the path to "extended-length" form before + performing the operation: + https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation + + On Windows, this function returns the extended-length absolute version of path. + On other platforms it returns path unchanged. + """ + if sys.platform.startswith("win32"): + path = path.resolve() + path = Path(get_extended_length_path_str(str(path))) + return path + + +def get_extended_length_path_str(path: str) -> str: + """Convert a path to a Windows extended length path.""" + long_path_prefix = "\\\\?\\" + unc_long_path_prefix = "\\\\?\\UNC\\" + if path.startswith((long_path_prefix, unc_long_path_prefix)): + return path + # UNC + if path.startswith("\\\\"): + return unc_long_path_prefix + path[2:] + return long_path_prefix + path + + +def rm_rf(path: Path) -> None: + """Remove the path contents recursively, even if some elements + are read-only.""" + path = ensure_extended_length_path(path) + onerror = partial(on_rm_rf_error, start_path=path) + if sys.version_info >= (3, 12): + shutil.rmtree(str(path), onexc=onerror) + else: + shutil.rmtree(str(path), onerror=onerror) + + +def find_prefixed(root: Path, prefix: str) -> Iterator[os.DirEntry[str]]: + """Find all elements in root that begin with the prefix, case-insensitive.""" + l_prefix = prefix.lower() + for x in os.scandir(root): + if x.name.lower().startswith(l_prefix): + yield x + + +def extract_suffixes(iter: Iterable[os.DirEntry[str]], prefix: str) -> Iterator[str]: + """Return the parts of the paths following the prefix. + + :param iter: Iterator over path names. + :param prefix: Expected prefix of the path names. + """ + p_len = len(prefix) + for entry in iter: + yield entry.name[p_len:] + + +def find_suffixes(root: Path, prefix: str) -> Iterator[str]: + """Combine find_prefixes and extract_suffixes.""" + return extract_suffixes(find_prefixed(root, prefix), prefix) + + +def parse_num(maybe_num: str) -> int: + """Parse number path suffixes, returns -1 on error.""" + try: + return int(maybe_num) + except ValueError: + return -1 + + +def _force_symlink(root: Path, target: str | PurePath, link_to: str | Path) -> None: + """Helper to create the current symlink. + + It's full of race conditions that are reasonably OK to ignore + for the context of best effort linking to the latest test run. + + The presumption being that in case of much parallelism + the inaccuracy is going to be acceptable. + """ + current_symlink = root.joinpath(target) + try: + current_symlink.unlink() + except OSError: + pass + try: + current_symlink.symlink_to(link_to) + except Exception: + pass + + +def make_numbered_dir(root: Path, prefix: str, mode: int = 0o700) -> Path: + """Create a directory with an increased number as suffix for the given prefix.""" + for i in range(10): + # try up to 10 times to create the folder + max_existing = max(map(parse_num, find_suffixes(root, prefix)), default=-1) + new_number = max_existing + 1 + new_path = root.joinpath(f"{prefix}{new_number}") + try: + new_path.mkdir(mode=mode) + except Exception: + pass + else: + _force_symlink(root, prefix + "current", new_path) + return new_path + else: + raise OSError( + "could not create numbered dir with prefix " + f"{prefix} in {root} after 10 tries" + ) + + +def create_cleanup_lock(p: Path) -> Path: + """Create a lock to prevent premature folder cleanup.""" + lock_path = get_lock_path(p) + try: + fd = os.open(str(lock_path), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) + except FileExistsError as e: + raise OSError(f"cannot create lockfile in {p}") from e + else: + pid = os.getpid() + spid = str(pid).encode() + os.write(fd, spid) + os.close(fd) + if not lock_path.is_file(): + raise OSError("lock path got renamed after successful creation") + return lock_path + + +def register_cleanup_lock_removal( + lock_path: Path, register: Any = atexit.register +) -> Any: + """Register a cleanup function for removing a lock, by default on atexit.""" + pid = os.getpid() + + def cleanup_on_exit(lock_path: Path = lock_path, original_pid: int = pid) -> None: + current_pid = os.getpid() + if current_pid != original_pid: + # fork + return + try: + lock_path.unlink() + except OSError: + pass + + return register(cleanup_on_exit) + + +def maybe_delete_a_numbered_dir(path: Path) -> None: + """Remove a numbered directory if its lock can be obtained and it does + not seem to be in use.""" + path = ensure_extended_length_path(path) + lock_path = None + try: + lock_path = create_cleanup_lock(path) + parent = path.parent + + garbage = parent.joinpath(f"garbage-{uuid.uuid4()}") + path.rename(garbage) + rm_rf(garbage) + except OSError: + # known races: + # * other process did a cleanup at the same time + # * deletable folder was found + # * process cwd (Windows) + return + finally: + # If we created the lock, ensure we remove it even if we failed + # to properly remove the numbered dir. + if lock_path is not None: + try: + lock_path.unlink() + except OSError: + pass + + +def ensure_deletable(path: Path, consider_lock_dead_if_created_before: float) -> bool: + """Check if `path` is deletable based on whether the lock file is expired.""" + if path.is_symlink(): + return False + lock = get_lock_path(path) + try: + if not lock.is_file(): + return True + except OSError: + # we might not have access to the lock file at all, in this case assume + # we don't have access to the entire directory (#7491). + return False + try: + lock_time = lock.stat().st_mtime + except Exception: + return False + else: + if lock_time < consider_lock_dead_if_created_before: + # We want to ignore any errors while trying to remove the lock such as: + # - PermissionDenied, like the file permissions have changed since the lock creation; + # - FileNotFoundError, in case another pytest process got here first; + # and any other cause of failure. + with contextlib.suppress(OSError): + lock.unlink() + return True + return False + + +def try_cleanup(path: Path, consider_lock_dead_if_created_before: float) -> None: + """Try to cleanup a folder if we can ensure it's deletable.""" + if ensure_deletable(path, consider_lock_dead_if_created_before): + maybe_delete_a_numbered_dir(path) + + +def cleanup_candidates(root: Path, prefix: str, keep: int) -> Iterator[Path]: + """List candidates for numbered directories to be removed - follows py.path.""" + max_existing = max(map(parse_num, find_suffixes(root, prefix)), default=-1) + max_delete = max_existing - keep + entries = find_prefixed(root, prefix) + entries, entries2 = itertools.tee(entries) + numbers = map(parse_num, extract_suffixes(entries2, prefix)) + for entry, number in zip(entries, numbers, strict=True): + if number <= max_delete: + yield Path(entry) + + +def cleanup_dead_symlinks(root: Path) -> None: + for left_dir in root.iterdir(): + if left_dir.is_symlink(): + if not left_dir.resolve().exists(): + left_dir.unlink() + + +def cleanup_numbered_dir( + root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float +) -> None: + """Cleanup for lock driven numbered directories.""" + if not root.exists(): + return + for path in cleanup_candidates(root, prefix, keep): + try_cleanup(path, consider_lock_dead_if_created_before) + for path in root.glob("garbage-*"): + try_cleanup(path, consider_lock_dead_if_created_before) + + cleanup_dead_symlinks(root) + + +def make_numbered_dir_with_cleanup( + root: Path, + prefix: str, + keep: int, + lock_timeout: float, + mode: int, +) -> Path: + """Create a numbered dir with a cleanup lock and remove old ones.""" + e = None + for i in range(10): + try: + p = make_numbered_dir(root, prefix, mode) + # Only lock the current dir when keep is not 0 + if keep != 0: + lock_path = create_cleanup_lock(p) + register_cleanup_lock_removal(lock_path) + except Exception as exc: + e = exc + else: + consider_lock_dead_if_created_before = p.stat().st_mtime - lock_timeout + # Register a cleanup for program exit + atexit.register( + cleanup_numbered_dir, + root, + prefix, + keep, + consider_lock_dead_if_created_before, + ) + return p + assert e is not None + raise e + + +def resolve_from_str(input: str, rootpath: Path) -> Path: + input = expanduser(input) + input = expandvars(input) + if isabs(input): + return Path(input) + else: + return rootpath.joinpath(input) + + +def fnmatch_ex(pattern: str, path: str | os.PathLike[str]) -> bool: + """A port of FNMatcher from py.path.common which works with PurePath() instances. + + The difference between this algorithm and PurePath.match() is that the + latter matches "**" glob expressions for each part of the path, while + this algorithm uses the whole path instead. + + For example: + "tests/foo/bar/doc/test_foo.py" matches pattern "tests/**/doc/test*.py" + with this algorithm, but not with PurePath.match(). + + This algorithm was ported to keep backward-compatibility with existing + settings which assume paths match according this logic. + + References: + * https://bugs.python.org/issue29249 + * https://bugs.python.org/issue34731 + """ + path = PurePath(path) + iswin32 = sys.platform.startswith("win") + + if iswin32 and sep not in pattern and posix_sep in pattern: + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posix_sep, sep) + + if sep not in pattern: + name = path.name + else: + name = str(path) + if path.is_absolute() and not os.path.isabs(pattern): + pattern = f"*{os.sep}{pattern}" + return fnmatch.fnmatch(name, pattern) + + +def parts(s: str) -> set[str]: + parts = s.split(sep) + return {sep.join(parts[: i + 1]) or sep for i in range(len(parts))} + + +def symlink_or_skip( + src: os.PathLike[str] | str, + dst: os.PathLike[str] | str, + **kwargs: Any, +) -> None: + """Make a symlink, or skip the test in case symlinks are not supported.""" + try: + os.symlink(src, dst, **kwargs) + except OSError as e: + skip(f"symlinks not supported: {e}") + + +class ImportMode(Enum): + """Possible values for `mode` parameter of `import_path`.""" + + prepend = "prepend" + append = "append" + importlib = "importlib" + + +class ImportPathMismatchError(ImportError): + """Raised on import_path() if there is a mismatch of __file__'s. + + This can happen when `import_path` is called multiple times with different filenames that has + the same basename but reside in packages + (for example "/tests1/test_foo.py" and "/tests2/test_foo.py"). + """ + + +def import_path( + path: str | os.PathLike[str], + *, + mode: str | ImportMode = ImportMode.prepend, + root: Path, + consider_namespace_packages: bool, +) -> ModuleType: + """ + Import and return a module from the given path, which can be a file (a module) or + a directory (a package). + + :param path: + Path to the file to import. + + :param mode: + Controls the underlying import mechanism that will be used: + + * ImportMode.prepend: the directory containing the module (or package, taking + `__init__.py` files into account) will be put at the *start* of `sys.path` before + being imported with `importlib.import_module`. + + * ImportMode.append: same as `prepend`, but the directory will be appended + to the end of `sys.path`, if not already in `sys.path`. + + * ImportMode.importlib: uses more fine control mechanisms provided by `importlib` + to import the module, which avoids having to muck with `sys.path` at all. It effectively + allows having same-named test modules in different places. + + :param root: + Used as an anchor when mode == ImportMode.importlib to obtain + a unique name for the module being imported so it can safely be stored + into ``sys.modules``. + + :param consider_namespace_packages: + If True, consider namespace packages when resolving module names. + + :raises ImportPathMismatchError: + If after importing the given `path` and the module `__file__` + are different. Only raised in `prepend` and `append` modes. + """ + path = Path(path) + mode = ImportMode(mode) + + if not path.exists(): + raise ImportError(path) + + if mode is ImportMode.importlib: + # Try to import this module using the standard import mechanisms, but + # without touching sys.path. + try: + pkg_root, module_name = resolve_pkg_root_and_module_name( + path, consider_namespace_packages=consider_namespace_packages + ) + except CouldNotResolvePathError: + pass + else: + # If the given module name is already in sys.modules, do not import it again. + with contextlib.suppress(KeyError): + return sys.modules[module_name] + + mod = _import_module_using_spec( + module_name, path, pkg_root, insert_modules=False + ) + if mod is not None: + return mod + + # Could not import the module with the current sys.path, so we fall back + # to importing the file as a single module, not being a part of a package. + module_name = module_name_from_path(path, root) + with contextlib.suppress(KeyError): + return sys.modules[module_name] + + mod = _import_module_using_spec( + module_name, path, path.parent, insert_modules=True + ) + if mod is None: + raise ImportError(f"Can't find module {module_name} at location {path}") + return mod + + try: + pkg_root, module_name = resolve_pkg_root_and_module_name( + path, consider_namespace_packages=consider_namespace_packages + ) + except CouldNotResolvePathError: + pkg_root, module_name = path.parent, path.stem + + # Change sys.path permanently: restoring it at the end of this function would cause surprising + # problems because of delayed imports: for example, a conftest.py file imported by this function + # might have local imports, which would fail at runtime if we restored sys.path. + if mode is ImportMode.append: + if str(pkg_root) not in sys.path: + sys.path.append(str(pkg_root)) + elif mode is ImportMode.prepend: + if str(pkg_root) != sys.path[0]: + sys.path.insert(0, str(pkg_root)) + else: + assert_never(mode) + + importlib.import_module(module_name) + + mod = sys.modules[module_name] + if path.name == "__init__.py": + return mod + + ignore = os.environ.get("PY_IGNORE_IMPORTMISMATCH", "") + if ignore != "1": + module_file = mod.__file__ + if module_file is None: + raise ImportPathMismatchError(module_name, module_file, path) + + if module_file.endswith((".pyc", ".pyo")): + module_file = module_file[:-1] + if module_file.endswith(os.sep + "__init__.py"): + module_file = module_file[: -(len(os.sep + "__init__.py"))] + + try: + is_same = _is_same(str(path), module_file) + except FileNotFoundError: + is_same = False + + if not is_same: + raise ImportPathMismatchError(module_name, module_file, path) + + return mod + + +def _import_module_using_spec( + module_name: str, module_path: Path, module_location: Path, *, insert_modules: bool +) -> ModuleType | None: + """ + Tries to import a module by its canonical name, path, and its parent location. + + :param module_name: + The expected module name, will become the key of `sys.modules`. + + :param module_path: + The file path of the module, for example `/foo/bar/test_demo.py`. + If module is a package, pass the path to the `__init__.py` of the package. + If module is a namespace package, pass directory path. + + :param module_location: + The parent location of the module. + If module is a package, pass the directory containing the `__init__.py` file. + + :param insert_modules: + If True, will call `insert_missing_modules` to create empty intermediate modules + with made-up module names (when importing test files not reachable from `sys.path`). + + Example 1 of parent_module_*: + + module_name: "a.b.c.demo" + module_path: Path("a/b/c/demo.py") + module_location: Path("a/b/c/") + if "a.b.c" is package ("a/b/c/__init__.py" exists), then + parent_module_name: "a.b.c" + parent_module_path: Path("a/b/c/__init__.py") + parent_module_location: Path("a/b/c/") + else: + parent_module_name: "a.b.c" + parent_module_path: Path("a/b/c") + parent_module_location: Path("a/b/") + + Example 2 of parent_module_*: + + module_name: "a.b.c" + module_path: Path("a/b/c/__init__.py") + module_location: Path("a/b/c/") + if "a.b" is package ("a/b/__init__.py" exists), then + parent_module_name: "a.b" + parent_module_path: Path("a/b/__init__.py") + parent_module_location: Path("a/b/") + else: + parent_module_name: "a.b" + parent_module_path: Path("a/b/") + parent_module_location: Path("a/") + """ + # Attempt to import the parent module, seems is our responsibility: + # https://github.com/python/cpython/blob/73906d5c908c1e0b73c5436faeff7d93698fc074/Lib/importlib/_bootstrap.py#L1308-L1311 + parent_module_name, _, name = module_name.rpartition(".") + parent_module: ModuleType | None = None + if parent_module_name: + parent_module = sys.modules.get(parent_module_name) + # If the parent_module lacks the `__path__` attribute, AttributeError when finding a submodule's spec, + # requiring re-import according to the path. + need_reimport = not hasattr(parent_module, "__path__") + if parent_module is None or need_reimport: + # Get parent_location based on location, get parent_path based on path. + if module_path.name == "__init__.py": + # If the current module is in a package, + # need to leave the package first and then enter the parent module. + parent_module_path = module_path.parent.parent + else: + parent_module_path = module_path.parent + + if (parent_module_path / "__init__.py").is_file(): + # If the parent module is a package, loading by __init__.py file. + parent_module_path = parent_module_path / "__init__.py" + + parent_module = _import_module_using_spec( + parent_module_name, + parent_module_path, + parent_module_path.parent, + insert_modules=insert_modules, + ) + + # Checking with sys.meta_path first in case one of its hooks can import this module, + # such as our own assertion-rewrite hook. + for meta_importer in sys.meta_path: + module_name_of_meta = getattr(meta_importer.__class__, "__module__", "") + if module_name_of_meta == "_pytest.assertion.rewrite" and module_path.is_file(): + # Import modules in subdirectories by module_path + # to ensure assertion rewrites are not missed (#12659). + find_spec_path = [str(module_location), str(module_path)] + else: + find_spec_path = [str(module_location)] + + spec = meta_importer.find_spec(module_name, find_spec_path) + + if spec_matches_module_path(spec, module_path): + break + else: + loader = None + if module_path.is_dir(): + # The `spec_from_file_location` matches a loader based on the file extension by default. + # For a namespace package, need to manually specify a loader. + loader = NamespaceLoader(name, module_path, PathFinder()) # type: ignore[arg-type] + + spec = importlib.util.spec_from_file_location( + module_name, str(module_path), loader=loader + ) + + if spec_matches_module_path(spec, module_path): + assert spec is not None + # Find spec and import this module. + mod = importlib.util.module_from_spec(spec) + sys.modules[module_name] = mod + spec.loader.exec_module(mod) # type: ignore[union-attr] + + # Set this module as an attribute of the parent module (#12194). + if parent_module is not None: + setattr(parent_module, name, mod) + + if insert_modules: + insert_missing_modules(sys.modules, module_name) + return mod + + return None + + +def spec_matches_module_path(module_spec: ModuleSpec | None, module_path: Path) -> bool: + """Return true if the given ModuleSpec can be used to import the given module path.""" + if module_spec is None: + return False + + if module_spec.origin: + return Path(module_spec.origin) == module_path + + # Compare the path with the `module_spec.submodule_Search_Locations` in case + # the module is part of a namespace package. + # https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.submodule_search_locations + if module_spec.submodule_search_locations: # can be None. + for path in module_spec.submodule_search_locations: + if Path(path) == module_path: + return True + + return False + + +# Implement a special _is_same function on Windows which returns True if the two filenames +# compare equal, to circumvent os.path.samefile returning False for mounts in UNC (#7678). +if sys.platform.startswith("win"): + + def _is_same(f1: str, f2: str) -> bool: + return Path(f1) == Path(f2) or os.path.samefile(f1, f2) + +else: + + def _is_same(f1: str, f2: str) -> bool: + return os.path.samefile(f1, f2) + + +def module_name_from_path(path: Path, root: Path) -> str: + """ + Return a dotted module name based on the given path, anchored on root. + + For example: path="projects/src/tests/test_foo.py" and root="/projects", the + resulting module name will be "src.tests.test_foo". + """ + path = path.with_suffix("") + try: + relative_path = path.relative_to(root) + except ValueError: + # If we can't get a relative path to root, use the full path, except + # for the first part ("d:\\" or "/" depending on the platform, for example). + path_parts = path.parts[1:] + else: + # Use the parts for the relative path to the root path. + path_parts = relative_path.parts + + # Module name for packages do not contain the __init__ file, unless + # the `__init__.py` file is at the root. + if len(path_parts) >= 2 and path_parts[-1] == "__init__": + path_parts = path_parts[:-1] + + # Module names cannot contain ".", normalize them to "_". This prevents + # a directory having a "." in the name (".env.310" for example) causing extra intermediate modules. + # Also, important to replace "." at the start of paths, as those are considered relative imports. + path_parts = tuple(x.replace(".", "_") for x in path_parts) + + return ".".join(path_parts) + + +def insert_missing_modules(modules: dict[str, ModuleType], module_name: str) -> None: + """ + Used by ``import_path`` to create intermediate modules when using mode=importlib. + + When we want to import a module as "src.tests.test_foo" for example, we need + to create empty modules "src" and "src.tests" after inserting "src.tests.test_foo", + otherwise "src.tests.test_foo" is not importable by ``__import__``. + """ + module_parts = module_name.split(".") + while module_name: + parent_module_name, _, child_name = module_name.rpartition(".") + if parent_module_name: + parent_module = modules.get(parent_module_name) + if parent_module is None: + try: + # If sys.meta_path is empty, calling import_module will issue + # a warning and raise ModuleNotFoundError. To avoid the + # warning, we check sys.meta_path explicitly and raise the error + # ourselves to fall back to creating a dummy module. + if not sys.meta_path: + raise ModuleNotFoundError + parent_module = importlib.import_module(parent_module_name) + except ModuleNotFoundError: + parent_module = ModuleType( + module_name, + doc="Empty module created by pytest's importmode=importlib.", + ) + modules[parent_module_name] = parent_module + + # Add child attribute to the parent that can reference the child + # modules. + if not hasattr(parent_module, child_name): + setattr(parent_module, child_name, modules[module_name]) + + module_parts.pop(-1) + module_name = ".".join(module_parts) + + +def resolve_package_path(path: Path) -> Path | None: + """Return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + + Returns None if it cannot be determined. + """ + result = None + for parent in itertools.chain((path,), path.parents): + if parent.is_dir(): + if not (parent / "__init__.py").is_file(): + break + if not parent.name.isidentifier(): + break + result = parent + return result + + +def resolve_pkg_root_and_module_name( + path: Path, *, consider_namespace_packages: bool = False +) -> tuple[Path, str]: + """ + Return the path to the directory of the root package that contains the + given Python file, and its module name: + + src/ + app/ + __init__.py + core/ + __init__.py + models.py + + Passing the full path to `models.py` will yield Path("src") and "app.core.models". + + If consider_namespace_packages is True, then we additionally check upwards in the hierarchy + for namespace packages: + + https://packaging.python.org/en/latest/guides/packaging-namespace-packages + + Raises CouldNotResolvePathError if the given path does not belong to a package (missing any __init__.py files). + """ + pkg_root: Path | None = None + pkg_path = resolve_package_path(path) + if pkg_path is not None: + pkg_root = pkg_path.parent + if consider_namespace_packages: + start = pkg_root if pkg_root is not None else path.parent + for candidate in (start, *start.parents): + module_name = compute_module_name(candidate, path) + if module_name and is_importable(module_name, path): + # Point the pkg_root to the root of the namespace package. + pkg_root = candidate + break + + if pkg_root is not None: + module_name = compute_module_name(pkg_root, path) + if module_name: + return pkg_root, module_name + + raise CouldNotResolvePathError(f"Could not resolve for {path}") + + +def is_importable(module_name: str, module_path: Path) -> bool: + """ + Return if the given module path could be imported normally by Python, akin to the user + entering the REPL and importing the corresponding module name directly, and corresponds + to the module_path specified. + + :param module_name: + Full module name that we want to check if is importable. + For example, "app.models". + + :param module_path: + Full path to the python module/package we want to check if is importable. + For example, "/projects/src/app/models.py". + """ + try: + # Note this is different from what we do in ``_import_module_using_spec``, where we explicitly search through + # sys.meta_path to be able to pass the path of the module that we want to import (``meta_importer.find_spec``). + # Using importlib.util.find_spec() is different, it gives the same results as trying to import + # the module normally in the REPL. + spec = importlib.util.find_spec(module_name) + except (ImportError, ValueError, ImportWarning): + return False + else: + return spec_matches_module_path(spec, module_path) + + +def compute_module_name(root: Path, module_path: Path) -> str | None: + """Compute a module name based on a path and a root anchor.""" + try: + path_without_suffix = module_path.with_suffix("") + except ValueError: + # Empty paths (such as Path.cwd()) might break meta_path hooks (like our own assertion rewriter). + return None + + try: + relative = path_without_suffix.relative_to(root) + except ValueError: # pragma: no cover + return None + names = list(relative.parts) + if not names: + return None + if names[-1] == "__init__": + names.pop() + return ".".join(names) + + +class CouldNotResolvePathError(Exception): + """Custom exception raised by resolve_pkg_root_and_module_name.""" + + +def scandir( + path: str | os.PathLike[str], + sort_key: Callable[[os.DirEntry[str]], object] = lambda entry: entry.name, +) -> list[os.DirEntry[str]]: + """Scan a directory recursively, in breadth-first order. + + The returned entries are sorted according to the given key. + The default is to sort by name. + If the directory does not exist, return an empty list. + """ + entries = [] + # Attempt to create a scandir iterator for the given path. + try: + scandir_iter = os.scandir(path) + except FileNotFoundError: + # If the directory does not exist, return an empty list. + return [] + # Use the scandir iterator in a context manager to ensure it is properly closed. + with scandir_iter as s: + for entry in s: + try: + entry.is_file() + except OSError as err: + if _ignore_error(err): + continue + # Reraise non-ignorable errors to avoid hiding issues. + raise + entries.append(entry) + entries.sort(key=sort_key) # type: ignore[arg-type] + return entries + + +def visit( + path: str | os.PathLike[str], recurse: Callable[[os.DirEntry[str]], bool] +) -> Iterator[os.DirEntry[str]]: + """Walk a directory recursively, in breadth-first order. + + The `recurse` predicate determines whether a directory is recursed. + + Entries at each directory level are sorted. + """ + entries = scandir(path) + yield from entries + for entry in entries: + if entry.is_dir() and recurse(entry): + yield from visit(entry.path, recurse) + + +def absolutepath(path: str | os.PathLike[str]) -> Path: + """Convert a path to an absolute path using os.path.abspath. + + Prefer this over Path.resolve() (see #6523). + Prefer this over Path.absolute() (not public, doesn't normalize). + """ + return Path(os.path.abspath(path)) + + +def commonpath(path1: Path, path2: Path) -> Path | None: + """Return the common part shared with the other path, or None if there is + no common part. + + If one path is relative and one is absolute, returns None. + """ + try: + return Path(os.path.commonpath((str(path1), str(path2)))) + except ValueError: + return None + + +def bestrelpath(directory: Path, dest: Path) -> str: + """Return a string which is a relative path from directory to dest such + that directory/bestrelpath == dest. + + The paths must be either both absolute or both relative. + + If no such path can be determined, returns dest. + """ + assert isinstance(directory, Path) + assert isinstance(dest, Path) + if dest == directory: + return os.curdir + # Find the longest common directory. + base = commonpath(directory, dest) + # Can be the case on Windows for two absolute paths on different drives. + # Can be the case for two relative paths without common prefix. + # Can be the case for a relative path and an absolute path. + if not base: + return str(dest) + reldirectory = directory.relative_to(base) + reldest = dest.relative_to(base) + return os.path.join( + # Back from directory to base. + *([os.pardir] * len(reldirectory.parts)), + # Forward from base to dest. + *reldest.parts, + ) + + +def safe_exists(p: Path) -> bool: + """Like Path.exists(), but account for input arguments that might be too long (#11394).""" + try: + return p.exists() + except (ValueError, OSError): + # ValueError: stat: path too long for Windows + # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect + return False + + +def samefile_nofollow(p1: Path, p2: Path) -> bool: + """Test whether two paths reference the same actual file or directory. + + Unlike Path.samefile(), does not resolve symlinks. + """ + return os.path.samestat(p1.lstat(), p2.lstat()) diff --git a/micromamba_root/Lib/site-packages/_pytest/py.typed b/micromamba_root/Lib/site-packages/_pytest/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/_pytest/pytester.py b/micromamba_root/Lib/site-packages/_pytest/pytester.py new file mode 100644 index 0000000000000000000000000000000000000000..1cd5f05dd7edaa173b0bf07f88f9533c83b534a9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/pytester.py @@ -0,0 +1,1791 @@ +# mypy: allow-untyped-defs +"""(Disabled by default) support for testing pytest and pytest plugins. + +PYTEST_DONT_REWRITE +""" + +from __future__ import annotations + +import collections.abc +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Sequence +import contextlib +from fnmatch import fnmatch +import gc +import importlib +from io import StringIO +import locale +import os +from pathlib import Path +import platform +import re +import shutil +import subprocess +import sys +import traceback +from typing import Any +from typing import Final +from typing import final +from typing import IO +from typing import Literal +from typing import overload +from typing import TextIO +from typing import TYPE_CHECKING +from weakref import WeakKeyDictionary + +from iniconfig import IniConfig +from iniconfig import SectionWrapper + +from _pytest import timing +from _pytest._code import Source +from _pytest.capture import _get_multicapture +from _pytest.compat import NOTSET +from _pytest.compat import NotSetType +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import main +from _pytest.config import PytestPluginManager +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import importorskip +from _pytest.outcomes import skip +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import make_numbered_dir +from _pytest.reports import CollectReport +from _pytest.reports import TestReport +from _pytest.tmpdir import TempPathFactory +from _pytest.warning_types import PytestFDWarning + + +if TYPE_CHECKING: + import pexpect + + +pytest_plugins = ["pytester_assertions"] + + +IGNORE_PAM = [ # filenames added when obtaining details about the current user + "/var/lib/sss/mc/passwd" +] + + +def pytest_addoption(parser: Parser) -> None: + parser.addoption( + "--lsof", + action="store_true", + dest="lsof", + default=False, + help="Run FD checks if lsof is available", + ) + + parser.addoption( + "--runpytest", + default="inprocess", + dest="runpytest", + choices=("inprocess", "subprocess"), + help=( + "Run pytest sub runs in tests using an 'inprocess' " + "or 'subprocess' (python -m main) method" + ), + ) + + parser.addini( + "pytester_example_dir", help="Directory to take the pytester example files from" + ) + + +def pytest_configure(config: Config) -> None: + if config.getvalue("lsof"): + checker = LsofFdLeakChecker() + if checker.matching_platform(): + config.pluginmanager.register(checker) + + config.addinivalue_line( + "markers", + "pytester_example_path(*path_segments): join the given path " + "segments to `pytester_example_dir` for this test.", + ) + + +class LsofFdLeakChecker: + def get_open_files(self) -> list[tuple[str, str]]: + if sys.version_info >= (3, 11): + # New in Python 3.11, ignores utf-8 mode + encoding = locale.getencoding() + else: + encoding = locale.getpreferredencoding(False) + out = subprocess.run( + ("lsof", "-Ffn0", "-p", str(os.getpid())), + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + check=True, + text=True, + encoding=encoding, + ).stdout + + def isopen(line: str) -> bool: + return line.startswith("f") and ( + "deleted" not in line + and "mem" not in line + and "txt" not in line + and "cwd" not in line + ) + + open_files = [] + + for line in out.split("\n"): + if isopen(line): + fields = line.split("\0") + fd = fields[0][1:] + filename = fields[1][1:] + if filename in IGNORE_PAM: + continue + if filename.startswith("/"): + open_files.append((fd, filename)) + + return open_files + + def matching_platform(self) -> bool: + try: + subprocess.run(("lsof", "-v"), check=True) + except (OSError, subprocess.CalledProcessError): + return False + else: + return True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_runtest_protocol(self, item: Item) -> Generator[None, object, object]: + lines1 = self.get_open_files() + try: + return (yield) + finally: + if hasattr(sys, "pypy_version_info"): + gc.collect() + lines2 = self.get_open_files() + + new_fds = {t[0] for t in lines2} - {t[0] for t in lines1} + leaked_files = [t for t in lines2 if t[0] in new_fds] + if leaked_files: + error = [ + f"***** {len(leaked_files)} FD leakage detected", + *(str(f) for f in leaked_files), + "*** Before:", + *(str(f) for f in lines1), + "*** After:", + *(str(f) for f in lines2), + f"***** {len(leaked_files)} FD leakage detected", + "*** function {}:{}: {} ".format(*item.location), + "See issue #2366", + ] + item.warn(PytestFDWarning("\n".join(error))) + + +# used at least by pytest-xdist plugin + + +@fixture +def _pytest(request: FixtureRequest) -> PytestArg: + """Return a helper which offers a gethookrecorder(hook) method which + returns a HookRecorder instance which helps to make assertions about called + hooks.""" + return PytestArg(request) + + +class PytestArg: + def __init__(self, request: FixtureRequest) -> None: + self._request = request + + def gethookrecorder(self, hook) -> HookRecorder: + hookrecorder = HookRecorder(hook._pm) + self._request.addfinalizer(hookrecorder.finish_recording) + return hookrecorder + + +def get_public_names(values: Iterable[str]) -> list[str]: + """Only return names from iterator values without a leading underscore.""" + return [x for x in values if x[0] != "_"] + + +@final +class RecordedHookCall: + """A recorded call to a hook. + + The arguments to the hook call are set as attributes. + For example: + + .. code-block:: python + + calls = hook_recorder.getcalls("pytest_runtest_setup") + # Suppose pytest_runtest_setup was called once with `item=an_item`. + assert calls[0].item is an_item + """ + + def __init__(self, name: str, kwargs) -> None: + self.__dict__.update(kwargs) + self._name = name + + def __repr__(self) -> str: + d = self.__dict__.copy() + del d["_name"] + return f"" + + if TYPE_CHECKING: + # The class has undetermined attributes, this tells mypy about it. + def __getattr__(self, key: str): ... + + +@final +class HookRecorder: + """Record all hooks called in a plugin manager. + + Hook recorders are created by :class:`Pytester`. + + This wraps all the hook calls in the plugin manager, recording each call + before propagating the normal calls. + """ + + def __init__( + self, pluginmanager: PytestPluginManager, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + + self._pluginmanager = pluginmanager + self.calls: list[RecordedHookCall] = [] + self.ret: int | ExitCode | None = None + + def before(hook_name: str, hook_impls, kwargs) -> None: + self.calls.append(RecordedHookCall(hook_name, kwargs)) + + def after(outcome, hook_name: str, hook_impls, kwargs) -> None: + pass + + self._undo_wrapping = pluginmanager.add_hookcall_monitoring(before, after) + + def finish_recording(self) -> None: + self._undo_wrapping() + + def getcalls(self, names: str | Iterable[str]) -> list[RecordedHookCall]: + """Get all recorded calls to hooks with the given names (or name).""" + if isinstance(names, str): + names = names.split() + return [call for call in self.calls if call._name in names] + + def assert_contains(self, entries: Sequence[tuple[str, str]]) -> None: + __tracebackhide__ = True + i = 0 + entries = list(entries) + # Since Python 3.13, f_locals is not a dict, but eval requires a dict. + backlocals = dict(sys._getframe(1).f_locals) + while entries: + name, check = entries.pop(0) + for ind, call in enumerate(self.calls[i:]): + if call._name == name: + print("NAMEMATCH", name, call) + if eval(check, backlocals, call.__dict__): + print("CHECKERMATCH", repr(check), "->", call) + else: + print("NOCHECKERMATCH", repr(check), "-", call) + continue + i += ind + 1 + break + print("NONAMEMATCH", name, "with", call) + else: + fail(f"could not find {name!r} check {check!r}") + + def popcall(self, name: str) -> RecordedHookCall: + __tracebackhide__ = True + for i, call in enumerate(self.calls): + if call._name == name: + del self.calls[i] + return call + lines = [f"could not find call {name!r}, in:"] + lines.extend([f" {x}" for x in self.calls]) + fail("\n".join(lines)) + + def getcall(self, name: str) -> RecordedHookCall: + values = self.getcalls(name) + assert len(values) == 1, (name, values) + return values[0] + + # functionality for test reports + + @overload + def getreports( + self, + names: Literal["pytest_collectreport"], + ) -> Sequence[CollectReport]: ... + + @overload + def getreports( + self, + names: Literal["pytest_runtest_logreport"], + ) -> Sequence[TestReport]: ... + + @overload + def getreports( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: ... + + def getreports( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: + return [x.report for x in self.getcalls(names)] + + def matchreport( + self, + inamepart: str = "", + names: str | Iterable[str] = ( + "pytest_runtest_logreport", + "pytest_collectreport", + ), + when: str | None = None, + ) -> CollectReport | TestReport: + """Return a testreport whose dotted import path matches.""" + values = [] + for rep in self.getreports(names=names): + if not when and rep.when != "call" and rep.passed: + # setup/teardown passing reports - let's ignore those + continue + if when and rep.when != when: + continue + if not inamepart or inamepart in rep.nodeid.split("::"): + values.append(rep) + if not values: + raise ValueError( + f"could not find test report matching {inamepart!r}: " + "no test reports at all!" + ) + if len(values) > 1: + raise ValueError( + f"found 2 or more testreports matching {inamepart!r}: {values}" + ) + return values[0] + + @overload + def getfailures( + self, + names: Literal["pytest_collectreport"], + ) -> Sequence[CollectReport]: ... + + @overload + def getfailures( + self, + names: Literal["pytest_runtest_logreport"], + ) -> Sequence[TestReport]: ... + + @overload + def getfailures( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: ... + + def getfailures( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: + return [rep for rep in self.getreports(names) if rep.failed] + + def getfailedcollections(self) -> Sequence[CollectReport]: + return self.getfailures("pytest_collectreport") + + def listoutcomes( + self, + ) -> tuple[ + Sequence[TestReport], + Sequence[CollectReport | TestReport], + Sequence[CollectReport | TestReport], + ]: + passed = [] + skipped = [] + failed = [] + for rep in self.getreports( + ("pytest_collectreport", "pytest_runtest_logreport") + ): + if rep.passed: + if rep.when == "call": + assert isinstance(rep, TestReport) + passed.append(rep) + elif rep.skipped: + skipped.append(rep) + else: + assert rep.failed, f"Unexpected outcome: {rep!r}" + failed.append(rep) + return passed, skipped, failed + + def countoutcomes(self) -> list[int]: + return [len(x) for x in self.listoutcomes()] + + def assertoutcome(self, passed: int = 0, skipped: int = 0, failed: int = 0) -> None: + __tracebackhide__ = True + from _pytest.pytester_assertions import assertoutcome + + outcomes = self.listoutcomes() + assertoutcome( + outcomes, + passed=passed, + skipped=skipped, + failed=failed, + ) + + def clear(self) -> None: + self.calls[:] = [] + + +@fixture +def linecomp() -> LineComp: + """A :class: `LineComp` instance for checking that an input linearly + contains a sequence of strings.""" + return LineComp() + + +@fixture(name="LineMatcher") +def LineMatcher_fixture(request: FixtureRequest) -> type[LineMatcher]: + """A reference to the :class: `LineMatcher`. + + This is instantiable with a list of lines (without their trailing newlines). + This is useful for testing large texts, such as the output of commands. + """ + return LineMatcher + + +@fixture +def pytester( + request: FixtureRequest, tmp_path_factory: TempPathFactory, monkeypatch: MonkeyPatch +) -> Pytester: + """ + Facilities to write tests/configuration files, execute pytest in isolation, and match + against expected output, perfect for black-box testing of pytest plugins. + + It attempts to isolate the test run from external factors as much as possible, modifying + the current working directory to ``path`` and environment variables during initialization. + + It is particularly useful for testing plugins. It is similar to the :fixture:`tmp_path` + fixture but provides methods which aid in testing pytest itself. + """ + return Pytester(request, tmp_path_factory, monkeypatch, _ispytest=True) + + +@fixture +def _sys_snapshot() -> Generator[None]: + snappaths = SysPathsSnapshot() + snapmods = SysModulesSnapshot() + yield + snapmods.restore() + snappaths.restore() + + +@fixture +def _config_for_test() -> Generator[Config]: + from _pytest.config import get_config + + config = get_config() + yield config + config._ensure_unconfigure() # cleanup, e.g. capman closing tmpfiles. + + +# Regex to match the session duration string in the summary: "74.34s". +rex_session_duration = re.compile(r"\d+\.\d\ds") +# Regex to match all the counts and phrases in the summary line: "34 passed, 111 skipped". +rex_outcome = re.compile(r"(\d+) (\w+)") + + +@final +class RunResult: + """The result of running a command from :class:`~pytest.Pytester`.""" + + def __init__( + self, + ret: int | ExitCode, + outlines: list[str], + errlines: list[str], + duration: float, + ) -> None: + try: + self.ret: int | ExitCode = ExitCode(ret) + """The return value.""" + except ValueError: + self.ret = ret + self.outlines = outlines + """List of lines captured from stdout.""" + self.errlines = errlines + """List of lines captured from stderr.""" + self.stdout = LineMatcher(outlines) + """:class:`~pytest.LineMatcher` of stdout. + + Use e.g. :func:`str(stdout) ` to reconstruct stdout, or the commonly used + :func:`stdout.fnmatch_lines() ` method. + """ + self.stderr = LineMatcher(errlines) + """:class:`~pytest.LineMatcher` of stderr.""" + self.duration = duration + """Duration in seconds.""" + + def __repr__(self) -> str: + return ( + f"" + ) + + def parseoutcomes(self) -> dict[str, int]: + """Return a dictionary of outcome noun -> count from parsing the terminal + output that the test process produced. + + The returned nouns will always be in plural form:: + + ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ==== + + Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``. + """ + return self.parse_summary_nouns(self.outlines) + + @classmethod + def parse_summary_nouns(cls, lines) -> dict[str, int]: + """Extract the nouns from a pytest terminal summary line. + + It always returns the plural noun for consistency:: + + ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ==== + + Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``. + """ + for line in reversed(lines): + if rex_session_duration.search(line): + outcomes = rex_outcome.findall(line) + ret = {noun: int(count) for (count, noun) in outcomes} + break + else: + raise ValueError("Pytest terminal summary report not found") + + to_plural = { + "warning": "warnings", + "error": "errors", + } + return {to_plural.get(k, k): v for k, v in ret.items()} + + def assert_outcomes( + self, + passed: int = 0, + skipped: int = 0, + failed: int = 0, + errors: int = 0, + xpassed: int = 0, + xfailed: int = 0, + warnings: int | None = None, + deselected: int | None = None, + ) -> None: + """ + Assert that the specified outcomes appear with the respective + numbers (0 means it didn't occur) in the text output from a test run. + + ``warnings`` and ``deselected`` are only checked if not None. + """ + __tracebackhide__ = True + from _pytest.pytester_assertions import assert_outcomes + + outcomes = self.parseoutcomes() + assert_outcomes( + outcomes, + passed=passed, + skipped=skipped, + failed=failed, + errors=errors, + xpassed=xpassed, + xfailed=xfailed, + warnings=warnings, + deselected=deselected, + ) + + +class SysModulesSnapshot: + def __init__(self, preserve: Callable[[str], bool] | None = None) -> None: + self.__preserve = preserve + self.__saved = dict(sys.modules) + + def restore(self) -> None: + if self.__preserve: + self.__saved.update( + (k, m) for k, m in sys.modules.items() if self.__preserve(k) + ) + sys.modules.clear() + sys.modules.update(self.__saved) + + +class SysPathsSnapshot: + def __init__(self) -> None: + self.__saved = list(sys.path), list(sys.meta_path) + + def restore(self) -> None: + sys.path[:], sys.meta_path[:] = self.__saved + + +@final +class Pytester: + """ + Facilities to write tests/configuration files, execute pytest in isolation, and match + against expected output, perfect for black-box testing of pytest plugins. + + It attempts to isolate the test run from external factors as much as possible, modifying + the current working directory to :attr:`path` and environment variables during initialization. + """ + + __test__ = False + + CLOSE_STDIN: Final = NOTSET + + class TimeoutExpired(Exception): + pass + + def __init__( + self, + request: FixtureRequest, + tmp_path_factory: TempPathFactory, + monkeypatch: MonkeyPatch, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._request = request + self._mod_collections: WeakKeyDictionary[Collector, list[Item | Collector]] = ( + WeakKeyDictionary() + ) + if request.function: + name: str = request.function.__name__ + else: + name = request.node.name + self._name = name + self._path: Path = tmp_path_factory.mktemp(name, numbered=True) + #: A list of plugins to use with :py:meth:`parseconfig` and + #: :py:meth:`runpytest`. Initially this is an empty list but plugins can + #: be added to the list. + #: + #: When running in subprocess mode, specify plugins by name (str) - adding + #: plugin objects directly is not supported. + self.plugins: list[str | _PluggyPlugin] = [] + self._sys_path_snapshot = SysPathsSnapshot() + self._sys_modules_snapshot = self.__take_sys_modules_snapshot() + self._request.addfinalizer(self._finalize) + self._method = self._request.config.getoption("--runpytest") + self._test_tmproot = tmp_path_factory.mktemp(f"tmp-{name}", numbered=True) + + self._monkeypatch = mp = monkeypatch + self.chdir() + mp.setenv("PYTEST_DEBUG_TEMPROOT", str(self._test_tmproot)) + # Ensure no unexpected caching via tox. + mp.delenv("TOX_ENV_DIR", raising=False) + # Discard outer pytest options. + mp.delenv("PYTEST_ADDOPTS", raising=False) + # Ensure no user config is used. + tmphome = str(self.path) + mp.setenv("HOME", tmphome) + mp.setenv("USERPROFILE", tmphome) + # Do not use colors for inner runs by default. + mp.setenv("PY_COLORS", "0") + + @property + def path(self) -> Path: + """Temporary directory path used to create files/run tests from, etc.""" + return self._path + + def __repr__(self) -> str: + return f"" + + def _finalize(self) -> None: + """ + Clean up global state artifacts. + + Some methods modify the global interpreter state and this tries to + clean this up. It does not remove the temporary directory however so + it can be looked at after the test run has finished. + """ + self._sys_modules_snapshot.restore() + self._sys_path_snapshot.restore() + + def __take_sys_modules_snapshot(self) -> SysModulesSnapshot: + # Some zope modules used by twisted-related tests keep internal state + # and can't be deleted; we had some trouble in the past with + # `zope.interface` for example. + # + # Preserve readline due to https://bugs.python.org/issue41033. + # pexpect issues a SIGWINCH. + def preserve_module(name): + return name.startswith(("zope", "readline")) + + return SysModulesSnapshot(preserve=preserve_module) + + def make_hook_recorder(self, pluginmanager: PytestPluginManager) -> HookRecorder: + """Create a new :class:`HookRecorder` for a :class:`PytestPluginManager`.""" + pluginmanager.reprec = reprec = HookRecorder(pluginmanager, _ispytest=True) # type: ignore[attr-defined] + self._request.addfinalizer(reprec.finish_recording) + return reprec + + def chdir(self) -> None: + """Cd into the temporary directory. + + This is done automatically upon instantiation. + """ + self._monkeypatch.chdir(self.path) + + def _makefile( + self, + ext: str, + lines: Sequence[Any | bytes], + files: dict[str, str], + encoding: str = "utf-8", + ) -> Path: + items = list(files.items()) + + if ext is None: + raise TypeError("ext must not be None") + + if ext and not ext.startswith("."): + raise ValueError( + f"pytester.makefile expects a file extension, try .{ext} instead of {ext}" + ) + + def to_text(s: Any | bytes) -> str: + return s.decode(encoding) if isinstance(s, bytes) else str(s) + + if lines: + source = "\n".join(to_text(x) for x in lines) + basename = self._name + items.insert(0, (basename, source)) + + ret = None + for basename, value in items: + p = self.path.joinpath(basename).with_suffix(ext) + p.parent.mkdir(parents=True, exist_ok=True) + source_ = Source(value) + source = "\n".join(to_text(line) for line in source_.lines) + p.write_text(source.strip(), encoding=encoding) + if ret is None: + ret = p + assert ret is not None + return ret + + def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: + r"""Create new text file(s) in the test directory. + + :param ext: + The extension the file(s) should use, including the dot, e.g. `.py`. + :param args: + All args are treated as strings and joined using newlines. + The result is written as contents to the file. The name of the + file is based on the test function requesting this fixture. + :param kwargs: + Each keyword is the name of a file, while the value of it will + be written as contents of the file. + :returns: + The first created file. + + Examples: + + .. code-block:: python + + pytester.makefile(".txt", "line1", "line2") + + pytester.makefile(".ini", pytest="[pytest]\naddopts=-rs\n") + + To create binary files, use :meth:`pathlib.Path.write_bytes` directly: + + .. code-block:: python + + filename = pytester.path.joinpath("foo.bin") + filename.write_bytes(b"...") + """ + return self._makefile(ext, args, kwargs) + + def makeconftest(self, source: str) -> Path: + """Write a conftest.py file. + + :param source: The contents. + :returns: The conftest.py file. + """ + return self.makepyfile(conftest=source) + + def makeini(self, source: str) -> Path: + """Write a tox.ini file. + + :param source: The contents. + :returns: The tox.ini file. + """ + return self.makefile(".ini", tox=source) + + def maketoml(self, source: str) -> Path: + """Write a pytest.toml file. + + :param source: The contents. + :returns: The pytest.toml file. + + .. versionadded:: 9.0 + """ + return self.makefile(".toml", pytest=source) + + def getinicfg(self, source: str) -> SectionWrapper: + """Return the pytest section from the tox.ini config file.""" + p = self.makeini(source) + return IniConfig(str(p))["pytest"] + + def makepyprojecttoml(self, source: str) -> Path: + """Write a pyproject.toml file. + + :param source: The contents. + :returns: The pyproject.ini file. + + .. versionadded:: 6.0 + """ + return self.makefile(".toml", pyproject=source) + + def makepyfile(self, *args, **kwargs) -> Path: + r"""Shortcut for .makefile() with a .py extension. + + Defaults to the test name with a '.py' extension, e.g test_foobar.py, overwriting + existing files. + + Examples: + + .. code-block:: python + + def test_something(pytester): + # Initial file is created test_something.py. + pytester.makepyfile("foobar") + # To create multiple files, pass kwargs accordingly. + pytester.makepyfile(custom="foobar") + # At this point, both 'test_something.py' & 'custom.py' exist in the test directory. + + """ + return self._makefile(".py", args, kwargs) + + def maketxtfile(self, *args, **kwargs) -> Path: + r"""Shortcut for .makefile() with a .txt extension. + + Defaults to the test name with a '.txt' extension, e.g test_foobar.txt, overwriting + existing files. + + Examples: + + .. code-block:: python + + def test_something(pytester): + # Initial file is created test_something.txt. + pytester.maketxtfile("foobar") + # To create multiple files, pass kwargs accordingly. + pytester.maketxtfile(custom="foobar") + # At this point, both 'test_something.txt' & 'custom.txt' exist in the test directory. + + """ + return self._makefile(".txt", args, kwargs) + + def syspathinsert(self, path: str | os.PathLike[str] | None = None) -> None: + """Prepend a directory to sys.path, defaults to :attr:`path`. + + This is undone automatically when this object dies at the end of each + test. + + :param path: + The path. + """ + if path is None: + path = self.path + + self._monkeypatch.syspath_prepend(str(path)) + + def mkdir(self, name: str | os.PathLike[str]) -> Path: + """Create a new (sub)directory. + + :param name: + The name of the directory, relative to the pytester path. + :returns: + The created directory. + :rtype: pathlib.Path + """ + p = self.path / name + p.mkdir() + return p + + def mkpydir(self, name: str | os.PathLike[str]) -> Path: + """Create a new python package. + + This creates a (sub)directory with an empty ``__init__.py`` file so it + gets recognised as a Python package. + """ + p = self.path / name + p.mkdir() + p.joinpath("__init__.py").touch() + return p + + def copy_example(self, name: str | None = None) -> Path: + """Copy file from project's directory into the testdir. + + :param name: + The name of the file to copy. + :return: + Path to the copied directory (inside ``self.path``). + :rtype: pathlib.Path + """ + example_dir_ = self._request.config.getini("pytester_example_dir") + if example_dir_ is None: + raise ValueError("pytester_example_dir is unset, can't copy examples") + example_dir: Path = self._request.config.rootpath / example_dir_ + + for extra_element in self._request.node.iter_markers("pytester_example_path"): + assert extra_element.args + example_dir = example_dir.joinpath(*extra_element.args) + + if name is None: + func_name = self._name + maybe_dir = example_dir / func_name + maybe_file = example_dir / (func_name + ".py") + + if maybe_dir.is_dir(): + example_path = maybe_dir + elif maybe_file.is_file(): + example_path = maybe_file + else: + raise LookupError( + f"{func_name} can't be found as module or package in {example_dir}" + ) + else: + example_path = example_dir.joinpath(name) + + if example_path.is_dir() and not example_path.joinpath("__init__.py").is_file(): + shutil.copytree(example_path, self.path, symlinks=True, dirs_exist_ok=True) + return self.path + elif example_path.is_file(): + result = self.path.joinpath(example_path.name) + shutil.copy(example_path, result) + return result + else: + raise LookupError( + f'example "{example_path}" is not found as a file or directory' + ) + + def getnode(self, config: Config, arg: str | os.PathLike[str]) -> Collector | Item: + """Get the collection node of a file. + + :param config: + A pytest config. + See :py:meth:`parseconfig` and :py:meth:`parseconfigure` for creating it. + :param arg: + Path to the file. + :returns: + The node. + """ + session = Session.from_config(config) + assert "::" not in str(arg) + p = Path(os.path.abspath(arg)) + config.hook.pytest_sessionstart(session=session) + res = session.perform_collect([str(p)], genitems=False)[0] + config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) + return res + + def getpathnode(self, path: str | os.PathLike[str]) -> Collector | Item: + """Return the collection node of a file. + + This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to + create the (configured) pytest Config instance. + + :param path: + Path to the file. + :returns: + The node. + """ + path = Path(path) + config = self.parseconfigure(path) + session = Session.from_config(config) + x = bestrelpath(session.path, path) + config.hook.pytest_sessionstart(session=session) + res = session.perform_collect([x], genitems=False)[0] + config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) + return res + + def genitems(self, colitems: Sequence[Item | Collector]) -> list[Item]: + """Generate all test items from a collection node. + + This recurses into the collection node and returns a list of all the + test items contained within. + + :param colitems: + The collection nodes. + :returns: + The collected items. + """ + session = colitems[0].session + result: list[Item] = [] + for colitem in colitems: + result.extend(session.genitems(colitem)) + return result + + def runitem(self, source: str) -> Any: + """Run the "test_func" Item. + + The calling test instance (class containing the test method) must + provide a ``.getrunner()`` method which should return a runner which + can run the test protocol for a single item, e.g. + ``_pytest.runner.runtestprotocol``. + """ + # used from runner functional tests + item = self.getitem(source) + # the test class where we are called from wants to provide the runner + testclassinstance = self._request.instance + runner = testclassinstance.getrunner() + return runner(item) + + def inline_runsource(self, source: str, *cmdlineargs) -> HookRecorder: + """Run a test module in process using ``pytest.main()``. + + This run writes "source" into a temporary file and runs + ``pytest.main()`` on it, returning a :py:class:`HookRecorder` instance + for the result. + + :param source: The source code of the test module. + :param cmdlineargs: Any extra command line arguments to use. + """ + p = self.makepyfile(source) + values = [*list(cmdlineargs), p] + return self.inline_run(*values) + + def inline_genitems(self, *args) -> tuple[list[Item], HookRecorder]: + """Run ``pytest.main(['--collect-only'])`` in-process. + + Runs the :py:func:`pytest.main` function to run all of pytest inside + the test process itself like :py:meth:`inline_run`, but returns a + tuple of the collected items and a :py:class:`HookRecorder` instance. + """ + rec = self.inline_run("--collect-only", *args) + items = [x.item for x in rec.getcalls("pytest_itemcollected")] + return items, rec + + def inline_run( + self, + *args: str | os.PathLike[str], + plugins=(), + no_reraise_ctrlc: bool = False, + ) -> HookRecorder: + """Run ``pytest.main()`` in-process, returning a HookRecorder. + + Runs the :py:func:`pytest.main` function to run all of pytest inside + the test process itself. This means it can return a + :py:class:`HookRecorder` instance which gives more detailed results + from that run than can be done by matching stdout/stderr from + :py:meth:`runpytest`. + + :param args: + Command line arguments to pass to :py:func:`pytest.main`. + :param plugins: + Extra plugin instances the ``pytest.main()`` instance should use. + :param no_reraise_ctrlc: + Typically we reraise keyboard interrupts from the child run. If + True, the KeyboardInterrupt exception is captured. + """ + from _pytest.unraisableexception import gc_collect_iterations_key + + # (maybe a cpython bug?) the importlib cache sometimes isn't updated + # properly between file creation and inline_run (especially if imports + # are interspersed with file creation) + importlib.invalidate_caches() + + plugins = list(plugins) + finalizers = [] + try: + # Any sys.module or sys.path changes done while running pytest + # inline should be reverted after the test run completes to avoid + # clashing with later inline tests run within the same pytest test, + # e.g. just because they use matching test module names. + finalizers.append(self.__take_sys_modules_snapshot().restore) + finalizers.append(SysPathsSnapshot().restore) + + # Important note: + # - our tests should not leave any other references/registrations + # laying around other than possibly loaded test modules + # referenced from sys.modules, as nothing will clean those up + # automatically + + rec = [] + + class PytesterHelperPlugin: + @staticmethod + def pytest_configure(config: Config) -> None: + rec.append(self.make_hook_recorder(config.pluginmanager)) + + # The unraisable plugin GC collect slows down inline + # pytester runs too much. + config.stash[gc_collect_iterations_key] = 0 + + plugins.append(PytesterHelperPlugin()) + ret = main([str(x) for x in args], plugins=plugins) + if len(rec) == 1: + reprec = rec.pop() + else: + + class reprec: # type: ignore + pass + + reprec.ret = ret + + # Typically we reraise keyboard interrupts from the child run + # because it's our user requesting interruption of the testing. + if ret == ExitCode.INTERRUPTED and not no_reraise_ctrlc: + calls = reprec.getcalls("pytest_keyboard_interrupt") + if calls and calls[-1].excinfo.type == KeyboardInterrupt: + raise KeyboardInterrupt() + return reprec + finally: + for finalizer in finalizers: + finalizer() + + def runpytest_inprocess( + self, *args: str | os.PathLike[str], **kwargs: Any + ) -> RunResult: + """Return result of running pytest in-process, providing a similar + interface to what self.runpytest() provides.""" + syspathinsert = kwargs.pop("syspathinsert", False) + + if syspathinsert: + self.syspathinsert() + instant = timing.Instant() + capture = _get_multicapture("sys") + capture.start_capturing() + try: + try: + reprec = self.inline_run(*args, **kwargs) + except SystemExit as e: + ret = e.args[0] + try: + ret = ExitCode(e.args[0]) + except ValueError: + pass + + class reprec: # type: ignore + ret = ret + + except Exception: + traceback.print_exc() + + class reprec: # type: ignore + ret = ExitCode(3) + + finally: + out, err = capture.readouterr() + capture.stop_capturing() + sys.stdout.write(out) + sys.stderr.write(err) + + assert reprec.ret is not None + res = RunResult( + reprec.ret, out.splitlines(), err.splitlines(), instant.elapsed().seconds + ) + res.reprec = reprec # type: ignore + return res + + def runpytest(self, *args: str | os.PathLike[str], **kwargs: Any) -> RunResult: + """Run pytest inline or in a subprocess, depending on the command line + option "--runpytest" and return a :py:class:`~pytest.RunResult`.""" + new_args = self._ensure_basetemp(args) + if self._method == "inprocess": + return self.runpytest_inprocess(*new_args, **kwargs) + elif self._method == "subprocess": + return self.runpytest_subprocess(*new_args, **kwargs) + raise RuntimeError(f"Unrecognized runpytest option: {self._method}") + + def _ensure_basetemp( + self, args: Sequence[str | os.PathLike[str]] + ) -> list[str | os.PathLike[str]]: + new_args = list(args) + for x in new_args: + if str(x).startswith("--basetemp"): + break + else: + new_args.append( + "--basetemp={}".format(self.path.parent.joinpath("basetemp")) + ) + return new_args + + def parseconfig(self, *args: str | os.PathLike[str]) -> Config: + """Return a new pytest :class:`pytest.Config` instance from given + commandline args. + + This invokes the pytest bootstrapping code in _pytest.config to create a + new :py:class:`pytest.PytestPluginManager` and call the + :hook:`pytest_cmdline_parse` hook to create a new :class:`pytest.Config` + instance. + + If :attr:`plugins` has been populated they should be plugin modules + to be registered with the plugin manager. + """ + import _pytest.config + + new_args = [str(x) for x in self._ensure_basetemp(args)] + + config = _pytest.config._prepareconfig(new_args, self.plugins) + # we don't know what the test will do with this half-setup config + # object and thus we make sure it gets unconfigured properly in any + # case (otherwise capturing could still be active, for example) + self._request.addfinalizer(config._ensure_unconfigure) + return config + + def parseconfigure(self, *args: str | os.PathLike[str]) -> Config: + """Return a new pytest configured Config instance. + + Returns a new :py:class:`pytest.Config` instance like + :py:meth:`parseconfig`, but also calls the :hook:`pytest_configure` + hook. + """ + config = self.parseconfig(*args) + config._do_configure() + return config + + def getitem( + self, source: str | os.PathLike[str], funcname: str = "test_func" + ) -> Item: + """Return the test item for a test function. + + Writes the source to a python file and runs pytest's collection on + the resulting module, returning the test item for the requested + function name. + + :param source: + The module source. + :param funcname: + The name of the test function for which to return a test item. + :returns: + The test item. + """ + items = self.getitems(source) + for item in items: + if item.name == funcname: + return item + assert 0, f"{funcname!r} item not found in module:\n{source}\nitems: {items}" + + def getitems(self, source: str | os.PathLike[str]) -> list[Item]: + """Return all test items collected from the module. + + Writes the source to a Python file and runs pytest's collection on + the resulting module, returning all test items contained within. + """ + modcol = self.getmodulecol(source) + return self.genitems([modcol]) + + def getmodulecol( + self, + source: str | os.PathLike[str], + configargs=(), + *, + withinit: bool = False, + ): + """Return the module collection node for ``source``. + + Writes ``source`` to a file using :py:meth:`makepyfile` and then + runs the pytest collection on it, returning the collection node for the + test module. + + :param source: + The source code of the module to collect. + + :param configargs: + Any extra arguments to pass to :py:meth:`parseconfigure`. + + :param withinit: + Whether to also write an ``__init__.py`` file to the same + directory to ensure it is a package. + """ + if isinstance(source, os.PathLike): + path = self.path.joinpath(source) + assert not withinit, "not supported for paths" + else: + kw = {self._name: str(source)} + path = self.makepyfile(**kw) + if withinit: + self.makepyfile(__init__="#") + self.config = config = self.parseconfigure(path, *configargs) + return self.getnode(config, path) + + def collect_by_name(self, modcol: Collector, name: str) -> Item | Collector | None: + """Return the collection node for name from the module collection. + + Searches a module collection node for a collection node matching the + given name. + + :param modcol: A module collection node; see :py:meth:`getmodulecol`. + :param name: The name of the node to return. + """ + if modcol not in self._mod_collections: + self._mod_collections[modcol] = list(modcol.collect()) + for colitem in self._mod_collections[modcol]: + if colitem.name == name: + return colitem + return None + + def popen( + self, + cmdargs: Sequence[str | os.PathLike[str]], + stdout: int | TextIO = subprocess.PIPE, + stderr: int | TextIO = subprocess.PIPE, + stdin: NotSetType | bytes | IO[Any] | int = CLOSE_STDIN, + **kw, + ): + """Invoke :py:class:`subprocess.Popen`. + + Calls :py:class:`subprocess.Popen` making sure the current working + directory is in ``PYTHONPATH``. + + You probably want to use :py:meth:`run` instead. + """ + env = os.environ.copy() + env["PYTHONPATH"] = os.pathsep.join( + filter(None, [os.getcwd(), env.get("PYTHONPATH", "")]) + ) + kw["env"] = env + + if stdin is self.CLOSE_STDIN: + kw["stdin"] = subprocess.PIPE + elif isinstance(stdin, bytes): + kw["stdin"] = subprocess.PIPE + else: + kw["stdin"] = stdin + + popen = subprocess.Popen(cmdargs, stdout=stdout, stderr=stderr, **kw) + if stdin is self.CLOSE_STDIN: + assert popen.stdin is not None + popen.stdin.close() + elif isinstance(stdin, bytes): + assert popen.stdin is not None + popen.stdin.write(stdin) + + return popen + + def run( + self, + *cmdargs: str | os.PathLike[str], + timeout: float | None = None, + stdin: NotSetType | bytes | IO[Any] | int = CLOSE_STDIN, + ) -> RunResult: + """Run a command with arguments. + + Run a process using :py:class:`subprocess.Popen` saving the stdout and + stderr. + + :param cmdargs: + The sequence of arguments to pass to :py:class:`subprocess.Popen`, + with path-like objects being converted to :py:class:`str` + automatically. + :param timeout: + The period in seconds after which to timeout and raise + :py:class:`Pytester.TimeoutExpired`. + :param stdin: + Optional standard input. + + - If it is ``CLOSE_STDIN`` (Default), then this method calls + :py:class:`subprocess.Popen` with ``stdin=subprocess.PIPE``, and + the standard input is closed immediately after the new command is + started. + + - If it is of type :py:class:`bytes`, these bytes are sent to the + standard input of the command. + + - Otherwise, it is passed through to :py:class:`subprocess.Popen`. + For further information in this case, consult the document of the + ``stdin`` parameter in :py:class:`subprocess.Popen`. + :type stdin: _pytest.compat.NotSetType | bytes | IO[Any] | int + :returns: + The result. + + """ + __tracebackhide__ = True + + cmdargs = tuple(os.fspath(arg) for arg in cmdargs) + p1 = self.path.joinpath("stdout") + p2 = self.path.joinpath("stderr") + print("running:", *cmdargs) + print(" in:", Path.cwd()) + + with p1.open("w", encoding="utf8") as f1, p2.open("w", encoding="utf8") as f2: + instant = timing.Instant() + popen = self.popen( + cmdargs, + stdin=stdin, + stdout=f1, + stderr=f2, + ) + if popen.stdin is not None: + popen.stdin.close() + + def handle_timeout() -> None: + __tracebackhide__ = True + + timeout_message = f"{timeout} second timeout expired running: {cmdargs}" + + popen.kill() + popen.wait() + raise self.TimeoutExpired(timeout_message) + + if timeout is None: + ret = popen.wait() + else: + try: + ret = popen.wait(timeout) + except subprocess.TimeoutExpired: + handle_timeout() + f1.flush() + f2.flush() + + with p1.open(encoding="utf8") as f1, p2.open(encoding="utf8") as f2: + out = f1.read().splitlines() + err = f2.read().splitlines() + + self._dump_lines(out, sys.stdout) + self._dump_lines(err, sys.stderr) + + with contextlib.suppress(ValueError): + ret = ExitCode(ret) + return RunResult(ret, out, err, instant.elapsed().seconds) + + def _dump_lines(self, lines, fp): + try: + for line in lines: + print(line, file=fp) + except UnicodeEncodeError: + print(f"couldn't print to {fp} because of encoding") + + def _getpytestargs(self) -> tuple[str, ...]: + return sys.executable, "-mpytest" + + def runpython(self, script: os.PathLike[str]) -> RunResult: + """Run a python script using sys.executable as interpreter.""" + return self.run(sys.executable, script) + + def runpython_c(self, command: str) -> RunResult: + """Run ``python -c "command"``.""" + return self.run(sys.executable, "-c", command) + + def runpytest_subprocess( + self, *args: str | os.PathLike[str], timeout: float | None = None + ) -> RunResult: + """Run pytest as a subprocess with given arguments. + + Any plugins added to the :py:attr:`plugins` list will be added using the + ``-p`` command line option. Additionally ``--basetemp`` is used to put + any temporary files and directories in a numbered directory prefixed + with "runpytest-" to not conflict with the normal numbered pytest + location for temporary files and directories. + + :param args: + The sequence of arguments to pass to the pytest subprocess. + :param timeout: + The period in seconds after which to timeout and raise + :py:class:`Pytester.TimeoutExpired`. + :returns: + The result. + """ + __tracebackhide__ = True + p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) + args = (f"--basetemp={p}", *args) + for plugin in self.plugins: + if not isinstance(plugin, str): + raise ValueError( + f"Specifying plugins as objects is not supported in pytester subprocess mode; " + f"specify by name instead: {plugin}" + ) + args = ("-p", plugin, *args) + args = self._getpytestargs() + args + return self.run(*args, timeout=timeout) + + def spawn_pytest(self, string: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """Run pytest using pexpect. + + This makes sure to use the right pytest and sets up the temporary + directory locations. + + The pexpect child is returned. + """ + basetemp = self.path / "temp-pexpect" + basetemp.mkdir(mode=0o700) + invoke = " ".join(map(str, self._getpytestargs())) + cmd = f"{invoke} --basetemp={basetemp} {string}" + return self.spawn(cmd, expect_timeout=expect_timeout) + + def spawn(self, cmd: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """Run a command using pexpect. + + The pexpect child is returned. + """ + pexpect = importorskip("pexpect", "3.0") + if hasattr(sys, "pypy_version_info") and "64" in platform.machine(): + skip("pypy-64 bit not supported") + if not hasattr(pexpect, "spawn"): + skip("pexpect.spawn not available") + logfile = self.path.joinpath("spawn.out").open("wb") + + child = pexpect.spawn(cmd, logfile=logfile, timeout=expect_timeout) + self._request.addfinalizer(logfile.close) + return child + + +class LineComp: + def __init__(self) -> None: + self.stringio = StringIO() + """:class:`python:io.StringIO()` instance used for input.""" + + def assert_contains_lines(self, lines2: Sequence[str]) -> None: + """Assert that ``lines2`` are contained (linearly) in :attr:`stringio`'s value. + + Lines are matched using :func:`LineMatcher.fnmatch_lines `. + """ + __tracebackhide__ = True + val = self.stringio.getvalue() + self.stringio.truncate(0) + self.stringio.seek(0) + lines1 = val.split("\n") + LineMatcher(lines1).fnmatch_lines(lines2) + + +class LineMatcher: + """Flexible matching of text. + + This is a convenience class to test large texts like the output of + commands. + + The constructor takes a list of lines without their trailing newlines, i.e. + ``text.splitlines()``. + """ + + def __init__(self, lines: list[str]) -> None: + self.lines = lines + self._log_output: list[str] = [] + + def __str__(self) -> str: + """Return the entire original text. + + .. versionadded:: 6.2 + You can use :meth:`str` in older versions. + """ + return "\n".join(self.lines) + + def _getlines(self, lines2: str | Sequence[str] | Source) -> Sequence[str]: + if isinstance(lines2, str): + lines2 = Source(lines2) + if isinstance(lines2, Source): + lines2 = lines2.strip().lines + return lines2 + + def fnmatch_lines_random(self, lines2: Sequence[str]) -> None: + """Check lines exist in the output in any order (using :func:`python:fnmatch.fnmatch`).""" + __tracebackhide__ = True + self._match_lines_random(lines2, fnmatch) + + def re_match_lines_random(self, lines2: Sequence[str]) -> None: + """Check lines exist in the output in any order (using :func:`python:re.match`).""" + __tracebackhide__ = True + self._match_lines_random(lines2, lambda name, pat: bool(re.match(pat, name))) + + def _match_lines_random( + self, lines2: Sequence[str], match_func: Callable[[str, str], bool] + ) -> None: + __tracebackhide__ = True + lines2 = self._getlines(lines2) + for line in lines2: + for x in self.lines: + if line == x or match_func(x, line): + self._log("matched: ", repr(line)) + break + else: + msg = f"line {line!r} not found in output" + self._log(msg) + self._fail(msg) + + def get_lines_after(self, fnline: str) -> Sequence[str]: + """Return all lines following the given line in the text. + + The given line can contain glob wildcards. + """ + for i, line in enumerate(self.lines): + if fnline == line or fnmatch(line, fnline): + return self.lines[i + 1 :] + raise ValueError(f"line {fnline!r} not found in output") + + def _log(self, *args) -> None: + self._log_output.append(" ".join(str(x) for x in args)) + + @property + def _log_text(self) -> str: + return "\n".join(self._log_output) + + def fnmatch_lines( + self, lines2: Sequence[str], *, consecutive: bool = False + ) -> None: + """Check lines exist in the output (using :func:`python:fnmatch.fnmatch`). + + The argument is a list of lines which have to match and can use glob + wildcards. If they do not match a pytest.fail() is called. The + matches and non-matches are also shown as part of the error message. + + :param lines2: String patterns to match. + :param consecutive: Match lines consecutively? + """ + __tracebackhide__ = True + self._match_lines(lines2, fnmatch, "fnmatch", consecutive=consecutive) + + def re_match_lines( + self, lines2: Sequence[str], *, consecutive: bool = False + ) -> None: + """Check lines exist in the output (using :func:`python:re.match`). + + The argument is a list of lines which have to match using ``re.match``. + If they do not match a pytest.fail() is called. + + The matches and non-matches are also shown as part of the error message. + + :param lines2: string patterns to match. + :param consecutive: match lines consecutively? + """ + __tracebackhide__ = True + self._match_lines( + lines2, + lambda name, pat: bool(re.match(pat, name)), + "re.match", + consecutive=consecutive, + ) + + def _match_lines( + self, + lines2: Sequence[str], + match_func: Callable[[str, str], bool], + match_nickname: str, + *, + consecutive: bool = False, + ) -> None: + """Underlying implementation of ``fnmatch_lines`` and ``re_match_lines``. + + :param Sequence[str] lines2: + List of string patterns to match. The actual format depends on + ``match_func``. + :param match_func: + A callable ``match_func(line, pattern)`` where line is the + captured line from stdout/stderr and pattern is the matching + pattern. + :param str match_nickname: + The nickname for the match function that will be logged to stdout + when a match occurs. + :param consecutive: + Match lines consecutively? + """ + if not isinstance(lines2, collections.abc.Sequence): + raise TypeError(f"invalid type for lines2: {type(lines2).__name__}") + lines2 = self._getlines(lines2) + lines1 = self.lines[:] + extralines = [] + __tracebackhide__ = True + wnick = len(match_nickname) + 1 + started = False + for line in lines2: + nomatchprinted = False + while lines1: + nextline = lines1.pop(0) + if line == nextline: + self._log("exact match:", repr(line)) + started = True + break + elif match_func(nextline, line): + self._log(f"{match_nickname}:", repr(line)) + self._log( + "{:>{width}}".format("with:", width=wnick), repr(nextline) + ) + started = True + break + else: + if consecutive and started: + msg = f"no consecutive match: {line!r}" + self._log(msg) + self._log( + "{:>{width}}".format("with:", width=wnick), repr(nextline) + ) + self._fail(msg) + if not nomatchprinted: + self._log( + "{:>{width}}".format("nomatch:", width=wnick), repr(line) + ) + nomatchprinted = True + self._log("{:>{width}}".format("and:", width=wnick), repr(nextline)) + extralines.append(nextline) + else: + msg = f"remains unmatched: {line!r}" + self._log(msg) + self._fail(msg) + self._log_output = [] + + def no_fnmatch_line(self, pat: str) -> None: + """Ensure captured lines do not match the given pattern, using ``fnmatch.fnmatch``. + + :param str pat: The pattern to match lines. + """ + __tracebackhide__ = True + self._no_match_line(pat, fnmatch, "fnmatch") + + def no_re_match_line(self, pat: str) -> None: + """Ensure captured lines do not match the given pattern, using ``re.match``. + + :param str pat: The regular expression to match lines. + """ + __tracebackhide__ = True + self._no_match_line( + pat, lambda name, pat: bool(re.match(pat, name)), "re.match" + ) + + def _no_match_line( + self, pat: str, match_func: Callable[[str, str], bool], match_nickname: str + ) -> None: + """Ensure captured lines does not have a the given pattern, using ``fnmatch.fnmatch``. + + :param str pat: The pattern to match lines. + """ + __tracebackhide__ = True + nomatch_printed = False + wnick = len(match_nickname) + 1 + for line in self.lines: + if match_func(line, pat): + msg = f"{match_nickname}: {pat!r}" + self._log(msg) + self._log("{:>{width}}".format("with:", width=wnick), repr(line)) + self._fail(msg) + else: + if not nomatch_printed: + self._log("{:>{width}}".format("nomatch:", width=wnick), repr(pat)) + nomatch_printed = True + self._log("{:>{width}}".format("and:", width=wnick), repr(line)) + self._log_output = [] + + def _fail(self, msg: str) -> None: + __tracebackhide__ = True + log_text = self._log_text + self._log_output = [] + fail(log_text) + + def str(self) -> str: + """Return the entire original text.""" + return str(self) diff --git a/micromamba_root/Lib/site-packages/_pytest/pytester_assertions.py b/micromamba_root/Lib/site-packages/_pytest/pytester_assertions.py new file mode 100644 index 0000000000000000000000000000000000000000..915cc8a10ff4781da48a44d88bf591788b8ab673 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/pytester_assertions.py @@ -0,0 +1,74 @@ +"""Helper plugin for pytester; should not be loaded on its own.""" + +# This plugin contains assertions used by pytester. pytester cannot +# contain them itself, since it is imported by the `pytest` module, +# hence cannot be subject to assertion rewriting, which requires a +# module to not be already imported. +from __future__ import annotations + +from collections.abc import Sequence + +from _pytest.reports import CollectReport +from _pytest.reports import TestReport + + +def assertoutcome( + outcomes: tuple[ + Sequence[TestReport], + Sequence[CollectReport | TestReport], + Sequence[CollectReport | TestReport], + ], + passed: int = 0, + skipped: int = 0, + failed: int = 0, +) -> None: + __tracebackhide__ = True + + realpassed, realskipped, realfailed = outcomes + obtained = { + "passed": len(realpassed), + "skipped": len(realskipped), + "failed": len(realfailed), + } + expected = {"passed": passed, "skipped": skipped, "failed": failed} + assert obtained == expected, outcomes + + +def assert_outcomes( + outcomes: dict[str, int], + passed: int = 0, + skipped: int = 0, + failed: int = 0, + errors: int = 0, + xpassed: int = 0, + xfailed: int = 0, + warnings: int | None = None, + deselected: int | None = None, +) -> None: + """Assert that the specified outcomes appear with the respective + numbers (0 means it didn't occur) in the text output from a test run.""" + __tracebackhide__ = True + + obtained = { + "passed": outcomes.get("passed", 0), + "skipped": outcomes.get("skipped", 0), + "failed": outcomes.get("failed", 0), + "errors": outcomes.get("errors", 0), + "xpassed": outcomes.get("xpassed", 0), + "xfailed": outcomes.get("xfailed", 0), + } + expected = { + "passed": passed, + "skipped": skipped, + "failed": failed, + "errors": errors, + "xpassed": xpassed, + "xfailed": xfailed, + } + if warnings is not None: + obtained["warnings"] = outcomes.get("warnings", 0) + expected["warnings"] = warnings + if deselected is not None: + obtained["deselected"] = outcomes.get("deselected", 0) + expected["deselected"] = deselected + assert obtained == expected diff --git a/micromamba_root/Lib/site-packages/_pytest/python.py b/micromamba_root/Lib/site-packages/_pytest/python.py new file mode 100644 index 0000000000000000000000000000000000000000..e63751877a40b8e5768236ff4c3bc2fb09699482 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/python.py @@ -0,0 +1,1772 @@ +# mypy: allow-untyped-defs +"""Python test discovery, setup and run of test functions.""" + +from __future__ import annotations + +import abc +from collections import Counter +from collections import defaultdict +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import Sequence +import dataclasses +import enum +import fnmatch +from functools import partial +import inspect +import itertools +import os +from pathlib import Path +import re +import textwrap +import types +from typing import Any +from typing import cast +from typing import final +from typing import Literal +from typing import NoReturn +from typing import TYPE_CHECKING +import warnings + +import _pytest +from _pytest import fixtures +from _pytest import nodes +from _pytest._code import filter_traceback +from _pytest._code import getfslineno +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest._code.code import Traceback +from _pytest._io.saferepr import saferepr +from _pytest.compat import ascii_escaped +from _pytest.compat import get_default_arg_names +from _pytest.compat import get_real_func +from _pytest.compat import getimfunc +from _pytest.compat import is_async_function +from _pytest.compat import LEGACY_PATH +from _pytest.compat import NOTSET +from _pytest.compat import safe_getattr +from _pytest.compat import safe_isclass +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import FixtureRequest +from _pytest.fixtures import FuncFixtureInfo +from _pytest.fixtures import get_scope_node +from _pytest.main import Session +from _pytest.mark import ParameterSet +from _pytest.mark.structures import _HiddenParam +from _pytest.mark.structures import get_unpacked_marks +from _pytest.mark.structures import HIDDEN_PARAM +from _pytest.mark.structures import Mark +from _pytest.mark.structures import MarkDecorator +from _pytest.mark.structures import normalize_mark_list +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.pathlib import fnmatch_ex +from _pytest.pathlib import import_path +from _pytest.pathlib import ImportPathMismatchError +from _pytest.pathlib import scandir +from _pytest.scope import _ScopeName +from _pytest.scope import Scope +from _pytest.stash import StashKey +from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "python_files", + type="args", + # NOTE: default is also used in AssertionRewritingHook. + default=["test_*.py", "*_test.py"], + help="Glob-style file patterns for Python test module discovery", + ) + parser.addini( + "python_classes", + type="args", + default=["Test"], + help="Prefixes or glob names for Python test class discovery", + ) + parser.addini( + "python_functions", + type="args", + default=["test"], + help="Prefixes or glob names for Python test function and method discovery", + ) + parser.addini( + "disable_test_id_escaping_and_forfeit_all_rights_to_community_support", + type="bool", + default=False, + help="Disable string escape non-ASCII characters, might cause unwanted " + "side effects(use at your own risk)", + ) + parser.addini( + "strict_parametrization_ids", + type="bool", + # None => fallback to `strict`. + default=None, + help="Emit an error if non-unique parameter set IDs are detected", + ) + + +def pytest_generate_tests(metafunc: Metafunc) -> None: + for marker in metafunc.definition.iter_markers(name="parametrize"): + metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker) + + +def pytest_configure(config: Config) -> None: + config.addinivalue_line( + "markers", + "parametrize(argnames, argvalues): call a test function multiple " + "times passing in different arguments in turn. argvalues generally " + "needs to be a list of values if argnames specifies only one name " + "or a list of tuples of values if argnames specifies multiple names. " + "Example: @parametrize('arg1', [1,2]) would lead to two calls of the " + "decorated test function, one with arg1=1 and another with arg1=2." + "see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info " + "and examples.", + ) + config.addinivalue_line( + "markers", + "usefixtures(fixturename1, fixturename2, ...): mark tests as needing " + "all of the specified fixtures. see " + "https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures ", + ) + + +def async_fail(nodeid: str) -> None: + msg = ( + "async def functions are not natively supported.\n" + "You need to install a suitable plugin for your async framework, for example:\n" + " - anyio\n" + " - pytest-asyncio\n" + " - pytest-tornasync\n" + " - pytest-trio\n" + " - pytest-twisted" + ) + fail(msg, pytrace=False) + + +@hookimpl(trylast=True) +def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: + testfunction = pyfuncitem.obj + if is_async_function(testfunction): + async_fail(pyfuncitem.nodeid) + funcargs = pyfuncitem.funcargs + testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} + result = testfunction(**testargs) + if hasattr(result, "__await__") or hasattr(result, "__aiter__"): + async_fail(pyfuncitem.nodeid) + elif result is not None: + warnings.warn( + PytestReturnNotNoneWarning( + f"Test functions should return None, but {pyfuncitem.nodeid} returned {type(result)!r}.\n" + "Did you mean to use `assert` instead of `return`?\n" + "See https://docs.pytest.org/en/stable/how-to/assert.html#return-not-none for more information." + ) + ) + return True + + +def pytest_collect_directory( + path: Path, parent: nodes.Collector +) -> nodes.Collector | None: + pkginit = path / "__init__.py" + try: + has_pkginit = pkginit.is_file() + except PermissionError: + # See https://github.com/pytest-dev/pytest/issues/12120#issuecomment-2106349096. + return None + if has_pkginit: + return Package.from_parent(parent, path=path) + return None + + +def pytest_collect_file(file_path: Path, parent: nodes.Collector) -> Module | None: + if file_path.suffix == ".py": + if not parent.session.isinitpath(file_path): + if not path_matches_patterns( + file_path, parent.config.getini("python_files") + ): + return None + ihook = parent.session.gethookproxy(file_path) + module: Module = ihook.pytest_pycollect_makemodule( + module_path=file_path, parent=parent + ) + return module + return None + + +def path_matches_patterns(path: Path, patterns: Iterable[str]) -> bool: + """Return whether path matches any of the patterns in the list of globs given.""" + return any(fnmatch_ex(pattern, path) for pattern in patterns) + + +def pytest_pycollect_makemodule(module_path: Path, parent) -> Module: + return Module.from_parent(parent, path=module_path) + + +@hookimpl(trylast=True) +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> None | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector]: + assert isinstance(collector, Class | Module), type(collector) + # Nothing was collected elsewhere, let's do it here. + if safe_isclass(obj): + if collector.istestclass(obj, name): + return Class.from_parent(collector, name=name, obj=obj) + elif collector.istestfunction(obj, name): + # mock seems to store unbound methods (issue473), normalize it. + obj = getattr(obj, "__func__", obj) + # We need to try and unwrap the function if it's a functools.partial + # or a functools.wrapped. + # We mustn't if it's been wrapped with mock.patch (python 2 only). + if not (inspect.isfunction(obj) or inspect.isfunction(get_real_func(obj))): + filename, lineno = getfslineno(obj) + warnings.warn_explicit( + message=PytestCollectionWarning( + f"cannot collect {name!r} because it is not a function." + ), + category=None, + filename=str(filename), + lineno=lineno + 1, + ) + elif getattr(obj, "__test__", True): + if inspect.isgeneratorfunction(obj): + fail( + f"'yield' keyword is allowed in fixtures, but not in tests ({name})", + pytrace=False, + ) + return list(collector._genfunctions(name, obj)) + return None + return None + + +class PyobjMixin(nodes.Node): + """this mix-in inherits from Node to carry over the typing information + + as its intended to always mix in before a node + its position in the mro is unaffected""" + + _ALLOW_MARKERS = True + + @property + def module(self): + """Python module object this node was collected from (can be None).""" + node = self.getparent(Module) + return node.obj if node is not None else None + + @property + def cls(self): + """Python class object this node was collected from (can be None).""" + node = self.getparent(Class) + return node.obj if node is not None else None + + @property + def instance(self): + """Python instance object the function is bound to. + + Returns None if not a test method, e.g. for a standalone test function, + a class or a module. + """ + # Overridden by Function. + return None + + @property + def obj(self): + """Underlying Python object.""" + obj = getattr(self, "_obj", None) + if obj is None: + self._obj = obj = self._getobj() + # XXX evil hack + # used to avoid Function marker duplication + if self._ALLOW_MARKERS: + self.own_markers.extend(get_unpacked_marks(self.obj)) + # This assumes that `obj` is called before there is a chance + # to add custom keys to `self.keywords`, so no fear of overriding. + self.keywords.update((mark.name, mark) for mark in self.own_markers) + return obj + + @obj.setter + def obj(self, value): + self._obj = value + + def _getobj(self): + """Get the underlying Python object. May be overwritten by subclasses.""" + # TODO: Improve the type of `parent` such that assert/ignore aren't needed. + assert self.parent is not None + obj = self.parent.obj # type: ignore[attr-defined] + return getattr(obj, self.name) + + def getmodpath(self, stopatmodule: bool = True, includemodule: bool = False) -> str: + """Return Python path relative to the containing module.""" + parts = [] + for node in self.iter_parents(): + name = node.name + if isinstance(node, Module): + name = os.path.splitext(name)[0] + if stopatmodule: + if includemodule: + parts.append(name) + break + parts.append(name) + parts.reverse() + return ".".join(parts) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + # XXX caching? + path, lineno = getfslineno(self.obj) + modpath = self.getmodpath() + return path, lineno, modpath + + +# As an optimization, these builtin attribute names are pre-ignored when +# iterating over an object during collection -- the pytest_pycollect_makeitem +# hook is not called for them. +# fmt: off +class _EmptyClass: pass # noqa: E701 +IGNORED_ATTRIBUTES = frozenset.union( + frozenset(), + # Module. + dir(types.ModuleType("empty_module")), + # Some extra module attributes the above doesn't catch. + {"__builtins__", "__file__", "__cached__"}, + # Class. + dir(_EmptyClass), + # Instance. + dir(_EmptyClass()), +) +del _EmptyClass +# fmt: on + + +class PyCollector(PyobjMixin, nodes.Collector, abc.ABC): + def funcnamefilter(self, name: str) -> bool: + return self._matches_prefix_or_glob_option("python_functions", name) + + def isnosetest(self, obj: object) -> bool: + """Look for the __test__ attribute, which is applied by the + @nose.tools.istest decorator. + """ + # We explicitly check for "is True" here to not mistakenly treat + # classes with a custom __getattr__ returning something truthy (like a + # function) as test classes. + return safe_getattr(obj, "__test__", False) is True + + def classnamefilter(self, name: str) -> bool: + return self._matches_prefix_or_glob_option("python_classes", name) + + def istestfunction(self, obj: object, name: str) -> bool: + if self.funcnamefilter(name) or self.isnosetest(obj): + if isinstance(obj, staticmethod | classmethod): + # staticmethods and classmethods need to be unwrapped. + obj = safe_getattr(obj, "__func__", False) + return callable(obj) and fixtures.getfixturemarker(obj) is None + else: + return False + + def istestclass(self, obj: object, name: str) -> bool: + if not (self.classnamefilter(name) or self.isnosetest(obj)): + return False + if inspect.isabstract(obj): + return False + return True + + def _matches_prefix_or_glob_option(self, option_name: str, name: str) -> bool: + """Check if the given name matches the prefix or glob-pattern defined + in configuration.""" + for option in self.config.getini(option_name): + if name.startswith(option): + return True + # Check that name looks like a glob-string before calling fnmatch + # because this is called for every name in each collected module, + # and fnmatch is somewhat expensive to call. + elif ("*" in option or "?" in option or "[" in option) and fnmatch.fnmatch( + name, option + ): + return True + return False + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + if not getattr(self.obj, "__test__", True): + return [] + + # Avoid random getattrs and peek in the __dict__ instead. + dicts = [getattr(self.obj, "__dict__", {})] + if isinstance(self.obj, type): + for basecls in self.obj.__mro__: + dicts.append(basecls.__dict__) + + # In each class, nodes should be definition ordered. + # __dict__ is definition ordered. + seen: set[str] = set() + dict_values: list[list[nodes.Item | nodes.Collector]] = [] + collect_imported_tests = self.session.config.getini("collect_imported_tests") + ihook = self.ihook + for dic in dicts: + values: list[nodes.Item | nodes.Collector] = [] + # Note: seems like the dict can change during iteration - + # be careful not to remove the list() without consideration. + for name, obj in list(dic.items()): + if name in IGNORED_ATTRIBUTES: + continue + if name in seen: + continue + seen.add(name) + + if not collect_imported_tests and isinstance(self, Module): + # Do not collect functions and classes from other modules. + if inspect.isfunction(obj) or inspect.isclass(obj): + if obj.__module__ != self._getobj().__name__: + continue + + res = ihook.pytest_pycollect_makeitem( + collector=self, name=name, obj=obj + ) + if res is None: + continue + elif isinstance(res, list): + values.extend(res) + else: + values.append(res) + dict_values.append(values) + + # Between classes in the class hierarchy, reverse-MRO order -- nodes + # inherited from base classes should come before subclasses. + result = [] + for values in reversed(dict_values): + result.extend(values) + return result + + def _genfunctions(self, name: str, funcobj) -> Iterator[Function]: + modulecol = self.getparent(Module) + assert modulecol is not None + module = modulecol.obj + clscol = self.getparent(Class) + cls = (clscol and clscol.obj) or None + + definition = FunctionDefinition.from_parent(self, name=name, callobj=funcobj) + fixtureinfo = definition._fixtureinfo + + # pytest_generate_tests impls call metafunc.parametrize() which fills + # metafunc._calls, the outcome of the hook. + metafunc = Metafunc( + definition=definition, + fixtureinfo=fixtureinfo, + config=self.config, + cls=cls, + module=module, + _ispytest=True, + ) + methods = [] + if hasattr(module, "pytest_generate_tests"): + methods.append(module.pytest_generate_tests) + if cls is not None and hasattr(cls, "pytest_generate_tests"): + methods.append(cls().pytest_generate_tests) + self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc)) + + if not metafunc._calls: + yield Function.from_parent(self, name=name, fixtureinfo=fixtureinfo) + else: + metafunc._recompute_direct_params_indices() + # Direct parametrizations taking place in module/class-specific + # `metafunc.parametrize` calls may have shadowed some fixtures, so make sure + # we update what the function really needs a.k.a its fixture closure. Note that + # direct parametrizations using `@pytest.mark.parametrize` have already been considered + # into making the closure using `ignore_args` arg to `getfixtureclosure`. + fixtureinfo.prune_dependency_tree() + + for callspec in metafunc._calls: + subname = f"{name}[{callspec.id}]" if callspec._idlist else name + yield Function.from_parent( + self, + name=subname, + callspec=callspec, + fixtureinfo=fixtureinfo, + keywords={callspec.id: True}, + originalname=name, + ) + + +def importtestmodule( + path: Path, + config: Config, +): + # We assume we are only called once per module. + importmode = config.getoption("--import-mode") + try: + mod = import_path( + path, + mode=importmode, + root=config.rootpath, + consider_namespace_packages=config.getini("consider_namespace_packages"), + ) + except SyntaxError as e: + raise nodes.Collector.CollectError( + ExceptionInfo.from_current().getrepr(style="short") + ) from e + except ImportPathMismatchError as e: + raise nodes.Collector.CollectError( + "import file mismatch:\n" + "imported module {!r} has this __file__ attribute:\n" + " {}\n" + "which is not the same as the test file we want to collect:\n" + " {}\n" + "HINT: remove __pycache__ / .pyc files and/or use a " + "unique basename for your test file modules".format(*e.args) + ) from e + except ImportError as e: + exc_info = ExceptionInfo.from_current() + if config.get_verbosity() < 2: + exc_info.traceback = exc_info.traceback.filter(filter_traceback) + exc_repr = ( + exc_info.getrepr(style="short") + if exc_info.traceback + else exc_info.exconly() + ) + formatted_tb = str(exc_repr) + raise nodes.Collector.CollectError( + f"ImportError while importing test module '{path}'.\n" + "Hint: make sure your test modules/packages have valid Python names.\n" + "Traceback:\n" + f"{formatted_tb}" + ) from e + except skip.Exception as e: + if e.allow_module_level: + raise + raise nodes.Collector.CollectError( + "Using pytest.skip outside of a test will skip the entire module. " + "If that's your intention, pass `allow_module_level=True`. " + "If you want to skip a specific test or an entire class, " + "use the @pytest.mark.skip or @pytest.mark.skipif decorators." + ) from e + config.pluginmanager.consider_module(mod) + return mod + + +class Module(nodes.File, PyCollector): + """Collector for test classes and functions in a Python module.""" + + def _getobj(self): + return importtestmodule(self.path, self.config) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + self._register_setup_module_fixture() + self._register_setup_function_fixture() + self.session._fixturemanager.parsefactories(self) + return super().collect() + + def _register_setup_module_fixture(self) -> None: + """Register an autouse, module-scoped fixture for the collected module object + that invokes setUpModule/tearDownModule if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_module = _get_first_non_fixture_func( + self.obj, ("setUpModule", "setup_module") + ) + teardown_module = _get_first_non_fixture_func( + self.obj, ("tearDownModule", "teardown_module") + ) + + if setup_module is None and teardown_module is None: + return + + def xunit_setup_module_fixture(request) -> Generator[None]: + module = request.module + if setup_module is not None: + _call_with_optional_argument(setup_module, module) + yield + if teardown_module is not None: + _call_with_optional_argument(teardown_module, module) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_module_fixture_{self.obj.__name__}", + func=xunit_setup_module_fixture, + nodeid=self.nodeid, + scope="module", + autouse=True, + ) + + def _register_setup_function_fixture(self) -> None: + """Register an autouse, function-scoped fixture for the collected module object + that invokes setup_function/teardown_function if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_function = _get_first_non_fixture_func(self.obj, ("setup_function",)) + teardown_function = _get_first_non_fixture_func( + self.obj, ("teardown_function",) + ) + if setup_function is None and teardown_function is None: + return + + def xunit_setup_function_fixture(request) -> Generator[None]: + if request.instance is not None: + # in this case we are bound to an instance, so we need to let + # setup_method handle this + yield + return + function = request.function + if setup_function is not None: + _call_with_optional_argument(setup_function, function) + yield + if teardown_function is not None: + _call_with_optional_argument(teardown_function, function) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_function_fixture_{self.obj.__name__}", + func=xunit_setup_function_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +class Package(nodes.Directory): + """Collector for files and directories in a Python packages -- directories + with an `__init__.py` file. + + .. note:: + + Directories without an `__init__.py` file are instead collected by + :class:`~pytest.Dir` by default. Both are :class:`~pytest.Directory` + collectors. + + .. versionchanged:: 8.0 + + Now inherits from :class:`~pytest.Directory`. + """ + + def __init__( + self, + fspath: LEGACY_PATH | None, + parent: nodes.Collector, + # NOTE: following args are unused: + config=None, + session=None, + nodeid=None, + path: Path | None = None, + ) -> None: + # NOTE: Could be just the following, but kept as-is for compat. + # super().__init__(self, fspath, parent=parent) + session = parent.session + super().__init__( + fspath=fspath, + path=path, + parent=parent, + config=config, + session=session, + nodeid=nodeid, + ) + + def setup(self) -> None: + init_mod = importtestmodule(self.path / "__init__.py", self.config) + + # Not using fixtures to call setup_module here because autouse fixtures + # from packages are not called automatically (#4085). + setup_module = _get_first_non_fixture_func( + init_mod, ("setUpModule", "setup_module") + ) + if setup_module is not None: + _call_with_optional_argument(setup_module, init_mod) + + teardown_module = _get_first_non_fixture_func( + init_mod, ("tearDownModule", "teardown_module") + ) + if teardown_module is not None: + func = partial(_call_with_optional_argument, teardown_module, init_mod) + self.addfinalizer(func) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + # Always collect __init__.py first. + def sort_key(entry: os.DirEntry[str]) -> object: + return (entry.name != "__init__.py", entry.name) + + config = self.config + col: nodes.Collector | None + cols: Sequence[nodes.Collector] + ihook = self.ihook + for direntry in scandir(self.path, sort_key): + if direntry.is_dir(): + path = Path(direntry.path) + if not self.session.isinitpath(path, with_parents=True): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + col = ihook.pytest_collect_directory(path=path, parent=self) + if col is not None: + yield col + + elif direntry.is_file(): + path = Path(direntry.path) + if not self.session.isinitpath(path): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + cols = ihook.pytest_collect_file(file_path=path, parent=self) + yield from cols + + +def _call_with_optional_argument(func, arg) -> None: + """Call the given function with the given argument if func accepts one argument, otherwise + calls func without arguments.""" + arg_count = func.__code__.co_argcount + if inspect.ismethod(func): + arg_count -= 1 + if arg_count: + func(arg) + else: + func() + + +def _get_first_non_fixture_func(obj: object, names: Iterable[str]) -> object | None: + """Return the attribute from the given object to be used as a setup/teardown + xunit-style function, but only if not marked as a fixture to avoid calling it twice. + """ + for name in names: + meth: object | None = getattr(obj, name, None) + if meth is not None and fixtures.getfixturemarker(meth) is None: + return meth + return None + + +class Class(PyCollector): + """Collector for test methods (and nested classes) in a Python class.""" + + @classmethod + def from_parent(cls, parent, *, name, obj=None, **kw) -> Self: # type: ignore[override] + """The public constructor.""" + return super().from_parent(name=name, parent=parent, **kw) + + def newinstance(self): + return self.obj() + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + if not safe_getattr(self.obj, "__test__", True): + return [] + if hasinit(self.obj): + assert self.parent is not None + self.warn( + PytestCollectionWarning( + f"cannot collect test class {self.obj.__name__!r} because it has a " + f"__init__ constructor (from: {self.parent.nodeid})" + ) + ) + return [] + elif hasnew(self.obj): + assert self.parent is not None + self.warn( + PytestCollectionWarning( + f"cannot collect test class {self.obj.__name__!r} because it has a " + f"__new__ constructor (from: {self.parent.nodeid})" + ) + ) + return [] + + self._register_setup_class_fixture() + self._register_setup_method_fixture() + + self.session._fixturemanager.parsefactories(self.newinstance(), self.nodeid) + + return super().collect() + + def _register_setup_class_fixture(self) -> None: + """Register an autouse, class scoped fixture into the collected class object + that invokes setup_class/teardown_class if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_class = _get_first_non_fixture_func(self.obj, ("setup_class",)) + teardown_class = _get_first_non_fixture_func(self.obj, ("teardown_class",)) + if setup_class is None and teardown_class is None: + return + + def xunit_setup_class_fixture(request) -> Generator[None]: + cls = request.cls + if setup_class is not None: + func = getimfunc(setup_class) + _call_with_optional_argument(func, cls) + yield + if teardown_class is not None: + func = getimfunc(teardown_class) + _call_with_optional_argument(func, cls) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_class_fixture_{self.obj.__qualname__}", + func=xunit_setup_class_fixture, + nodeid=self.nodeid, + scope="class", + autouse=True, + ) + + def _register_setup_method_fixture(self) -> None: + """Register an autouse, function scoped fixture into the collected class object + that invokes setup_method/teardown_method if either or both are available. + + Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_name = "setup_method" + setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) + teardown_name = "teardown_method" + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) + if setup_method is None and teardown_method is None: + return + + def xunit_setup_method_fixture(request) -> Generator[None]: + instance = request.instance + method = request.function + if setup_method is not None: + func = getattr(instance, setup_name) + _call_with_optional_argument(func, method) + yield + if teardown_method is not None: + func = getattr(instance, teardown_name) + _call_with_optional_argument(func, method) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_method_fixture_{self.obj.__qualname__}", + func=xunit_setup_method_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +def hasinit(obj: object) -> bool: + init: object = getattr(obj, "__init__", None) + if init: + return init != object.__init__ + return False + + +def hasnew(obj: object) -> bool: + new: object = getattr(obj, "__new__", None) + if new: + return new != object.__new__ + return False + + +@final +@dataclasses.dataclass(frozen=True) +class IdMaker: + """Make IDs for a parametrization.""" + + __slots__ = ( + "argnames", + "config", + "func_name", + "idfn", + "ids", + "nodeid", + "parametersets", + ) + + # The argnames of the parametrization. + argnames: Sequence[str] + # The ParameterSets of the parametrization. + parametersets: Sequence[ParameterSet] + # Optionally, a user-provided callable to make IDs for parameters in a + # ParameterSet. + idfn: Callable[[Any], object | None] | None + # Optionally, explicit IDs for ParameterSets by index. + ids: Sequence[object | None] | None + # Optionally, the pytest config. + # Used for controlling ASCII escaping, determining parametrization ID + # strictness, and for calling the :hook:`pytest_make_parametrize_id` hook. + config: Config | None + # Optionally, the ID of the node being parametrized. + # Used only for clearer error messages. + nodeid: str | None + # Optionally, the ID of the function being parametrized. + # Used only for clearer error messages. + func_name: str | None + + def make_unique_parameterset_ids(self) -> list[str | _HiddenParam]: + """Make a unique identifier for each ParameterSet, that may be used to + identify the parametrization in a node ID. + + If strict_parametrization_ids is enabled, and duplicates are detected, + raises CollectError. Otherwise makes the IDs unique as follows: + + Format is -...-[counter], where prm_x_token is + - user-provided id, if given + - else an id derived from the value, applicable for certain types + - else + The counter suffix is appended only in case a string wouldn't be unique + otherwise. + """ + resolved_ids = list(self._resolve_ids()) + # All IDs must be unique! + if len(resolved_ids) != len(set(resolved_ids)): + # Record the number of occurrences of each ID. + id_counts = Counter(resolved_ids) + + if self._strict_parametrization_ids_enabled(): + parameters = ", ".join(self.argnames) + parametersets = ", ".join( + [saferepr(list(param.values)) for param in self.parametersets] + ) + ids = ", ".join( + id if id is not HIDDEN_PARAM else "" for id in resolved_ids + ) + duplicates = ", ".join( + id if id is not HIDDEN_PARAM else "" + for id, count in id_counts.items() + if count > 1 + ) + msg = textwrap.dedent(f""" + Duplicate parametrization IDs detected, but strict_parametrization_ids is set. + + Test name: {self.nodeid} + Parameters: {parameters} + Parameter sets: {parametersets} + IDs: {ids} + Duplicates: {duplicates} + + You can fix this problem using `@pytest.mark.parametrize(..., ids=...)` or `pytest.param(..., id=...)`. + """).strip() # noqa: E501 + raise nodes.Collector.CollectError(msg) + + # Map the ID to its next suffix. + id_suffixes: dict[str, int] = defaultdict(int) + # Suffix non-unique IDs to make them unique. + for index, id in enumerate(resolved_ids): + if id_counts[id] > 1: + if id is HIDDEN_PARAM: + self._complain_multiple_hidden_parameter_sets() + suffix = "" + if id and id[-1].isdigit(): + suffix = "_" + new_id = f"{id}{suffix}{id_suffixes[id]}" + while new_id in set(resolved_ids): + id_suffixes[id] += 1 + new_id = f"{id}{suffix}{id_suffixes[id]}" + resolved_ids[index] = new_id + id_suffixes[id] += 1 + assert len(resolved_ids) == len(set(resolved_ids)), ( + f"Internal error: {resolved_ids=}" + ) + return resolved_ids + + def _strict_parametrization_ids_enabled(self) -> bool: + if self.config is None: + return False + strict_parametrization_ids = self.config.getini("strict_parametrization_ids") + if strict_parametrization_ids is None: + strict_parametrization_ids = self.config.getini("strict") + return cast(bool, strict_parametrization_ids) + + def _resolve_ids(self) -> Iterable[str | _HiddenParam]: + """Resolve IDs for all ParameterSets (may contain duplicates).""" + for idx, parameterset in enumerate(self.parametersets): + if parameterset.id is not None: + # ID provided directly - pytest.param(..., id="...") + if parameterset.id is HIDDEN_PARAM: + yield HIDDEN_PARAM + else: + yield _ascii_escaped_by_config(parameterset.id, self.config) + elif self.ids and idx < len(self.ids) and self.ids[idx] is not None: + # ID provided in the IDs list - parametrize(..., ids=[...]). + if self.ids[idx] is HIDDEN_PARAM: + yield HIDDEN_PARAM + else: + yield self._idval_from_value_required(self.ids[idx], idx) + else: + # ID not provided - generate it. + yield "-".join( + self._idval(val, argname, idx) + for val, argname in zip( + parameterset.values, self.argnames, strict=True + ) + ) + + def _idval(self, val: object, argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet.""" + idval = self._idval_from_function(val, argname, idx) + if idval is not None: + return idval + idval = self._idval_from_hook(val, argname) + if idval is not None: + return idval + idval = self._idval_from_value(val) + if idval is not None: + return idval + return self._idval_from_argname(argname, idx) + + def _idval_from_function(self, val: object, argname: str, idx: int) -> str | None: + """Try to make an ID for a parameter in a ParameterSet using the + user-provided id callable, if given.""" + if self.idfn is None: + return None + try: + id = self.idfn(val) + except Exception as e: + prefix = f"{self.nodeid}: " if self.nodeid is not None else "" + msg = "error raised while trying to determine id of parameter '{}' at position {}" + msg = prefix + msg.format(argname, idx) + raise ValueError(msg) from e + if id is None: + return None + return self._idval_from_value(id) + + def _idval_from_hook(self, val: object, argname: str) -> str | None: + """Try to make an ID for a parameter in a ParameterSet by calling the + :hook:`pytest_make_parametrize_id` hook.""" + if self.config: + id: str | None = self.config.hook.pytest_make_parametrize_id( + config=self.config, val=val, argname=argname + ) + return id + return None + + def _idval_from_value(self, val: object) -> str | None: + """Try to make an ID for a parameter in a ParameterSet from its value, + if the value type is supported.""" + if isinstance(val, str | bytes): + return _ascii_escaped_by_config(val, self.config) + elif val is None or isinstance(val, float | int | bool | complex): + return str(val) + elif isinstance(val, re.Pattern): + return ascii_escaped(val.pattern) + elif val is NOTSET: + # Fallback to default. Note that NOTSET is an enum.Enum. + pass + elif isinstance(val, enum.Enum): + return str(val) + elif isinstance(getattr(val, "__name__", None), str): + # Name of a class, function, module, etc. + name: str = getattr(val, "__name__") + return name + return None + + def _idval_from_value_required(self, val: object, idx: int) -> str: + """Like _idval_from_value(), but fails if the type is not supported.""" + id = self._idval_from_value(val) + if id is not None: + return id + + # Fail. + prefix = self._make_error_prefix() + msg = ( + f"{prefix}ids contains unsupported value {saferepr(val)} (type: {type(val)!r}) at index {idx}. " + "Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__." + ) + fail(msg, pytrace=False) + + @staticmethod + def _idval_from_argname(argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet from the argument name + and the index of the ParameterSet.""" + return str(argname) + str(idx) + + def _complain_multiple_hidden_parameter_sets(self) -> NoReturn: + fail( + f"{self._make_error_prefix()}multiple instances of HIDDEN_PARAM " + "cannot be used in the same parametrize call, " + "because the tests names need to be unique." + ) + + def _make_error_prefix(self) -> str: + if self.func_name is not None: + return f"In {self.func_name}: " + elif self.nodeid is not None: + return f"In {self.nodeid}: " + else: + return "" + + +@final +@dataclasses.dataclass(frozen=True) +class CallSpec2: + """A planned parameterized invocation of a test function. + + Calculated during collection for a given test function's Metafunc. + Once collection is over, each callspec is turned into a single Item + and stored in item.callspec. + """ + + # arg name -> arg value which will be passed to a fixture or pseudo-fixture + # of the same name. (indirect or direct parametrization respectively) + params: dict[str, object] = dataclasses.field(default_factory=dict) + # arg name -> arg index. + indices: dict[str, int] = dataclasses.field(default_factory=dict) + # arg name -> parameter scope. + # Used for sorting parametrized resources. + _arg2scope: Mapping[str, Scope] = dataclasses.field(default_factory=dict) + # Parts which will be added to the item's name in `[..]` separated by "-". + _idlist: Sequence[str] = dataclasses.field(default_factory=tuple) + # Marks which will be applied to the item. + marks: list[Mark] = dataclasses.field(default_factory=list) + + def setmulti( + self, + *, + argnames: Iterable[str], + valset: Iterable[object], + id: str | _HiddenParam, + marks: Iterable[Mark | MarkDecorator], + scope: Scope, + param_index: int, + nodeid: str, + ) -> CallSpec2: + params = self.params.copy() + indices = self.indices.copy() + arg2scope = dict(self._arg2scope) + for arg, val in zip(argnames, valset, strict=True): + if arg in params: + raise nodes.Collector.CollectError( + f"{nodeid}: duplicate parametrization of {arg!r}" + ) + params[arg] = val + indices[arg] = param_index + arg2scope[arg] = scope + return CallSpec2( + params=params, + indices=indices, + _arg2scope=arg2scope, + _idlist=self._idlist if id is HIDDEN_PARAM else [*self._idlist, id], + marks=[*self.marks, *normalize_mark_list(marks)], + ) + + def getparam(self, name: str) -> object: + try: + return self.params[name] + except KeyError as e: + raise ValueError(name) from e + + @property + def id(self) -> str: + return "-".join(self._idlist) + + +def get_direct_param_fixture_func(request: FixtureRequest) -> Any: + return request.param + + +# Used for storing pseudo fixturedefs for direct parametrization. +name2pseudofixturedef_key = StashKey[dict[str, FixtureDef[Any]]]() + + +@final +class Metafunc: + """Objects passed to the :hook:`pytest_generate_tests` hook. + + They help to inspect a test function and to generate tests according to + test configuration or values specified in the class or module where a + test function is defined. + """ + + def __init__( + self, + definition: FunctionDefinition, + fixtureinfo: fixtures.FuncFixtureInfo, + config: Config, + cls=None, + module=None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + + #: Access to the underlying :class:`_pytest.python.FunctionDefinition`. + self.definition = definition + + #: Access to the :class:`pytest.Config` object for the test session. + self.config = config + + #: The module object where the test function is defined in. + self.module = module + + #: Underlying Python test function. + self.function = definition.obj + + #: Set of fixture names required by the test function. + self.fixturenames = fixtureinfo.names_closure + + #: Class object where the test function is defined in or ``None``. + self.cls = cls + + self._arg2fixturedefs = fixtureinfo.name2fixturedefs + + # Result of parametrize(). + self._calls: list[CallSpec2] = [] + + self._params_directness: dict[str, Literal["indirect", "direct"]] = {} + + def parametrize( + self, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + indirect: bool | Sequence[str] = False, + ids: Iterable[object | None] | Callable[[Any], object | None] | None = None, + scope: _ScopeName | None = None, + *, + _param_mark: Mark | None = None, + ) -> None: + """Add new invocations to the underlying test function using the list + of argvalues for the given argnames. Parametrization is performed + during the collection phase. If you need to setup expensive resources + see about setting ``indirect`` to do it at test setup time instead. + + Can be called multiple times per test function (but only on different + argument names), in which case each call parametrizes all previous + parametrizations, e.g. + + :: + + unparametrized: t + parametrize ["x", "y"]: t[x], t[y] + parametrize [1, 2]: t[x-1], t[x-2], t[y-1], t[y-2] + + :param argnames: + A comma-separated string denoting one or more argument names, or + a list/tuple of argument strings. + + :param argvalues: + The list of argvalues determines how often a test is invoked with + different argument values. + + If only one argname was specified argvalues is a list of values. + If N argnames were specified, argvalues must be a list of + N-tuples, where each tuple-element specifies a value for its + respective argname. + + :param indirect: + A list of arguments' names (subset of argnames) or a boolean. + If True the list contains all names from the argnames. Each + argvalue corresponding to an argname in this list will + be passed as request.param to its respective argname fixture + function so that it can perform more expensive setups during the + setup phase of a test rather than at collection time. + + :param ids: + Sequence of (or generator for) ids for ``argvalues``, + or a callable to return part of the id for each argvalue. + + With sequences (and generators like ``itertools.count()``) the + returned ids should be of type ``string``, ``int``, ``float``, + ``bool``, or ``None``. + They are mapped to the corresponding index in ``argvalues``. + ``None`` means to use the auto-generated id. + + .. versionadded:: 8.4 + :ref:`hidden-param` means to hide the parameter set + from the test name. Can only be used at most 1 time, as + test names need to be unique. + + If it is a callable it will be called for each entry in + ``argvalues``, and the return value is used as part of the + auto-generated id for the whole set (where parts are joined with + dashes ("-")). + This is useful to provide more specific ids for certain items, e.g. + dates. Returning ``None`` will use an auto-generated id. + + If no ids are provided they will be generated automatically from + the argvalues. + + :param scope: + If specified it denotes the scope of the parameters. + The scope is used for grouping tests by parameter instances. + It will also override any fixture-function defined scope, allowing + to set a dynamic scope using test context or configuration. + """ + nodeid = self.definition.nodeid + + argnames, parametersets = ParameterSet._for_parametrize( + argnames, + argvalues, + self.function, + self.config, + nodeid=self.definition.nodeid, + ) + del argvalues + + if "request" in argnames: + fail( + f"{nodeid}: 'request' is a reserved name and cannot be used in @pytest.mark.parametrize", + pytrace=False, + ) + + if scope is not None: + scope_ = Scope.from_user( + scope, descr=f"parametrize() call in {self.function.__name__}" + ) + else: + scope_ = _find_parametrized_scope(argnames, self._arg2fixturedefs, indirect) + + self._validate_if_using_arg_names(argnames, indirect) + + # Use any already (possibly) generated ids with parametrize Marks. + if _param_mark and _param_mark._param_ids_from: + generated_ids = _param_mark._param_ids_from._param_ids_generated + if generated_ids is not None: + ids = generated_ids + + ids = self._resolve_parameter_set_ids( + argnames, ids, parametersets, nodeid=self.definition.nodeid + ) + + # Store used (possibly generated) ids with parametrize Marks. + if _param_mark and _param_mark._param_ids_from and generated_ids is None: + object.__setattr__(_param_mark._param_ids_from, "_param_ids_generated", ids) + + # Calculate directness. + arg_directness = self._resolve_args_directness(argnames, indirect) + self._params_directness.update(arg_directness) + + # Add direct parametrizations as fixturedefs to arg2fixturedefs by + # registering artificial "pseudo" FixtureDef's such that later at test + # setup time we can rely on FixtureDefs to exist for all argnames. + node = None + # For scopes higher than function, a "pseudo" FixtureDef might have + # already been created for the scope. We thus store and cache the + # FixtureDef on the node related to the scope. + if scope_ is Scope.Function: + name2pseudofixturedef = None + else: + collector = self.definition.parent + assert collector is not None + node = get_scope_node(collector, scope_) + if node is None: + # If used class scope and there is no class, use module-level + # collector (for now). + if scope_ is Scope.Class: + assert isinstance(collector, Module) + node = collector + # If used package scope and there is no package, use session + # (for now). + elif scope_ is Scope.Package: + node = collector.session + else: + assert False, f"Unhandled missing scope: {scope}" + default: dict[str, FixtureDef[Any]] = {} + name2pseudofixturedef = node.stash.setdefault( + name2pseudofixturedef_key, default + ) + for argname in argnames: + if arg_directness[argname] == "indirect": + continue + if name2pseudofixturedef is not None and argname in name2pseudofixturedef: + fixturedef = name2pseudofixturedef[argname] + else: + fixturedef = FixtureDef( + config=self.config, + baseid="", + argname=argname, + func=get_direct_param_fixture_func, + scope=scope_, + params=None, + ids=None, + _ispytest=True, + ) + if name2pseudofixturedef is not None: + name2pseudofixturedef[argname] = fixturedef + self._arg2fixturedefs[argname] = [fixturedef] + + # Create the new calls: if we are parametrize() multiple times (by applying the decorator + # more than once) then we accumulate those calls generating the cartesian product + # of all calls. + newcalls = [] + for callspec in self._calls or [CallSpec2()]: + for param_index, (param_id, param_set) in enumerate( + zip(ids, parametersets, strict=True) + ): + newcallspec = callspec.setmulti( + argnames=argnames, + valset=param_set.values, + id=param_id, + marks=param_set.marks, + scope=scope_, + param_index=param_index, + nodeid=nodeid, + ) + newcalls.append(newcallspec) + self._calls = newcalls + + def _resolve_parameter_set_ids( + self, + argnames: Sequence[str], + ids: Iterable[object | None] | Callable[[Any], object | None] | None, + parametersets: Sequence[ParameterSet], + nodeid: str, + ) -> list[str | _HiddenParam]: + """Resolve the actual ids for the given parameter sets. + + :param argnames: + Argument names passed to ``parametrize()``. + :param ids: + The `ids` parameter of the ``parametrize()`` call (see docs). + :param parametersets: + The parameter sets, each containing a set of values corresponding + to ``argnames``. + :param nodeid str: + The nodeid of the definition item that generated this + parametrization. + :returns: + List with ids for each parameter set given. + """ + if ids is None: + idfn = None + ids_ = None + elif callable(ids): + idfn = ids + ids_ = None + else: + idfn = None + ids_ = self._validate_ids(ids, parametersets, self.function.__name__) + id_maker = IdMaker( + argnames, + parametersets, + idfn, + ids_, + self.config, + nodeid=nodeid, + func_name=self.function.__name__, + ) + return id_maker.make_unique_parameterset_ids() + + def _validate_ids( + self, + ids: Iterable[object | None], + parametersets: Sequence[ParameterSet], + func_name: str, + ) -> list[object | None]: + try: + num_ids = len(ids) # type: ignore[arg-type] + except TypeError: + try: + iter(ids) + except TypeError as e: + raise TypeError("ids must be a callable or an iterable") from e + num_ids = len(parametersets) + + # num_ids == 0 is a special case: https://github.com/pytest-dev/pytest/issues/1849 + if num_ids != len(parametersets) and num_ids != 0: + msg = "In {}: {} parameter sets specified, with different number of ids: {}" + fail(msg.format(func_name, len(parametersets), num_ids), pytrace=False) + + return list(itertools.islice(ids, num_ids)) + + def _resolve_args_directness( + self, + argnames: Sequence[str], + indirect: bool | Sequence[str], + ) -> dict[str, Literal["indirect", "direct"]]: + """Resolve if each parametrized argument must be considered an indirect + parameter to a fixture of the same name, or a direct parameter to the + parametrized function, based on the ``indirect`` parameter of the + parametrized() call. + + :param argnames: + List of argument names passed to ``parametrize()``. + :param indirect: + Same as the ``indirect`` parameter of ``parametrize()``. + :returns + A dict mapping each arg name to either "indirect" or "direct". + """ + arg_directness: dict[str, Literal["indirect", "direct"]] + if isinstance(indirect, bool): + arg_directness = dict.fromkeys( + argnames, "indirect" if indirect else "direct" + ) + elif isinstance(indirect, Sequence): + arg_directness = dict.fromkeys(argnames, "direct") + for arg in indirect: + if arg not in argnames: + fail( + f"In {self.function.__name__}: indirect fixture '{arg}' doesn't exist", + pytrace=False, + ) + arg_directness[arg] = "indirect" + else: + fail( + f"In {self.function.__name__}: expected Sequence or boolean" + f" for indirect, got {type(indirect).__name__}", + pytrace=False, + ) + return arg_directness + + def _validate_if_using_arg_names( + self, + argnames: Sequence[str], + indirect: bool | Sequence[str], + ) -> None: + """Check if all argnames are being used, by default values, or directly/indirectly. + + :param List[str] argnames: List of argument names passed to ``parametrize()``. + :param indirect: Same as the ``indirect`` parameter of ``parametrize()``. + :raises ValueError: If validation fails. + """ + default_arg_names = set(get_default_arg_names(self.function)) + func_name = self.function.__name__ + for arg in argnames: + if arg not in self.fixturenames: + if arg in default_arg_names: + fail( + f"In {func_name}: function already takes an argument '{arg}' with a default value", + pytrace=False, + ) + else: + if isinstance(indirect, Sequence): + name = "fixture" if arg in indirect else "argument" + else: + name = "fixture" if indirect else "argument" + fail( + f"In {func_name}: function uses no {name} '{arg}'", + pytrace=False, + ) + + def _recompute_direct_params_indices(self) -> None: + for argname, param_type in self._params_directness.items(): + if param_type == "direct": + for i, callspec in enumerate(self._calls): + callspec.indices[argname] = i + + +def _find_parametrized_scope( + argnames: Sequence[str], + arg2fixturedefs: Mapping[str, Sequence[fixtures.FixtureDef[object]]], + indirect: bool | Sequence[str], +) -> Scope: + """Find the most appropriate scope for a parametrized call based on its arguments. + + When there's at least one direct argument, always use "function" scope. + + When a test function is parametrized and all its arguments are indirect + (e.g. fixtures), return the most narrow scope based on the fixtures used. + + Related to issue #1832, based on code posted by @Kingdread. + """ + if isinstance(indirect, Sequence): + all_arguments_are_fixtures = len(indirect) == len(argnames) + else: + all_arguments_are_fixtures = bool(indirect) + + if all_arguments_are_fixtures: + fixturedefs = arg2fixturedefs or {} + used_scopes = [ + fixturedef[-1]._scope + for name, fixturedef in fixturedefs.items() + if name in argnames + ] + # Takes the most narrow scope from used fixtures. + return min(used_scopes, default=Scope.Function) + + return Scope.Function + + +def _ascii_escaped_by_config(val: str | bytes, config: Config | None) -> str: + if config is None: + escape_option = False + else: + escape_option = config.getini( + "disable_test_id_escaping_and_forfeit_all_rights_to_community_support" + ) + # TODO: If escaping is turned off and the user passes bytes, + # will return a bytes. For now we ignore this but the + # code *probably* doesn't handle this case. + return val if escape_option else ascii_escaped(val) # type: ignore + + +class Function(PyobjMixin, nodes.Item): + """Item responsible for setting up and executing a Python test function. + + :param name: + The full function name, including any decorations like those + added by parametrization (``my_func[my_param]``). + :param parent: + The parent Node. + :param config: + The pytest Config object. + :param callspec: + If given, this function has been parametrized and the callspec contains + meta information about the parametrization. + :param callobj: + If given, the object which will be called when the Function is invoked, + otherwise the callobj will be obtained from ``parent`` using ``originalname``. + :param keywords: + Keywords bound to the function object for "-k" matching. + :param session: + The pytest Session object. + :param fixtureinfo: + Fixture information already resolved at this fixture node.. + :param originalname: + The attribute name to use for accessing the underlying function object. + Defaults to ``name``. Set this if name is different from the original name, + for example when it contains decorations like those added by parametrization + (``my_func[my_param]``). + """ + + # Disable since functions handle it themselves. + _ALLOW_MARKERS = False + + def __init__( + self, + name: str, + parent, + config: Config | None = None, + callspec: CallSpec2 | None = None, + callobj=NOTSET, + keywords: Mapping[str, Any] | None = None, + session: Session | None = None, + fixtureinfo: FuncFixtureInfo | None = None, + originalname: str | None = None, + ) -> None: + super().__init__(name, parent, config=config, session=session) + + if callobj is not NOTSET: + self._obj = callobj + self._instance = getattr(callobj, "__self__", None) + + #: Original function name, without any decorations (for example + #: parametrization adds a ``"[...]"`` suffix to function names), used to access + #: the underlying function object from ``parent`` (in case ``callobj`` is not given + #: explicitly). + #: + #: .. versionadded:: 3.0 + self.originalname = originalname or name + + # Note: when FunctionDefinition is introduced, we should change ``originalname`` + # to a readonly property that returns FunctionDefinition.name. + + self.own_markers.extend(get_unpacked_marks(self.obj)) + if callspec: + self.callspec = callspec + self.own_markers.extend(callspec.marks) + + # todo: this is a hell of a hack + # https://github.com/pytest-dev/pytest/issues/4569 + # Note: the order of the updates is important here; indicates what + # takes priority (ctor argument over function attributes over markers). + # Take own_markers only; NodeKeywords handles parent traversal on its own. + self.keywords.update((mark.name, mark) for mark in self.own_markers) + self.keywords.update(self.obj.__dict__) + if keywords: + self.keywords.update(keywords) + + if fixtureinfo is None: + fm = self.session._fixturemanager + fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls) + self._fixtureinfo: FuncFixtureInfo = fixtureinfo + self.fixturenames = fixtureinfo.names_closure + self._initrequest() + + # todo: determine sound type limitations + @classmethod + def from_parent(cls, parent, **kw) -> Self: + """The public constructor.""" + return super().from_parent(parent=parent, **kw) + + def _initrequest(self) -> None: + self.funcargs: dict[str, object] = {} + self._request = fixtures.TopRequest(self, _ispytest=True) + + @property + def function(self): + """Underlying python 'function' object.""" + return getimfunc(self.obj) + + @property + def instance(self): + try: + return self._instance + except AttributeError: + if isinstance(self.parent, Class): + # Each Function gets a fresh class instance. + self._instance = self._getinstance() + else: + self._instance = None + return self._instance + + def _getinstance(self): + if isinstance(self.parent, Class): + # Each Function gets a fresh class instance. + return self.parent.newinstance() + else: + return None + + def _getobj(self): + instance = self.instance + if instance is not None: + parent_obj = instance + else: + assert self.parent is not None + parent_obj = self.parent.obj # type: ignore[attr-defined] + return getattr(parent_obj, self.originalname) + + @property + def _pyfuncitem(self): + """(compatonly) for code expecting pytest-2.2 style request objects.""" + return self + + def runtest(self) -> None: + """Execute the underlying test function.""" + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + + def setup(self) -> None: + self._request._fillfixtures() + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + if hasattr(self, "_obj") and not self.config.getoption("fulltrace", False): + code = _pytest._code.Code.from_function(get_real_func(self.obj)) + path, firstlineno = code.path, code.firstlineno + traceback = excinfo.traceback + ntraceback = traceback.cut(path=path, firstlineno=firstlineno) + if ntraceback == traceback: + ntraceback = ntraceback.cut(path=path) + if ntraceback == traceback: + ntraceback = ntraceback.filter(filter_traceback) + if not ntraceback: + ntraceback = traceback + ntraceback = ntraceback.filter(excinfo) + + # issue364: mark all but first and last frames to + # only show a single-line message for each frame. + if self.config.getoption("tbstyle", "auto") == "auto": + if len(ntraceback) > 2: + ntraceback = Traceback( + ( + ntraceback[0], + *(t.with_repr_style("short") for t in ntraceback[1:-1]), + ntraceback[-1], + ) + ) + + return ntraceback + return excinfo.traceback + + # TODO: Type ignored -- breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, + excinfo: ExceptionInfo[BaseException], + ) -> str | TerminalRepr: + style = self.config.getoption("tbstyle", "auto") + if style == "auto": + style = "long" + return self._repr_failure_py(excinfo, style=style) + + +class FunctionDefinition(Function): + """This class is a stop gap solution until we evolve to have actual function + definition nodes and manage to get rid of ``metafunc``.""" + + def runtest(self) -> None: + raise RuntimeError("function definitions are not supposed to be run as tests") + + setup = runtest diff --git a/micromamba_root/Lib/site-packages/_pytest/python_api.py b/micromamba_root/Lib/site-packages/_pytest/python_api.py new file mode 100644 index 0000000000000000000000000000000000000000..bab70aa4a8c07c2c0906e948d195d6bc097a0c87 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/python_api.py @@ -0,0 +1,819 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +from collections.abc import Collection +from collections.abc import Mapping +from collections.abc import Sequence +from collections.abc import Sized +from decimal import Decimal +import math +from numbers import Complex +import pprint +import sys +from typing import Any +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: + from numpy import ndarray + + +def _compare_approx( + full_object: object, + message_data: Sequence[tuple[str, str, str]], + number_of_elements: int, + different_ids: Sequence[object], + max_abs_diff: float, + max_rel_diff: float, +) -> list[str]: + message_list = list(message_data) + message_list.insert(0, ("Index", "Obtained", "Expected")) + max_sizes = [0, 0, 0] + for index, obtained, expected in message_list: + max_sizes[0] = max(max_sizes[0], len(index)) + max_sizes[1] = max(max_sizes[1], len(obtained)) + max_sizes[2] = max(max_sizes[2], len(expected)) + explanation = [ + f"comparison failed. Mismatched elements: {len(different_ids)} / {number_of_elements}:", + f"Max absolute difference: {max_abs_diff}", + f"Max relative difference: {max_rel_diff}", + ] + [ + f"{indexes:<{max_sizes[0]}} | {obtained:<{max_sizes[1]}} | {expected:<{max_sizes[2]}}" + for indexes, obtained, expected in message_list + ] + return explanation + + +# builtin pytest.approx helper + + +class ApproxBase: + """Provide shared utilities for making approximate comparisons between + numbers or sequences of numbers.""" + + # Tell numpy to use our `__eq__` operator instead of its. + __array_ufunc__ = None + __array_priority__ = 100 + + def __init__(self, expected, rel=None, abs=None, nan_ok: bool = False) -> None: + __tracebackhide__ = True + self.expected = expected + self.abs = abs + self.rel = rel + self.nan_ok = nan_ok + self._check_type() + + def __repr__(self) -> str: + raise NotImplementedError + + def _repr_compare(self, other_side: Any) -> list[str]: + return [ + "comparison failed", + f"Obtained: {other_side}", + f"Expected: {self}", + ] + + def __eq__(self, actual) -> bool: + return all( + a == self._approx_scalar(x) for a, x in self._yield_comparisons(actual) + ) + + def __bool__(self): + __tracebackhide__ = True + raise AssertionError( + "approx() is not supported in a boolean context.\nDid you mean: `assert a == approx(b)`?" + ) + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + def __ne__(self, actual) -> bool: + return not (actual == self) + + def _approx_scalar(self, x) -> ApproxScalar: + if isinstance(x, Decimal): + return ApproxDecimal(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok) + return ApproxScalar(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok) + + def _yield_comparisons(self, actual): + """Yield all the pairs of numbers to be compared. + + This is used to implement the `__eq__` method. + """ + raise NotImplementedError + + def _check_type(self) -> None: + """Raise a TypeError if the expected value is not a valid type.""" + # This is only a concern if the expected value is a sequence. In every + # other case, the approx() function ensures that the expected value has + # a numeric type. For this reason, the default is to do nothing. The + # classes that deal with sequences should reimplement this method to + # raise if there are any non-numeric elements in the sequence. + + +def _recursive_sequence_map(f, x): + """Recursively map a function over a sequence of arbitrary depth""" + if isinstance(x, list | tuple): + seq_type = type(x) + return seq_type(_recursive_sequence_map(f, xi) for xi in x) + elif _is_sequence_like(x): + return [_recursive_sequence_map(f, xi) for xi in x] + else: + return f(x) + + +class ApproxNumpy(ApproxBase): + """Perform approximate comparisons where the expected value is numpy array.""" + + def __repr__(self) -> str: + list_scalars = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) + return f"approx({list_scalars!r})" + + def _repr_compare(self, other_side: ndarray | list[Any]) -> list[str]: + import itertools + import math + + def get_value_from_nested_list( + nested_list: list[Any], nd_index: tuple[Any, ...] + ) -> Any: + """ + Helper function to get the value out of a nested list, given an n-dimensional index. + This mimics numpy's indexing, but for raw nested python lists. + """ + value: Any = nested_list + for i in nd_index: + value = value[i] + return value + + np_array_shape = self.expected.shape + approx_side_as_seq = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) + + # convert other_side to numpy array to ensure shape attribute is available + other_side_as_array = _as_numpy_array(other_side) + assert other_side_as_array is not None + + if np_array_shape != other_side_as_array.shape: + return [ + "Impossible to compare arrays with different shapes.", + f"Shapes: {np_array_shape} and {other_side_as_array.shape}", + ] + + number_of_elements = self.expected.size + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for index in itertools.product(*(range(i) for i in np_array_shape)): + approx_value = get_value_from_nested_list(approx_side_as_seq, index) + other_value = get_value_from_nested_list(other_side_as_array, index) + if approx_value != other_value: + abs_diff = abs(approx_value.expected - other_value) + max_abs_diff = max(max_abs_diff, abs_diff) + if other_value == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) + different_ids.append(index) + + message_data = [ + ( + str(index), + str(get_value_from_nested_list(other_side_as_array, index)), + str(get_value_from_nested_list(approx_side_as_seq, index)), + ) + for index in different_ids + ] + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + import numpy as np + + # self.expected is supposed to always be an array here. + + if not np.isscalar(actual): + try: + actual = np.asarray(actual) + except Exception as e: + raise TypeError(f"cannot compare '{actual}' to numpy.ndarray") from e + + if not np.isscalar(actual) and actual.shape != self.expected.shape: + return False + + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + import numpy as np + + # `actual` can either be a numpy array or a scalar, it is treated in + # `__eq__` before being passed to `ApproxBase.__eq__`, which is the + # only method that calls this one. + + if np.isscalar(actual): + for i in np.ndindex(self.expected.shape): + yield actual, self.expected[i].item() + else: + for i in np.ndindex(self.expected.shape): + yield actual[i].item(), self.expected[i].item() + + +class ApproxMapping(ApproxBase): + """Perform approximate comparisons where the expected value is a mapping + with numeric values (the keys can be anything).""" + + def __repr__(self) -> str: + return f"approx({ ({k: self._approx_scalar(v) for k, v in self.expected.items()})!r})" + + def _repr_compare(self, other_side: Mapping[object, float]) -> list[str]: + import math + + if len(self.expected) != len(other_side): + return [ + "Impossible to compare mappings with different sizes.", + f"Lengths: {len(self.expected)} and {len(other_side)}", + ] + + if self.expected.keys() != other_side.keys(): + return [ + "comparison failed.", + f"Mappings has different keys: expected {self.expected.keys()} but got {other_side.keys()}", + ] + + approx_side_as_map = { + k: self._approx_scalar(v) for k, v in self.expected.items() + } + + number_of_elements = len(approx_side_as_map) + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for approx_key, approx_value in approx_side_as_map.items(): + other_value = other_side[approx_key] + if approx_value != other_value: + if approx_value.expected is not None and other_value is not None: + try: + max_abs_diff = max( + max_abs_diff, abs(approx_value.expected - other_value) + ) + if approx_value.expected == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max( + max_rel_diff, + abs( + (approx_value.expected - other_value) + / approx_value.expected + ), + ) + except ZeroDivisionError: + pass + different_ids.append(approx_key) + + message_data = [ + (str(key), str(other_side[key]), str(approx_side_as_map[key])) + for key in different_ids + ] + + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + try: + if set(actual.keys()) != set(self.expected.keys()): + return False + except AttributeError: + return False + + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + for k in self.expected.keys(): + yield actual[k], self.expected[k] + + def _check_type(self) -> None: + __tracebackhide__ = True + for key, value in self.expected.items(): + if isinstance(value, type(self.expected)): + msg = "pytest.approx() does not support nested dictionaries: key={!r} value={!r}\n full mapping={}" + raise TypeError(msg.format(key, value, pprint.pformat(self.expected))) + + +class ApproxSequenceLike(ApproxBase): + """Perform approximate comparisons where the expected value is a sequence of numbers.""" + + def __repr__(self) -> str: + seq_type = type(self.expected) + if seq_type not in (tuple, list): + seq_type = list + return f"approx({seq_type(self._approx_scalar(x) for x in self.expected)!r})" + + def _repr_compare(self, other_side: Sequence[float]) -> list[str]: + import math + + if len(self.expected) != len(other_side): + return [ + "Impossible to compare lists with different sizes.", + f"Lengths: {len(self.expected)} and {len(other_side)}", + ] + + approx_side_as_map = _recursive_sequence_map(self._approx_scalar, self.expected) + + number_of_elements = len(approx_side_as_map) + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for i, (approx_value, other_value) in enumerate( + zip(approx_side_as_map, other_side, strict=True) + ): + if approx_value != other_value: + try: + abs_diff = abs(approx_value.expected - other_value) + max_abs_diff = max(max_abs_diff, abs_diff) + # Ignore non-numbers for the diff calculations (#13012). + except TypeError: + pass + else: + if other_value == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) + different_ids.append(i) + message_data = [ + (str(i), str(other_side[i]), str(approx_side_as_map[i])) + for i in different_ids + ] + + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + try: + if len(actual) != len(self.expected): + return False + except TypeError: + return False + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + return zip(actual, self.expected, strict=True) + + def _check_type(self) -> None: + __tracebackhide__ = True + for index, x in enumerate(self.expected): + if isinstance(x, type(self.expected)): + msg = "pytest.approx() does not support nested data structures: {!r} at index {}\n full sequence: {}" + raise TypeError(msg.format(x, index, pprint.pformat(self.expected))) + + +class ApproxScalar(ApproxBase): + """Perform approximate comparisons where the expected value is a single number.""" + + # Using Real should be better than this Union, but not possible yet: + # https://github.com/python/typeshed/pull/3108 + DEFAULT_ABSOLUTE_TOLERANCE: float | Decimal = 1e-12 + DEFAULT_RELATIVE_TOLERANCE: float | Decimal = 1e-6 + + def __repr__(self) -> str: + """Return a string communicating both the expected value and the + tolerance for the comparison being made. + + For example, ``1.0 ± 1e-6``, ``(3+4j) ± 5e-6 ∠ ±180°``. + """ + # Don't show a tolerance for values that aren't compared using + # tolerances, i.e. non-numerics and infinities. Need to call abs to + # handle complex numbers, e.g. (inf + 1j). + if ( + isinstance(self.expected, bool) + or (not isinstance(self.expected, Complex | Decimal)) + or math.isinf(abs(self.expected) or isinstance(self.expected, bool)) + ): + return str(self.expected) + + # If a sensible tolerance can't be calculated, self.tolerance will + # raise a ValueError. In this case, display '???'. + try: + if 1e-3 <= self.tolerance < 1e3: + vetted_tolerance = f"{self.tolerance:n}" + else: + vetted_tolerance = f"{self.tolerance:.1e}" + + if ( + isinstance(self.expected, Complex) + and self.expected.imag + and not math.isinf(self.tolerance) + ): + vetted_tolerance += " ∠ ±180°" + except ValueError: + vetted_tolerance = "???" + + return f"{self.expected} ± {vetted_tolerance}" + + def __eq__(self, actual) -> bool: + """Return whether the given value is equal to the expected value + within the pre-specified tolerance.""" + + def is_bool(val: Any) -> bool: + # Check if `val` is a native bool or numpy bool. + if isinstance(val, bool): + return True + if np := sys.modules.get("numpy"): + return isinstance(val, np.bool_) + return False + + asarray = _as_numpy_array(actual) + if asarray is not None: + # Call ``__eq__()`` manually to prevent infinite-recursion with + # numpy<1.13. See #3748. + return all(self.__eq__(a) for a in asarray.flat) + + # Short-circuit exact equality, except for bool and np.bool_ + if is_bool(self.expected) and not is_bool(actual): + return False + elif actual == self.expected: + return True + + # If either type is non-numeric, fall back to strict equality. + # NB: we need Complex, rather than just Number, to ensure that __abs__, + # __sub__, and __float__ are defined. Also, consider bool to be + # non-numeric, even though it has the required arithmetic. + if is_bool(self.expected) or not ( + isinstance(self.expected, Complex | Decimal) + and isinstance(actual, Complex | Decimal) + ): + return False + + # Allow the user to control whether NaNs are considered equal to each + # other or not. The abs() calls are for compatibility with complex + # numbers. + if math.isnan(abs(self.expected)): + return self.nan_ok and math.isnan(abs(actual)) + + # Infinity shouldn't be approximately equal to anything but itself, but + # if there's a relative tolerance, it will be infinite and infinity + # will seem approximately equal to everything. The equal-to-itself + # case would have been short circuited above, so here we can just + # return false if the expected value is infinite. The abs() call is + # for compatibility with complex numbers. + if math.isinf(abs(self.expected)): + return False + + # Return true if the two numbers are within the tolerance. + result: bool = abs(self.expected - actual) <= self.tolerance + return result + + __hash__ = None + + @property + def tolerance(self): + """Return the tolerance for the comparison. + + This could be either an absolute tolerance or a relative tolerance, + depending on what the user specified or which would be larger. + """ + + def set_default(x, default): + return x if x is not None else default + + # Figure out what the absolute tolerance should be. ``self.abs`` is + # either None or a value specified by the user. + absolute_tolerance = set_default(self.abs, self.DEFAULT_ABSOLUTE_TOLERANCE) + + if absolute_tolerance < 0: + raise ValueError( + f"absolute tolerance can't be negative: {absolute_tolerance}" + ) + if math.isnan(absolute_tolerance): + raise ValueError("absolute tolerance can't be NaN.") + + # If the user specified an absolute tolerance but not a relative one, + # just return the absolute tolerance. + if self.rel is None: + if self.abs is not None: + return absolute_tolerance + + # Figure out what the relative tolerance should be. ``self.rel`` is + # either None or a value specified by the user. This is done after + # we've made sure the user didn't ask for an absolute tolerance only, + # because we don't want to raise errors about the relative tolerance if + # we aren't even going to use it. + relative_tolerance = set_default( + self.rel, self.DEFAULT_RELATIVE_TOLERANCE + ) * abs(self.expected) + + if relative_tolerance < 0: + raise ValueError( + f"relative tolerance can't be negative: {relative_tolerance}" + ) + if math.isnan(relative_tolerance): + raise ValueError("relative tolerance can't be NaN.") + + # Return the larger of the relative and absolute tolerances. + return max(relative_tolerance, absolute_tolerance) + + +class ApproxDecimal(ApproxScalar): + """Perform approximate comparisons where the expected value is a Decimal.""" + + DEFAULT_ABSOLUTE_TOLERANCE = Decimal("1e-12") + DEFAULT_RELATIVE_TOLERANCE = Decimal("1e-6") + + def __repr__(self) -> str: + if isinstance(self.rel, float): + rel = Decimal.from_float(self.rel) + else: + rel = self.rel + + if isinstance(self.abs, float): + abs_ = Decimal.from_float(self.abs) + else: + abs_ = self.abs + + tol_str = "???" + if rel is not None and Decimal("1e-3") <= rel <= Decimal("1e3"): + tol_str = f"{rel:.1e}" + elif abs_ is not None: + tol_str = f"{abs_:.1e}" + + return f"{self.expected} ± {tol_str}" + + +def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: + """Assert that two numbers (or two ordered sequences of numbers) are equal to each other + within some tolerance. + + Due to the :doc:`python:tutorial/floatingpoint`, numbers that we + would intuitively expect to be equal are not always so:: + + >>> 0.1 + 0.2 == 0.3 + False + + This problem is commonly encountered when writing tests, e.g. when making + sure that floating-point values are what you expect them to be. One way to + deal with this problem is to assert that two floating-point numbers are + equal to within some appropriate tolerance:: + + >>> abs((0.1 + 0.2) - 0.3) < 1e-6 + True + + However, comparisons like this are tedious to write and difficult to + understand. Furthermore, absolute comparisons like the one above are + usually discouraged because there's no tolerance that works well for all + situations. ``1e-6`` is good for numbers around ``1``, but too small for + very big numbers and too big for very small ones. It's better to express + the tolerance as a fraction of the expected value, but relative comparisons + like that are even more difficult to write correctly and concisely. + + The ``approx`` class performs floating-point comparisons using a syntax + that's as intuitive as possible:: + + >>> from pytest import approx + >>> 0.1 + 0.2 == approx(0.3) + True + + The same syntax also works for ordered sequences of numbers:: + + >>> (0.1 + 0.2, 0.2 + 0.4) == approx((0.3, 0.6)) + True + + ``numpy`` arrays:: + + >>> import numpy as np # doctest: +SKIP + >>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6])) # doctest: +SKIP + True + + And for a ``numpy`` array against a scalar:: + + >>> import numpy as np # doctest: +SKIP + >>> np.array([0.1, 0.2]) + np.array([0.2, 0.1]) == approx(0.3) # doctest: +SKIP + True + + Only ordered sequences are supported, because ``approx`` needs + to infer the relative position of the sequences without ambiguity. This means + ``sets`` and other unordered sequences are not supported. + + Finally, dictionary *values* can also be compared:: + + >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) + True + + The comparison will be true if both mappings have the same keys and their + respective values match the expected tolerances. + + **Tolerances** + + By default, ``approx`` considers numbers within a relative tolerance of + ``1e-6`` (i.e. one part in a million) of its expected value to be equal. + This treatment would lead to surprising results if the expected value was + ``0.0``, because nothing but ``0.0`` itself is relatively close to ``0.0``. + To handle this case less surprisingly, ``approx`` also considers numbers + within an absolute tolerance of ``1e-12`` of its expected value to be + equal. Infinity and NaN are special cases. Infinity is only considered + equal to itself, regardless of the relative tolerance. NaN is not + considered equal to anything by default, but you can make it be equal to + itself by setting the ``nan_ok`` argument to True. (This is meant to + facilitate comparing arrays that use NaN to mean "no data".) + + Both the relative and absolute tolerances can be changed by passing + arguments to the ``approx`` constructor:: + + >>> 1.0001 == approx(1) + False + >>> 1.0001 == approx(1, rel=1e-3) + True + >>> 1.0001 == approx(1, abs=1e-3) + True + + If you specify ``abs`` but not ``rel``, the comparison will not consider + the relative tolerance at all. In other words, two numbers that are within + the default relative tolerance of ``1e-6`` will still be considered unequal + if they exceed the specified absolute tolerance. If you specify both + ``abs`` and ``rel``, the numbers will be considered equal if either + tolerance is met:: + + >>> 1 + 1e-8 == approx(1) + True + >>> 1 + 1e-8 == approx(1, abs=1e-12) + False + >>> 1 + 1e-8 == approx(1, rel=1e-6, abs=1e-12) + True + + **Non-numeric types** + + You can also use ``approx`` to compare non-numeric types, or dicts and + sequences containing non-numeric types, in which case it falls back to + strict equality. This can be useful for comparing dicts and sequences that + can contain optional values:: + + >>> {"required": 1.0000005, "optional": None} == approx({"required": 1, "optional": None}) + True + >>> [None, 1.0000005] == approx([None,1]) + True + >>> ["foo", 1.0000005] == approx([None,1]) + False + + If you're thinking about using ``approx``, then you might want to know how + it compares to other good ways of comparing floating-point numbers. All of + these algorithms are based on relative and absolute tolerances and should + agree for the most part, but they do have meaningful differences: + + - ``math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0)``: True if the relative + tolerance is met w.r.t. either ``a`` or ``b`` or if the absolute + tolerance is met. Because the relative tolerance is calculated w.r.t. + both ``a`` and ``b``, this test is symmetric (i.e. neither ``a`` nor + ``b`` is a "reference value"). You have to specify an absolute tolerance + if you want to compare to ``0.0`` because there is no tolerance by + default. More information: :py:func:`math.isclose`. + + - ``numpy.isclose(a, b, rtol=1e-5, atol=1e-8)``: True if the difference + between ``a`` and ``b`` is less that the sum of the relative tolerance + w.r.t. ``b`` and the absolute tolerance. Because the relative tolerance + is only calculated w.r.t. ``b``, this test is asymmetric and you can + think of ``b`` as the reference value. Support for comparing sequences + is provided by :py:func:`numpy.allclose`. More information: + :std:doc:`numpy:reference/generated/numpy.isclose`. + + - ``unittest.TestCase.assertAlmostEqual(a, b)``: True if ``a`` and ``b`` + are within an absolute tolerance of ``1e-7``. No relative tolerance is + considered , so this function is not appropriate for very large or very + small numbers. Also, it's only available in subclasses of ``unittest.TestCase`` + and it's ugly because it doesn't follow PEP8. More information: + :py:meth:`unittest.TestCase.assertAlmostEqual`. + + - ``a == pytest.approx(b, rel=1e-6, abs=1e-12)``: True if the relative + tolerance is met w.r.t. ``b`` or if the absolute tolerance is met. + Because the relative tolerance is only calculated w.r.t. ``b``, this test + is asymmetric and you can think of ``b`` as the reference value. In the + special case that you explicitly specify an absolute tolerance but not a + relative tolerance, only the absolute tolerance is considered. + + .. note:: + + ``approx`` can handle numpy arrays, but we recommend the + specialised test helpers in :std:doc:`numpy:reference/routines.testing` + if you need support for comparisons, NaNs, or ULP-based tolerances. + + To match strings using regex, you can use + `Matches `_ + from the + `re_assert package `_. + + + .. note:: + + Unlike built-in equality, this function considers + booleans unequal to numeric zero or one. For example:: + + >>> 1 == approx(True) + False + + .. warning:: + + .. versionchanged:: 3.2 + + In order to avoid inconsistent behavior, :py:exc:`TypeError` is + raised for ``>``, ``>=``, ``<`` and ``<=`` comparisons. + The example below illustrates the problem:: + + assert approx(0.1) > 0.1 + 1e-10 # calls approx(0.1).__gt__(0.1 + 1e-10) + assert 0.1 + 1e-10 > approx(0.1) # calls approx(0.1).__lt__(0.1 + 1e-10) + + In the second example one expects ``approx(0.1).__le__(0.1 + 1e-10)`` + to be called. But instead, ``approx(0.1).__lt__(0.1 + 1e-10)`` is used to + comparison. This is because the call hierarchy of rich comparisons + follows a fixed behavior. More information: :py:meth:`object.__ge__` + + .. versionchanged:: 3.7.1 + ``approx`` raises ``TypeError`` when it encounters a dict value or + sequence element of non-numeric type. + + .. versionchanged:: 6.1.0 + ``approx`` falls back to strict equality for non-numeric types instead + of raising ``TypeError``. + """ + # Delegate the comparison to a class that knows how to deal with the type + # of the expected value (e.g. int, float, list, dict, numpy.array, etc). + # + # The primary responsibility of these classes is to implement ``__eq__()`` + # and ``__repr__()``. The former is used to actually check if some + # "actual" value is equivalent to the given expected value within the + # allowed tolerance. The latter is used to show the user the expected + # value and tolerance, in the case that a test failed. + # + # The actual logic for making approximate comparisons can be found in + # ApproxScalar, which is used to compare individual numbers. All of the + # other Approx classes eventually delegate to this class. The ApproxBase + # class provides some convenient methods and overloads, but isn't really + # essential. + + __tracebackhide__ = True + + if isinstance(expected, Decimal): + cls: type[ApproxBase] = ApproxDecimal + elif isinstance(expected, Mapping): + cls = ApproxMapping + elif _is_numpy_array(expected): + expected = _as_numpy_array(expected) + cls = ApproxNumpy + elif _is_sequence_like(expected): + cls = ApproxSequenceLike + elif isinstance(expected, Collection) and not isinstance(expected, str | bytes): + msg = f"pytest.approx() only supports ordered sequences, but got: {expected!r}" + raise TypeError(msg) + else: + cls = ApproxScalar + + return cls(expected, rel, abs, nan_ok) + + +def _is_sequence_like(expected: object) -> bool: + return ( + hasattr(expected, "__getitem__") + and isinstance(expected, Sized) + and not isinstance(expected, str | bytes) + ) + + +def _is_numpy_array(obj: object) -> bool: + """ + Return true if the given object is implicitly convertible to ndarray, + and numpy is already imported. + """ + return _as_numpy_array(obj) is not None + + +def _as_numpy_array(obj: object) -> ndarray | None: + """ + Return an ndarray if the given object is implicitly convertible to ndarray, + and numpy is already imported, otherwise None. + """ + np: Any = sys.modules.get("numpy") + if np is not None: + # avoid infinite recursion on numpy scalars, which have __array__ + if np.isscalar(obj): + return None + elif isinstance(obj, np.ndarray): + return obj + elif hasattr(obj, "__array__") or hasattr("obj", "__array_interface__"): + return np.asarray(obj) + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/raises.py b/micromamba_root/Lib/site-packages/_pytest/raises.py new file mode 100644 index 0000000000000000000000000000000000000000..7c246fde2802101ec6029dcdce8bd8322f674a64 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/raises.py @@ -0,0 +1,1517 @@ +from __future__ import annotations + +from abc import ABC +from abc import abstractmethod +import re +from re import Pattern +import sys +from textwrap import indent +from typing import Any +from typing import cast +from typing import final +from typing import Generic +from typing import get_args +from typing import get_origin +from typing import Literal +from typing import overload +from typing import TYPE_CHECKING +import warnings + +from _pytest._code import ExceptionInfo +from _pytest._code.code import stringify_exception +from _pytest.outcomes import fail +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + from collections.abc import Callable + from collections.abc import Sequence + + # for some reason Sphinx does not play well with 'from types import TracebackType' + import types + from typing import TypeGuard + + from typing_extensions import ParamSpec + from typing_extensions import TypeVar + + P = ParamSpec("P") + + # this conditional definition is because we want to allow a TypeVar default + BaseExcT_co_default = TypeVar( + "BaseExcT_co_default", + bound=BaseException, + default=BaseException, + covariant=True, + ) + + # Use short name because it shows up in docs. + E = TypeVar("E", bound=BaseException, default=BaseException) +else: + from typing import TypeVar + + BaseExcT_co_default = TypeVar( + "BaseExcT_co_default", bound=BaseException, covariant=True + ) + +# RaisesGroup doesn't work with a default. +BaseExcT_co = TypeVar("BaseExcT_co", bound=BaseException, covariant=True) +BaseExcT_1 = TypeVar("BaseExcT_1", bound=BaseException) +BaseExcT_2 = TypeVar("BaseExcT_2", bound=BaseException) +ExcT_1 = TypeVar("ExcT_1", bound=Exception) +ExcT_2 = TypeVar("ExcT_2", bound=Exception) + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + from exceptiongroup import ExceptionGroup + + +# String patterns default to including the unicode flag. +_REGEX_NO_FLAGS = re.compile(r"").flags + + +# pytest.raises helper +@overload +def raises( + expected_exception: type[E] | tuple[type[E], ...], + *, + match: str | re.Pattern[str] | None = ..., + check: Callable[[E], bool] = ..., +) -> RaisesExc[E]: ... + + +@overload +def raises( + *, + match: str | re.Pattern[str], + # If exception_type is not provided, check() must do any typechecks itself. + check: Callable[[BaseException], bool] = ..., +) -> RaisesExc[BaseException]: ... + + +@overload +def raises(*, check: Callable[[BaseException], bool]) -> RaisesExc[BaseException]: ... + + +@overload +def raises( + expected_exception: type[E] | tuple[type[E], ...], + func: Callable[..., Any], + *args: Any, + **kwargs: Any, +) -> ExceptionInfo[E]: ... + + +def raises( + expected_exception: type[E] | tuple[type[E], ...] | None = None, + *args: Any, + **kwargs: Any, +) -> RaisesExc[BaseException] | ExceptionInfo[E]: + r"""Assert that a code block/function call raises an exception type, or one of its subclasses. + + :param expected_exception: + The expected exception type, or a tuple if one of multiple possible + exception types are expected. Note that subclasses of the passed exceptions + will also match. + + This is not a required parameter, you may opt to only use ``match`` and/or + ``check`` for verifying the raised exception. + + :kwparam str | re.Pattern[str] | None match: + If specified, a string containing a regular expression, + or a regular expression object, that is tested against the string + representation of the exception and its :pep:`678` `__notes__` + using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. + + (This is only used when ``pytest.raises`` is used as a context manager, + and passed through to the function otherwise. + When using ``pytest.raises`` as a function, you can use: + ``pytest.raises(Exc, func, match="passed on").match("my pattern")``.) + + :kwparam Callable[[BaseException], bool] check: + + .. versionadded:: 8.4 + + If specified, a callable that will be called with the exception as a parameter + after checking the type and the match regex if specified. + If it returns ``True`` it will be considered a match, if not it will + be considered a failed match. + + + Use ``pytest.raises`` as a context manager, which will capture the exception of the given + type, or any of its subclasses:: + + >>> import pytest + >>> with pytest.raises(ZeroDivisionError): + ... 1/0 + + If the code block does not raise the expected exception (:class:`ZeroDivisionError` in the example + above), or no exception at all, the check will fail instead. + + You can also use the keyword argument ``match`` to assert that the + exception matches a text or regex:: + + >>> with pytest.raises(ValueError, match='must be 0 or None'): + ... raise ValueError("value must be 0 or None") + + >>> with pytest.raises(ValueError, match=r'must be \d+$'): + ... raise ValueError("value must be 42") + + The ``match`` argument searches the formatted exception string, which includes any + `PEP-678 `__ ``__notes__``: + + >>> with pytest.raises(ValueError, match=r"had a note added"): # doctest: +SKIP + ... e = ValueError("value must be 42") + ... e.add_note("had a note added") + ... raise e + + The ``check`` argument, if provided, must return True when passed the raised exception + for the match to be successful, otherwise an :exc:`AssertionError` is raised. + + >>> import errno + >>> with pytest.raises(OSError, check=lambda e: e.errno == errno.EACCES): + ... raise OSError(errno.EACCES, "no permission to view") + + The context manager produces an :class:`ExceptionInfo` object which can be used to inspect the + details of the captured exception:: + + >>> with pytest.raises(ValueError) as exc_info: + ... raise ValueError("value must be 42") + >>> assert exc_info.type is ValueError + >>> assert exc_info.value.args[0] == "value must be 42" + + .. warning:: + + Given that ``pytest.raises`` matches subclasses, be wary of using it to match :class:`Exception` like this:: + + # Careful, this will catch ANY exception raised. + with pytest.raises(Exception): + some_function() + + Because :class:`Exception` is the base class of almost all exceptions, it is easy for this to hide + real bugs, where the user wrote this expecting a specific exception, but some other exception is being + raised due to a bug introduced during a refactoring. + + Avoid using ``pytest.raises`` to catch :class:`Exception` unless certain that you really want to catch + **any** exception raised. + + .. note:: + + When using ``pytest.raises`` as a context manager, it's worthwhile to + note that normal context manager rules apply and that the exception + raised *must* be the final line in the scope of the context manager. + Lines of code after that, within the scope of the context manager will + not be executed. For example:: + + >>> value = 15 + >>> with pytest.raises(ValueError) as exc_info: + ... if value > 10: + ... raise ValueError("value must be <= 10") + ... assert exc_info.type is ValueError # This will not execute. + + Instead, the following approach must be taken (note the difference in + scope):: + + >>> with pytest.raises(ValueError) as exc_info: + ... if value > 10: + ... raise ValueError("value must be <= 10") + ... + >>> assert exc_info.type is ValueError + + **Expecting exception groups** + + When expecting exceptions wrapped in :exc:`BaseExceptionGroup` or + :exc:`ExceptionGroup`, you should instead use :class:`pytest.RaisesGroup`. + + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` + it is possible to parametrize tests such that + some runs raise an exception and others do not. + + See :ref:`parametrizing_conditional_raising` for an example. + + .. seealso:: + + :ref:`assertraises` for more examples and detailed discussion. + + **Legacy form** + + It is possible to specify a callable by passing a to-be-called lambda:: + + >>> raises(ZeroDivisionError, lambda: 1/0) + + + or you can specify an arbitrary callable with arguments:: + + >>> def f(x): return 1/x + ... + >>> raises(ZeroDivisionError, f, 0) + + >>> raises(ZeroDivisionError, f, x=0) + + + The form above is fully supported but discouraged for new code because the + context manager form is regarded as more readable and less error-prone. + + .. note:: + Similar to caught exception objects in Python, explicitly clearing + local references to returned ``ExceptionInfo`` objects can + help the Python interpreter speed up its garbage collection. + + Clearing those references breaks a reference cycle + (``ExceptionInfo`` --> caught exception --> frame stack raising + the exception --> current frame stack --> local variables --> + ``ExceptionInfo``) which makes Python keep all objects referenced + from that cycle (including all local variables in the current + frame) alive until the next cyclic garbage collection run. + More detailed information can be found in the official Python + documentation for :ref:`the try statement `. + """ + __tracebackhide__ = True + + if not args: + if set(kwargs) - {"match", "check", "expected_exception"}: + msg = "Unexpected keyword arguments passed to pytest.raises: " + msg += ", ".join(sorted(kwargs)) + msg += "\nUse context-manager form instead?" + raise TypeError(msg) + + if expected_exception is None: + return RaisesExc(**kwargs) + return RaisesExc(expected_exception, **kwargs) + + if not expected_exception: + raise ValueError( + f"Expected an exception type or a tuple of exception types, but got `{expected_exception!r}`. " + f"Raising exceptions is already understood as failing the test, so you don't need " + f"any special code to say 'this should never raise an exception'." + ) + func = args[0] + if not callable(func): + raise TypeError(f"{func!r} object (type: {type(func)}) must be callable") + with RaisesExc(expected_exception) as excinfo: + func(*args[1:], **kwargs) + try: + return excinfo + finally: + del excinfo + + +# note: RaisesExc/RaisesGroup uses fail() internally, so this alias +# indicates (to [internal] plugins?) that `pytest.raises` will +# raise `_pytest.outcomes.Failed`, where +# `outcomes.Failed is outcomes.fail.Exception is raises.Exception` +# note: this is *not* the same as `_pytest.main.Failed` +# note: mypy does not recognize this attribute, and it's not possible +# to use a protocol/decorator like the others in outcomes due to +# https://github.com/python/mypy/issues/18715 +raises.Exception = fail.Exception # type: ignore[attr-defined] + + +def _match_pattern(match: Pattern[str]) -> str | Pattern[str]: + """Helper function to remove redundant `re.compile` calls when printing regex""" + return match.pattern if match.flags == _REGEX_NO_FLAGS else match + + +def repr_callable(fun: Callable[[BaseExcT_1], bool]) -> str: + """Get the repr of a ``check`` parameter. + + Split out so it can be monkeypatched (e.g. by hypothesis) + """ + return repr(fun) + + +def backquote(s: str) -> str: + return "`" + s + "`" + + +def _exception_type_name( + e: type[BaseException] | tuple[type[BaseException], ...], +) -> str: + if isinstance(e, type): + return e.__name__ + if len(e) == 1: + return e[0].__name__ + return "(" + ", ".join(ee.__name__ for ee in e) + ")" + + +def _check_raw_type( + expected_type: type[BaseException] | tuple[type[BaseException], ...] | None, + exception: BaseException, +) -> str | None: + if expected_type is None or expected_type == (): + return None + + if not isinstance( + exception, + expected_type, + ): + actual_type_str = backquote(_exception_type_name(type(exception)) + "()") + expected_type_str = backquote(_exception_type_name(expected_type)) + if ( + isinstance(exception, BaseExceptionGroup) + and isinstance(expected_type, type) + and not issubclass(expected_type, BaseExceptionGroup) + ): + return f"Unexpected nested {actual_type_str}, expected {expected_type_str}" + return f"{actual_type_str} is not an instance of {expected_type_str}" + return None + + +def is_fully_escaped(s: str) -> bool: + # we know we won't compile with re.VERBOSE, so whitespace doesn't need to be escaped + metacharacters = "{}()+.*?^$[]" + return not any( + c in metacharacters and (i == 0 or s[i - 1] != "\\") for (i, c) in enumerate(s) + ) + + +def unescape(s: str) -> str: + return re.sub(r"\\([{}()+-.*?^$\[\]\s\\])", r"\1", s) + + +# These classes conceptually differ from ExceptionInfo in that ExceptionInfo is tied, and +# constructed from, a particular exception - whereas these are constructed with expected +# exceptions, and later allow matching towards particular exceptions. +# But there's overlap in `ExceptionInfo.match` and `AbstractRaises._check_match`, as with +# `AbstractRaises.matches` and `ExceptionInfo.errisinstance`+`ExceptionInfo.group_contains`. +# The interaction between these classes should perhaps be improved. +class AbstractRaises(ABC, Generic[BaseExcT_co]): + """ABC with common functionality shared between RaisesExc and RaisesGroup""" + + def __init__( + self, + *, + match: str | Pattern[str] | None, + check: Callable[[BaseExcT_co], bool] | None, + ) -> None: + if isinstance(match, str): + # juggle error in order to avoid context to fail (necessary?) + re_error = None + try: + self.match: Pattern[str] | None = re.compile(match) + except re.error as e: + re_error = e + if re_error is not None: + fail(f"Invalid regex pattern provided to 'match': {re_error}") + if match == "": + warnings.warn( + PytestWarning( + "matching against an empty string will *always* pass. If you want " + "to check for an empty message you need to pass '^$'. If you don't " + "want to match you should pass `None` or leave out the parameter." + ), + stacklevel=2, + ) + else: + self.match = match + + # check if this is a fully escaped regex and has ^$ to match fully + # in which case we can do a proper diff on error + self.rawmatch: str | None = None + if isinstance(match, str) or ( + isinstance(match, Pattern) and match.flags == _REGEX_NO_FLAGS + ): + if isinstance(match, Pattern): + match = match.pattern + if ( + match + and match[0] == "^" + and match[-1] == "$" + and is_fully_escaped(match[1:-1]) + ): + self.rawmatch = unescape(match[1:-1]) + + self.check = check + self._fail_reason: str | None = None + + # used to suppress repeated printing of `repr(self.check)` + self._nested: bool = False + + # set in self._parse_exc + self.is_baseexception = False + + def _parse_exc( + self, exc: type[BaseExcT_1] | types.GenericAlias, expected: str + ) -> type[BaseExcT_1]: + if isinstance(exc, type) and issubclass(exc, BaseException): + if not issubclass(exc, Exception): + self.is_baseexception = True + return exc + # because RaisesGroup does not support variable number of exceptions there's + # still a use for RaisesExc(ExceptionGroup[Exception]). + origin_exc: type[BaseException] | None = get_origin(exc) + if origin_exc and issubclass(origin_exc, BaseExceptionGroup): + exc_type = get_args(exc)[0] + if ( + issubclass(origin_exc, ExceptionGroup) and exc_type in (Exception, Any) + ) or ( + issubclass(origin_exc, BaseExceptionGroup) + and exc_type in (BaseException, Any) + ): + if not issubclass(origin_exc, ExceptionGroup): + self.is_baseexception = True + return cast(type[BaseExcT_1], origin_exc) + else: + raise ValueError( + f"Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseException]` " + f"are accepted as generic types but got `{exc}`. " + f"As `raises` will catch all instances of the specified group regardless of the " + f"generic argument specific nested exceptions has to be checked " + f"with `RaisesGroup`." + ) + # unclear if the Type/ValueError distinction is even helpful here + msg = f"Expected {expected}, but got " + if isinstance(exc, type): # type: ignore[unreachable] + raise ValueError(msg + f"{exc.__name__!r}") + if isinstance(exc, BaseException): # type: ignore[unreachable] + raise TypeError(msg + f"an exception instance: {type(exc).__name__}") + raise TypeError(msg + repr(type(exc).__name__)) + + @property + def fail_reason(self) -> str | None: + """Set after a call to :meth:`matches` to give a human-readable reason for why the match failed. + When used as a context manager the string will be printed as the reason for the + test failing.""" + return self._fail_reason + + def _check_check( + self: AbstractRaises[BaseExcT_1], + exception: BaseExcT_1, + ) -> bool: + if self.check is None: + return True + + if self.check(exception): + return True + + check_repr = "" if self._nested else " " + repr_callable(self.check) + self._fail_reason = f"check{check_repr} did not return True" + return False + + # TODO: harmonize with ExceptionInfo.match + def _check_match(self, e: BaseException) -> bool: + if self.match is None or re.search( + self.match, + stringified_exception := stringify_exception( + e, include_subexception_msg=False + ), + ): + return True + + # if we're matching a group, make sure we're explicit to reduce confusion + # if they're trying to match an exception contained within the group + maybe_specify_type = ( + f" the `{_exception_type_name(type(e))}()`" + if isinstance(e, BaseExceptionGroup) + else "" + ) + if isinstance(self.rawmatch, str): + # TODO: it instructs to use `-v` to print leading text, but that doesn't work + # I also don't know if this is the proper entry point, or tool to use at all + from _pytest.assertion.util import _diff_text + from _pytest.assertion.util import dummy_highlighter + + diff = _diff_text(self.rawmatch, stringified_exception, dummy_highlighter) + self._fail_reason = ("\n" if diff[0][0] == "-" else "") + "\n".join(diff) + return False + + self._fail_reason = ( + f"Regex pattern did not match{maybe_specify_type}.\n" + f" Expected regex: {_match_pattern(self.match)!r}\n" + f" Actual message: {stringified_exception!r}" + ) + if _match_pattern(self.match) == stringified_exception: + self._fail_reason += "\n Did you mean to `re.escape()` the regex?" + return False + + @abstractmethod + def matches( + self: AbstractRaises[BaseExcT_1], exception: BaseException + ) -> TypeGuard[BaseExcT_1]: + """Check if an exception matches the requirements of this AbstractRaises. + If it fails, :meth:`AbstractRaises.fail_reason` should be set. + """ + + +@final +class RaisesExc(AbstractRaises[BaseExcT_co_default]): + """ + .. versionadded:: 8.4 + + + This is the class constructed when calling :func:`pytest.raises`, but may be used + directly as a helper class with :class:`RaisesGroup` when you want to specify + requirements on sub-exceptions. + + You don't need this if you only want to specify the type, since :class:`RaisesGroup` + accepts ``type[BaseException]``. + + :param type[BaseException] | tuple[type[BaseException]] | None expected_exception: + The expected type, or one of several possible types. + May be ``None`` in order to only make use of ``match`` and/or ``check`` + + The type is checked with :func:`isinstance`, and does not need to be an exact match. + If that is wanted you can use the ``check`` parameter. + + :kwparam str | Pattern[str] match: + A regex to match. + + :kwparam Callable[[BaseException], bool] check: + If specified, a callable that will be called with the exception as a parameter + after checking the type and the match regex if specified. + If it returns ``True`` it will be considered a match, if not it will + be considered a failed match. + + :meth:`RaisesExc.matches` can also be used standalone to check individual exceptions. + + Examples:: + + with RaisesGroup(RaisesExc(ValueError, match="string")) + ... + with RaisesGroup(RaisesExc(check=lambda x: x.args == (3, "hello"))): + ... + with RaisesGroup(RaisesExc(check=lambda x: type(x) is ValueError)): + ... + """ + + # Trio bundled hypothesis monkeypatching, we will probably instead assume that + # hypothesis will handle that in their pytest plugin by the time this is released. + # Alternatively we could add a version of get_pretty_function_description ourselves + # https://github.com/HypothesisWorks/hypothesis/blob/8ced2f59f5c7bea3344e35d2d53e1f8f8eb9fcd8/hypothesis-python/src/hypothesis/internal/reflection.py#L439 + + # At least one of the three parameters must be passed. + @overload + def __init__( + self, + expected_exception: ( + type[BaseExcT_co_default] | tuple[type[BaseExcT_co_default], ...] + ), + /, + *, + match: str | Pattern[str] | None = ..., + check: Callable[[BaseExcT_co_default], bool] | None = ..., + ) -> None: ... + + @overload + def __init__( + self: RaisesExc[BaseException], # Give E a value. + /, + *, + match: str | Pattern[str] | None, + # If exception_type is not provided, check() must do any typechecks itself. + check: Callable[[BaseException], bool] | None = ..., + ) -> None: ... + + @overload + def __init__(self, /, *, check: Callable[[BaseException], bool]) -> None: ... + + def __init__( + self, + expected_exception: ( + type[BaseExcT_co_default] | tuple[type[BaseExcT_co_default], ...] | None + ) = None, + /, + *, + match: str | Pattern[str] | None = None, + check: Callable[[BaseExcT_co_default], bool] | None = None, + ): + super().__init__(match=match, check=check) + if isinstance(expected_exception, tuple): + expected_exceptions = expected_exception + elif expected_exception is None: + expected_exceptions = () + else: + expected_exceptions = (expected_exception,) + + if (expected_exceptions == ()) and match is None and check is None: + raise ValueError("You must specify at least one parameter to match on.") + + self.expected_exceptions = tuple( + self._parse_exc(e, expected="a BaseException type") + for e in expected_exceptions + ) + + self._just_propagate = False + + def matches( + self, + exception: BaseException | None, + ) -> TypeGuard[BaseExcT_co_default]: + """Check if an exception matches the requirements of this :class:`RaisesExc`. + If it fails, :attr:`RaisesExc.fail_reason` will be set. + + Examples:: + + assert RaisesExc(ValueError).matches(my_exception): + # is equivalent to + assert isinstance(my_exception, ValueError) + + # this can be useful when checking e.g. the ``__cause__`` of an exception. + with pytest.raises(ValueError) as excinfo: + ... + assert RaisesExc(SyntaxError, match="foo").matches(excinfo.value.__cause__) + # above line is equivalent to + assert isinstance(excinfo.value.__cause__, SyntaxError) + assert re.search("foo", str(excinfo.value.__cause__) + + """ + self._just_propagate = False + if exception is None: + self._fail_reason = "exception is None" + return False + if not self._check_type(exception): + self._just_propagate = True + return False + + if not self._check_match(exception): + return False + + return self._check_check(exception) + + def __repr__(self) -> str: + parameters = [] + if self.expected_exceptions: + parameters.append(_exception_type_name(self.expected_exceptions)) + if self.match is not None: + # If no flags were specified, discard the redundant re.compile() here. + parameters.append( + f"match={_match_pattern(self.match)!r}", + ) + if self.check is not None: + parameters.append(f"check={repr_callable(self.check)}") + return f"RaisesExc({', '.join(parameters)})" + + def _check_type(self, exception: BaseException) -> TypeGuard[BaseExcT_co_default]: + self._fail_reason = _check_raw_type(self.expected_exceptions, exception) + return self._fail_reason is None + + def __enter__(self) -> ExceptionInfo[BaseExcT_co_default]: + self.excinfo: ExceptionInfo[BaseExcT_co_default] = ExceptionInfo.for_later() + return self.excinfo + + # TODO: move common code into superclass + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: types.TracebackType | None, + ) -> bool: + __tracebackhide__ = True + if exc_type is None: + if not self.expected_exceptions: + fail("DID NOT RAISE any exception") + if len(self.expected_exceptions) > 1: + fail(f"DID NOT RAISE any of {self.expected_exceptions!r}") + + fail(f"DID NOT RAISE {self.expected_exceptions[0]!r}") + + assert self.excinfo is not None, ( + "Internal error - should have been constructed in __enter__" + ) + + if not self.matches(exc_val): + if self._just_propagate: + return False + raise AssertionError(self._fail_reason) + + # Cast to narrow the exception type now that it's verified.... + # even though the TypeGuard in self.matches should be narrowing + exc_info = cast( + "tuple[type[BaseExcT_co_default], BaseExcT_co_default, types.TracebackType]", + (exc_type, exc_val, exc_tb), + ) + self.excinfo.fill_unfilled(exc_info) + return True + + +@final +class RaisesGroup(AbstractRaises[BaseExceptionGroup[BaseExcT_co]]): + """ + .. versionadded:: 8.4 + + Contextmanager for checking for an expected :exc:`ExceptionGroup`. + This works similar to :func:`pytest.raises`, but allows for specifying the structure of an :exc:`ExceptionGroup`. + :meth:`ExceptionInfo.group_contains` also tries to handle exception groups, + but it is very bad at checking that you *didn't* get unexpected exceptions. + + The catching behaviour differs from :ref:`except* `, being much + stricter about the structure by default. + By using ``allow_unwrapped=True`` and ``flatten_subgroups=True`` you can match + :ref:`except* ` fully when expecting a single exception. + + :param args: + Any number of exception types, :class:`RaisesGroup` or :class:`RaisesExc` + to specify the exceptions contained in this exception. + All specified exceptions must be present in the raised group, *and no others*. + + If you expect a variable number of exceptions you need to use + :func:`pytest.raises(ExceptionGroup) ` and manually check + the contained exceptions. Consider making use of :meth:`RaisesExc.matches`. + + It does not care about the order of the exceptions, so + ``RaisesGroup(ValueError, TypeError)`` + is equivalent to + ``RaisesGroup(TypeError, ValueError)``. + :kwparam str | re.Pattern[str] | None match: + If specified, a string containing a regular expression, + or a regular expression object, that is tested against the string + representation of the exception group and its :pep:`678` `__notes__` + using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. + + Note that " (5 subgroups)" will be stripped from the ``repr`` before matching. + :kwparam Callable[[E], bool] check: + If specified, a callable that will be called with the group as a parameter + after successfully matching the expected exceptions. If it returns ``True`` + it will be considered a match, if not it will be considered a failed match. + :kwparam bool allow_unwrapped: + If expecting a single exception or :class:`RaisesExc` it will match even + if the exception is not inside an exceptiongroup. + + Using this together with ``match``, ``check`` or expecting multiple exceptions + will raise an error. + :kwparam bool flatten_subgroups: + "flatten" any groups inside the raised exception group, extracting all exceptions + inside any nested groups, before matching. Without this it expects you to + fully specify the nesting structure by passing :class:`RaisesGroup` as expected + parameter. + + Examples:: + + with RaisesGroup(ValueError): + raise ExceptionGroup("", (ValueError(),)) + # match + with RaisesGroup( + ValueError, + ValueError, + RaisesExc(TypeError, match="^expected int$"), + match="^my group$", + ): + raise ExceptionGroup( + "my group", + [ + ValueError(), + TypeError("expected int"), + ValueError(), + ], + ) + # check + with RaisesGroup( + KeyboardInterrupt, + match="^hello$", + check=lambda x: isinstance(x.__cause__, ValueError), + ): + raise BaseExceptionGroup("hello", [KeyboardInterrupt()]) from ValueError + # nested groups + with RaisesGroup(RaisesGroup(ValueError)): + raise ExceptionGroup("", (ExceptionGroup("", (ValueError(),)),)) + + # flatten_subgroups + with RaisesGroup(ValueError, flatten_subgroups=True): + raise ExceptionGroup("", (ExceptionGroup("", (ValueError(),)),)) + + # allow_unwrapped + with RaisesGroup(ValueError, allow_unwrapped=True): + raise ValueError + + + :meth:`RaisesGroup.matches` can also be used directly to check a standalone exception group. + + + The matching algorithm is greedy, which means cases such as this may fail:: + + with RaisesGroup(ValueError, RaisesExc(ValueError, match="hello")): + raise ExceptionGroup("", (ValueError("hello"), ValueError("goodbye"))) + + even though it generally does not care about the order of the exceptions in the group. + To avoid the above you should specify the first :exc:`ValueError` with a :class:`RaisesExc` as well. + + .. note:: + When raised exceptions don't match the expected ones, you'll get a detailed error + message explaining why. This includes ``repr(check)`` if set, which in Python can be + overly verbose, showing memory locations etc etc. + + If installed and imported (in e.g. ``conftest.py``), the ``hypothesis`` library will + monkeypatch this output to provide shorter & more readable repr's. + """ + + # allow_unwrapped=True requires: singular exception, exception not being + # RaisesGroup instance, match is None, check is None + @overload + def __init__( + self, + expected_exception: type[BaseExcT_co] | RaisesExc[BaseExcT_co], + /, + *, + allow_unwrapped: Literal[True], + flatten_subgroups: bool = False, + ) -> None: ... + + # flatten_subgroups = True also requires no nested RaisesGroup + @overload + def __init__( + self, + expected_exception: type[BaseExcT_co] | RaisesExc[BaseExcT_co], + /, + *other_exceptions: type[BaseExcT_co] | RaisesExc[BaseExcT_co], + flatten_subgroups: Literal[True], + match: str | Pattern[str] | None = None, + check: Callable[[BaseExceptionGroup[BaseExcT_co]], bool] | None = None, + ) -> None: ... + + # simplify the typevars if possible (the following 3 are equivalent but go simpler->complicated) + # ... the first handles RaisesGroup[ValueError], the second RaisesGroup[ExceptionGroup[ValueError]], + # the third RaisesGroup[ValueError | ExceptionGroup[ValueError]]. + # ... otherwise, we will get results like RaisesGroup[ValueError | ExceptionGroup[Never]] (I think) + # (technically correct but misleading) + @overload + def __init__( + self: RaisesGroup[ExcT_1], + expected_exception: type[ExcT_1] | RaisesExc[ExcT_1], + /, + *other_exceptions: type[ExcT_1] | RaisesExc[ExcT_1], + match: str | Pattern[str] | None = None, + check: Callable[[ExceptionGroup[ExcT_1]], bool] | None = None, + ) -> None: ... + + @overload + def __init__( + self: RaisesGroup[ExceptionGroup[ExcT_2]], + expected_exception: RaisesGroup[ExcT_2], + /, + *other_exceptions: RaisesGroup[ExcT_2], + match: str | Pattern[str] | None = None, + check: Callable[[ExceptionGroup[ExceptionGroup[ExcT_2]]], bool] | None = None, + ) -> None: ... + + @overload + def __init__( + self: RaisesGroup[ExcT_1 | ExceptionGroup[ExcT_2]], + expected_exception: type[ExcT_1] | RaisesExc[ExcT_1] | RaisesGroup[ExcT_2], + /, + *other_exceptions: type[ExcT_1] | RaisesExc[ExcT_1] | RaisesGroup[ExcT_2], + match: str | Pattern[str] | None = None, + check: ( + Callable[[ExceptionGroup[ExcT_1 | ExceptionGroup[ExcT_2]]], bool] | None + ) = None, + ) -> None: ... + + # same as the above 3 but handling BaseException + @overload + def __init__( + self: RaisesGroup[BaseExcT_1], + expected_exception: type[BaseExcT_1] | RaisesExc[BaseExcT_1], + /, + *other_exceptions: type[BaseExcT_1] | RaisesExc[BaseExcT_1], + match: str | Pattern[str] | None = None, + check: Callable[[BaseExceptionGroup[BaseExcT_1]], bool] | None = None, + ) -> None: ... + + @overload + def __init__( + self: RaisesGroup[BaseExceptionGroup[BaseExcT_2]], + expected_exception: RaisesGroup[BaseExcT_2], + /, + *other_exceptions: RaisesGroup[BaseExcT_2], + match: str | Pattern[str] | None = None, + check: ( + Callable[[BaseExceptionGroup[BaseExceptionGroup[BaseExcT_2]]], bool] | None + ) = None, + ) -> None: ... + + @overload + def __init__( + self: RaisesGroup[BaseExcT_1 | BaseExceptionGroup[BaseExcT_2]], + expected_exception: type[BaseExcT_1] + | RaisesExc[BaseExcT_1] + | RaisesGroup[BaseExcT_2], + /, + *other_exceptions: type[BaseExcT_1] + | RaisesExc[BaseExcT_1] + | RaisesGroup[BaseExcT_2], + match: str | Pattern[str] | None = None, + check: ( + Callable[ + [BaseExceptionGroup[BaseExcT_1 | BaseExceptionGroup[BaseExcT_2]]], + bool, + ] + | None + ) = None, + ) -> None: ... + + def __init__( + self: RaisesGroup[ExcT_1 | BaseExcT_1 | BaseExceptionGroup[BaseExcT_2]], + expected_exception: type[BaseExcT_1] + | RaisesExc[BaseExcT_1] + | RaisesGroup[BaseExcT_2], + /, + *other_exceptions: type[BaseExcT_1] + | RaisesExc[BaseExcT_1] + | RaisesGroup[BaseExcT_2], + allow_unwrapped: bool = False, + flatten_subgroups: bool = False, + match: str | Pattern[str] | None = None, + check: ( + Callable[[BaseExceptionGroup[BaseExcT_1]], bool] + | Callable[[ExceptionGroup[ExcT_1]], bool] + | None + ) = None, + ): + # The type hint on the `self` and `check` parameters uses different formats + # that are *very* hard to reconcile while adhering to the overloads, so we cast + # it to avoid an error when passing it to super().__init__ + check = cast( + "Callable[[BaseExceptionGroup[ExcT_1|BaseExcT_1|BaseExceptionGroup[BaseExcT_2]]], bool]", + check, + ) + super().__init__(match=match, check=check) + self.allow_unwrapped = allow_unwrapped + self.flatten_subgroups: bool = flatten_subgroups + self.is_baseexception = False + + if allow_unwrapped and other_exceptions: + raise ValueError( + "You cannot specify multiple exceptions with `allow_unwrapped=True.`" + " If you want to match one of multiple possible exceptions you should" + " use a `RaisesExc`." + " E.g. `RaisesExc(check=lambda e: isinstance(e, (...)))`", + ) + if allow_unwrapped and isinstance(expected_exception, RaisesGroup): + raise ValueError( + "`allow_unwrapped=True` has no effect when expecting a `RaisesGroup`." + " You might want it in the expected `RaisesGroup`, or" + " `flatten_subgroups=True` if you don't care about the structure.", + ) + if allow_unwrapped and (match is not None or check is not None): + raise ValueError( + "`allow_unwrapped=True` bypasses the `match` and `check` parameters" + " if the exception is unwrapped. If you intended to match/check the" + " exception you should use a `RaisesExc` object. If you want to match/check" + " the exceptiongroup when the exception *is* wrapped you need to" + " do e.g. `if isinstance(exc.value, ExceptionGroup):" + " assert RaisesGroup(...).matches(exc.value)` afterwards.", + ) + + self.expected_exceptions: tuple[ + type[BaseExcT_co] | RaisesExc[BaseExcT_co] | RaisesGroup[BaseException], ... + ] = tuple( + self._parse_excgroup(e, "a BaseException type, RaisesExc, or RaisesGroup") + for e in ( + expected_exception, + *other_exceptions, + ) + ) + + def _parse_excgroup( + self, + exc: ( + type[BaseExcT_co] + | types.GenericAlias + | RaisesExc[BaseExcT_1] + | RaisesGroup[BaseExcT_2] + ), + expected: str, + ) -> type[BaseExcT_co] | RaisesExc[BaseExcT_1] | RaisesGroup[BaseExcT_2]: + # verify exception type and set `self.is_baseexception` + if isinstance(exc, RaisesGroup): + if self.flatten_subgroups: + raise ValueError( + "You cannot specify a nested structure inside a RaisesGroup with" + " `flatten_subgroups=True`. The parameter will flatten subgroups" + " in the raised exceptiongroup before matching, which would never" + " match a nested structure.", + ) + self.is_baseexception |= exc.is_baseexception + exc._nested = True + return exc + elif isinstance(exc, RaisesExc): + self.is_baseexception |= exc.is_baseexception + exc._nested = True + return exc + elif isinstance(exc, tuple): + raise TypeError( + f"Expected {expected}, but got {type(exc).__name__!r}.\n" + "RaisesGroup does not support tuples of exception types when expecting one of " + "several possible exception types like RaisesExc.\n" + "If you meant to expect a group with multiple exceptions, list them as separate arguments." + ) + else: + return super()._parse_exc(exc, expected) + + @overload + def __enter__( + self: RaisesGroup[ExcT_1], + ) -> ExceptionInfo[ExceptionGroup[ExcT_1]]: ... + @overload + def __enter__( + self: RaisesGroup[BaseExcT_1], + ) -> ExceptionInfo[BaseExceptionGroup[BaseExcT_1]]: ... + + def __enter__(self) -> ExceptionInfo[BaseExceptionGroup[BaseException]]: + self.excinfo: ExceptionInfo[BaseExceptionGroup[BaseExcT_co]] = ( + ExceptionInfo.for_later() + ) + return self.excinfo + + def __repr__(self) -> str: + reqs = [ + e.__name__ if isinstance(e, type) else repr(e) + for e in self.expected_exceptions + ] + if self.allow_unwrapped: + reqs.append(f"allow_unwrapped={self.allow_unwrapped}") + if self.flatten_subgroups: + reqs.append(f"flatten_subgroups={self.flatten_subgroups}") + if self.match is not None: + # If no flags were specified, discard the redundant re.compile() here. + reqs.append(f"match={_match_pattern(self.match)!r}") + if self.check is not None: + reqs.append(f"check={repr_callable(self.check)}") + return f"RaisesGroup({', '.join(reqs)})" + + def _unroll_exceptions( + self, + exceptions: Sequence[BaseException], + ) -> Sequence[BaseException]: + """Used if `flatten_subgroups=True`.""" + res: list[BaseException] = [] + for exc in exceptions: + if isinstance(exc, BaseExceptionGroup): + res.extend(self._unroll_exceptions(exc.exceptions)) + + else: + res.append(exc) + return res + + @overload + def matches( + self: RaisesGroup[ExcT_1], + exception: BaseException | None, + ) -> TypeGuard[ExceptionGroup[ExcT_1]]: ... + @overload + def matches( + self: RaisesGroup[BaseExcT_1], + exception: BaseException | None, + ) -> TypeGuard[BaseExceptionGroup[BaseExcT_1]]: ... + + def matches( + self, + exception: BaseException | None, + ) -> bool: + """Check if an exception matches the requirements of this RaisesGroup. + If it fails, `RaisesGroup.fail_reason` will be set. + + Example:: + + with pytest.raises(TypeError) as excinfo: + ... + assert RaisesGroup(ValueError).matches(excinfo.value.__cause__) + # the above line is equivalent to + myexc = excinfo.value.__cause + assert isinstance(myexc, BaseExceptionGroup) + assert len(myexc.exceptions) == 1 + assert isinstance(myexc.exceptions[0], ValueError) + """ + self._fail_reason = None + if exception is None: + self._fail_reason = "exception is None" + return False + if not isinstance(exception, BaseExceptionGroup): + # we opt to only print type of the exception here, as the repr would + # likely be quite long + not_group_msg = f"`{type(exception).__name__}()` is not an exception group" + if len(self.expected_exceptions) > 1: + self._fail_reason = not_group_msg + return False + # if we have 1 expected exception, check if it would work even if + # allow_unwrapped is not set + res = self._check_expected(self.expected_exceptions[0], exception) + if res is None and self.allow_unwrapped: + return True + + if res is None: + self._fail_reason = ( + f"{not_group_msg}, but would match with `allow_unwrapped=True`" + ) + elif self.allow_unwrapped: + self._fail_reason = res + else: + self._fail_reason = not_group_msg + return False + + actual_exceptions: Sequence[BaseException] = exception.exceptions + if self.flatten_subgroups: + actual_exceptions = self._unroll_exceptions(actual_exceptions) + + if not self._check_match(exception): + self._fail_reason = cast(str, self._fail_reason) + old_reason = self._fail_reason + if ( + len(actual_exceptions) == len(self.expected_exceptions) == 1 + and isinstance(expected := self.expected_exceptions[0], type) + and isinstance(actual := actual_exceptions[0], expected) + and self._check_match(actual) + ): + assert self.match is not None, "can't be None if _check_match failed" + assert self._fail_reason is old_reason is not None + self._fail_reason += ( + f"\n" + f" but matched the expected `{self._repr_expected(expected)}`.\n" + f" You might want " + f"`RaisesGroup(RaisesExc({expected.__name__}, match={_match_pattern(self.match)!r}))`" + ) + else: + self._fail_reason = old_reason + return False + + # do the full check on expected exceptions + if not self._check_exceptions( + exception, + actual_exceptions, + ): + self._fail_reason = cast(str, self._fail_reason) + assert self._fail_reason is not None + old_reason = self._fail_reason + # if we're not expecting a nested structure, and there is one, do a second + # pass where we try flattening it + if ( + not self.flatten_subgroups + and not any( + isinstance(e, RaisesGroup) for e in self.expected_exceptions + ) + and any(isinstance(e, BaseExceptionGroup) for e in actual_exceptions) + and self._check_exceptions( + exception, + self._unroll_exceptions(exception.exceptions), + ) + ): + # only indent if it's a single-line reason. In a multi-line there's already + # indented lines that this does not belong to. + indent = " " if "\n" not in self._fail_reason else "" + self._fail_reason = ( + old_reason + + f"\n{indent}Did you mean to use `flatten_subgroups=True`?" + ) + else: + self._fail_reason = old_reason + return False + + # Only run `self.check` once we know `exception` is of the correct type. + if not self._check_check(exception): + reason = ( + cast(str, self._fail_reason) + f" on the {type(exception).__name__}" + ) + if ( + len(actual_exceptions) == len(self.expected_exceptions) == 1 + and isinstance(expected := self.expected_exceptions[0], type) + # we explicitly break typing here :) + and self._check_check(actual_exceptions[0]) # type: ignore[arg-type] + ): + self._fail_reason = reason + ( + f", but did return True for the expected {self._repr_expected(expected)}." + f" You might want RaisesGroup(RaisesExc({expected.__name__}, check=<...>))" + ) + else: + self._fail_reason = reason + return False + + return True + + @staticmethod + def _check_expected( + expected_type: ( + type[BaseException] | RaisesExc[BaseException] | RaisesGroup[BaseException] + ), + exception: BaseException, + ) -> str | None: + """Helper method for `RaisesGroup.matches` and `RaisesGroup._check_exceptions` + to check one of potentially several expected exceptions.""" + if isinstance(expected_type, type): + return _check_raw_type(expected_type, exception) + res = expected_type.matches(exception) + if res: + return None + assert expected_type.fail_reason is not None + if expected_type.fail_reason.startswith("\n"): + return f"\n{expected_type!r}: {indent(expected_type.fail_reason, ' ')}" + return f"{expected_type!r}: {expected_type.fail_reason}" + + @staticmethod + def _repr_expected(e: type[BaseException] | AbstractRaises[BaseException]) -> str: + """Get the repr of an expected type/RaisesExc/RaisesGroup, but we only want + the name if it's a type""" + if isinstance(e, type): + return _exception_type_name(e) + return repr(e) + + @overload + def _check_exceptions( + self: RaisesGroup[ExcT_1], + _exception: Exception, + actual_exceptions: Sequence[Exception], + ) -> TypeGuard[ExceptionGroup[ExcT_1]]: ... + @overload + def _check_exceptions( + self: RaisesGroup[BaseExcT_1], + _exception: BaseException, + actual_exceptions: Sequence[BaseException], + ) -> TypeGuard[BaseExceptionGroup[BaseExcT_1]]: ... + + def _check_exceptions( + self, + _exception: BaseException, + actual_exceptions: Sequence[BaseException], + ) -> bool: + """Helper method for RaisesGroup.matches that attempts to pair up expected and actual exceptions""" + # The _exception parameter is not used, but necessary for the TypeGuard + + # full table with all results + results = ResultHolder(self.expected_exceptions, actual_exceptions) + + # (indexes of) raised exceptions that haven't (yet) found an expected + remaining_actual = list(range(len(actual_exceptions))) + # (indexes of) expected exceptions that haven't found a matching raised + failed_expected: list[int] = [] + # successful greedy matches + matches: dict[int, int] = {} + + # loop over expected exceptions first to get a more predictable result + for i_exp, expected in enumerate(self.expected_exceptions): + for i_rem in remaining_actual: + res = self._check_expected(expected, actual_exceptions[i_rem]) + results.set_result(i_exp, i_rem, res) + if res is None: + remaining_actual.remove(i_rem) + matches[i_exp] = i_rem + break + else: + failed_expected.append(i_exp) + + # All exceptions matched up successfully + if not remaining_actual and not failed_expected: + return True + + # in case of a single expected and single raised we simplify the output + if 1 == len(actual_exceptions) == len(self.expected_exceptions): + assert not matches + self._fail_reason = res + return False + + # The test case is failing, so we can do a slow and exhaustive check to find + # duplicate matches etc that will be helpful in debugging + for i_exp, expected in enumerate(self.expected_exceptions): + for i_actual, actual in enumerate(actual_exceptions): + if results.has_result(i_exp, i_actual): + continue + results.set_result( + i_exp, i_actual, self._check_expected(expected, actual) + ) + + successful_str = ( + f"{len(matches)} matched exception{'s' if len(matches) > 1 else ''}. " + if matches + else "" + ) + + # all expected were found + if not failed_expected and results.no_match_for_actual(remaining_actual): + self._fail_reason = ( + f"{successful_str}Unexpected exception(s):" + f" {[actual_exceptions[i] for i in remaining_actual]!r}" + ) + return False + # all raised exceptions were expected + if not remaining_actual and results.no_match_for_expected(failed_expected): + no_match_for_str = ", ".join( + self._repr_expected(self.expected_exceptions[i]) + for i in failed_expected + ) + self._fail_reason = f"{successful_str}Too few exceptions raised, found no match for: [{no_match_for_str}]" + return False + + # if there's only one remaining and one failed, and the unmatched didn't match anything else, + # we elect to only print why the remaining and the failed didn't match. + if ( + 1 == len(remaining_actual) == len(failed_expected) + and results.no_match_for_actual(remaining_actual) + and results.no_match_for_expected(failed_expected) + ): + self._fail_reason = f"{successful_str}{results.get_result(failed_expected[0], remaining_actual[0])}" + return False + + # there's both expected and raised exceptions without matches + s = "" + if matches: + s += f"\n{successful_str}" + indent_1 = " " * 2 + indent_2 = " " * 4 + + if not remaining_actual: + s += "\nToo few exceptions raised!" + elif not failed_expected: + s += "\nUnexpected exception(s)!" + + if failed_expected: + s += "\nThe following expected exceptions did not find a match:" + rev_matches = {v: k for k, v in matches.items()} + for i_failed in failed_expected: + s += ( + f"\n{indent_1}{self._repr_expected(self.expected_exceptions[i_failed])}" + ) + for i_actual, actual in enumerate(actual_exceptions): + if results.get_result(i_exp, i_actual) is None: + # we print full repr of match target + s += ( + f"\n{indent_2}It matches {backquote(repr(actual))} which was paired with " + + backquote( + self._repr_expected( + self.expected_exceptions[rev_matches[i_actual]] + ) + ) + ) + + if remaining_actual: + s += "\nThe following raised exceptions did not find a match" + for i_actual in remaining_actual: + s += f"\n{indent_1}{actual_exceptions[i_actual]!r}:" + for i_exp, expected in enumerate(self.expected_exceptions): + res = results.get_result(i_exp, i_actual) + if i_exp in failed_expected: + assert res is not None + if res[0] != "\n": + s += "\n" + s += indent(res, indent_2) + if res is None: + # we print full repr of match target + s += ( + f"\n{indent_2}It matches {backquote(self._repr_expected(expected))} " + f"which was paired with {backquote(repr(actual_exceptions[matches[i_exp]]))}" + ) + + if len(self.expected_exceptions) == len(actual_exceptions) and possible_match( + results + ): + s += ( + "\nThere exist a possible match when attempting an exhaustive check," + " but RaisesGroup uses a greedy algorithm. " + "Please make your expected exceptions more stringent with `RaisesExc` etc" + " so the greedy algorithm can function." + ) + self._fail_reason = s + return False + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: types.TracebackType | None, + ) -> bool: + __tracebackhide__ = True + if exc_type is None: + fail(f"DID NOT RAISE any exception, expected `{self.expected_type()}`") + + assert self.excinfo is not None, ( + "Internal error - should have been constructed in __enter__" + ) + + # group_str is the only thing that differs between RaisesExc and RaisesGroup... + # I might just scrap it? Or make it part of fail_reason + group_str = ( + "(group)" + if self.allow_unwrapped and not issubclass(exc_type, BaseExceptionGroup) + else "group" + ) + + if not self.matches(exc_val): + fail(f"Raised exception {group_str} did not match: {self._fail_reason}") + + # Cast to narrow the exception type now that it's verified.... + # even though the TypeGuard in self.matches should be narrowing + exc_info = cast( + "tuple[type[BaseExceptionGroup[BaseExcT_co]], BaseExceptionGroup[BaseExcT_co], types.TracebackType]", + (exc_type, exc_val, exc_tb), + ) + self.excinfo.fill_unfilled(exc_info) + return True + + def expected_type(self) -> str: + subexcs = [] + for e in self.expected_exceptions: + if isinstance(e, RaisesExc): + subexcs.append(repr(e)) + elif isinstance(e, RaisesGroup): + subexcs.append(e.expected_type()) + elif isinstance(e, type): + subexcs.append(e.__name__) + else: # pragma: no cover + raise AssertionError("unknown type") + group_type = "Base" if self.is_baseexception else "" + return f"{group_type}ExceptionGroup({', '.join(subexcs)})" + + +@final +class NotChecked: + """Singleton for unchecked values in ResultHolder""" + + +class ResultHolder: + """Container for results of checking exceptions. + Used in RaisesGroup._check_exceptions and possible_match. + """ + + def __init__( + self, + expected_exceptions: tuple[ + type[BaseException] | AbstractRaises[BaseException], ... + ], + actual_exceptions: Sequence[BaseException], + ) -> None: + self.results: list[list[str | type[NotChecked] | None]] = [ + [NotChecked for _ in expected_exceptions] for _ in actual_exceptions + ] + + def set_result(self, expected: int, actual: int, result: str | None) -> None: + self.results[actual][expected] = result + + def get_result(self, expected: int, actual: int) -> str | None: + res = self.results[actual][expected] + assert res is not NotChecked + # mypy doesn't support identity checking against anything but None + return res # type: ignore[return-value] + + def has_result(self, expected: int, actual: int) -> bool: + return self.results[actual][expected] is not NotChecked + + def no_match_for_expected(self, expected: list[int]) -> bool: + for i in expected: + for actual_results in self.results: + assert actual_results[i] is not NotChecked + if actual_results[i] is None: + return False + return True + + def no_match_for_actual(self, actual: list[int]) -> bool: + for i in actual: + for res in self.results[i]: + assert res is not NotChecked + if res is None: + return False + return True + + +def possible_match(results: ResultHolder, used: set[int] | None = None) -> bool: + if used is None: + used = set() + curr_row = len(used) + if curr_row == len(results.results): + return True + return any( + val is None and i not in used and possible_match(results, used | {i}) + for (i, val) in enumerate(results.results[curr_row]) + ) diff --git a/micromamba_root/Lib/site-packages/_pytest/recwarn.py b/micromamba_root/Lib/site-packages/_pytest/recwarn.py new file mode 100644 index 0000000000000000000000000000000000000000..e3db717bfe475c210d4e38ff233369e6872ae81c --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/recwarn.py @@ -0,0 +1,367 @@ +# mypy: allow-untyped-defs +"""Record warnings during test function execution.""" + +from __future__ import annotations + +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterator +from pprint import pformat +import re +from types import TracebackType +from typing import Any +from typing import final +from typing import overload +from typing import TYPE_CHECKING +from typing import TypeVar + + +if TYPE_CHECKING: + from typing_extensions import Self + +import warnings + +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.outcomes import Exit +from _pytest.outcomes import fail + + +T = TypeVar("T") + + +@fixture +def recwarn() -> Generator[WarningsRecorder]: + """Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. + + See :ref:`warnings` for information on warning categories. + """ + wrec = WarningsRecorder(_ispytest=True) + with wrec: + warnings.simplefilter("default") + yield wrec + + +@overload +def deprecated_call( + *, match: str | re.Pattern[str] | None = ... +) -> WarningsRecorder: ... + + +@overload +def deprecated_call(func: Callable[..., T], *args: Any, **kwargs: Any) -> T: ... + + +def deprecated_call( + func: Callable[..., Any] | None = None, *args: Any, **kwargs: Any +) -> WarningsRecorder | Any: + """Assert that code produces a ``DeprecationWarning`` or ``PendingDeprecationWarning`` or ``FutureWarning``. + + This function can be used as a context manager:: + + >>> import warnings + >>> def api_call_v2(): + ... warnings.warn('use v3 of this api', DeprecationWarning) + ... return 200 + + >>> import pytest + >>> with pytest.deprecated_call(): + ... assert api_call_v2() == 200 + + It can also be used by passing a function and ``*args`` and ``**kwargs``, + in which case it will ensure calling ``func(*args, **kwargs)`` produces one of + the warnings types above. The return value is the return value of the function. + + In the context manager form you may use the keyword argument ``match`` to assert + that the warning matches a text or regex. + + The context manager produces a list of :class:`warnings.WarningMessage` objects, + one for each warning raised. + """ + __tracebackhide__ = True + if func is not None: + args = (func, *args) + return warns( + (DeprecationWarning, PendingDeprecationWarning, FutureWarning), *args, **kwargs + ) + + +@overload +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...] = ..., + *, + match: str | re.Pattern[str] | None = ..., +) -> WarningsChecker: ... + + +@overload +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...], + func: Callable[..., T], + *args: Any, + **kwargs: Any, +) -> T: ... + + +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...] = Warning, + *args: Any, + match: str | re.Pattern[str] | None = None, + **kwargs: Any, +) -> WarningsChecker | Any: + r"""Assert that code raises a particular class of warning. + + Specifically, the parameter ``expected_warning`` can be a warning class or tuple + of warning classes, and the code inside the ``with`` block must issue at least one + warning of that class or classes. + + This helper produces a list of :class:`warnings.WarningMessage` objects, one for + each warning emitted (regardless of whether it is an ``expected_warning`` or not). + Since pytest 8.0, unmatched warnings are also re-emitted when the context closes. + + This function can be used as a context manager:: + + >>> import pytest + >>> with pytest.warns(RuntimeWarning): + ... warnings.warn("my warning", RuntimeWarning) + + In the context manager form you may use the keyword argument ``match`` to assert + that the warning matches a text or regex:: + + >>> with pytest.warns(UserWarning, match='must be 0 or None'): + ... warnings.warn("value must be 0 or None", UserWarning) + + >>> with pytest.warns(UserWarning, match=r'must be \d+$'): + ... warnings.warn("value must be 42", UserWarning) + + >>> with pytest.warns(UserWarning): # catch re-emitted warning + ... with pytest.warns(UserWarning, match=r'must be \d+$'): + ... warnings.warn("this is not here", UserWarning) + Traceback (most recent call last): + ... + Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted... + + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests + such that some runs raise a warning and others do not. + + This could be achieved in the same way as with exceptions, see + :ref:`parametrizing_conditional_raising` for an example. + + """ + __tracebackhide__ = True + if not args: + if kwargs: + argnames = ", ".join(sorted(kwargs)) + raise TypeError( + f"Unexpected keyword arguments passed to pytest.warns: {argnames}" + "\nUse context-manager form instead?" + ) + return WarningsChecker(expected_warning, match_expr=match, _ispytest=True) + else: + func = args[0] + if not callable(func): + raise TypeError(f"{func!r} object (type: {type(func)}) must be callable") + with WarningsChecker(expected_warning, _ispytest=True): + return func(*args[1:], **kwargs) + + +class WarningsRecorder(warnings.catch_warnings): + """A context manager to record raised warnings. + + Each recorded warning is an instance of :class:`warnings.WarningMessage`. + + Adapted from `warnings.catch_warnings`. + + .. note:: + ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated + differently; see :ref:`ensuring_function_triggers`. + + """ + + def __init__(self, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + super().__init__(record=True) + self._entered = False + self._list: list[warnings.WarningMessage] = [] + + @property + def list(self) -> list[warnings.WarningMessage]: + """The list of recorded warnings.""" + return self._list + + def __getitem__(self, i: int) -> warnings.WarningMessage: + """Get a recorded warning by index.""" + return self._list[i] + + def __iter__(self) -> Iterator[warnings.WarningMessage]: + """Iterate through the recorded warnings.""" + return iter(self._list) + + def __len__(self) -> int: + """The number of recorded warnings.""" + return len(self._list) + + def pop(self, cls: type[Warning] = Warning) -> warnings.WarningMessage: + """Pop the first recorded warning which is an instance of ``cls``, + but not an instance of a child class of any other match. + Raises ``AssertionError`` if there is no match. + """ + best_idx: int | None = None + for i, w in enumerate(self._list): + if w.category == cls: + return self._list.pop(i) # exact match, stop looking + if issubclass(w.category, cls) and ( + best_idx is None + or not issubclass(w.category, self._list[best_idx].category) + ): + best_idx = i + if best_idx is not None: + return self._list.pop(best_idx) + __tracebackhide__ = True + raise AssertionError(f"{cls!r} not found in warning list") + + def clear(self) -> None: + """Clear the list of recorded warnings.""" + self._list[:] = [] + + # Type ignored because we basically want the `catch_warnings` generic type + # parameter to be ourselves but that is not possible(?). + def __enter__(self) -> Self: # type: ignore[override] + if self._entered: + __tracebackhide__ = True + raise RuntimeError(f"Cannot enter {self!r} twice") + _list = super().__enter__() + # record=True means it's None. + assert _list is not None + self._list = _list + warnings.simplefilter("always") + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if not self._entered: + __tracebackhide__ = True + raise RuntimeError(f"Cannot exit {self!r} without entering first") + + super().__exit__(exc_type, exc_val, exc_tb) + + # Built-in catch_warnings does not reset entered state so we do it + # manually here for this context manager to become reusable. + self._entered = False + + +@final +class WarningsChecker(WarningsRecorder): + def __init__( + self, + expected_warning: type[Warning] | tuple[type[Warning], ...] = Warning, + match_expr: str | re.Pattern[str] | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + super().__init__(_ispytest=True) + + msg = "exceptions must be derived from Warning, not %s" + if isinstance(expected_warning, tuple): + for exc in expected_warning: + if not issubclass(exc, Warning): + raise TypeError(msg % type(exc)) + expected_warning_tup = expected_warning + elif isinstance(expected_warning, type) and issubclass( + expected_warning, Warning + ): + expected_warning_tup = (expected_warning,) + else: + raise TypeError(msg % type(expected_warning)) + + self.expected_warning = expected_warning_tup + self.match_expr = match_expr + + def matches(self, warning: warnings.WarningMessage) -> bool: + assert self.expected_warning is not None + return issubclass(warning.category, self.expected_warning) and bool( + self.match_expr is None or re.search(self.match_expr, str(warning.message)) + ) + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + super().__exit__(exc_type, exc_val, exc_tb) + + __tracebackhide__ = True + + # BaseExceptions like pytest.{skip,fail,xfail,exit} or Ctrl-C within + # pytest.warns should *not* trigger "DID NOT WARN" and get suppressed + # when the warning doesn't happen. Control-flow exceptions should always + # propagate. + if exc_val is not None and ( + not isinstance(exc_val, Exception) + # Exit is an Exception, not a BaseException, for some reason. + or isinstance(exc_val, Exit) + ): + return + + def found_str() -> str: + return pformat([record.message for record in self], indent=2) + + try: + if not any(issubclass(w.category, self.expected_warning) for w in self): + fail( + f"DID NOT WARN. No warnings of type {self.expected_warning} were emitted.\n" + f" Emitted warnings: {found_str()}." + ) + elif not any(self.matches(w) for w in self): + fail( + f"DID NOT WARN. No warnings of type {self.expected_warning} matching the regex were emitted.\n" + f" Regex: {self.match_expr}\n" + f" Emitted warnings: {found_str()}." + ) + finally: + # Whether or not any warnings matched, we want to re-emit all unmatched warnings. + for w in self: + if not self.matches(w): + warnings.warn_explicit( + message=w.message, + category=w.category, + filename=w.filename, + lineno=w.lineno, + module=w.__module__, + source=w.source, + ) + + # Currently in Python it is possible to pass other types than an + # `str` message when creating `Warning` instances, however this + # causes an exception when :func:`warnings.filterwarnings` is used + # to filter those warnings. See + # https://github.com/python/cpython/issues/103577 for a discussion. + # While this can be considered a bug in CPython, we put guards in + # pytest as the error message produced without this check in place + # is confusing (#10865). + for w in self: + if type(w.message) is not UserWarning: + # If the warning was of an incorrect type then `warnings.warn()` + # creates a UserWarning. Any other warning must have been specified + # explicitly. + continue + if not w.message.args: + # UserWarning() without arguments must have been specified explicitly. + continue + msg = w.message.args[0] + if isinstance(msg, str): + continue + # It's possible that UserWarning was explicitly specified, and + # its first argument was not a string. But that case can't be + # distinguished from an invalid type. + raise TypeError( + f"Warning must be str or Warning, got {msg!r} (type {type(msg).__name__})" + ) diff --git a/micromamba_root/Lib/site-packages/_pytest/reports.py b/micromamba_root/Lib/site-packages/_pytest/reports.py new file mode 100644 index 0000000000000000000000000000000000000000..011a69db00155c507a344280927a0787daf39fe8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/reports.py @@ -0,0 +1,694 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +from collections.abc import Iterable +from collections.abc import Iterator +from collections.abc import Mapping +from collections.abc import Sequence +import dataclasses +from io import StringIO +import os +from pprint import pprint +import sys +from typing import Any +from typing import cast +from typing import final +from typing import Literal +from typing import NoReturn +from typing import TYPE_CHECKING + +from _pytest._code.code import ExceptionChainRepr +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import ExceptionRepr +from _pytest._code.code import ReprEntry +from _pytest._code.code import ReprEntryNative +from _pytest._code.code import ReprExceptionInfo +from _pytest._code.code import ReprFileLocation +from _pytest._code.code import ReprFuncArgs +from _pytest._code.code import ReprLocals +from _pytest._code.code import ReprTraceback +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.config import Config +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import skip + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + + +if TYPE_CHECKING: + from typing_extensions import Self + + from _pytest.runner import CallInfo + + +def getworkerinfoline(node): + try: + return node._workerinfocache + except AttributeError: + d = node.workerinfo + ver = "{}.{}.{}".format(*d["version_info"][:3]) + node._workerinfocache = s = "[{}] {} -- Python {} {}".format( + d["id"], d["sysplatform"], ver, d["executable"] + ) + return s + + +class BaseReport: + when: str | None + location: tuple[str, int | None, str] | None + longrepr: ( + None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr + ) + sections: list[tuple[str, str]] + nodeid: str + outcome: Literal["passed", "failed", "skipped"] + + def __init__(self, **kw: Any) -> None: + self.__dict__.update(kw) + + if TYPE_CHECKING: + # Can have arbitrary fields given to __init__(). + def __getattr__(self, key: str) -> Any: ... + + def toterminal(self, out: TerminalWriter) -> None: + if hasattr(self, "node"): + worker_info = getworkerinfoline(self.node) + if worker_info: + out.line(worker_info) + + longrepr = self.longrepr + if longrepr is None: + return + + if hasattr(longrepr, "toterminal"): + longrepr_terminal = cast(TerminalRepr, longrepr) + longrepr_terminal.toterminal(out) + else: + try: + s = str(longrepr) + except UnicodeEncodeError: + s = "" + out.line(s) + + def get_sections(self, prefix: str) -> Iterator[tuple[str, str]]: + for name, content in self.sections: + if name.startswith(prefix): + yield prefix, content + + @property + def longreprtext(self) -> str: + """Read-only property that returns the full string representation of + ``longrepr``. + + .. versionadded:: 3.0 + """ + file = StringIO() + tw = TerminalWriter(file) + tw.hasmarkup = False + self.toterminal(tw) + exc = file.getvalue() + return exc.strip() + + @property + def caplog(self) -> str: + """Return captured log lines, if log capturing is enabled. + + .. versionadded:: 3.5 + """ + return "\n".join( + content for (prefix, content) in self.get_sections("Captured log") + ) + + @property + def capstdout(self) -> str: + """Return captured text from stdout, if capturing is enabled. + + .. versionadded:: 3.0 + """ + return "".join( + content for (prefix, content) in self.get_sections("Captured stdout") + ) + + @property + def capstderr(self) -> str: + """Return captured text from stderr, if capturing is enabled. + + .. versionadded:: 3.0 + """ + return "".join( + content for (prefix, content) in self.get_sections("Captured stderr") + ) + + @property + def passed(self) -> bool: + """Whether the outcome is passed.""" + return self.outcome == "passed" + + @property + def failed(self) -> bool: + """Whether the outcome is failed.""" + return self.outcome == "failed" + + @property + def skipped(self) -> bool: + """Whether the outcome is skipped.""" + return self.outcome == "skipped" + + @property + def fspath(self) -> str: + """The path portion of the reported node, as a string.""" + return self.nodeid.split("::")[0] + + @property + def count_towards_summary(self) -> bool: + """**Experimental** Whether this report should be counted towards the + totals shown at the end of the test session: "1 passed, 1 failure, etc". + + .. note:: + + This function is considered **experimental**, so beware that it is subject to changes + even in patch releases. + """ + return True + + @property + def head_line(self) -> str | None: + """**Experimental** The head line shown with longrepr output for this + report, more commonly during traceback representation during + failures:: + + ________ Test.foo ________ + + + In the example above, the head_line is "Test.foo". + + .. note:: + + This function is considered **experimental**, so beware that it is subject to changes + even in patch releases. + """ + if self.location is not None: + _fspath, _lineno, domain = self.location + return domain + return None + + def _get_verbose_word_with_markup( + self, config: Config, default_markup: Mapping[str, bool] + ) -> tuple[str, Mapping[str, bool]]: + _category, _short, verbose = config.hook.pytest_report_teststatus( + report=self, config=config + ) + + if isinstance(verbose, str): + return verbose, default_markup + + if isinstance(verbose, Sequence) and len(verbose) == 2: + word, markup = verbose + if isinstance(word, str) and isinstance(markup, Mapping): + return word, markup + + fail( # pragma: no cover + "pytest_report_teststatus() hook (from a plugin) returned " + f"an invalid verbose value: {verbose!r}.\nExpected either a string " + "or a tuple of (word, markup)." + ) + + def _to_json(self) -> dict[str, Any]: + """Return the contents of this report as a dict of builtin entries, + suitable for serialization. + + This was originally the serialize_report() function from xdist (ca03269). + + Experimental method. + """ + return _report_to_json(self) + + @classmethod + def _from_json(cls, reportdict: dict[str, object]) -> Self: + """Create either a TestReport or CollectReport, depending on the calling class. + + It is the callers responsibility to know which class to pass here. + + This was originally the serialize_report() function from xdist (ca03269). + + Experimental method. + """ + kwargs = _report_kwargs_from_json(reportdict) + return cls(**kwargs) + + +def _report_unserialization_failure( + type_name: str, report_class: type[BaseReport], reportdict +) -> NoReturn: + url = "https://github.com/pytest-dev/pytest/issues" + stream = StringIO() + pprint("-" * 100, stream=stream) + pprint(f"INTERNALERROR: Unknown entry type returned: {type_name}", stream=stream) + pprint(f"report_name: {report_class}", stream=stream) + pprint(reportdict, stream=stream) + pprint(f"Please report this bug at {url}", stream=stream) + pprint("-" * 100, stream=stream) + raise RuntimeError(stream.getvalue()) + + +def _format_failed_longrepr( + item: Item, call: CallInfo[None], excinfo: ExceptionInfo[BaseException] +): + if call.when == "call": + longrepr = item.repr_failure(excinfo) + else: + # Exception in setup or teardown. + longrepr = item._repr_failure_py( + excinfo, style=item.config.getoption("tbstyle", "auto") + ) + return longrepr + + +def _format_exception_group_all_skipped_longrepr( + item: Item, + excinfo: ExceptionInfo[BaseExceptionGroup[BaseException | BaseExceptionGroup]], +) -> tuple[str, int, str]: + r = excinfo._getreprcrash() + assert r is not None, ( + "There should always be a traceback entry for skipping a test." + ) + if all( + getattr(skip, "_use_item_location", False) for skip in excinfo.value.exceptions + ): + path, line = item.reportinfo()[:2] + assert line is not None + loc = (os.fspath(path), line + 1) + default_msg = "skipped" + else: + loc = (str(r.path), r.lineno) + default_msg = r.message + + # Get all unique skip messages. + msgs: list[str] = [] + for exception in excinfo.value.exceptions: + m = getattr(exception, "msg", None) or ( + exception.args[0] if exception.args else None + ) + if m and m not in msgs: + msgs.append(m) + + reason = "; ".join(msgs) if msgs else default_msg + longrepr = (*loc, reason) + return longrepr + + +class TestReport(BaseReport): + """Basic test report object (also used for setup and teardown calls if + they fail). + + Reports can contain arbitrary extra attributes. + """ + + __test__ = False + + # Defined by skipping plugin. + # xfail reason if xfailed, otherwise not defined. Use hasattr to distinguish. + wasxfail: str + + def __init__( + self, + nodeid: str, + location: tuple[str, int | None, str], + keywords: Mapping[str, Any], + outcome: Literal["passed", "failed", "skipped"], + longrepr: None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr, + when: Literal["setup", "call", "teardown"], + sections: Iterable[tuple[str, str]] = (), + duration: float = 0, + start: float = 0, + stop: float = 0, + user_properties: Iterable[tuple[str, object]] | None = None, + **extra, + ) -> None: + #: Normalized collection nodeid. + self.nodeid = nodeid + + #: A (filesystempath, lineno, domaininfo) tuple indicating the + #: actual location of a test item - it might be different from the + #: collected one e.g. if a method is inherited from a different module. + #: The filesystempath may be relative to ``config.rootdir``. + #: The line number is 0-based. + self.location: tuple[str, int | None, str] = location + + #: A name -> value dictionary containing all keywords and + #: markers associated with a test invocation. + self.keywords: Mapping[str, Any] = keywords + + #: Test outcome, always one of "passed", "failed", "skipped". + self.outcome = outcome + + #: None or a failure representation. + self.longrepr = longrepr + + #: One of 'setup', 'call', 'teardown' to indicate runtest phase. + self.when: Literal["setup", "call", "teardown"] = when + + #: User properties is a list of tuples (name, value) that holds user + #: defined properties of the test. + self.user_properties = list(user_properties or []) + + #: Tuples of str ``(heading, content)`` with extra information + #: for the test report. Used by pytest to add text captured + #: from ``stdout``, ``stderr``, and intercepted logging events. May + #: be used by other plugins to add arbitrary information to reports. + self.sections = list(sections) + + #: Time it took to run just the test. + self.duration: float = duration + + #: The system time when the call started, in seconds since the epoch. + self.start: float = start + #: The system time when the call ended, in seconds since the epoch. + self.stop: float = stop + + self.__dict__.update(extra) + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.nodeid!r} when={self.when!r} outcome={self.outcome!r}>" + + @classmethod + def from_item_and_call(cls, item: Item, call: CallInfo[None]) -> TestReport: + """Create and fill a TestReport with standard item and call info. + + :param item: The item. + :param call: The call info. + """ + when = call.when + # Remove "collect" from the Literal type -- only for collection calls. + assert when != "collect" + duration = call.duration + start = call.start + stop = call.stop + keywords = {x: 1 for x in item.keywords} + excinfo = call.excinfo + sections = [] + if not call.excinfo: + outcome: Literal["passed", "failed", "skipped"] = "passed" + longrepr: ( + None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr + ) = None + else: + if not isinstance(excinfo, ExceptionInfo): + outcome = "failed" + longrepr = excinfo + elif isinstance(excinfo.value, skip.Exception): + outcome = "skipped" + r = excinfo._getreprcrash() + assert r is not None, ( + "There should always be a traceback entry for skipping a test." + ) + if excinfo.value._use_item_location: + path, line = item.reportinfo()[:2] + assert line is not None + longrepr = (os.fspath(path), line + 1, r.message) + else: + longrepr = (str(r.path), r.lineno, r.message) + elif isinstance(excinfo.value, BaseExceptionGroup) and ( + excinfo.value.split(skip.Exception)[1] is None + ): + # All exceptions in the group are skip exceptions. + outcome = "skipped" + excinfo = cast( + ExceptionInfo[ + BaseExceptionGroup[BaseException | BaseExceptionGroup] + ], + excinfo, + ) + longrepr = _format_exception_group_all_skipped_longrepr(item, excinfo) + else: + outcome = "failed" + longrepr = _format_failed_longrepr(item, call, excinfo) + for rwhen, key, content in item._report_sections: + sections.append((f"Captured {key} {rwhen}", content)) + return cls( + item.nodeid, + item.location, + keywords, + outcome, + longrepr, + when, + sections, + duration, + start, + stop, + user_properties=item.user_properties, + ) + + +@final +class CollectReport(BaseReport): + """Collection report object. + + Reports can contain arbitrary extra attributes. + """ + + when = "collect" + + def __init__( + self, + nodeid: str, + outcome: Literal["passed", "failed", "skipped"], + longrepr: None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr, + result: list[Item | Collector] | None, + sections: Iterable[tuple[str, str]] = (), + **extra, + ) -> None: + #: Normalized collection nodeid. + self.nodeid = nodeid + + #: Test outcome, always one of "passed", "failed", "skipped". + self.outcome = outcome + + #: None or a failure representation. + self.longrepr = longrepr + + #: The collected items and collection nodes. + self.result = result or [] + + #: Tuples of str ``(heading, content)`` with extra information + #: for the test report. Used by pytest to add text captured + #: from ``stdout``, ``stderr``, and intercepted logging events. May + #: be used by other plugins to add arbitrary information to reports. + self.sections = list(sections) + + self.__dict__.update(extra) + + @property + def location( # type:ignore[override] + self, + ) -> tuple[str, int | None, str] | None: + return (self.fspath, None, self.fspath) + + def __repr__(self) -> str: + return f"" + + +class CollectErrorRepr(TerminalRepr): + def __init__(self, msg: str) -> None: + self.longrepr = msg + + def toterminal(self, out: TerminalWriter) -> None: + out.line(self.longrepr, red=True) + + +def pytest_report_to_serializable( + report: CollectReport | TestReport, +) -> dict[str, Any] | None: + if isinstance(report, TestReport | CollectReport): + data = report._to_json() + data["$report_type"] = report.__class__.__name__ + return data + # TODO: Check if this is actually reachable. + return None # type: ignore[unreachable] + + +def pytest_report_from_serializable( + data: dict[str, Any], +) -> CollectReport | TestReport | None: + if "$report_type" in data: + if data["$report_type"] == "TestReport": + return TestReport._from_json(data) + elif data["$report_type"] == "CollectReport": + return CollectReport._from_json(data) + assert False, "Unknown report_type unserialize data: {}".format( + data["$report_type"] + ) + return None + + +def _report_to_json(report: BaseReport) -> dict[str, Any]: + """Return the contents of this report as a dict of builtin entries, + suitable for serialization. + + This was originally the serialize_report() function from xdist (ca03269). + """ + + def serialize_repr_entry( + entry: ReprEntry | ReprEntryNative, + ) -> dict[str, Any]: + data = dataclasses.asdict(entry) + for key, value in data.items(): + if hasattr(value, "__dict__"): + data[key] = dataclasses.asdict(value) + entry_data = {"type": type(entry).__name__, "data": data} + return entry_data + + def serialize_repr_traceback(reprtraceback: ReprTraceback) -> dict[str, Any]: + result = dataclasses.asdict(reprtraceback) + result["reprentries"] = [ + serialize_repr_entry(x) for x in reprtraceback.reprentries + ] + return result + + def serialize_repr_crash( + reprcrash: ReprFileLocation | None, + ) -> dict[str, Any] | None: + if reprcrash is not None: + return dataclasses.asdict(reprcrash) + else: + return None + + def serialize_exception_longrepr(rep: BaseReport) -> dict[str, Any]: + assert rep.longrepr is not None + # TODO: Investigate whether the duck typing is really necessary here. + longrepr = cast(ExceptionRepr, rep.longrepr) + result: dict[str, Any] = { + "reprcrash": serialize_repr_crash(longrepr.reprcrash), + "reprtraceback": serialize_repr_traceback(longrepr.reprtraceback), + "sections": longrepr.sections, + } + if isinstance(longrepr, ExceptionChainRepr): + result["chain"] = [] + for repr_traceback, repr_crash, description in longrepr.chain: + result["chain"].append( + ( + serialize_repr_traceback(repr_traceback), + serialize_repr_crash(repr_crash), + description, + ) + ) + else: + result["chain"] = None + return result + + d = report.__dict__.copy() + if hasattr(report.longrepr, "toterminal"): + if hasattr(report.longrepr, "reprtraceback") and hasattr( + report.longrepr, "reprcrash" + ): + d["longrepr"] = serialize_exception_longrepr(report) + else: + d["longrepr"] = str(report.longrepr) + else: + d["longrepr"] = report.longrepr + for name in d: + if isinstance(d[name], os.PathLike): + d[name] = os.fspath(d[name]) + elif name == "result": + d[name] = None # for now + return d + + +def _report_kwargs_from_json(reportdict: dict[str, Any]) -> dict[str, Any]: + """Return **kwargs that can be used to construct a TestReport or + CollectReport instance. + + This was originally the serialize_report() function from xdist (ca03269). + """ + + def deserialize_repr_entry(entry_data): + data = entry_data["data"] + entry_type = entry_data["type"] + if entry_type == "ReprEntry": + reprfuncargs = None + reprfileloc = None + reprlocals = None + if data["reprfuncargs"]: + reprfuncargs = ReprFuncArgs(**data["reprfuncargs"]) + if data["reprfileloc"]: + reprfileloc = ReprFileLocation(**data["reprfileloc"]) + if data["reprlocals"]: + reprlocals = ReprLocals(data["reprlocals"]["lines"]) + + reprentry: ReprEntry | ReprEntryNative = ReprEntry( + lines=data["lines"], + reprfuncargs=reprfuncargs, + reprlocals=reprlocals, + reprfileloc=reprfileloc, + style=data["style"], + ) + elif entry_type == "ReprEntryNative": + reprentry = ReprEntryNative(data["lines"]) + else: + _report_unserialization_failure(entry_type, TestReport, reportdict) + return reprentry + + def deserialize_repr_traceback(repr_traceback_dict): + repr_traceback_dict["reprentries"] = [ + deserialize_repr_entry(x) for x in repr_traceback_dict["reprentries"] + ] + return ReprTraceback(**repr_traceback_dict) + + def deserialize_repr_crash(repr_crash_dict: dict[str, Any] | None): + if repr_crash_dict is not None: + return ReprFileLocation(**repr_crash_dict) + else: + return None + + if ( + reportdict["longrepr"] + and "reprcrash" in reportdict["longrepr"] + and "reprtraceback" in reportdict["longrepr"] + ): + reprtraceback = deserialize_repr_traceback( + reportdict["longrepr"]["reprtraceback"] + ) + reprcrash = deserialize_repr_crash(reportdict["longrepr"]["reprcrash"]) + if reportdict["longrepr"]["chain"]: + chain = [] + for repr_traceback_data, repr_crash_data, description in reportdict[ + "longrepr" + ]["chain"]: + chain.append( + ( + deserialize_repr_traceback(repr_traceback_data), + deserialize_repr_crash(repr_crash_data), + description, + ) + ) + exception_info: ExceptionChainRepr | ReprExceptionInfo = ExceptionChainRepr( + chain + ) + else: + exception_info = ReprExceptionInfo( + reprtraceback=reprtraceback, + reprcrash=reprcrash, + ) + + for section in reportdict["longrepr"]["sections"]: + exception_info.addsection(*section) + reportdict["longrepr"] = exception_info + + return reportdict diff --git a/micromamba_root/Lib/site-packages/_pytest/runner.py b/micromamba_root/Lib/site-packages/_pytest/runner.py new file mode 100644 index 0000000000000000000000000000000000000000..9c20ff9e638f56d7e039729ebcda6d8f38e9c551 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/runner.py @@ -0,0 +1,580 @@ +# mypy: allow-untyped-defs +"""Basic collect and runtest protocol implementations.""" + +from __future__ import annotations + +import bdb +from collections.abc import Callable +import dataclasses +import os +import sys +import types +from typing import cast +from typing import final +from typing import Generic +from typing import Literal +from typing import TYPE_CHECKING +from typing import TypeVar + +from .config import Config +from .reports import BaseReport +from .reports import CollectErrorRepr +from .reports import CollectReport +from .reports import TestReport +from _pytest import timing +from _pytest._code.code import ExceptionChainRepr +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.nodes import Collector +from _pytest.nodes import Directory +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.outcomes import Exit +from _pytest.outcomes import OutcomeException +from _pytest.outcomes import Skipped +from _pytest.outcomes import TEST_OUTCOME + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + +if TYPE_CHECKING: + from _pytest.main import Session + from _pytest.terminal import TerminalReporter + +# +# pytest plugin hooks. + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting", "Reporting", after="general") + group.addoption( + "--durations", + action="store", + type=int, + default=None, + metavar="N", + help="Show N slowest setup/test durations (N=0 for all)", + ) + group.addoption( + "--durations-min", + action="store", + type=float, + default=None, + metavar="N", + help="Minimal duration in seconds for inclusion in slowest list. " + "Default: 0.005 (or 0.0 if -vv is given).", + ) + + +def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None: + durations = terminalreporter.config.option.durations + durations_min = terminalreporter.config.option.durations_min + verbose = terminalreporter.config.get_verbosity() + if durations is None: + return + if durations_min is None: + durations_min = 0.005 if verbose < 2 else 0.0 + tr = terminalreporter + dlist = [] + for replist in tr.stats.values(): + for rep in replist: + if hasattr(rep, "duration"): + dlist.append(rep) + if not dlist: + return + dlist.sort(key=lambda x: x.duration, reverse=True) + if not durations: + tr.write_sep("=", "slowest durations") + else: + tr.write_sep("=", f"slowest {durations} durations") + dlist = dlist[:durations] + + for i, rep in enumerate(dlist): + if rep.duration < durations_min: + tr.write_line("") + message = f"({len(dlist) - i} durations < {durations_min:g}s hidden." + if terminalreporter.config.option.durations_min is None: + message += " Use -vv to show these durations." + message += ")" + tr.write_line(message) + break + tr.write_line(f"{rep.duration:02.2f}s {rep.when:<8} {rep.nodeid}") + + +def pytest_sessionstart(session: Session) -> None: + session._setupstate = SetupState() + + +def pytest_sessionfinish(session: Session) -> None: + session._setupstate.teardown_exact(None) + + +def pytest_runtest_protocol(item: Item, nextitem: Item | None) -> bool: + ihook = item.ihook + ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location) + runtestprotocol(item, nextitem=nextitem) + ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location) + return True + + +def runtestprotocol( + item: Item, log: bool = True, nextitem: Item | None = None +) -> list[TestReport]: + hasrequest = hasattr(item, "_request") + if hasrequest and not item._request: # type: ignore[attr-defined] + # This only happens if the item is re-run, as is done by + # pytest-rerunfailures. + item._initrequest() # type: ignore[attr-defined] + rep = call_and_report(item, "setup", log) + reports = [rep] + if rep.passed: + if item.config.getoption("setupshow", False): + show_test_item(item) + if not item.config.getoption("setuponly", False): + reports.append(call_and_report(item, "call", log)) + # If the session is about to fail or stop, teardown everything - this is + # necessary to correctly report fixture teardown errors (see #11706) + if item.session.shouldfail or item.session.shouldstop: + nextitem = None + reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) + # After all teardown hooks have been called + # want funcargs and request info to go away. + if hasrequest: + item._request = False # type: ignore[attr-defined] + item.funcargs = None # type: ignore[attr-defined] + return reports + + +def show_test_item(item: Item) -> None: + """Show test function, parameters and the fixtures of the test item.""" + tw = item.config.get_terminal_writer() + tw.line() + tw.write(" " * 8) + tw.write(item.nodeid) + used_fixtures = sorted(getattr(item, "fixturenames", [])) + if used_fixtures: + tw.write(" (fixtures used: {})".format(", ".join(used_fixtures))) + tw.flush() + + +def pytest_runtest_setup(item: Item) -> None: + _update_current_test_var(item, "setup") + item.session._setupstate.setup(item) + + +def pytest_runtest_call(item: Item) -> None: + _update_current_test_var(item, "call") + try: + del sys.last_type + del sys.last_value + del sys.last_traceback + if sys.version_info >= (3, 12, 0): + del sys.last_exc # type:ignore[attr-defined] + except AttributeError: + pass + try: + item.runtest() + except Exception as e: + # Store trace info to allow postmortem debugging + sys.last_type = type(e) + sys.last_value = e + if sys.version_info >= (3, 12, 0): + sys.last_exc = e # type:ignore[attr-defined] + assert e.__traceback__ is not None + # Skip *this* frame + sys.last_traceback = e.__traceback__.tb_next + raise + + +def pytest_runtest_teardown(item: Item, nextitem: Item | None) -> None: + _update_current_test_var(item, "teardown") + item.session._setupstate.teardown_exact(nextitem) + _update_current_test_var(item, None) + + +def _update_current_test_var( + item: Item, when: Literal["setup", "call", "teardown"] | None +) -> None: + """Update :envvar:`PYTEST_CURRENT_TEST` to reflect the current item and stage. + + If ``when`` is None, delete ``PYTEST_CURRENT_TEST`` from the environment. + """ + var_name = "PYTEST_CURRENT_TEST" + if when: + value = f"{item.nodeid} ({when})" + # don't allow null bytes on environment variables (see #2644, #2957) + value = value.replace("\x00", "(null)") + os.environ[var_name] = value + else: + os.environ.pop(var_name) + + +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str] | None: + if report.when in ("setup", "teardown"): + if report.failed: + # category, shortletter, verbose-word + return "error", "E", "ERROR" + elif report.skipped: + return "skipped", "s", "SKIPPED" + else: + return "", "", "" + return None + + +# +# Implementation + + +def call_and_report( + item: Item, when: Literal["setup", "call", "teardown"], log: bool = True, **kwds +) -> TestReport: + ihook = item.ihook + if when == "setup": + runtest_hook: Callable[..., None] = ihook.pytest_runtest_setup + elif when == "call": + runtest_hook = ihook.pytest_runtest_call + elif when == "teardown": + runtest_hook = ihook.pytest_runtest_teardown + else: + assert False, f"Unhandled runtest hook case: {when}" + + call = CallInfo.from_call( + lambda: runtest_hook(item=item, **kwds), + when=when, + reraise=get_reraise_exceptions(item.config), + ) + report: TestReport = ihook.pytest_runtest_makereport(item=item, call=call) + if log: + ihook.pytest_runtest_logreport(report=report) + if check_interactive_exception(call, report): + ihook.pytest_exception_interact(node=item, call=call, report=report) + return report + + +def get_reraise_exceptions(config: Config) -> tuple[type[BaseException], ...]: + """Return exception types that should not be suppressed in general.""" + reraise: tuple[type[BaseException], ...] = (Exit,) + if not config.getoption("usepdb", False): + reraise += (KeyboardInterrupt,) + return reraise + + +def check_interactive_exception(call: CallInfo[object], report: BaseReport) -> bool: + """Check whether the call raised an exception that should be reported as + interactive.""" + if call.excinfo is None: + # Didn't raise. + return False + if hasattr(report, "wasxfail"): + # Exception was expected. + return False + if isinstance(call.excinfo.value, Skipped | bdb.BdbQuit): + # Special control flow exception. + return False + return True + + +TResult = TypeVar("TResult", covariant=True) + + +@final +@dataclasses.dataclass +class CallInfo(Generic[TResult]): + """Result/Exception info of a function invocation.""" + + _result: TResult | None + #: The captured exception of the call, if it raised. + excinfo: ExceptionInfo[BaseException] | None + #: The system time when the call started, in seconds since the epoch. + start: float + #: The system time when the call ended, in seconds since the epoch. + stop: float + #: The call duration, in seconds. + duration: float + #: The context of invocation: "collect", "setup", "call" or "teardown". + when: Literal["collect", "setup", "call", "teardown"] + + def __init__( + self, + result: TResult | None, + excinfo: ExceptionInfo[BaseException] | None, + start: float, + stop: float, + duration: float, + when: Literal["collect", "setup", "call", "teardown"], + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._result = result + self.excinfo = excinfo + self.start = start + self.stop = stop + self.duration = duration + self.when = when + + @property + def result(self) -> TResult: + """The return value of the call, if it didn't raise. + + Can only be accessed if excinfo is None. + """ + if self.excinfo is not None: + raise AttributeError(f"{self!r} has no valid result") + # The cast is safe because an exception wasn't raised, hence + # _result has the expected function return type (which may be + # None, that's why a cast and not an assert). + return cast(TResult, self._result) + + @classmethod + def from_call( + cls, + func: Callable[[], TResult], + when: Literal["collect", "setup", "call", "teardown"], + reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None, + ) -> CallInfo[TResult]: + """Call func, wrapping the result in a CallInfo. + + :param func: + The function to call. Called without arguments. + :type func: Callable[[], _pytest.runner.TResult] + :param when: + The phase in which the function is called. + :param reraise: + Exception or exceptions that shall propagate if raised by the + function, instead of being wrapped in the CallInfo. + """ + excinfo = None + instant = timing.Instant() + try: + result: TResult | None = func() + except BaseException: + excinfo = ExceptionInfo.from_current() + if reraise is not None and isinstance(excinfo.value, reraise): + raise + result = None + duration = instant.elapsed() + return cls( + start=duration.start.time, + stop=duration.stop.time, + duration=duration.seconds, + when=when, + result=result, + excinfo=excinfo, + _ispytest=True, + ) + + def __repr__(self) -> str: + if self.excinfo is None: + return f"" + return f"" + + +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> TestReport: + return TestReport.from_item_and_call(item, call) + + +def pytest_make_collect_report(collector: Collector) -> CollectReport: + def collect() -> list[Item | Collector]: + # Before collecting, if this is a Directory, load the conftests. + # If a conftest import fails to load, it is considered a collection + # error of the Directory collector. This is why it's done inside of the + # CallInfo wrapper. + # + # Note: initial conftests are loaded early, not here. + if isinstance(collector, Directory): + collector.config.pluginmanager._loadconftestmodules( + collector.path, + collector.config.getoption("importmode"), + rootpath=collector.config.rootpath, + consider_namespace_packages=collector.config.getini( + "consider_namespace_packages" + ), + ) + + return list(collector.collect()) + + call = CallInfo.from_call( + collect, "collect", reraise=(KeyboardInterrupt, SystemExit) + ) + longrepr: None | tuple[str, int, str] | str | TerminalRepr = None + if not call.excinfo: + outcome: Literal["passed", "skipped", "failed"] = "passed" + else: + skip_exceptions = [Skipped] + unittest = sys.modules.get("unittest") + if unittest is not None: + skip_exceptions.append(unittest.SkipTest) + if isinstance(call.excinfo.value, tuple(skip_exceptions)): + outcome = "skipped" + r_ = collector._repr_failure_py(call.excinfo, "line") + assert isinstance(r_, ExceptionChainRepr), repr(r_) + r = r_.reprcrash + assert r + longrepr = (str(r.path), r.lineno, r.message) + else: + outcome = "failed" + errorinfo = collector.repr_failure(call.excinfo) + if not hasattr(errorinfo, "toterminal"): + assert isinstance(errorinfo, str) + errorinfo = CollectErrorRepr(errorinfo) + longrepr = errorinfo + result = call.result if not call.excinfo else None + rep = CollectReport(collector.nodeid, outcome, longrepr, result) + rep.call = call # type: ignore # see collect_one_node + return rep + + +class SetupState: + """Shared state for setting up/tearing down test items or collectors + in a session. + + Suppose we have a collection tree as follows: + + + + + + + + The SetupState maintains a stack. The stack starts out empty: + + [] + + During the setup phase of item1, setup(item1) is called. What it does + is: + + push session to stack, run session.setup() + push mod1 to stack, run mod1.setup() + push item1 to stack, run item1.setup() + + The stack is: + + [session, mod1, item1] + + While the stack is in this shape, it is allowed to add finalizers to + each of session, mod1, item1 using addfinalizer(). + + During the teardown phase of item1, teardown_exact(item2) is called, + where item2 is the next item to item1. What it does is: + + pop item1 from stack, run its teardowns + pop mod1 from stack, run its teardowns + + mod1 was popped because it ended its purpose with item1. The stack is: + + [session] + + During the setup phase of item2, setup(item2) is called. What it does + is: + + push mod2 to stack, run mod2.setup() + push item2 to stack, run item2.setup() + + Stack: + + [session, mod2, item2] + + During the teardown phase of item2, teardown_exact(None) is called, + because item2 is the last item. What it does is: + + pop item2 from stack, run its teardowns + pop mod2 from stack, run its teardowns + pop session from stack, run its teardowns + + Stack: + + [] + + The end! + """ + + def __init__(self) -> None: + # The stack is in the dict insertion order. + self.stack: dict[ + Node, + tuple[ + # Node's finalizers. + list[Callable[[], object]], + # Node's exception and original traceback, if its setup raised. + tuple[OutcomeException | Exception, types.TracebackType | None] | None, + ], + ] = {} + + def setup(self, item: Item) -> None: + """Setup objects along the collector chain to the item.""" + needed_collectors = item.listchain() + + # If a collector fails its setup, fail its entire subtree of items. + # The setup is not retried for each item - the same exception is used. + for col, (finalizers, exc) in self.stack.items(): + assert col in needed_collectors, "previous item was not torn down properly" + if exc: + raise exc[0].with_traceback(exc[1]) + + for col in needed_collectors[len(self.stack) :]: + assert col not in self.stack + # Push onto the stack. + self.stack[col] = ([col.teardown], None) + try: + col.setup() + except TEST_OUTCOME as exc: + self.stack[col] = (self.stack[col][0], (exc, exc.__traceback__)) + raise + + def addfinalizer(self, finalizer: Callable[[], object], node: Node) -> None: + """Attach a finalizer to the given node. + + The node must be currently active in the stack. + """ + assert node and not isinstance(node, tuple) + assert callable(finalizer) + assert node in self.stack, (node, self.stack) + self.stack[node][0].append(finalizer) + + def teardown_exact(self, nextitem: Item | None) -> None: + """Teardown the current stack up until reaching nodes that nextitem + also descends from. + + When nextitem is None (meaning we're at the last item), the entire + stack is torn down. + """ + needed_collectors = (nextitem and nextitem.listchain()) or [] + exceptions: list[BaseException] = [] + while self.stack: + if list(self.stack.keys()) == needed_collectors[: len(self.stack)]: + break + node, (finalizers, _) = self.stack.popitem() + these_exceptions = [] + while finalizers: + fin = finalizers.pop() + try: + fin() + except TEST_OUTCOME as e: + these_exceptions.append(e) + + if len(these_exceptions) == 1: + exceptions.extend(these_exceptions) + elif these_exceptions: + msg = f"errors while tearing down {node!r}" + exceptions.append(BaseExceptionGroup(msg, these_exceptions[::-1])) + + if len(exceptions) == 1: + raise exceptions[0] + elif exceptions: + raise BaseExceptionGroup("errors during test teardown", exceptions[::-1]) + if nextitem is None: + assert not self.stack + + +def collect_one_node(collector: Collector) -> CollectReport: + ihook = collector.ihook + ihook.pytest_collectstart(collector=collector) + rep: CollectReport = ihook.pytest_make_collect_report(collector=collector) + call = rep.__dict__.pop("call", None) + if call and check_interactive_exception(call, rep): + ihook.pytest_exception_interact(node=collector, call=call, report=rep) + return rep diff --git a/micromamba_root/Lib/site-packages/_pytest/scope.py b/micromamba_root/Lib/site-packages/_pytest/scope.py new file mode 100644 index 0000000000000000000000000000000000000000..2b007e878936a2c7c8b40d7470ea6ac457c5251b --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/scope.py @@ -0,0 +1,91 @@ +""" +Scope definition and related utilities. + +Those are defined here, instead of in the 'fixtures' module because +their use is spread across many other pytest modules, and centralizing it in 'fixtures' +would cause circular references. + +Also this makes the module light to import, as it should. +""" + +from __future__ import annotations + +from enum import Enum +from functools import total_ordering +from typing import Literal + + +_ScopeName = Literal["session", "package", "module", "class", "function"] + + +@total_ordering +class Scope(Enum): + """ + Represents one of the possible fixture scopes in pytest. + + Scopes are ordered from lower to higher, that is: + + ->>> higher ->>> + + Function < Class < Module < Package < Session + + <<<- lower <<<- + """ + + # Scopes need to be listed from lower to higher. + Function = "function" + Class = "class" + Module = "module" + Package = "package" + Session = "session" + + def next_lower(self) -> Scope: + """Return the next lower scope.""" + index = _SCOPE_INDICES[self] + if index == 0: + raise ValueError(f"{self} is the lower-most scope") + return _ALL_SCOPES[index - 1] + + def next_higher(self) -> Scope: + """Return the next higher scope.""" + index = _SCOPE_INDICES[self] + if index == len(_SCOPE_INDICES) - 1: + raise ValueError(f"{self} is the upper-most scope") + return _ALL_SCOPES[index + 1] + + def __lt__(self, other: Scope) -> bool: + self_index = _SCOPE_INDICES[self] + other_index = _SCOPE_INDICES[other] + return self_index < other_index + + @classmethod + def from_user( + cls, scope_name: _ScopeName, descr: str, where: str | None = None + ) -> Scope: + """ + Given a scope name from the user, return the equivalent Scope enum. Should be used + whenever we want to convert a user provided scope name to its enum object. + + If the scope name is invalid, construct a user friendly message and call pytest.fail. + """ + from _pytest.outcomes import fail + + try: + # Holding this reference is necessary for mypy at the moment. + scope = Scope(scope_name) + except ValueError: + fail( + "{} {}got an unexpected scope value '{}'".format( + descr, f"from {where} " if where else "", scope_name + ), + pytrace=False, + ) + return scope + + +_ALL_SCOPES = list(Scope) +_SCOPE_INDICES = {scope: index for index, scope in enumerate(_ALL_SCOPES)} + + +# Ordered list of scopes which can contain many tests (in practice all except Function). +HIGH_SCOPES = [x for x in Scope if x is not Scope.Function] diff --git a/micromamba_root/Lib/site-packages/_pytest/setuponly.py b/micromamba_root/Lib/site-packages/_pytest/setuponly.py new file mode 100644 index 0000000000000000000000000000000000000000..7e6b46bcdb4ab6e646653df9f847b11b5f50e943 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/setuponly.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Generator + +from _pytest._io.saferepr import saferepr +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import SubRequest +from _pytest.scope import Scope +import pytest + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--setuponly", + "--setup-only", + action="store_true", + help="Only setup fixtures, do not execute tests", + ) + group.addoption( + "--setupshow", + "--setup-show", + action="store_true", + help="Show setup of fixtures while executing tests", + ) + + +@pytest.hookimpl(wrapper=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[object], request: SubRequest +) -> Generator[None, object, object]: + try: + return (yield) + finally: + if request.config.option.setupshow: + if hasattr(request, "param"): + # Save the fixture parameter so ._show_fixture_action() can + # display it now and during the teardown (in .finish()). + if fixturedef.ids: + if callable(fixturedef.ids): + param = fixturedef.ids(request.param) + else: + param = fixturedef.ids[request.param_index] + else: + param = request.param + fixturedef.cached_param = param # type: ignore[attr-defined] + _show_fixture_action(fixturedef, request.config, "SETUP") + + +def pytest_fixture_post_finalizer( + fixturedef: FixtureDef[object], request: SubRequest +) -> None: + if fixturedef.cached_result is not None: + config = request.config + if config.option.setupshow: + _show_fixture_action(fixturedef, request.config, "TEARDOWN") + if hasattr(fixturedef, "cached_param"): + del fixturedef.cached_param + + +def _show_fixture_action( + fixturedef: FixtureDef[object], config: Config, msg: str +) -> None: + capman = config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture() + + tw = config.get_terminal_writer() + tw.line() + # Use smaller indentation the higher the scope: Session = 0, Package = 1, etc. + scope_indent = list(reversed(Scope)).index(fixturedef._scope) + tw.write(" " * 2 * scope_indent) + + scopename = fixturedef.scope[0].upper() + tw.write(f"{msg:<8} {scopename} {fixturedef.argname}") + + if msg == "SETUP": + deps = sorted(arg for arg in fixturedef.argnames if arg != "request") + if deps: + tw.write(" (fixtures used: {})".format(", ".join(deps))) + + if hasattr(fixturedef, "cached_param"): + tw.write(f"[{saferepr(fixturedef.cached_param, maxsize=42)}]") + + tw.flush() + + if capman: + capman.resume_global_capture() + + +@pytest.hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.setuponly: + config.option.setupshow = True + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/setupplan.py b/micromamba_root/Lib/site-packages/_pytest/setupplan.py new file mode 100644 index 0000000000000000000000000000000000000000..4e124cce2434e02d928c8ceb8cc8eaf63e271404 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/setupplan.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import SubRequest +import pytest + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--setupplan", + "--setup-plan", + action="store_true", + help="Show what fixtures and tests would be executed but " + "don't execute anything", + ) + + +@pytest.hookimpl(tryfirst=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[object], request: SubRequest +) -> object | None: + # Will return a dummy fixture if the setuponly option is provided. + if request.config.option.setupplan: + my_cache_key = fixturedef.cache_key(request) + fixturedef.cached_result = (None, my_cache_key, None) + return fixturedef.cached_result + return None + + +@pytest.hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.setupplan: + config.option.setuponly = True + config.option.setupshow = True + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/skipping.py b/micromamba_root/Lib/site-packages/_pytest/skipping.py new file mode 100644 index 0000000000000000000000000000000000000000..3b067629de0ea681b4e165b73748d27658835197 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/skipping.py @@ -0,0 +1,321 @@ +# mypy: allow-untyped-defs +"""Support for skip/xfail functions and markers.""" + +from __future__ import annotations + +from collections.abc import Generator +from collections.abc import Mapping +import dataclasses +import os +import platform +import sys +import traceback + +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.mark.structures import Mark +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import xfail +from _pytest.raises import AbstractRaises +from _pytest.reports import BaseReport +from _pytest.reports import TestReport +from _pytest.runner import CallInfo +from _pytest.stash import StashKey + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--runxfail", + action="store_true", + dest="runxfail", + default=False, + help="Report the results of xfail tests as if they were not marked", + ) + + parser.addini( + "strict_xfail", + "Default for the strict parameter of xfail " + "markers when not given explicitly (default: False) (alias: xfail_strict)", + type="bool", + # None => fallback to `strict`. + default=None, + aliases=["xfail_strict"], + ) + + +def pytest_configure(config: Config) -> None: + if config.option.runxfail: + # yay a hack + import pytest + + old = pytest.xfail + config.add_cleanup(lambda: setattr(pytest, "xfail", old)) + + def nop(*args, **kwargs): + pass + + nop.Exception = xfail.Exception # type: ignore[attr-defined] + setattr(pytest, "xfail", nop) + + config.addinivalue_line( + "markers", + "skip(reason=None): skip the given test function with an optional reason. " + 'Example: skip(reason="no way of currently testing this") skips the ' + "test.", + ) + config.addinivalue_line( + "markers", + "skipif(condition, ..., *, reason=...): " + "skip the given test function if any of the conditions evaluate to True. " + "Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. " + "See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif", + ) + config.addinivalue_line( + "markers", + "xfail(condition, ..., *, reason=..., run=True, raises=None, strict=strict_xfail): " + "mark the test function as an expected failure if any of the conditions " + "evaluate to True. Optionally specify a reason for better reporting " + "and run=False if you don't even want to execute the test function. " + "If only specific exception(s) are expected, you can list them in " + "raises, and if the test fails in other ways, it will be reported as " + "a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail", + ) + + +def evaluate_condition(item: Item, mark: Mark, condition: object) -> tuple[bool, str]: + """Evaluate a single skipif/xfail condition. + + If an old-style string condition is given, it is eval()'d, otherwise the + condition is bool()'d. If this fails, an appropriately formatted pytest.fail + is raised. + + Returns (result, reason). The reason is only relevant if the result is True. + """ + # String condition. + if isinstance(condition, str): + globals_ = { + "os": os, + "sys": sys, + "platform": platform, + "config": item.config, + } + for dictionary in reversed( + item.ihook.pytest_markeval_namespace(config=item.config) + ): + if not isinstance(dictionary, Mapping): + raise ValueError( + f"pytest_markeval_namespace() needs to return a dict, got {dictionary!r}" + ) + globals_.update(dictionary) + if hasattr(item, "obj"): + globals_.update(item.obj.__globals__) + try: + filename = f"<{mark.name} condition>" + condition_code = compile(condition, filename, "eval") + result = eval(condition_code, globals_) + except SyntaxError as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition", + " " + condition, + " " + " " * (exc.offset or 0) + "^", + "SyntaxError: invalid syntax", + ] + fail("\n".join(msglines), pytrace=False) + except Exception as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition", + " " + condition, + *traceback.format_exception_only(type(exc), exc), + ] + fail("\n".join(msglines), pytrace=False) + + # Boolean condition. + else: + try: + result = bool(condition) + except Exception as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition as a boolean", + *traceback.format_exception_only(type(exc), exc), + ] + fail("\n".join(msglines), pytrace=False) + + reason = mark.kwargs.get("reason", None) + if reason is None: + if isinstance(condition, str): + reason = "condition: " + condition + else: + # XXX better be checked at collection time + msg = ( + f"Error evaluating {mark.name!r}: " + + "you need to specify reason=STRING when using booleans as conditions." + ) + fail(msg, pytrace=False) + + return result, reason + + +@dataclasses.dataclass(frozen=True) +class Skip: + """The result of evaluate_skip_marks().""" + + reason: str = "unconditional skip" + + +def evaluate_skip_marks(item: Item) -> Skip | None: + """Evaluate skip and skipif marks on item, returning Skip if triggered.""" + for mark in item.iter_markers(name="skipif"): + if "condition" not in mark.kwargs: + conditions = mark.args + else: + conditions = (mark.kwargs["condition"],) + + # Unconditional. + if not conditions: + reason = mark.kwargs.get("reason", "") + return Skip(reason) + + # If any of the conditions are true. + for condition in conditions: + result, reason = evaluate_condition(item, mark, condition) + if result: + return Skip(reason) + + for mark in item.iter_markers(name="skip"): + try: + return Skip(*mark.args, **mark.kwargs) + except TypeError as e: + raise TypeError(str(e) + " - maybe you meant pytest.mark.skipif?") from None + + return None + + +@dataclasses.dataclass(frozen=True) +class Xfail: + """The result of evaluate_xfail_marks().""" + + __slots__ = ("raises", "reason", "run", "strict") + + reason: str + run: bool + strict: bool + raises: ( + type[BaseException] + | tuple[type[BaseException], ...] + | AbstractRaises[BaseException] + | None + ) + + +def evaluate_xfail_marks(item: Item) -> Xfail | None: + """Evaluate xfail marks on item, returning Xfail if triggered.""" + for mark in item.iter_markers(name="xfail"): + run = mark.kwargs.get("run", True) + strict = mark.kwargs.get("strict") + if strict is None: + strict = item.config.getini("strict_xfail") + if strict is None: + strict = item.config.getini("strict") + raises = mark.kwargs.get("raises", None) + if "condition" not in mark.kwargs: + conditions = mark.args + else: + conditions = (mark.kwargs["condition"],) + + # Unconditional. + if not conditions: + reason = mark.kwargs.get("reason", "") + return Xfail(reason, run, strict, raises) + + # If any of the conditions are true. + for condition in conditions: + result, reason = evaluate_condition(item, mark, condition) + if result: + return Xfail(reason, run, strict, raises) + + return None + + +# Saves the xfail mark evaluation. Can be refreshed during call if None. +xfailed_key = StashKey[Xfail | None]() + + +@hookimpl(tryfirst=True) +def pytest_runtest_setup(item: Item) -> None: + skipped = evaluate_skip_marks(item) + if skipped: + raise skip.Exception(skipped.reason, _use_item_location=True) + + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + if xfailed and not item.config.option.runxfail and not xfailed.run: + xfail("[NOTRUN] " + xfailed.reason) + + +@hookimpl(wrapper=True) +def pytest_runtest_call(item: Item) -> Generator[None]: + xfailed = item.stash.get(xfailed_key, None) + if xfailed is None: + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + + if xfailed and not item.config.option.runxfail and not xfailed.run: + xfail("[NOTRUN] " + xfailed.reason) + + try: + return (yield) + finally: + # The test run may have added an xfail mark dynamically. + xfailed = item.stash.get(xfailed_key, None) + if xfailed is None: + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + + +@hookimpl(wrapper=True) +def pytest_runtest_makereport( + item: Item, call: CallInfo[None] +) -> Generator[None, TestReport, TestReport]: + rep = yield + xfailed = item.stash.get(xfailed_key, None) + if item.config.option.runxfail: + pass # don't interfere + elif call.excinfo and isinstance(call.excinfo.value, xfail.Exception): + assert call.excinfo.value.msg is not None + rep.wasxfail = call.excinfo.value.msg + rep.outcome = "skipped" + elif not rep.skipped and xfailed: + if call.excinfo: + raises = xfailed.raises + if raises is None or ( + ( + isinstance(raises, type | tuple) + and isinstance(call.excinfo.value, raises) + ) + or ( + isinstance(raises, AbstractRaises) + and raises.matches(call.excinfo.value) + ) + ): + rep.outcome = "skipped" + rep.wasxfail = xfailed.reason + else: + rep.outcome = "failed" + elif call.when == "call": + if xfailed.strict: + rep.outcome = "failed" + rep.longrepr = "[XPASS(strict)] " + xfailed.reason + else: + rep.outcome = "passed" + rep.wasxfail = xfailed.reason + return rep + + +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str] | None: + if hasattr(report, "wasxfail"): + if report.skipped: + return "xfailed", "x", "XFAIL" + elif report.passed: + return "xpassed", "X", "XPASS" + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/stash.py b/micromamba_root/Lib/site-packages/_pytest/stash.py new file mode 100644 index 0000000000000000000000000000000000000000..6a9ff884e04880129db61e4b521be72e18c31919 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/stash.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from typing import Any +from typing import cast +from typing import Generic +from typing import TypeVar + + +__all__ = ["Stash", "StashKey"] + + +T = TypeVar("T") +D = TypeVar("D") + + +class StashKey(Generic[T]): + """``StashKey`` is an object used as a key to a :class:`Stash`. + + A ``StashKey`` is associated with the type ``T`` of the value of the key. + + A ``StashKey`` is unique and cannot conflict with another key. + + .. versionadded:: 7.0 + """ + + __slots__ = () + + +class Stash: + r"""``Stash`` is a type-safe heterogeneous mutable mapping that + allows keys and value types to be defined separately from + where it (the ``Stash``) is created. + + Usually you will be given an object which has a ``Stash``, for example + :class:`~pytest.Config` or a :class:`~_pytest.nodes.Node`: + + .. code-block:: python + + stash: Stash = some_object.stash + + If a module or plugin wants to store data in this ``Stash``, it creates + :class:`StashKey`\s for its keys (at the module level): + + .. code-block:: python + + # At the top-level of the module + some_str_key = StashKey[str]() + some_bool_key = StashKey[bool]() + + To store information: + + .. code-block:: python + + # Value type must match the key. + stash[some_str_key] = "value" + stash[some_bool_key] = True + + To retrieve the information: + + .. code-block:: python + + # The static type of some_str is str. + some_str = stash[some_str_key] + # The static type of some_bool is bool. + some_bool = stash[some_bool_key] + + .. versionadded:: 7.0 + """ + + __slots__ = ("_storage",) + + def __init__(self) -> None: + self._storage: dict[StashKey[Any], object] = {} + + def __setitem__(self, key: StashKey[T], value: T) -> None: + """Set a value for key.""" + self._storage[key] = value + + def __getitem__(self, key: StashKey[T]) -> T: + """Get the value for key. + + Raises ``KeyError`` if the key wasn't set before. + """ + return cast(T, self._storage[key]) + + def get(self, key: StashKey[T], default: D) -> T | D: + """Get the value for key, or return default if the key wasn't set + before.""" + try: + return self[key] + except KeyError: + return default + + def setdefault(self, key: StashKey[T], default: T) -> T: + """Return the value of key if already set, otherwise set the value + of key to default and return default.""" + try: + return self[key] + except KeyError: + self[key] = default + return default + + def __delitem__(self, key: StashKey[T]) -> None: + """Delete the value for key. + + Raises ``KeyError`` if the key wasn't set before. + """ + del self._storage[key] + + def __contains__(self, key: StashKey[T]) -> bool: + """Return whether key was set.""" + return key in self._storage + + def __len__(self) -> int: + """Return how many items exist in the stash.""" + return len(self._storage) diff --git a/micromamba_root/Lib/site-packages/_pytest/stepwise.py b/micromamba_root/Lib/site-packages/_pytest/stepwise.py new file mode 100644 index 0000000000000000000000000000000000000000..8901540eb59760822b1346861f8f8098fabe83a4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/stepwise.py @@ -0,0 +1,209 @@ +from __future__ import annotations + +import dataclasses +from datetime import datetime +from datetime import timedelta +from typing import Any +from typing import TYPE_CHECKING + +from _pytest import nodes +from _pytest.cacheprovider import Cache +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.main import Session +from _pytest.reports import TestReport + + +if TYPE_CHECKING: + from typing_extensions import Self + +STEPWISE_CACHE_DIR = "cache/stepwise" + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--sw", + "--stepwise", + action="store_true", + default=False, + dest="stepwise", + help="Exit on test failure and continue from last failing test next time", + ) + group.addoption( + "--sw-skip", + "--stepwise-skip", + action="store_true", + default=False, + dest="stepwise_skip", + help="Ignore the first failing test but stop on the next failing test. " + "Implicitly enables --stepwise.", + ) + group.addoption( + "--sw-reset", + "--stepwise-reset", + action="store_true", + default=False, + dest="stepwise_reset", + help="Resets stepwise state, restarting the stepwise workflow. " + "Implicitly enables --stepwise.", + ) + + +def pytest_configure(config: Config) -> None: + # --stepwise-skip/--stepwise-reset implies stepwise. + if config.option.stepwise_skip or config.option.stepwise_reset: + config.option.stepwise = True + if config.getoption("stepwise"): + config.pluginmanager.register(StepwisePlugin(config), "stepwiseplugin") + + +def pytest_sessionfinish(session: Session) -> None: + if not session.config.getoption("stepwise"): + assert session.config.cache is not None + if hasattr(session.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return + + +@dataclasses.dataclass +class StepwiseCacheInfo: + # The nodeid of the last failed test. + last_failed: str | None + + # The number of tests in the last time --stepwise was run. + # We use this information as a simple way to invalidate the cache information, avoiding + # confusing behavior in case the cache is stale. + last_test_count: int | None + + # The date when the cache was last updated, for information purposes only. + last_cache_date_str: str + + @property + def last_cache_date(self) -> datetime: + return datetime.fromisoformat(self.last_cache_date_str) + + @classmethod + def empty(cls) -> Self: + return cls( + last_failed=None, + last_test_count=None, + last_cache_date_str=datetime.now().isoformat(), + ) + + def update_date_to_now(self) -> None: + self.last_cache_date_str = datetime.now().isoformat() + + +class StepwisePlugin: + def __init__(self, config: Config) -> None: + self.config = config + self.session: Session | None = None + self.report_status: list[str] = [] + assert config.cache is not None + self.cache: Cache = config.cache + self.skip: bool = config.getoption("stepwise_skip") + self.reset: bool = config.getoption("stepwise_reset") + self.cached_info = self._load_cached_info() + + def _load_cached_info(self) -> StepwiseCacheInfo: + cached_dict: dict[str, Any] | None = self.cache.get(STEPWISE_CACHE_DIR, None) + if cached_dict: + try: + return StepwiseCacheInfo( + cached_dict["last_failed"], + cached_dict["last_test_count"], + cached_dict["last_cache_date_str"], + ) + except (KeyError, TypeError) as e: + error = f"{type(e).__name__}: {e}" + self.report_status.append(f"error reading cache, discarding ({error})") + + # Cache not found or error during load, return a new cache. + return StepwiseCacheInfo.empty() + + def pytest_sessionstart(self, session: Session) -> None: + self.session = session + + def pytest_collection_modifyitems( + self, config: Config, items: list[nodes.Item] + ) -> None: + last_test_count = self.cached_info.last_test_count + self.cached_info.last_test_count = len(items) + + if self.reset: + self.report_status.append("resetting state, not skipping.") + self.cached_info.last_failed = None + return + + if not self.cached_info.last_failed: + self.report_status.append("no previously failed tests, not skipping.") + return + + if last_test_count is not None and last_test_count != len(items): + self.report_status.append( + f"test count changed, not skipping (now {len(items)} tests, previously {last_test_count})." + ) + self.cached_info.last_failed = None + return + + # Check all item nodes until we find a match on last failed. + failed_index = None + for index, item in enumerate(items): + if item.nodeid == self.cached_info.last_failed: + failed_index = index + break + + # If the previously failed test was not found among the test items, + # do not skip any tests. + if failed_index is None: + self.report_status.append("previously failed test not found, not skipping.") + else: + cache_age = datetime.now() - self.cached_info.last_cache_date + # Round up to avoid showing microseconds. + cache_age = timedelta(seconds=int(cache_age.total_seconds())) + self.report_status.append( + f"skipping {failed_index} already passed items (cache from {cache_age} ago," + f" use --sw-reset to discard)." + ) + deselected = items[:failed_index] + del items[:failed_index] + config.hook.pytest_deselected(items=deselected) + + def pytest_runtest_logreport(self, report: TestReport) -> None: + if report.failed: + if self.skip: + # Remove test from the failed ones (if it exists) and unset the skip option + # to make sure the following tests will not be skipped. + if report.nodeid == self.cached_info.last_failed: + self.cached_info.last_failed = None + + self.skip = False + else: + # Mark test as the last failing and interrupt the test session. + self.cached_info.last_failed = report.nodeid + assert self.session is not None + self.session.shouldstop = ( + "Test failed, continuing from this test next run." + ) + + else: + # If the test was actually run and did pass. + if report.when == "call": + # Remove test from the failed ones, if exists. + if report.nodeid == self.cached_info.last_failed: + self.cached_info.last_failed = None + + def pytest_report_collectionfinish(self) -> list[str] | None: + if self.config.get_verbosity() >= 0 and self.report_status: + return [f"stepwise: {x}" for x in self.report_status] + return None + + def pytest_sessionfinish(self) -> None: + if hasattr(self.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return + self.cached_info.update_date_to_now() + self.cache.set(STEPWISE_CACHE_DIR, dataclasses.asdict(self.cached_info)) diff --git a/micromamba_root/Lib/site-packages/_pytest/subtests.py b/micromamba_root/Lib/site-packages/_pytest/subtests.py new file mode 100644 index 0000000000000000000000000000000000000000..e0ceb27f4b1ca8f6681faf082c314fc1bebd3f04 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/subtests.py @@ -0,0 +1,411 @@ +"""Builtin plugin that adds subtests support.""" + +from __future__ import annotations + +from collections import defaultdict +from collections.abc import Callable +from collections.abc import Iterator +from collections.abc import Mapping +from contextlib import AbstractContextManager +from contextlib import contextmanager +from contextlib import ExitStack +from contextlib import nullcontext +import dataclasses +import time +from types import TracebackType +from typing import Any +from typing import TYPE_CHECKING + +import pluggy + +from _pytest._code import ExceptionInfo +from _pytest._io.saferepr import saferepr +from _pytest.capture import CaptureFixture +from _pytest.capture import FDCapture +from _pytest.capture import SysCapture +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import SubRequest +from _pytest.logging import catching_logs +from _pytest.logging import LogCaptureHandler +from _pytest.logging import LoggingPlugin +from _pytest.reports import TestReport +from _pytest.runner import CallInfo +from _pytest.runner import check_interactive_exception +from _pytest.runner import get_reraise_exceptions +from _pytest.stash import StashKey + + +if TYPE_CHECKING: + from typing_extensions import Self + + +def pytest_addoption(parser: Parser) -> None: + Config._add_verbosity_ini( + parser, + Config.VERBOSITY_SUBTESTS, + help=( + "Specify verbosity level for subtests. " + "Higher levels will generate output for passed subtests. Failed subtests are always reported." + ), + ) + + +@dataclasses.dataclass(frozen=True, slots=True, kw_only=True) +class SubtestContext: + """The values passed to Subtests.test() that are included in the test report.""" + + msg: str | None + kwargs: Mapping[str, Any] + + def _to_json(self) -> dict[str, Any]: + return dataclasses.asdict(self) + + @classmethod + def _from_json(cls, d: dict[str, Any]) -> Self: + return cls(msg=d["msg"], kwargs=d["kwargs"]) + + +@dataclasses.dataclass(init=False) +class SubtestReport(TestReport): + context: SubtestContext + + @property + def head_line(self) -> str: + _, _, domain = self.location + return f"{domain} {self._sub_test_description()}" + + def _sub_test_description(self) -> str: + parts = [] + if self.context.msg is not None: + parts.append(f"[{self.context.msg}]") + if self.context.kwargs: + params_desc = ", ".join( + f"{k}={saferepr(v)}" for (k, v) in self.context.kwargs.items() + ) + parts.append(f"({params_desc})") + return " ".join(parts) or "()" + + def _to_json(self) -> dict[str, Any]: + data = super()._to_json() + del data["context"] + data["_report_type"] = "SubTestReport" + data["_subtest.context"] = self.context._to_json() + return data + + @classmethod + def _from_json(cls, reportdict: dict[str, Any]) -> SubtestReport: + report = super()._from_json(reportdict) + report.context = SubtestContext._from_json(reportdict["_subtest.context"]) + return report + + @classmethod + def _new( + cls, + test_report: TestReport, + context: SubtestContext, + captured_output: Captured | None, + captured_logs: CapturedLogs | None, + ) -> Self: + result = super()._from_json(test_report._to_json()) + result.context = context + + if captured_output: + if captured_output.out: + result.sections.append(("Captured stdout call", captured_output.out)) + if captured_output.err: + result.sections.append(("Captured stderr call", captured_output.err)) + + if captured_logs and (log := captured_logs.handler.stream.getvalue()): + result.sections.append(("Captured log call", log)) + + return result + + +@fixture +def subtests(request: SubRequest) -> Subtests: + """Provides subtests functionality.""" + capmam = request.node.config.pluginmanager.get_plugin("capturemanager") + suspend_capture_ctx = ( + capmam.global_and_fixture_disabled if capmam is not None else nullcontext + ) + return Subtests(request.node.ihook, suspend_capture_ctx, request, _ispytest=True) + + +class Subtests: + """Subtests fixture, enables declaring subtests inside test functions via the :meth:`test` method.""" + + def __init__( + self, + ihook: pluggy.HookRelay, + suspend_capture_ctx: Callable[[], AbstractContextManager[None]], + request: SubRequest, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._ihook = ihook + self._suspend_capture_ctx = suspend_capture_ctx + self._request = request + + def test( + self, + msg: str | None = None, + **kwargs: Any, + ) -> _SubTestContextManager: + """ + Context manager for subtests, capturing exceptions raised inside the subtest scope and + reporting assertion failures and errors individually. + + Usage + ----- + + .. code-block:: python + + def test(subtests): + for i in range(5): + with subtests.test("custom message", i=i): + assert i % 2 == 0 + + :param msg: + If given, the message will be shown in the test report in case of subtest failure. + + :param kwargs: + Arbitrary values that are also added to the subtest report. + """ + return _SubTestContextManager( + self._ihook, + msg, + kwargs, + request=self._request, + suspend_capture_ctx=self._suspend_capture_ctx, + config=self._request.config, + ) + + +@dataclasses.dataclass +class _SubTestContextManager: + """ + Context manager for subtests, capturing exceptions raised inside the subtest scope and handling + them through the pytest machinery. + """ + + # Note: initially the logic for this context manager was implemented directly + # in Subtests.test() as a @contextmanager, however, it is not possible to control the output fully when + # exiting from it due to an exception when in `--exitfirst` mode, so this was refactored into an + # explicit context manager class (pytest-dev/pytest-subtests#134). + + ihook: pluggy.HookRelay + msg: str | None + kwargs: dict[str, Any] + suspend_capture_ctx: Callable[[], AbstractContextManager[None]] + request: SubRequest + config: Config + + def __enter__(self) -> None: + __tracebackhide__ = True + + self._start = time.time() + self._precise_start = time.perf_counter() + self._exc_info = None + + self._exit_stack = ExitStack() + self._captured_output = self._exit_stack.enter_context( + capturing_output(self.request) + ) + self._captured_logs = self._exit_stack.enter_context( + capturing_logs(self.request) + ) + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + __tracebackhide__ = True + if exc_val is not None: + exc_info = ExceptionInfo.from_exception(exc_val) + else: + exc_info = None + + self._exit_stack.close() + + precise_stop = time.perf_counter() + duration = precise_stop - self._precise_start + stop = time.time() + + call_info = CallInfo[None]( + None, + exc_info, + start=self._start, + stop=stop, + duration=duration, + when="call", + _ispytest=True, + ) + report = self.ihook.pytest_runtest_makereport( + item=self.request.node, call=call_info + ) + sub_report = SubtestReport._new( + report, + SubtestContext(msg=self.msg, kwargs=self.kwargs), + captured_output=self._captured_output, + captured_logs=self._captured_logs, + ) + + if sub_report.failed: + failed_subtests = self.config.stash[failed_subtests_key] + failed_subtests[self.request.node.nodeid] += 1 + + with self.suspend_capture_ctx(): + self.ihook.pytest_runtest_logreport(report=sub_report) + + if check_interactive_exception(call_info, sub_report): + self.ihook.pytest_exception_interact( + node=self.request.node, call=call_info, report=sub_report + ) + + if exc_val is not None: + if isinstance(exc_val, get_reraise_exceptions(self.config)): + return False + if self.request.session.shouldfail: + return False + return True + + +@contextmanager +def capturing_output(request: SubRequest) -> Iterator[Captured]: + option = request.config.getoption("capture", None) + + capman = request.config.pluginmanager.getplugin("capturemanager") + if getattr(capman, "_capture_fixture", None): + # capsys or capfd are active, subtest should not capture. + fixture = None + elif option == "sys": + fixture = CaptureFixture(SysCapture, request, _ispytest=True) + elif option == "fd": + fixture = CaptureFixture(FDCapture, request, _ispytest=True) + else: + fixture = None + + if fixture is not None: + fixture._start() + + captured = Captured() + try: + yield captured + finally: + if fixture is not None: + out, err = fixture.readouterr() + fixture.close() + captured.out = out + captured.err = err + + +@contextmanager +def capturing_logs( + request: SubRequest, +) -> Iterator[CapturedLogs | None]: + logging_plugin: LoggingPlugin | None = request.config.pluginmanager.getplugin( + "logging-plugin" + ) + if logging_plugin is None: + yield None + else: + handler = LogCaptureHandler() + handler.setFormatter(logging_plugin.formatter) + + captured_logs = CapturedLogs(handler) + with catching_logs(handler, level=logging_plugin.log_level): + yield captured_logs + + +@dataclasses.dataclass +class Captured: + out: str = "" + err: str = "" + + +@dataclasses.dataclass +class CapturedLogs: + handler: LogCaptureHandler + + +def pytest_report_to_serializable(report: TestReport) -> dict[str, Any] | None: + if isinstance(report, SubtestReport): + return report._to_json() + return None + + +def pytest_report_from_serializable(data: dict[str, Any]) -> SubtestReport | None: + if data.get("_report_type") == "SubTestReport": + return SubtestReport._from_json(data) + return None + + +# Dict of nodeid -> number of failed subtests. +# Used to fail top-level tests that passed but contain failed subtests. +failed_subtests_key = StashKey[defaultdict[str, int]]() + + +def pytest_configure(config: Config) -> None: + config.stash[failed_subtests_key] = defaultdict(lambda: 0) + + +@hookimpl(tryfirst=True) +def pytest_report_teststatus( + report: TestReport, + config: Config, +) -> tuple[str, str, str | Mapping[str, bool]] | None: + if report.when != "call": + return None + + quiet = config.get_verbosity(Config.VERBOSITY_SUBTESTS) == 0 + if isinstance(report, SubtestReport): + outcome = report.outcome + description = report._sub_test_description() + + if hasattr(report, "wasxfail"): + if quiet: + return "", "", "" + elif outcome == "skipped": + category = "xfailed" + short = "y" # x letter is used for regular xfail, y for subtest xfail + status = "SUBXFAIL" + # outcome == "passed" in an xfail is only possible via a @pytest.mark.xfail mark, which + # is not applicable to a subtest, which only handles pytest.xfail(). + else: # pragma: no cover + # This should not normally happen, unless some plugin is setting wasxfail without + # the correct outcome. Pytest expects the call outcome to be either skipped or + # passed in case of xfail. + # Let's pass this report to the next hook. + return None + return category, short, f"{status}{description}" + + if report.failed: + return outcome, "u", f"SUBFAILED{description}" + else: + if report.passed: + if quiet: + return "", "", "" + else: + return f"subtests {outcome}", "u", f"SUBPASSED{description}" + elif report.skipped: + if quiet: + return "", "", "" + else: + return outcome, "-", f"SUBSKIPPED{description}" + + else: + failed_subtests_count = config.stash[failed_subtests_key][report.nodeid] + # Top-level test, fail if it contains failed subtests and it has passed. + if report.passed and failed_subtests_count > 0: + report.outcome = "failed" + suffix = "s" if failed_subtests_count > 1 else "" + report.longrepr = f"contains {failed_subtests_count} failed subtest{suffix}" + + return None diff --git a/micromamba_root/Lib/site-packages/_pytest/terminal.py b/micromamba_root/Lib/site-packages/_pytest/terminal.py new file mode 100644 index 0000000000000000000000000000000000000000..e66e4f48dd69b1127185e46cb9c0a95390268909 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/terminal.py @@ -0,0 +1,1763 @@ +# mypy: allow-untyped-defs +"""Terminal reporting of the full testing process. + +This is a good source for looking at the various reporting hooks. +""" + +from __future__ import annotations + +import argparse +from collections import Counter +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Mapping +from collections.abc import Sequence +import dataclasses +import datetime +from functools import partial +import inspect +from pathlib import Path +import platform +import sys +import textwrap +from typing import Any +from typing import ClassVar +from typing import final +from typing import Literal +from typing import NamedTuple +from typing import TextIO +from typing import TYPE_CHECKING +import warnings + +import pluggy + +from _pytest import compat +from _pytest import nodes +from _pytest import timing +from _pytest._code import ExceptionInfo +from _pytest._code.code import ExceptionRepr +from _pytest._io import TerminalWriter +from _pytest._io.wcwidth import wcswidth +import _pytest._version +from _pytest.compat import running_on_ci +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.reports import BaseReport +from _pytest.reports import CollectReport +from _pytest.reports import TestReport + + +if TYPE_CHECKING: + from _pytest.main import Session + + +REPORT_COLLECTING_RESOLUTION = 0.5 + +KNOWN_TYPES = ( + "failed", + "passed", + "skipped", + "deselected", + "xfailed", + "xpassed", + "warnings", + "error", + "subtests passed", + "subtests failed", + "subtests skipped", +) + +_REPORTCHARS_DEFAULT = "fE" + + +class MoreQuietAction(argparse.Action): + """A modified copy of the argparse count action which counts down and updates + the legacy quiet attribute at the same time. + + Used to unify verbosity handling. + """ + + def __init__( + self, + option_strings: Sequence[str], + dest: str, + default: object = None, + required: bool = False, + help: str | None = None, + ) -> None: + super().__init__( + option_strings=option_strings, + dest=dest, + nargs=0, + default=default, + required=required, + help=help, + ) + + def __call__( + self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + values: str | Sequence[object] | None, + option_string: str | None = None, + ) -> None: + new_count = getattr(namespace, self.dest, 0) - 1 + setattr(namespace, self.dest, new_count) + # todo Deprecate config.quiet + namespace.quiet = getattr(namespace, "quiet", 0) + 1 + + +class TestShortLogReport(NamedTuple): + """Used to store the test status result category, shortletter and verbose word. + For example ``"rerun", "R", ("RERUN", {"yellow": True})``. + + :ivar category: + The class of result, for example ``“passed”``, ``“skipped”``, ``“error”``, or the empty string. + + :ivar letter: + The short letter shown as testing progresses, for example ``"."``, ``"s"``, ``"E"``, or the empty string. + + :ivar word: + Verbose word is shown as testing progresses in verbose mode, for example ``"PASSED"``, ``"SKIPPED"``, + ``"ERROR"``, or the empty string. + """ + + category: str + letter: str + word: str | tuple[str, Mapping[str, bool]] + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting", "Reporting", after="general") + group._addoption( # private to use reserved lower-case short option + "-v", + "--verbose", + action="count", + default=0, + dest="verbose", + help="Increase verbosity", + ) + group.addoption( + "--no-header", + action="store_true", + default=False, + dest="no_header", + help="Disable header", + ) + group.addoption( + "--no-summary", + action="store_true", + default=False, + dest="no_summary", + help="Disable summary", + ) + group.addoption( + "--no-fold-skipped", + action="store_false", + dest="fold_skipped", + default=True, + help="Do not fold skipped tests in short summary.", + ) + group.addoption( + "--force-short-summary", + action="store_true", + dest="force_short_summary", + default=False, + help="Force condensed summary output regardless of verbosity level.", + ) + group._addoption( # private to use reserved lower-case short option + "-q", + "--quiet", + action=MoreQuietAction, + default=0, + dest="verbose", + help="Decrease verbosity", + ) + group.addoption( + "--verbosity", + dest="verbose", + type=int, + default=0, + help="Set verbosity. Default: 0.", + ) + group._addoption( # private to use reserved lower-case short option + "-r", + action="store", + dest="reportchars", + default=_REPORTCHARS_DEFAULT, + metavar="chars", + help="Show extra test summary info as specified by chars: (f)ailed, " + "(E)rror, (s)kipped, (x)failed, (X)passed, " + "(p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. " + "(w)arnings are enabled by default (see --disable-warnings), " + "'N' can be used to reset the list. (default: 'fE').", + ) + group.addoption( + "--disable-warnings", + "--disable-pytest-warnings", + default=False, + dest="disable_warnings", + action="store_true", + help="Disable warnings summary", + ) + group._addoption( # private to use reserved lower-case short option + "-l", + "--showlocals", + action="store_true", + dest="showlocals", + default=False, + help="Show locals in tracebacks (disabled by default)", + ) + group.addoption( + "--no-showlocals", + action="store_false", + dest="showlocals", + help="Hide locals in tracebacks (negate --showlocals passed through addopts)", + ) + group.addoption( + "--tb", + metavar="style", + action="store", + dest="tbstyle", + default="auto", + choices=["auto", "long", "short", "no", "line", "native"], + help="Traceback print mode (auto/long/short/line/native/no)", + ) + group.addoption( + "--xfail-tb", + action="store_true", + dest="xfail_tb", + default=False, + help="Show tracebacks for xfail (as long as --tb != no)", + ) + group.addoption( + "--show-capture", + action="store", + dest="showcapture", + choices=["no", "stdout", "stderr", "log", "all"], + default="all", + help="Controls how captured stdout/stderr/log is shown on failed tests. " + "Default: all.", + ) + group.addoption( + "--fulltrace", + "--full-trace", + action="store_true", + default=False, + help="Don't cut any tracebacks (default is to cut)", + ) + group.addoption( + "--color", + metavar="color", + action="store", + dest="color", + default="auto", + choices=["yes", "no", "auto"], + help="Color terminal output (yes/no/auto)", + ) + group.addoption( + "--code-highlight", + default="yes", + choices=["yes", "no"], + help="Whether code should be highlighted (only if --color is also enabled). " + "Default: yes.", + ) + + parser.addini( + "console_output_style", + help='Console output: "classic", or with additional progress information ' + '("progress" (percentage) | "count" | "progress-even-when-capture-no" (forces ' + "progress even when capture=no)", + default="progress", + ) + Config._add_verbosity_ini( + parser, + Config.VERBOSITY_TEST_CASES, + help=( + "Specify a verbosity level for test case execution, overriding the main level. " + "Higher levels will provide more detailed information about each test case executed." + ), + ) + + +def pytest_configure(config: Config) -> None: + reporter = TerminalReporter(config, sys.stdout) + config.pluginmanager.register(reporter, "terminalreporter") + if config.option.debug or config.option.traceconfig: + + def mywriter(tags, args): + msg = " ".join(map(str, args)) + reporter.write_line("[traceconfig] " + msg) + + config.trace.root.setprocessor("pytest:config", mywriter) + + # See terminalprogress.py. + # On Windows it's safe to load by default. + if sys.platform == "win32": + config.pluginmanager.import_plugin("terminalprogress") + + +def getreportopt(config: Config) -> str: + reportchars: str = config.option.reportchars + + old_aliases = {"F", "S"} + reportopts = "" + for char in reportchars: + if char in old_aliases: + char = char.lower() + if char == "a": + reportopts = "sxXEf" + elif char == "A": + reportopts = "PpsxXEf" + elif char == "N": + reportopts = "" + elif char not in reportopts: + reportopts += char + + if not config.option.disable_warnings and "w" not in reportopts: + reportopts = "w" + reportopts + elif config.option.disable_warnings and "w" in reportopts: + reportopts = reportopts.replace("w", "") + + return reportopts + + +@hookimpl(trylast=True) # after _pytest.runner +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str]: + letter = "F" + if report.passed: + letter = "." + elif report.skipped: + letter = "s" + + outcome: str = report.outcome + if report.when in ("collect", "setup", "teardown") and outcome == "failed": + outcome = "error" + letter = "E" + + return outcome, letter, outcome.upper() + + +@dataclasses.dataclass +class WarningReport: + """Simple structure to hold warnings information captured by ``pytest_warning_recorded``. + + :ivar str message: + User friendly message about the warning. + :ivar str|None nodeid: + nodeid that generated the warning (see ``get_location``). + :ivar tuple fslocation: + File system location of the source of the warning (see ``get_location``). + """ + + message: str + nodeid: str | None = None + fslocation: tuple[str, int] | None = None + + count_towards_summary: ClassVar = True + + def get_location(self, config: Config) -> str | None: + """Return the more user-friendly information about the location of a warning, or None.""" + if self.nodeid: + return self.nodeid + if self.fslocation: + filename, linenum = self.fslocation + relpath = bestrelpath(config.invocation_params.dir, absolutepath(filename)) + return f"{relpath}:{linenum}" + return None + + +@final +class TerminalReporter: + def __init__(self, config: Config, file: TextIO | None = None) -> None: + import _pytest.config + + self.config = config + self._numcollected = 0 + self._session: Session | None = None + self._showfspath: bool | None = None + + self.stats: dict[str, list[Any]] = {} + self._main_color: str | None = None + self._known_types: list[str] | None = None + self.startpath = config.invocation_params.dir + if file is None: + file = sys.stdout + self._tw = _pytest.config.create_terminal_writer(config, file) + self._screen_width = self._tw.fullwidth + self.currentfspath: None | Path | str | int = None + self.reportchars = getreportopt(config) + self.foldskipped = config.option.fold_skipped + self.hasmarkup = self._tw.hasmarkup + # isatty should be a method but was wrongly implemented as a boolean. + # We use CallableBool here to support both. + self.isatty = compat.CallableBool(file.isatty()) + self._progress_nodeids_reported: set[str] = set() + self._timing_nodeids_reported: set[str] = set() + self._show_progress_info = self._determine_show_progress_info() + self._collect_report_last_write = timing.Instant() + self._already_displayed_warnings: int | None = None + self._keyboardinterrupt_memo: ExceptionRepr | None = None + + def _determine_show_progress_info( + self, + ) -> Literal["progress", "count", "times", False]: + """Return whether we should display progress information based on the current config.""" + # do not show progress if we are not capturing output (#3038) unless explicitly + # overridden by progress-even-when-capture-no + if ( + self.config.getoption("capture", "no") == "no" + and self.config.getini("console_output_style") + != "progress-even-when-capture-no" + ): + return False + # do not show progress if we are showing fixture setup/teardown + if self.config.getoption("setupshow", False): + return False + cfg: str = self.config.getini("console_output_style") + if cfg in {"progress", "progress-even-when-capture-no"}: + return "progress" + elif cfg == "count": + return "count" + elif cfg == "times": + return "times" + else: + return False + + @property + def verbosity(self) -> int: + verbosity: int = self.config.option.verbose + return verbosity + + @property + def showheader(self) -> bool: + return self.verbosity >= 0 + + @property + def no_header(self) -> bool: + return bool(self.config.option.no_header) + + @property + def no_summary(self) -> bool: + return bool(self.config.option.no_summary) + + @property + def showfspath(self) -> bool: + if self._showfspath is None: + return self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) >= 0 + return self._showfspath + + @showfspath.setter + def showfspath(self, value: bool | None) -> None: + self._showfspath = value + + @property + def showlongtestinfo(self) -> bool: + return self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) > 0 + + @property + def reported_progress(self) -> int: + """The amount of items reported in the progress so far. + + :meta private: + """ + return len(self._progress_nodeids_reported) + + def hasopt(self, char: str) -> bool: + char = {"xfailed": "x", "skipped": "s"}.get(char, char) + return char in self.reportchars + + def write_fspath_result(self, nodeid: str, res: str, **markup: bool) -> None: + fspath = self.config.rootpath / nodeid.split("::")[0] + if self.currentfspath is None or fspath != self.currentfspath: + if self.currentfspath is not None and self._show_progress_info: + self._write_progress_information_filling_space() + self.currentfspath = fspath + relfspath = bestrelpath(self.startpath, fspath) + self._tw.line() + self._tw.write(relfspath + " ") + self._tw.write(res, flush=True, **markup) + + def write_ensure_prefix(self, prefix: str, extra: str = "", **kwargs) -> None: + if self.currentfspath != prefix: + self._tw.line() + self.currentfspath = prefix + self._tw.write(prefix) + if extra: + self._tw.write(extra, **kwargs) + self.currentfspath = -2 + + def ensure_newline(self) -> None: + if self.currentfspath: + self._tw.line() + self.currentfspath = None + + def wrap_write( + self, + content: str, + *, + flush: bool = False, + margin: int = 8, + line_sep: str = "\n", + **markup: bool, + ) -> None: + """Wrap message with margin for progress info.""" + width_of_current_line = self._tw.width_of_current_line + wrapped = line_sep.join( + textwrap.wrap( + " " * width_of_current_line + content, + width=self._screen_width - margin, + drop_whitespace=True, + replace_whitespace=False, + ), + ) + wrapped = wrapped[width_of_current_line:] + self._tw.write(wrapped, flush=flush, **markup) + + def write(self, content: str, *, flush: bool = False, **markup: bool) -> None: + self._tw.write(content, flush=flush, **markup) + + def write_raw(self, content: str, *, flush: bool = False) -> None: + self._tw.write_raw(content, flush=flush) + + def flush(self) -> None: + self._tw.flush() + + def write_line(self, line: str | bytes, **markup: bool) -> None: + if not isinstance(line, str): + line = str(line, errors="replace") + self.ensure_newline() + self._tw.line(line, **markup) + + def rewrite(self, line: str, **markup: bool) -> None: + """Rewinds the terminal cursor to the beginning and writes the given line. + + :param erase: + If True, will also add spaces until the full terminal width to ensure + previous lines are properly erased. + + The rest of the keyword arguments are markup instructions. + """ + erase = markup.pop("erase", False) + if erase: + fill_count = self._tw.fullwidth - len(line) - 1 + fill = " " * fill_count + else: + fill = "" + line = str(line) + self._tw.write("\r" + line + fill, **markup) + + def write_sep( + self, + sep: str, + title: str | None = None, + fullwidth: int | None = None, + **markup: bool, + ) -> None: + self.ensure_newline() + self._tw.sep(sep, title, fullwidth, **markup) + + def section(self, title: str, sep: str = "=", **kw: bool) -> None: + self._tw.sep(sep, title, **kw) + + def line(self, msg: str, **kw: bool) -> None: + self._tw.line(msg, **kw) + + def _add_stats(self, category: str, items: Sequence[Any]) -> None: + set_main_color = category not in self.stats + self.stats.setdefault(category, []).extend(items) + if set_main_color: + self._set_main_color() + + def pytest_internalerror(self, excrepr: ExceptionRepr) -> bool: + for line in str(excrepr).split("\n"): + self.write_line("INTERNALERROR> " + line) + return True + + def pytest_warning_recorded( + self, + warning_message: warnings.WarningMessage, + nodeid: str, + ) -> None: + from _pytest.warnings import warning_record_to_str + + fslocation = warning_message.filename, warning_message.lineno + message = warning_record_to_str(warning_message) + + warning_report = WarningReport( + fslocation=fslocation, message=message, nodeid=nodeid + ) + self._add_stats("warnings", [warning_report]) + + def pytest_plugin_registered(self, plugin: _PluggyPlugin) -> None: + if self.config.option.traceconfig: + msg = f"PLUGIN registered: {plugin}" + # XXX This event may happen during setup/teardown time + # which unfortunately captures our output here + # which garbles our output if we use self.write_line. + self.write_line(msg) + + def pytest_deselected(self, items: Sequence[Item]) -> None: + self._add_stats("deselected", items) + + def pytest_runtest_logstart( + self, nodeid: str, location: tuple[str, int | None, str] + ) -> None: + fspath, lineno, domain = location + # Ensure that the path is printed before the + # 1st test of a module starts running. + if self.showlongtestinfo: + line = self._locationline(nodeid, fspath, lineno, domain) + self.write_ensure_prefix(line, "") + self.flush() + elif self.showfspath: + self.write_fspath_result(nodeid, "") + self.flush() + + def pytest_runtest_logreport(self, report: TestReport) -> None: + self._tests_ran = True + rep = report + + res = TestShortLogReport( + *self.config.hook.pytest_report_teststatus(report=rep, config=self.config) + ) + category, letter, word = res.category, res.letter, res.word + if not isinstance(word, tuple): + markup = None + else: + word, markup = word + self._add_stats(category, [rep]) + if not letter and not word: + # Probably passed setup/teardown. + return + if markup is None: + was_xfail = hasattr(report, "wasxfail") + if rep.passed and not was_xfail: + markup = {"green": True} + elif rep.passed and was_xfail: + markup = {"yellow": True} + elif rep.failed: + markup = {"red": True} + elif rep.skipped: + markup = {"yellow": True} + else: + markup = {} + self._progress_nodeids_reported.add(rep.nodeid) + if self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) <= 0: + self._tw.write(letter, **markup) + # When running in xdist, the logreport and logfinish of multiple + # items are interspersed, e.g. `logreport`, `logreport`, + # `logfinish`, `logfinish`. To avoid the "past edge" calculation + # from getting confused and overflowing (#7166), do the past edge + # printing here and not in logfinish, except for the 100% which + # should only be printed after all teardowns are finished. + if self._show_progress_info and not self._is_last_item: + self._write_progress_information_if_past_edge() + else: + line = self._locationline(rep.nodeid, *rep.location) + running_xdist = hasattr(rep, "node") + if not running_xdist: + self.write_ensure_prefix(line, word, **markup) + if rep.skipped or hasattr(report, "wasxfail"): + reason = _get_raw_skip_reason(rep) + if self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) < 2: + available_width = ( + (self._tw.fullwidth - self._tw.width_of_current_line) + - len(" [100%]") + - 1 + ) + formatted_reason = _format_trimmed( + " ({})", reason, available_width + ) + else: + formatted_reason = f" ({reason})" + + if reason and formatted_reason is not None: + self.wrap_write(formatted_reason) + if self._show_progress_info: + self._write_progress_information_filling_space() + else: + self.ensure_newline() + self._tw.write(f"[{rep.node.gateway.id}]") + if self._show_progress_info: + self._tw.write( + self._get_progress_information_message() + " ", cyan=True + ) + else: + self._tw.write(" ") + self._tw.write(word, **markup) + self._tw.write(" " + line) + self.currentfspath = -2 + self.flush() + + @property + def _is_last_item(self) -> bool: + assert self._session is not None + return self.reported_progress == self._session.testscollected + + @hookimpl(wrapper=True) + def pytest_runtestloop(self) -> Generator[None, object, object]: + result = yield + + # Write the final/100% progress -- deferred until the loop is complete. + if ( + self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) <= 0 + and self._show_progress_info + and self.reported_progress + ): + self._write_progress_information_filling_space() + + return result + + def _get_progress_information_message(self) -> str: + assert self._session + collected = self._session.testscollected + if self._show_progress_info == "count": + if collected: + progress = self.reported_progress + counter_format = f"{{:{len(str(collected))}d}}" + format_string = f" [{counter_format}/{{}}]" + return format_string.format(progress, collected) + return f" [ {collected} / {collected} ]" + if self._show_progress_info == "times": + if not collected: + return "" + all_reports = ( + self._get_reports_to_display("passed") + + self._get_reports_to_display("xpassed") + + self._get_reports_to_display("failed") + + self._get_reports_to_display("xfailed") + + self._get_reports_to_display("skipped") + + self._get_reports_to_display("error") + + self._get_reports_to_display("") + ) + current_location = all_reports[-1].location[0] + not_reported = [ + r for r in all_reports if r.nodeid not in self._timing_nodeids_reported + ] + tests_in_module = sum( + i.location[0] == current_location for i in self._session.items + ) + tests_completed = sum( + r.when == "setup" + for r in not_reported + if r.location[0] == current_location + ) + last_in_module = tests_completed == tests_in_module + if self.showlongtestinfo or last_in_module: + self._timing_nodeids_reported.update(r.nodeid for r in not_reported) + return format_node_duration( + sum(r.duration for r in not_reported if isinstance(r, TestReport)) + ) + return "" + if collected: + return f" [{self.reported_progress * 100 // collected:3d}%]" + return " [100%]" + + def _write_progress_information_if_past_edge(self) -> None: + w = self._width_of_current_line + if self._show_progress_info == "count": + assert self._session + num_tests = self._session.testscollected + progress_length = len(f" [{num_tests}/{num_tests}]") + elif self._show_progress_info == "times": + progress_length = len(" 99h 59m") + else: + progress_length = len(" [100%]") + past_edge = w + progress_length + 1 >= self._screen_width + if past_edge: + main_color, _ = self._get_main_color() + msg = self._get_progress_information_message() + self._tw.write(msg + "\n", **{main_color: True}) + + def _write_progress_information_filling_space(self) -> None: + color, _ = self._get_main_color() + msg = self._get_progress_information_message() + w = self._width_of_current_line + fill = self._tw.fullwidth - w - 1 + self.write(msg.rjust(fill), flush=True, **{color: True}) + + @property + def _width_of_current_line(self) -> int: + """Return the width of the current line.""" + return self._tw.width_of_current_line + + def pytest_collection(self) -> None: + if self.isatty(): + if self.config.option.verbose >= 0: + self.write("collecting ... ", flush=True, bold=True) + elif self.config.option.verbose >= 1: + self.write("collecting ... ", flush=True, bold=True) + + def pytest_collectreport(self, report: CollectReport) -> None: + if report.failed: + self._add_stats("error", [report]) + elif report.skipped: + self._add_stats("skipped", [report]) + items = [x for x in report.result if isinstance(x, Item)] + self._numcollected += len(items) + if self.isatty(): + self.report_collect() + + def report_collect(self, final: bool = False) -> None: + if self.config.option.verbose < 0: + return + + if not final: + # Only write the "collecting" report every `REPORT_COLLECTING_RESOLUTION`. + if ( + self._collect_report_last_write.elapsed().seconds + < REPORT_COLLECTING_RESOLUTION + ): + return + self._collect_report_last_write = timing.Instant() + + errors = len(self.stats.get("error", [])) + skipped = len(self.stats.get("skipped", [])) + deselected = len(self.stats.get("deselected", [])) + selected = self._numcollected - deselected + line = "collected " if final else "collecting " + line += ( + str(self._numcollected) + " item" + ("" if self._numcollected == 1 else "s") + ) + if errors: + line += f" / {errors} error{'s' if errors != 1 else ''}" + if deselected: + line += f" / {deselected} deselected" + if skipped: + line += f" / {skipped} skipped" + if self._numcollected > selected: + line += f" / {selected} selected" + if self.isatty(): + self.rewrite(line, bold=True, erase=True) + if final: + self.write("\n") + else: + self.write_line(line) + + @hookimpl(trylast=True) + def pytest_sessionstart(self, session: Session) -> None: + self._session = session + self._session_start = timing.Instant() + if not self.showheader: + return + self.write_sep("=", "test session starts", bold=True) + verinfo = platform.python_version() + if not self.no_header: + msg = f"platform {sys.platform} -- Python {verinfo}" + pypy_version_info = getattr(sys, "pypy_version_info", None) + if pypy_version_info: + verinfo = ".".join(map(str, pypy_version_info[:3])) + msg += f"[pypy-{verinfo}-{pypy_version_info[3]}]" + msg += f", pytest-{_pytest._version.version}, pluggy-{pluggy.__version__}" + if ( + self.verbosity > 0 + or self.config.option.debug + or getattr(self.config.option, "pastebin", None) + ): + msg += " -- " + str(sys.executable) + self.write_line(msg) + lines = self.config.hook.pytest_report_header( + config=self.config, start_path=self.startpath + ) + self._write_report_lines_from_hooks(lines) + + def _write_report_lines_from_hooks( + self, lines: Sequence[str | Sequence[str]] + ) -> None: + for line_or_lines in reversed(lines): + if isinstance(line_or_lines, str): + self.write_line(line_or_lines) + else: + for line in line_or_lines: + self.write_line(line) + + def pytest_report_header(self, config: Config) -> list[str]: + result = [f"rootdir: {config.rootpath}"] + + if config.inipath: + warning = "" + if config._ignored_config_files: + warning = f" (WARNING: ignoring pytest config in {', '.join(config._ignored_config_files)}!)" + result.append( + "configfile: " + bestrelpath(config.rootpath, config.inipath) + warning + ) + + if config.args_source == Config.ArgsSource.TESTPATHS: + testpaths: list[str] = config.getini("testpaths") + result.append("testpaths: {}".format(", ".join(testpaths))) + + plugininfo = config.pluginmanager.list_plugin_distinfo() + if plugininfo: + result.append( + "plugins: {}".format(", ".join(_plugin_nameversions(plugininfo))) + ) + return result + + def pytest_collection_finish(self, session: Session) -> None: + self.report_collect(True) + + lines = self.config.hook.pytest_report_collectionfinish( + config=self.config, + start_path=self.startpath, + items=session.items, + ) + self._write_report_lines_from_hooks(lines) + + if self.config.getoption("collectonly"): + if session.items: + if self.config.option.verbose > -1: + self._tw.line("") + self._printcollecteditems(session.items) + + failed = self.stats.get("failed") + if failed: + self._tw.sep("!", "collection failures") + for rep in failed: + rep.toterminal(self._tw) + + def _printcollecteditems(self, items: Sequence[Item]) -> None: + test_cases_verbosity = self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) + if test_cases_verbosity < 0: + if test_cases_verbosity < -1: + counts = Counter(item.nodeid.split("::", 1)[0] for item in items) + for name, count in sorted(counts.items()): + self._tw.line(f"{name}: {count}") + else: + for item in items: + self._tw.line(item.nodeid) + return + stack: list[Node] = [] + indent = "" + for item in items: + needed_collectors = item.listchain()[1:] # strip root node + while stack: + if stack == needed_collectors[: len(stack)]: + break + stack.pop() + for col in needed_collectors[len(stack) :]: + stack.append(col) + indent = (len(stack) - 1) * " " + self._tw.line(f"{indent}{col}") + if test_cases_verbosity >= 1: + obj = getattr(col, "obj", None) + doc = inspect.getdoc(obj) if obj else None + if doc: + for line in doc.splitlines(): + self._tw.line("{}{}".format(indent + " ", line)) + + @hookimpl(wrapper=True) + def pytest_sessionfinish( + self, session: Session, exitstatus: int | ExitCode + ) -> Generator[None]: + result = yield + self._tw.line("") + summary_exit_codes = ( + ExitCode.OK, + ExitCode.TESTS_FAILED, + ExitCode.INTERRUPTED, + ExitCode.USAGE_ERROR, + ExitCode.NO_TESTS_COLLECTED, + ) + if exitstatus in summary_exit_codes and not self.no_summary: + self.config.hook.pytest_terminal_summary( + terminalreporter=self, exitstatus=exitstatus, config=self.config + ) + if session.shouldfail: + self.write_sep("!", str(session.shouldfail), red=True) + if exitstatus == ExitCode.INTERRUPTED: + self._report_keyboardinterrupt() + self._keyboardinterrupt_memo = None + elif session.shouldstop: + self.write_sep("!", str(session.shouldstop), red=True) + self.summary_stats() + return result + + @hookimpl(wrapper=True) + def pytest_terminal_summary(self) -> Generator[None]: + self.summary_errors() + self.summary_failures() + self.summary_xfailures() + self.summary_warnings() + self.summary_passes() + self.summary_xpasses() + try: + return (yield) + finally: + self.short_test_summary() + # Display any extra warnings from teardown here (if any). + self.summary_warnings() + + def pytest_keyboard_interrupt(self, excinfo: ExceptionInfo[BaseException]) -> None: + self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True) + + def pytest_unconfigure(self) -> None: + if self._keyboardinterrupt_memo is not None: + self._report_keyboardinterrupt() + + def _report_keyboardinterrupt(self) -> None: + excrepr = self._keyboardinterrupt_memo + assert excrepr is not None + assert excrepr.reprcrash is not None + msg = excrepr.reprcrash.message + self.write_sep("!", msg) + if "KeyboardInterrupt" in msg: + if self.config.option.fulltrace: + excrepr.toterminal(self._tw) + else: + excrepr.reprcrash.toterminal(self._tw) + self._tw.line( + "(to show a full traceback on KeyboardInterrupt use --full-trace)", + yellow=True, + ) + + def _locationline( + self, nodeid: str, fspath: str, lineno: int | None, domain: str + ) -> str: + def mkrel(nodeid: str) -> str: + line = self.config.cwd_relative_nodeid(nodeid) + if domain and line.endswith(domain): + line = line[: -len(domain)] + values = domain.split("[") + values[0] = values[0].replace(".", "::") # don't replace '.' in params + line += "[".join(values) + return line + + # fspath comes from testid which has a "/"-normalized path. + if fspath: + res = mkrel(nodeid) + if self.verbosity >= 2 and nodeid.split("::")[0] != fspath.replace( + "\\", nodes.SEP + ): + res += " <- " + bestrelpath(self.startpath, Path(fspath)) + else: + res = "[location]" + return res + " " + + def _getfailureheadline(self, rep): + head_line = rep.head_line + if head_line: + return head_line + return "test session" # XXX? + + def _getcrashline(self, rep): + try: + return str(rep.longrepr.reprcrash) + except AttributeError: + try: + return str(rep.longrepr)[:50] + except AttributeError: + return "" + + # + # Summaries for sessionfinish. + # + def getreports(self, name: str): + return [x for x in self.stats.get(name, ()) if not hasattr(x, "_pdbshown")] + + def summary_warnings(self) -> None: + if self.hasopt("w"): + all_warnings: list[WarningReport] | None = self.stats.get("warnings") + if not all_warnings: + return + + final = self._already_displayed_warnings is not None + if final: + warning_reports = all_warnings[self._already_displayed_warnings :] + else: + warning_reports = all_warnings + self._already_displayed_warnings = len(warning_reports) + if not warning_reports: + return + + reports_grouped_by_message: dict[str, list[WarningReport]] = {} + for wr in warning_reports: + reports_grouped_by_message.setdefault(wr.message, []).append(wr) + + def collapsed_location_report(reports: list[WarningReport]) -> str: + locations = [] + for w in reports: + location = w.get_location(self.config) + if location: + locations.append(location) + + if len(locations) < 10: + return "\n".join(map(str, locations)) + + counts_by_filename = Counter( + str(loc).split("::", 1)[0] for loc in locations + ) + return "\n".join( + "{}: {} warning{}".format(k, v, "s" if v > 1 else "") + for k, v in counts_by_filename.items() + ) + + title = "warnings summary (final)" if final else "warnings summary" + self.write_sep("=", title, yellow=True, bold=False) + for message, message_reports in reports_grouped_by_message.items(): + maybe_location = collapsed_location_report(message_reports) + if maybe_location: + self._tw.line(maybe_location) + lines = message.splitlines() + indented = "\n".join(" " + x for x in lines) + message = indented.rstrip() + else: + message = message.rstrip() + self._tw.line(message) + self._tw.line() + self._tw.line( + "-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html" + ) + + def summary_passes(self) -> None: + self.summary_passes_combined("passed", "PASSES", "P") + + def summary_xpasses(self) -> None: + self.summary_passes_combined("xpassed", "XPASSES", "X") + + def summary_passes_combined( + self, which_reports: str, sep_title: str, needed_opt: str + ) -> None: + if self.config.option.tbstyle != "no": + if self.hasopt(needed_opt): + reports: list[TestReport] = self.getreports(which_reports) + if not reports: + return + self.write_sep("=", sep_title) + for rep in reports: + if rep.sections: + msg = self._getfailureheadline(rep) + self.write_sep("_", msg, green=True, bold=True) + self._outrep_summary(rep) + self._handle_teardown_sections(rep.nodeid) + + def _get_teardown_reports(self, nodeid: str) -> list[TestReport]: + reports = self.getreports("") + return [ + report + for report in reports + if report.when == "teardown" and report.nodeid == nodeid + ] + + def _handle_teardown_sections(self, nodeid: str) -> None: + for report in self._get_teardown_reports(nodeid): + self.print_teardown_sections(report) + + def print_teardown_sections(self, rep: TestReport) -> None: + showcapture = self.config.option.showcapture + if showcapture == "no": + return + for secname, content in rep.sections: + if showcapture != "all" and showcapture not in secname: + continue + if "teardown" in secname: + self._tw.sep("-", secname) + if content[-1:] == "\n": + content = content[:-1] + self._tw.line(content) + + def summary_failures(self) -> None: + style = self.config.option.tbstyle + self.summary_failures_combined("failed", "FAILURES", style=style) + + def summary_xfailures(self) -> None: + show_tb = self.config.option.xfail_tb + style = self.config.option.tbstyle if show_tb else "no" + self.summary_failures_combined("xfailed", "XFAILURES", style=style) + + def summary_failures_combined( + self, + which_reports: str, + sep_title: str, + *, + style: str, + needed_opt: str | None = None, + ) -> None: + if style != "no": + if not needed_opt or self.hasopt(needed_opt): + reports: list[BaseReport] = self.getreports(which_reports) + if not reports: + return + self.write_sep("=", sep_title) + if style == "line": + for rep in reports: + line = self._getcrashline(rep) + self._outrep_summary(rep) + self.write_line(line) + else: + for rep in reports: + msg = self._getfailureheadline(rep) + self.write_sep("_", msg, red=True, bold=True) + self._outrep_summary(rep) + self._handle_teardown_sections(rep.nodeid) + + def summary_errors(self) -> None: + if self.config.option.tbstyle != "no": + reports: list[BaseReport] = self.getreports("error") + if not reports: + return + self.write_sep("=", "ERRORS") + for rep in self.stats["error"]: + msg = self._getfailureheadline(rep) + if rep.when == "collect": + msg = "ERROR collecting " + msg + else: + msg = f"ERROR at {rep.when} of {msg}" + self.write_sep("_", msg, red=True, bold=True) + self._outrep_summary(rep) + + def _outrep_summary(self, rep: BaseReport) -> None: + rep.toterminal(self._tw) + showcapture = self.config.option.showcapture + if showcapture == "no": + return + for secname, content in rep.sections: + if showcapture != "all" and showcapture not in secname: + continue + self._tw.sep("-", secname) + if content[-1:] == "\n": + content = content[:-1] + self._tw.line(content) + + def summary_stats(self) -> None: + if self.verbosity < -1: + return + + session_duration = self._session_start.elapsed() + (parts, main_color) = self.build_summary_stats_line() + line_parts = [] + + display_sep = self.verbosity >= 0 + if display_sep: + fullwidth = self._tw.fullwidth + for text, markup in parts: + with_markup = self._tw.markup(text, **markup) + if display_sep: + fullwidth += len(with_markup) - len(text) + line_parts.append(with_markup) + msg = ", ".join(line_parts) + + main_markup = {main_color: True} + duration = f" in {format_session_duration(session_duration.seconds)}" + duration_with_markup = self._tw.markup(duration, **main_markup) + if display_sep: + fullwidth += len(duration_with_markup) - len(duration) + msg += duration_with_markup + + if display_sep: + markup_for_end_sep = self._tw.markup("", **main_markup) + if markup_for_end_sep.endswith("\x1b[0m"): + markup_for_end_sep = markup_for_end_sep[:-4] + fullwidth += len(markup_for_end_sep) + msg += markup_for_end_sep + + if display_sep: + self.write_sep("=", msg, fullwidth=fullwidth, **main_markup) + else: + self.write_line(msg, **main_markup) + + def short_test_summary(self) -> None: + if not self.reportchars: + return + + def show_simple(lines: list[str], *, stat: str) -> None: + failed = self.stats.get(stat, []) + if not failed: + return + config = self.config + for rep in failed: + color = _color_for_type.get(stat, _color_for_type_default) + line = _get_line_with_reprcrash_message( + config, rep, self._tw, {color: True} + ) + lines.append(line) + + def show_xfailed(lines: list[str]) -> None: + xfailed = self.stats.get("xfailed", []) + for rep in xfailed: + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.wasxfail + if reason: + line += " - " + str(reason) + + lines.append(line) + + def show_xpassed(lines: list[str]) -> None: + xpassed = self.stats.get("xpassed", []) + for rep in xpassed: + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.wasxfail + if reason: + line += " - " + str(reason) + lines.append(line) + + def show_skipped_folded(lines: list[str]) -> None: + skipped: list[CollectReport] = self.stats.get("skipped", []) + fskips = _folded_skips(self.startpath, skipped) if skipped else [] + if not fskips: + return + verbose_word, verbose_markup = skipped[0]._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + prefix = "Skipped: " + for num, fspath, lineno, reason in fskips: + if reason.startswith(prefix): + reason = reason[len(prefix) :] + if lineno is not None: + lines.append(f"{markup_word} [{num}] {fspath}:{lineno}: {reason}") + else: + lines.append(f"{markup_word} [{num}] {fspath}: {reason}") + + def show_skipped_unfolded(lines: list[str]) -> None: + skipped: list[CollectReport] = self.stats.get("skipped", []) + + for rep in skipped: + assert rep.longrepr is not None + assert isinstance(rep.longrepr, tuple), (rep, rep.longrepr) + assert len(rep.longrepr) == 3, (rep, rep.longrepr) + + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.longrepr[2] + if reason: + line += " - " + str(reason) + lines.append(line) + + def show_skipped(lines: list[str]) -> None: + if self.foldskipped: + show_skipped_folded(lines) + else: + show_skipped_unfolded(lines) + + REPORTCHAR_ACTIONS: Mapping[str, Callable[[list[str]], None]] = { + "x": show_xfailed, + "X": show_xpassed, + "f": partial(show_simple, stat="failed"), + "s": show_skipped, + "p": partial(show_simple, stat="passed"), + "E": partial(show_simple, stat="error"), + } + + lines: list[str] = [] + for char in self.reportchars: + action = REPORTCHAR_ACTIONS.get(char) + if action: # skipping e.g. "P" (passed with output) here. + action(lines) + + if lines: + self.write_sep("=", "short test summary info", cyan=True, bold=True) + for line in lines: + self.write_line(line) + + def _get_main_color(self) -> tuple[str, list[str]]: + if self._main_color is None or self._known_types is None or self._is_last_item: + self._set_main_color() + assert self._main_color + assert self._known_types + return self._main_color, self._known_types + + def _determine_main_color(self, unknown_type_seen: bool) -> str: + stats = self.stats + if "failed" in stats or "error" in stats: + main_color = "red" + elif "warnings" in stats or "xpassed" in stats or unknown_type_seen: + main_color = "yellow" + elif "passed" in stats or not self._is_last_item: + main_color = "green" + else: + main_color = "yellow" + return main_color + + def _set_main_color(self) -> None: + unknown_types: list[str] = [] + for found_type in self.stats: + if found_type: # setup/teardown reports have an empty key, ignore them + if found_type not in KNOWN_TYPES and found_type not in unknown_types: + unknown_types.append(found_type) + self._known_types = list(KNOWN_TYPES) + unknown_types + self._main_color = self._determine_main_color(bool(unknown_types)) + + def build_summary_stats_line(self) -> tuple[list[tuple[str, dict[str, bool]]], str]: + """ + Build the parts used in the last summary stats line. + + The summary stats line is the line shown at the end, "=== 12 passed, 2 errors in Xs===". + + This function builds a list of the "parts" that make up for the text in that line, in + the example above it would be:: + + [ + ("12 passed", {"green": True}), + ("2 errors", {"red": True} + ] + + That last dict for each line is a "markup dictionary", used by TerminalWriter to + color output. + + The final color of the line is also determined by this function, and is the second + element of the returned tuple. + """ + if self.config.getoption("collectonly"): + return self._build_collect_only_summary_stats_line() + else: + return self._build_normal_summary_stats_line() + + def _get_reports_to_display(self, key: str) -> list[Any]: + """Get test/collection reports for the given status key, such as `passed` or `error`.""" + reports = self.stats.get(key, []) + return [x for x in reports if getattr(x, "count_towards_summary", True)] + + def _build_normal_summary_stats_line( + self, + ) -> tuple[list[tuple[str, dict[str, bool]]], str]: + main_color, known_types = self._get_main_color() + parts = [] + + for key in known_types: + reports = self._get_reports_to_display(key) + if reports: + count = len(reports) + color = _color_for_type.get(key, _color_for_type_default) + markup = {color: True, "bold": color == main_color} + parts.append(("%d %s" % pluralize(count, key), markup)) # noqa: UP031 + + if not parts: + parts = [("no tests ran", {_color_for_type_default: True})] + + return parts, main_color + + def _build_collect_only_summary_stats_line( + self, + ) -> tuple[list[tuple[str, dict[str, bool]]], str]: + deselected = len(self._get_reports_to_display("deselected")) + errors = len(self._get_reports_to_display("error")) + + if self._numcollected == 0: + parts = [("no tests collected", {"yellow": True})] + main_color = "yellow" + + elif deselected == 0: + main_color = "green" + collected_output = "%d %s collected" % pluralize(self._numcollected, "test") # noqa: UP031 + parts = [(collected_output, {main_color: True})] + else: + all_tests_were_deselected = self._numcollected == deselected + if all_tests_were_deselected: + main_color = "yellow" + collected_output = f"no tests collected ({deselected} deselected)" + else: + main_color = "green" + selected = self._numcollected - deselected + collected_output = f"{selected}/{self._numcollected} tests collected ({deselected} deselected)" + + parts = [(collected_output, {main_color: True})] + + if errors: + main_color = _color_for_type["error"] + parts += [("%d %s" % pluralize(errors, "error"), {main_color: True})] # noqa: UP031 + + return parts, main_color + + +def _get_node_id_with_markup(tw: TerminalWriter, config: Config, rep: BaseReport): + nodeid = config.cwd_relative_nodeid(rep.nodeid) + path, *parts = nodeid.split("::") + if parts: + parts_markup = tw.markup("::".join(parts), bold=True) + return path + "::" + parts_markup + else: + return path + + +def _format_trimmed(format: str, msg: str, available_width: int) -> str | None: + """Format msg into format, ellipsizing it if doesn't fit in available_width. + + Returns None if even the ellipsis can't fit. + """ + # Only use the first line. + i = msg.find("\n") + if i != -1: + msg = msg[:i] + + ellipsis = "..." + format_width = wcswidth(format.format("")) + if format_width + len(ellipsis) > available_width: + return None + + if format_width + wcswidth(msg) > available_width: + available_width -= len(ellipsis) + msg = msg[:available_width] + while format_width + wcswidth(msg) > available_width: + msg = msg[:-1] + msg += ellipsis + + return format.format(msg) + + +def _get_line_with_reprcrash_message( + config: Config, rep: BaseReport, tw: TerminalWriter, word_markup: dict[str, bool] +) -> str: + """Get summary line for a report, trying to add reprcrash message.""" + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + config, word_markup + ) + word = tw.markup(verbose_word, **verbose_markup) + node = _get_node_id_with_markup(tw, config, rep) + + line = f"{word} {node}" + line_width = wcswidth(line) + + msg: str | None + try: + if isinstance(rep.longrepr, str): + msg = rep.longrepr + else: + # Type ignored intentionally -- possible AttributeError expected. + msg = rep.longrepr.reprcrash.message # type: ignore[union-attr] + except AttributeError: + pass + else: + if ( + running_on_ci() or config.option.verbose >= 2 + ) and not config.option.force_short_summary: + msg = f" - {msg}" + else: + available_width = tw.fullwidth - line_width + msg = _format_trimmed(" - {}", msg, available_width) + if msg is not None: + line += msg + + return line + + +def _folded_skips( + startpath: Path, + skipped: Sequence[CollectReport], +) -> list[tuple[int, str, int | None, str]]: + d: dict[tuple[str, int | None, str], list[CollectReport]] = {} + for event in skipped: + assert event.longrepr is not None + assert isinstance(event.longrepr, tuple), (event, event.longrepr) + assert len(event.longrepr) == 3, (event, event.longrepr) + fspath, lineno, reason = event.longrepr + # For consistency, report all fspaths in relative form. + fspath = bestrelpath(startpath, Path(fspath)) + keywords = getattr(event, "keywords", {}) + # Folding reports with global pytestmark variable. + # This is a workaround, because for now we cannot identify the scope of a skip marker + # TODO: Revisit after marks scope would be fixed. + if ( + event.when == "setup" + and "skip" in keywords + and "pytestmark" not in keywords + ): + key: tuple[str, int | None, str] = (fspath, None, reason) + else: + key = (fspath, lineno, reason) + d.setdefault(key, []).append(event) + values: list[tuple[int, str, int | None, str]] = [] + for key, events in d.items(): + values.append((len(events), *key)) + return values + + +_color_for_type = { + "failed": "red", + "error": "red", + "warnings": "yellow", + "passed": "green", + "subtests passed": "green", + "subtests failed": "red", +} +_color_for_type_default = "yellow" + + +def pluralize(count: int, noun: str) -> tuple[int, str]: + # No need to pluralize words such as `failed` or `passed`. + if noun not in ["error", "warnings", "test"]: + return count, noun + + # The `warnings` key is plural. To avoid API breakage, we keep it that way but + # set it to singular here so we can determine plurality in the same way as we do + # for `error`. + noun = noun.replace("warnings", "warning") + + return count, noun + "s" if count != 1 else noun + + +def _plugin_nameversions(plugininfo) -> list[str]: + values: list[str] = [] + for plugin, dist in plugininfo: + # Gets us name and version! + name = f"{dist.project_name}-{dist.version}" + # Questionable convenience, but it keeps things short. + if name.startswith("pytest-"): + name = name[7:] + # We decided to print python package names they can have more than one plugin. + if name not in values: + values.append(name) + return values + + +def format_session_duration(seconds: float) -> str: + """Format the given seconds in a human readable manner to show in the final summary.""" + if seconds < 60: + return f"{seconds:.2f}s" + else: + dt = datetime.timedelta(seconds=int(seconds)) + return f"{seconds:.2f}s ({dt})" + + +def format_node_duration(seconds: float) -> str: + """Format the given seconds in a human readable manner to show in the test progress.""" + # The formatting is designed to be compact and readable, with at most 7 characters + # for durations below 100 hours. + if seconds < 0.00001: + return f" {seconds * 1000000:.3f}us" + if seconds < 0.0001: + return f" {seconds * 1000000:.2f}us" + if seconds < 0.001: + return f" {seconds * 1000000:.1f}us" + if seconds < 0.01: + return f" {seconds * 1000:.3f}ms" + if seconds < 0.1: + return f" {seconds * 1000:.2f}ms" + if seconds < 1: + return f" {seconds * 1000:.1f}ms" + if seconds < 60: + return f" {seconds:.3f}s" + if seconds < 3600: + return f" {seconds // 60:.0f}m {seconds % 60:.0f}s" + return f" {seconds // 3600:.0f}h {(seconds % 3600) // 60:.0f}m" + + +def _get_raw_skip_reason(report: TestReport) -> str: + """Get the reason string of a skip/xfail/xpass test report. + + The string is just the part given by the user. + """ + if hasattr(report, "wasxfail"): + reason = report.wasxfail + if reason.startswith("reason: "): + reason = reason[len("reason: ") :] + return reason + else: + assert report.skipped + assert isinstance(report.longrepr, tuple) + _, _, reason = report.longrepr + if reason.startswith("Skipped: "): + reason = reason[len("Skipped: ") :] + elif reason == "Skipped": + reason = "" + return reason + + +class TerminalProgressPlugin: + """Terminal progress reporting plugin using OSC 9;4 ANSI sequences. + + Emits OSC 9;4 sequences to indicate test progress to terminal + tabs/windows/etc. + + Not all terminal emulators support this feature. + + Ref: https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC + """ + + def __init__(self, tr: TerminalReporter) -> None: + self._tr = tr + self._session: Session | None = None + self._has_failures = False + + def _emit_progress( + self, + state: Literal["remove", "normal", "error", "indeterminate", "paused"], + progress: int | None = None, + ) -> None: + """Emit OSC 9;4 sequence for indicating progress to the terminal. + + :param state: + Progress state to set. + :param progress: + Progress value 0-100. Required for "normal", optional for "error" + and "paused", otherwise ignored. + """ + assert progress is None or 0 <= progress <= 100 + + # OSC 9;4 sequence: ESC ] 9 ; 4 ; state ; progress ST + # ST can be ESC \ or BEL. ESC \ seems better supported. + match state: + case "remove": + sequence = "\x1b]9;4;0;\x1b\\" + case "normal": + assert progress is not None + sequence = f"\x1b]9;4;1;{progress}\x1b\\" + case "error": + if progress is not None: + sequence = f"\x1b]9;4;2;{progress}\x1b\\" + else: + sequence = "\x1b]9;4;2;\x1b\\" + case "indeterminate": + sequence = "\x1b]9;4;3;\x1b\\" + case "paused": + if progress is not None: + sequence = f"\x1b]9;4;4;{progress}\x1b\\" + else: + sequence = "\x1b]9;4;4;\x1b\\" + + self._tr.write_raw(sequence, flush=True) + + @hookimpl + def pytest_sessionstart(self, session: Session) -> None: + self._session = session + # Show indeterminate progress during collection. + self._emit_progress("indeterminate") + + @hookimpl + def pytest_collection_finish(self) -> None: + assert self._session is not None + if self._session.testscollected > 0: + # Switch from indeterminate to 0% progress. + self._emit_progress("normal", 0) + + @hookimpl + def pytest_runtest_logreport(self, report: TestReport) -> None: + if report.failed: + self._has_failures = True + + # Let's consider the "call" phase for progress. + if report.when != "call": + return + + # Calculate and emit progress. + assert self._session is not None + collected = self._session.testscollected + if collected > 0: + reported = self._tr.reported_progress + progress = min(reported * 100 // collected, 100) + self._emit_progress("error" if self._has_failures else "normal", progress) + + @hookimpl + def pytest_sessionfinish(self) -> None: + self._emit_progress("remove") diff --git a/micromamba_root/Lib/site-packages/_pytest/terminalprogress.py b/micromamba_root/Lib/site-packages/_pytest/terminalprogress.py new file mode 100644 index 0000000000000000000000000000000000000000..287f0d569ffdd0714b2e3997c52ef101d34a8066 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/terminalprogress.py @@ -0,0 +1,30 @@ +# A plugin to register the TerminalProgressPlugin plugin. +# +# This plugin is not loaded by default due to compatibility issues (#13896), +# but can be enabled in one of these ways: +# - The terminal plugin enables it in a few cases where it's safe, and not +# blocked by the user (using e.g. `-p no:terminalprogress`). +# - The user explicitly requests it, e.g. using `-p terminalprogress`. +# +# In a few years, if it's safe, we can consider enabling it by default. Then, +# this file will become unnecessary and can be inlined into terminal.py. + +from __future__ import annotations + +import os + +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.terminal import TerminalProgressPlugin +from _pytest.terminal import TerminalReporter + + +@hookimpl(trylast=True) +def pytest_configure(config: Config) -> None: + reporter: TerminalReporter | None = config.pluginmanager.get_plugin( + "terminalreporter" + ) + + if reporter is not None and reporter.isatty() and os.environ.get("TERM") != "dumb": + plugin = TerminalProgressPlugin(reporter) + config.pluginmanager.register(plugin, name="terminalprogress-plugin") diff --git a/micromamba_root/Lib/site-packages/_pytest/threadexception.py b/micromamba_root/Lib/site-packages/_pytest/threadexception.py new file mode 100644 index 0000000000000000000000000000000000000000..eb57783be261ebf30f1c03a04cab471f5ec6f063 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/threadexception.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +import collections +from collections.abc import Callable +import functools +import sys +import threading +import traceback +from typing import NamedTuple +from typing import TYPE_CHECKING +import warnings + +from _pytest.config import Config +from _pytest.nodes import Item +from _pytest.stash import StashKey +from _pytest.tracemalloc import tracemalloc_message +import pytest + + +if TYPE_CHECKING: + pass + +if sys.version_info < (3, 11): + from exceptiongroup import ExceptionGroup + + +class ThreadExceptionMeta(NamedTuple): + msg: str + cause_msg: str + exc_value: BaseException | None + + +thread_exceptions: StashKey[collections.deque[ThreadExceptionMeta | BaseException]] = ( + StashKey() +) + + +def collect_thread_exception(config: Config) -> None: + pop_thread_exception = config.stash[thread_exceptions].pop + errors: list[pytest.PytestUnhandledThreadExceptionWarning | RuntimeError] = [] + meta = None + hook_error = None + try: + while True: + try: + meta = pop_thread_exception() + except IndexError: + break + + if isinstance(meta, BaseException): + hook_error = RuntimeError("Failed to process thread exception") + hook_error.__cause__ = meta + errors.append(hook_error) + continue + + msg = meta.msg + try: + warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg)) + except pytest.PytestUnhandledThreadExceptionWarning as e: + # This except happens when the warning is treated as an error (e.g. `-Werror`). + if meta.exc_value is not None: + # Exceptions have a better way to show the traceback, but + # warnings do not, so hide the traceback from the msg and + # set the cause so the traceback shows up in the right place. + e.args = (meta.cause_msg,) + e.__cause__ = meta.exc_value + errors.append(e) + + if len(errors) == 1: + raise errors[0] + if errors: + raise ExceptionGroup("multiple thread exception warnings", errors) + finally: + del errors, meta, hook_error + + +def cleanup( + *, config: Config, prev_hook: Callable[[threading.ExceptHookArgs], object] +) -> None: + try: + try: + # We don't join threads here, so exceptions raised from any + # threads still running by the time _threading_atexits joins them + # do not get captured (see #13027). + collect_thread_exception(config) + finally: + threading.excepthook = prev_hook + finally: + del config.stash[thread_exceptions] + + +def thread_exception_hook( + args: threading.ExceptHookArgs, + /, + *, + append: Callable[[ThreadExceptionMeta | BaseException], object], +) -> None: + try: + # we need to compute these strings here as they might change after + # the excepthook finishes and before the metadata object is + # collected by a pytest hook + thread_name = "" if args.thread is None else args.thread.name + summary = f"Exception in thread {thread_name}" + traceback_message = "\n\n" + "".join( + traceback.format_exception( + args.exc_type, + args.exc_value, + args.exc_traceback, + ) + ) + tracemalloc_tb = "\n" + tracemalloc_message(args.thread) + msg = summary + traceback_message + tracemalloc_tb + cause_msg = summary + tracemalloc_tb + + append( + ThreadExceptionMeta( + # Compute these strings here as they might change later + msg=msg, + cause_msg=cause_msg, + exc_value=args.exc_value, + ) + ) + except BaseException as e: + append(e) + # Raising this will cause the exception to be logged twice, once in our + # collect_thread_exception and once by sys.excepthook + # which is fine - this should never happen anyway and if it does + # it should probably be reported as a pytest bug. + raise + + +def pytest_configure(config: Config) -> None: + prev_hook = threading.excepthook + deque: collections.deque[ThreadExceptionMeta | BaseException] = collections.deque() + config.stash[thread_exceptions] = deque + config.add_cleanup(functools.partial(cleanup, config=config, prev_hook=prev_hook)) + threading.excepthook = functools.partial(thread_exception_hook, append=deque.append) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_setup(item: Item) -> None: + collect_thread_exception(item.config) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_call(item: Item) -> None: + collect_thread_exception(item.config) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_teardown(item: Item) -> None: + collect_thread_exception(item.config) diff --git a/micromamba_root/Lib/site-packages/_pytest/timing.py b/micromamba_root/Lib/site-packages/_pytest/timing.py new file mode 100644 index 0000000000000000000000000000000000000000..51c3db23f6fa51a33a00567f0f0e9af99cad949b --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/timing.py @@ -0,0 +1,95 @@ +"""Indirection for time functions. + +We intentionally grab some "time" functions internally to avoid tests mocking "time" to affect +pytest runtime information (issue #185). + +Fixture "mock_timing" also interacts with this module for pytest's own tests. +""" + +from __future__ import annotations + +import dataclasses +from datetime import datetime +from datetime import timezone +from time import perf_counter +from time import sleep +from time import time +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: + from pytest import MonkeyPatch + + +@dataclasses.dataclass(frozen=True) +class Instant: + """ + Represents an instant in time, used to both get the timestamp value and to measure + the duration of a time span. + + Inspired by Rust's `std::time::Instant`. + """ + + # Creation time of this instant, using time.time(), to measure actual time. + # Note: using a `lambda` to correctly get the mocked time via `MockTiming`. + time: float = dataclasses.field(default_factory=lambda: time(), init=False) + + # Performance counter tick of the instant, used to measure precise elapsed time. + # Note: using a `lambda` to correctly get the mocked time via `MockTiming`. + perf_count: float = dataclasses.field( + default_factory=lambda: perf_counter(), init=False + ) + + def elapsed(self) -> Duration: + """Measure the duration since `Instant` was created.""" + return Duration(start=self, stop=Instant()) + + def as_utc(self) -> datetime: + """Instant as UTC datetime.""" + return datetime.fromtimestamp(self.time, timezone.utc) + + +@dataclasses.dataclass(frozen=True) +class Duration: + """A span of time as measured by `Instant.elapsed()`.""" + + start: Instant + stop: Instant + + @property + def seconds(self) -> float: + """Elapsed time of the duration in seconds, measured using a performance counter for precise timing.""" + return self.stop.perf_count - self.start.perf_count + + +@dataclasses.dataclass +class MockTiming: + """Mocks _pytest.timing with a known object that can be used to control timing in tests + deterministically. + + pytest itself should always use functions from `_pytest.timing` instead of `time` directly. + + This then allows us more control over time during testing, if testing code also + uses `_pytest.timing` functions. + + Time is static, and only advances through `sleep` calls, thus tests might sleep over large + numbers and obtain accurate time() calls at the end, making tests reliable and instant.""" + + _current_time: float = datetime(2020, 5, 22, 14, 20, 50).timestamp() + + def sleep(self, seconds: float) -> None: + self._current_time += seconds + + def time(self) -> float: + return self._current_time + + def patch(self, monkeypatch: MonkeyPatch) -> None: + # pylint: disable-next=import-self + from _pytest import timing # noqa: PLW0406 + + monkeypatch.setattr(timing, "sleep", self.sleep) + monkeypatch.setattr(timing, "time", self.time) + monkeypatch.setattr(timing, "perf_counter", self.time) + + +__all__ = ["perf_counter", "sleep", "time"] diff --git a/micromamba_root/Lib/site-packages/_pytest/tmpdir.py b/micromamba_root/Lib/site-packages/_pytest/tmpdir.py new file mode 100644 index 0000000000000000000000000000000000000000..66ca9f190e38ed95995f0ded13d9d401a0517c93 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/tmpdir.py @@ -0,0 +1,337 @@ +# mypy: allow-untyped-defs +"""Support for providing temporary directories to test functions.""" + +from __future__ import annotations + +from collections.abc import Generator +import dataclasses +import os +from pathlib import Path +import re +from shutil import rmtree +import stat +import tempfile +from typing import Any +from typing import final +from typing import Literal + +from .pathlib import cleanup_dead_symlinks +from .pathlib import LOCK_TIMEOUT +from .pathlib import make_numbered_dir +from .pathlib import make_numbered_dir_with_cleanup +from .pathlib import rm_rf +from _pytest.compat import get_user_id +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Item +from _pytest.reports import TestReport +from _pytest.stash import StashKey + + +tmppath_result_key = StashKey[dict[str, bool]]() +RetentionType = Literal["all", "failed", "none"] + + +@final +@dataclasses.dataclass +class TempPathFactory: + """Factory for temporary directories under the common base temp directory, + as discussed at :ref:`temporary directory location and retention`. + """ + + _given_basetemp: Path | None + # pluggy TagTracerSub, not currently exposed, so Any. + _trace: Any + _basetemp: Path | None + _retention_count: int + _retention_policy: RetentionType + + def __init__( + self, + given_basetemp: Path | None, + retention_count: int, + retention_policy: RetentionType, + trace, + basetemp: Path | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + if given_basetemp is None: + self._given_basetemp = None + else: + # Use os.path.abspath() to get absolute path instead of resolve() as it + # does not work the same in all platforms (see #4427). + # Path.absolute() exists, but it is not public (see https://bugs.python.org/issue25012). + self._given_basetemp = Path(os.path.abspath(str(given_basetemp))) + self._trace = trace + self._retention_count = retention_count + self._retention_policy = retention_policy + self._basetemp = basetemp + + @classmethod + def from_config( + cls, + config: Config, + *, + _ispytest: bool = False, + ) -> TempPathFactory: + """Create a factory according to pytest configuration. + + :meta private: + """ + check_ispytest(_ispytest) + count = int(config.getini("tmp_path_retention_count")) + if count < 0: + raise ValueError( + f"tmp_path_retention_count must be >= 0. Current input: {count}." + ) + + policy = config.getini("tmp_path_retention_policy") + if policy not in ("all", "failed", "none"): + raise ValueError( + f"tmp_path_retention_policy must be either all, failed, none. Current input: {policy}." + ) + + return cls( + given_basetemp=config.option.basetemp, + trace=config.trace.get("tmpdir"), + retention_count=count, + retention_policy=policy, + _ispytest=True, + ) + + def _ensure_relative_to_basetemp(self, basename: str) -> str: + basename = os.path.normpath(basename) + if (self.getbasetemp() / basename).resolve().parent != self.getbasetemp(): + raise ValueError(f"{basename} is not a normalized and relative path") + return basename + + def mktemp(self, basename: str, numbered: bool = True) -> Path: + """Create a new temporary directory managed by the factory. + + :param basename: + Directory base name, must be a relative path. + + :param numbered: + If ``True``, ensure the directory is unique by adding a numbered + suffix greater than any existing one: ``basename="foo-"`` and ``numbered=True`` + means that this function will create directories named ``"foo-0"``, + ``"foo-1"``, ``"foo-2"`` and so on. + + :returns: + The path to the new directory. + """ + basename = self._ensure_relative_to_basetemp(basename) + if not numbered: + p = self.getbasetemp().joinpath(basename) + p.mkdir(mode=0o700) + else: + p = make_numbered_dir(root=self.getbasetemp(), prefix=basename, mode=0o700) + self._trace("mktemp", p) + return p + + def getbasetemp(self) -> Path: + """Return the base temporary directory, creating it if needed. + + :returns: + The base temporary directory. + """ + if self._basetemp is not None: + return self._basetemp + + if self._given_basetemp is not None: + basetemp = self._given_basetemp + if basetemp.exists(): + rm_rf(basetemp) + basetemp.mkdir(mode=0o700) + basetemp = basetemp.resolve() + else: + from_env = os.environ.get("PYTEST_DEBUG_TEMPROOT") + temproot = Path(from_env or tempfile.gettempdir()).resolve() + user = get_user() or "unknown" + # use a sub-directory in the temproot to speed-up + # make_numbered_dir() call + rootdir = temproot.joinpath(f"pytest-of-{user}") + try: + rootdir.mkdir(mode=0o700, exist_ok=True) + except OSError: + # getuser() likely returned illegal characters for the platform, use unknown back off mechanism + rootdir = temproot.joinpath("pytest-of-unknown") + rootdir.mkdir(mode=0o700, exist_ok=True) + # Because we use exist_ok=True with a predictable name, make sure + # we are the owners, to prevent any funny business (on unix, where + # temproot is usually shared). + # Also, to keep things private, fixup any world-readable temp + # rootdir's permissions. Historically 0o755 was used, so we can't + # just error out on this, at least for a while. + # Don't follow symlinks, otherwise we're open to symlink-swapping + # TOCTOU vulnerability. + # This check makes us vulnerable to a DoS - a user can `mkdir + # /tmp/pytest-of-otheruser` and then `otheruser` will fail this + # check. For now we don't consider it a real problem. otheruser can + # change their TMPDIR or --basetemp, and maybe give the prankster a + # good scolding. + uid = get_user_id() + if uid is not None: + stat_follow_symlinks = ( + False if os.stat in os.supports_follow_symlinks else True + ) + rootdir_stat = rootdir.stat(follow_symlinks=stat_follow_symlinks) + if stat.S_ISLNK(rootdir_stat.st_mode): + raise OSError( + f"The temporary directory {rootdir} is a symbolic link. " + "Fix this and try again." + ) + if rootdir_stat.st_uid != uid: + raise OSError( + f"The temporary directory {rootdir} is not owned by the current user. " + "Fix this and try again." + ) + if (rootdir_stat.st_mode & 0o077) != 0: + chmod_follow_symlinks = ( + False if os.chmod in os.supports_follow_symlinks else True + ) + rootdir.chmod( + rootdir_stat.st_mode & ~0o077, + follow_symlinks=chmod_follow_symlinks, + ) + keep = self._retention_count + if self._retention_policy == "none": + keep = 0 + basetemp = make_numbered_dir_with_cleanup( + prefix="pytest-", + root=rootdir, + keep=keep, + lock_timeout=LOCK_TIMEOUT, + mode=0o700, + ) + assert basetemp is not None, basetemp + self._basetemp = basetemp + self._trace("new basetemp", basetemp) + return basetemp + + +def get_user() -> str | None: + """Return the current user name, or None if getuser() does not work + in the current environment (see #1010).""" + try: + # In some exotic environments, getpass may not be importable. + import getpass + + return getpass.getuser() + except (ImportError, OSError, KeyError): + return None + + +def pytest_configure(config: Config) -> None: + """Create a TempPathFactory and attach it to the config object. + + This is to comply with existing plugins which expect the handler to be + available at pytest_configure time, but ideally should be moved entirely + to the tmp_path_factory session fixture. + """ + mp = MonkeyPatch() + config.add_cleanup(mp.undo) + _tmp_path_factory = TempPathFactory.from_config(config, _ispytest=True) + mp.setattr(config, "_tmp_path_factory", _tmp_path_factory, raising=False) + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "tmp_path_retention_count", + help="How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.", + default="3", + # NOTE: Would have been better as an `int` but can't change it now. + type="string", + ) + + parser.addini( + "tmp_path_retention_policy", + help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. " + "(all/failed/none)", + type="string", + default="all", + ) + + +@fixture(scope="session") +def tmp_path_factory(request: FixtureRequest) -> TempPathFactory: + """Return a :class:`pytest.TempPathFactory` instance for the test session.""" + # Set dynamically by pytest_configure() above. + return request.config._tmp_path_factory # type: ignore + + +def _mk_tmp(request: FixtureRequest, factory: TempPathFactory) -> Path: + name = request.node.name + name = re.sub(r"[\W]", "_", name) + MAXVAL = 30 + name = name[:MAXVAL] + return factory.mktemp(name, numbered=True) + + +@fixture +def tmp_path( + request: FixtureRequest, tmp_path_factory: TempPathFactory +) -> Generator[Path]: + """Return a temporary directory (as :class:`pathlib.Path` object) + which is unique to each test function invocation. + The temporary directory is created as a subdirectory + of the base temporary directory, with configurable retention, + as discussed in :ref:`temporary directory location and retention`. + """ + path = _mk_tmp(request, tmp_path_factory) + yield path + + # Remove the tmpdir if the policy is "failed" and the test passed. + policy = tmp_path_factory._retention_policy + result_dict = request.node.stash[tmppath_result_key] + + if policy == "failed" and result_dict.get("call", True): + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(path, ignore_errors=True) + + del request.node.stash[tmppath_result_key] + + +def pytest_sessionfinish(session, exitstatus: int | ExitCode): + """After each session, remove base directory if all the tests passed, + the policy is "failed", and the basetemp is not specified by a user. + """ + tmp_path_factory: TempPathFactory = session.config._tmp_path_factory + basetemp = tmp_path_factory._basetemp + if basetemp is None: + return + + policy = tmp_path_factory._retention_policy + if ( + exitstatus == 0 + and policy == "failed" + and tmp_path_factory._given_basetemp is None + ): + if basetemp.is_dir(): + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(basetemp, ignore_errors=True) + + # Remove dead symlinks. + if basetemp.is_dir(): + cleanup_dead_symlinks(basetemp) + + +@hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_makereport( + item: Item, call +) -> Generator[None, TestReport, TestReport]: + rep = yield + assert rep.when is not None + empty: dict[str, bool] = {} + item.stash.setdefault(tmppath_result_key, empty)[rep.when] = rep.passed + return rep diff --git a/micromamba_root/Lib/site-packages/_pytest/tracemalloc.py b/micromamba_root/Lib/site-packages/_pytest/tracemalloc.py new file mode 100644 index 0000000000000000000000000000000000000000..5d0b19855c734ed8885c1ceb7bec20b34ac66b52 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/tracemalloc.py @@ -0,0 +1,24 @@ +from __future__ import annotations + + +def tracemalloc_message(source: object) -> str: + if source is None: + return "" + + try: + import tracemalloc + except ImportError: + return "" + + tb = tracemalloc.get_object_traceback(source) + if tb is not None: + formatted_tb = "\n".join(tb.format()) + # Use a leading new line to better separate the (large) output + # from the traceback to the previous warning text. + return f"\nObject allocated at:\n{formatted_tb}" + # No need for a leading new line. + url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings" + return ( + "Enable tracemalloc to get traceback where the object was allocated.\n" + f"See {url} for more info." + ) diff --git a/micromamba_root/Lib/site-packages/_pytest/unittest.py b/micromamba_root/Lib/site-packages/_pytest/unittest.py new file mode 100644 index 0000000000000000000000000000000000000000..31be8847821c9f8547b9e7d2fb3ce55406e87ab4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/unittest.py @@ -0,0 +1,632 @@ +# mypy: allow-untyped-defs +"""Discover and run std-library "unittest" style tests.""" + +from __future__ import annotations + +from collections.abc import Callable +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Iterator +from enum import auto +from enum import Enum +import inspect +import sys +import traceback +import types +from typing import Any +from typing import TYPE_CHECKING +from unittest import TestCase + +import _pytest._code +from _pytest._code import ExceptionInfo +from _pytest.compat import assert_never +from _pytest.compat import is_async_function +from _pytest.config import hookimpl +from _pytest.fixtures import FixtureRequest +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import exit +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import xfail +from _pytest.python import Class +from _pytest.python import Function +from _pytest.python import Module +from _pytest.runner import CallInfo +from _pytest.runner import check_interactive_exception +from _pytest.subtests import SubtestContext +from _pytest.subtests import SubtestReport + + +if sys.version_info[:2] < (3, 11): + from exceptiongroup import ExceptionGroup + +if TYPE_CHECKING: + from types import TracebackType + import unittest + + import twisted.trial.unittest + + +_SysExcInfoType = ( + tuple[type[BaseException], BaseException, types.TracebackType] + | tuple[None, None, None] +) + + +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> UnitTestCase | None: + try: + # Has unittest been imported? + ut = sys.modules["unittest"] + # Is obj a subclass of unittest.TestCase? + # Type ignored because `ut` is an opaque module. + if not issubclass(obj, ut.TestCase): # type: ignore + return None + except Exception: + return None + # Is obj a concrete class? + # Abstract classes can't be instantiated so no point collecting them. + if inspect.isabstract(obj): + return None + # Yes, so let's collect it. + return UnitTestCase.from_parent(collector, name=name, obj=obj) + + +class UnitTestCase(Class): + # Marker for fixturemanger.getfixtureinfo() + # to declare that our children do not support funcargs. + nofuncargs = True + + def newinstance(self): + # TestCase __init__ takes the method (test) name. The TestCase + # constructor treats the name "runTest" as a special no-op, so it can be + # used when a dummy instance is needed. While unittest.TestCase has a + # default, some subclasses omit the default (#9610), so always supply + # it. + return self.obj("runTest") + + def collect(self) -> Iterable[Item | Collector]: + from unittest import TestLoader + + cls = self.obj + if not getattr(cls, "__test__", True): + return + + skipped = _is_skipped(cls) + if not skipped: + self._register_unittest_setup_method_fixture(cls) + self._register_unittest_setup_class_fixture(cls) + self._register_setup_class_fixture() + + self.session._fixturemanager.parsefactories(self.newinstance(), self.nodeid) + + loader = TestLoader() + foundsomething = False + for name in loader.getTestCaseNames(self.obj): + x = getattr(self.obj, name) + if not getattr(x, "__test__", True): + continue + yield TestCaseFunction.from_parent(self, name=name) + foundsomething = True + + if not foundsomething: + runtest = getattr(self.obj, "runTest", None) + if runtest is not None: + ut = sys.modules.get("twisted.trial.unittest", None) + if ut is None or runtest != ut.TestCase.runTest: + yield TestCaseFunction.from_parent(self, name="runTest") + + def _register_unittest_setup_class_fixture(self, cls: type) -> None: + """Register an auto-use fixture to invoke setUpClass and + tearDownClass (#517).""" + setup = getattr(cls, "setUpClass", None) + teardown = getattr(cls, "tearDownClass", None) + if setup is None and teardown is None: + return None + cleanup = getattr(cls, "doClassCleanups", lambda: None) + + def process_teardown_exceptions() -> None: + # tearDown_exceptions is a list set in the class containing exc_infos for errors during + # teardown for the class. + exc_infos = getattr(cls, "tearDown_exceptions", None) + if not exc_infos: + return + exceptions = [exc for (_, exc, _) in exc_infos] + # If a single exception, raise it directly as this provides a more readable + # error (hopefully this will improve in #12255). + if len(exceptions) == 1: + raise exceptions[0] + else: + raise ExceptionGroup("Unittest class cleanup errors", exceptions) + + def unittest_setup_class_fixture( + request: FixtureRequest, + ) -> Generator[None]: + cls = request.cls + if _is_skipped(cls): + reason = cls.__unittest_skip_why__ + raise skip.Exception(reason, _use_item_location=True) + if setup is not None: + try: + setup() + # unittest does not call the cleanup function for every BaseException, so we + # follow this here. + except Exception: + cleanup() + process_teardown_exceptions() + raise + yield + try: + if teardown is not None: + teardown() + finally: + cleanup() + process_teardown_exceptions() + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_unittest_setUpClass_fixture_{cls.__qualname__}", + func=unittest_setup_class_fixture, + nodeid=self.nodeid, + scope="class", + autouse=True, + ) + + def _register_unittest_setup_method_fixture(self, cls: type) -> None: + """Register an auto-use fixture to invoke setup_method and + teardown_method (#517).""" + setup = getattr(cls, "setup_method", None) + teardown = getattr(cls, "teardown_method", None) + if setup is None and teardown is None: + return None + + def unittest_setup_method_fixture( + request: FixtureRequest, + ) -> Generator[None]: + self = request.instance + if _is_skipped(self): + reason = self.__unittest_skip_why__ + raise skip.Exception(reason, _use_item_location=True) + if setup is not None: + setup(self, request.function) + yield + if teardown is not None: + teardown(self, request.function) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_unittest_setup_method_fixture_{cls.__qualname__}", + func=unittest_setup_method_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +class TestCaseFunction(Function): + nofuncargs = True + failfast = False + _excinfo: list[_pytest._code.ExceptionInfo[BaseException]] | None = None + + def _getinstance(self): + assert isinstance(self.parent, UnitTestCase) + return self.parent.obj(self.name) + + # Backward compat for pytest-django; can be removed after pytest-django + # updates + some slack. + @property + def _testcase(self): + return self.instance + + def setup(self) -> None: + # A bound method to be called during teardown() if set (see 'runtest()'). + self._explicit_tearDown: Callable[[], None] | None = None + super().setup() + if sys.version_info < (3, 11): + # A cache of the subTest errors and non-subtest skips in self._outcome. + # Compute and cache these lists once, instead of computing them again and again for each subtest (#13965). + self._cached_errors_and_skips: tuple[list[Any], list[Any]] | None = None + + def teardown(self) -> None: + if self._explicit_tearDown is not None: + self._explicit_tearDown() + self._explicit_tearDown = None + self._obj = None + del self._instance + super().teardown() + + def startTest(self, testcase: unittest.TestCase) -> None: + pass + + def _addexcinfo(self, rawexcinfo: _SysExcInfoType) -> None: + rawexcinfo = _handle_twisted_exc_info(rawexcinfo) + try: + excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info( + rawexcinfo # type: ignore[arg-type] + ) + # Invoke the attributes to trigger storing the traceback + # trial causes some issue there. + _ = excinfo.value + _ = excinfo.traceback + except TypeError: + try: + try: + values = traceback.format_exception(*rawexcinfo) + values.insert( + 0, + "NOTE: Incompatible Exception Representation, " + "displaying natively:\n\n", + ) + fail("".join(values), pytrace=False) + except (fail.Exception, KeyboardInterrupt): + raise + except BaseException: + fail( + "ERROR: Unknown Incompatible Exception " + f"representation:\n{rawexcinfo!r}", + pytrace=False, + ) + except KeyboardInterrupt: + raise + except fail.Exception: + excinfo = _pytest._code.ExceptionInfo.from_current() + self.__dict__.setdefault("_excinfo", []).append(excinfo) + + def addError( + self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType + ) -> None: + try: + if isinstance(rawexcinfo[1], exit.Exception): + exit(rawexcinfo[1].msg) + except TypeError: + pass + self._addexcinfo(rawexcinfo) + + def addFailure( + self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType + ) -> None: + self._addexcinfo(rawexcinfo) + + def addSkip( + self, testcase: unittest.TestCase, reason: str, *, handle_subtests: bool = True + ) -> None: + from unittest.case import _SubTest # type: ignore[attr-defined] + + def add_skip() -> None: + try: + raise skip.Exception(reason, _use_item_location=True) + except skip.Exception: + self._addexcinfo(sys.exc_info()) + + if not handle_subtests: + add_skip() + return + + if isinstance(testcase, _SubTest): + add_skip() + if self._excinfo is not None: + exc_info = self._excinfo[-1] + self.addSubTest(testcase.test_case, testcase, exc_info) + else: + # For python < 3.11: the non-subtest skips have to be added by `add_skip` only after all subtest + # failures are processed by `_addSubTest`: `self.instance._outcome` has no attribute + # `skipped/errors` anymore. + # We also need to check if `self.instance._outcome` is `None` (this happens if the test + # class/method is decorated with `unittest.skip`, see pytest-dev/pytest-subtests#173). + if sys.version_info < (3, 11) and self.instance._outcome is not None: + subtest_errors, _ = self._obtain_errors_and_skips() + if len(subtest_errors) == 0: + add_skip() + else: + add_skip() + + def addExpectedFailure( + self, + testcase: unittest.TestCase, + rawexcinfo: _SysExcInfoType, + reason: str = "", + ) -> None: + try: + xfail(str(reason)) + except xfail.Exception: + self._addexcinfo(sys.exc_info()) + + def addUnexpectedSuccess( + self, + testcase: unittest.TestCase, + reason: twisted.trial.unittest.Todo | None = None, + ) -> None: + msg = "Unexpected success" + if reason: + msg += f": {reason.reason}" + # Preserve unittest behaviour - fail the test. Explicitly not an XPASS. + try: + fail(msg, pytrace=False) + except fail.Exception: + self._addexcinfo(sys.exc_info()) + + def addSuccess(self, testcase: unittest.TestCase) -> None: + pass + + def stopTest(self, testcase: unittest.TestCase) -> None: + pass + + def addDuration(self, testcase: unittest.TestCase, elapsed: float) -> None: + pass + + def runtest(self) -> None: + from _pytest.debugging import maybe_wrap_pytest_function_for_tracing + + testcase = self.instance + assert testcase is not None + + maybe_wrap_pytest_function_for_tracing(self) + + # Let the unittest framework handle async functions. + if is_async_function(self.obj): + testcase(result=self) + else: + # When --pdb is given, we want to postpone calling tearDown() otherwise + # when entering the pdb prompt, tearDown() would have probably cleaned up + # instance variables, which makes it difficult to debug. + # Arguably we could always postpone tearDown(), but this changes the moment where the + # TestCase instance interacts with the results object, so better to only do it + # when absolutely needed. + # We need to consider if the test itself is skipped, or the whole class. + assert isinstance(self.parent, UnitTestCase) + skipped = _is_skipped(self.obj) or _is_skipped(self.parent.obj) + if self.config.getoption("usepdb") and not skipped: + self._explicit_tearDown = testcase.tearDown + setattr(testcase, "tearDown", lambda *args: None) + + # We need to update the actual bound method with self.obj, because + # wrap_pytest_function_for_tracing replaces self.obj by a wrapper. + setattr(testcase, self.name, self.obj) + try: + testcase(result=self) + finally: + delattr(testcase, self.name) + + def _traceback_filter( + self, excinfo: _pytest._code.ExceptionInfo[BaseException] + ) -> _pytest._code.Traceback: + traceback = super()._traceback_filter(excinfo) + ntraceback = traceback.filter( + lambda x: not x.frame.f_globals.get("__unittest"), + ) + if not ntraceback: + ntraceback = traceback + return ntraceback + + def addSubTest( + self, + test_case: Any, + test: TestCase, + exc_info: ExceptionInfo[BaseException] + | tuple[type[BaseException], BaseException, TracebackType] + | None, + ) -> None: + # Importing this private symbol locally in case this symbol is renamed/removed in the future; importing + # it globally would break pytest entirely, importing it locally only will break unittests using `addSubTest`. + from unittest.case import _subtest_msg_sentinel # type: ignore[attr-defined] + + exception_info: ExceptionInfo[BaseException] | None + match exc_info: + case tuple(): + exception_info = ExceptionInfo(exc_info, _ispytest=True) + case ExceptionInfo() | None: + exception_info = exc_info + case unreachable: + assert_never(unreachable) + + call_info = CallInfo[None]( + None, + exception_info, + start=0, + stop=0, + duration=0, + when="call", + _ispytest=True, + ) + msg = None if test._message is _subtest_msg_sentinel else str(test._message) # type: ignore[attr-defined] + report = self.ihook.pytest_runtest_makereport(item=self, call=call_info) + sub_report = SubtestReport._new( + report, + SubtestContext(msg=msg, kwargs=dict(test.params)), # type: ignore[attr-defined] + captured_output=None, + captured_logs=None, + ) + self.ihook.pytest_runtest_logreport(report=sub_report) + if check_interactive_exception(call_info, sub_report): + self.ihook.pytest_exception_interact( + node=self, call=call_info, report=sub_report + ) + + # For python < 3.11: add non-subtest skips once all subtest failures are processed by # `_addSubTest`. + if sys.version_info < (3, 11): + subtest_errors, non_subtest_skip = self._obtain_errors_and_skips() + + # Check if we have non-subtest skips: if there are also sub failures, non-subtest skips are not treated in + # `_addSubTest` and have to be added using `add_skip` after all subtest failures are processed. + if len(non_subtest_skip) > 0 and len(subtest_errors) > 0: + # Make sure we have processed the last subtest failure + last_subset_error = subtest_errors[-1] + if exc_info is last_subset_error[-1]: + # Add non-subtest skips (as they could not be treated in `_addSkip`) + for testcase, reason in non_subtest_skip: + self.addSkip(testcase, reason, handle_subtests=False) + + def _obtain_errors_and_skips(self) -> tuple[list[Any], list[Any]]: + """Compute or obtain the cached values for subtest errors and non-subtest skips.""" + from unittest.case import _SubTest # type: ignore[attr-defined] + + assert sys.version_info < (3, 11), ( + "This workaround only should be used in Python 3.10" + ) + if self._cached_errors_and_skips is not None: + return self._cached_errors_and_skips + + subtest_errors = [ + (x, y) + for x, y in self.instance._outcome.errors + if isinstance(x, _SubTest) and y is not None + ] + + non_subtest_skips = [ + (x, y) + for x, y in self.instance._outcome.skipped + if not isinstance(x, _SubTest) + ] + self._cached_errors_and_skips = (subtest_errors, non_subtest_skips) + return subtest_errors, non_subtest_skips + + +@hookimpl(tryfirst=True) +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None: + if isinstance(item, TestCaseFunction): + if item._excinfo: + call.excinfo = item._excinfo.pop(0) + try: + del call.result + except AttributeError: + pass + + # Convert unittest.SkipTest to pytest.skip. + # This covers explicit `raise unittest.SkipTest`. + unittest = sys.modules.get("unittest") + if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest): + excinfo = call.excinfo + call2 = CallInfo[None].from_call(lambda: skip(str(excinfo.value)), call.when) + call.excinfo = call2.excinfo + + +def _is_skipped(obj) -> bool: + """Return True if the given object has been marked with @unittest.skip.""" + return bool(getattr(obj, "__unittest_skip__", False)) + + +def pytest_configure() -> None: + """Register the TestCaseFunction class as an IReporter if twisted.trial is available.""" + if _get_twisted_version() is not TwistedVersion.NotInstalled: + from twisted.trial.itrial import IReporter + from zope.interface import classImplements + + classImplements(TestCaseFunction, IReporter) + + +class TwistedVersion(Enum): + """ + The Twisted version installed in the environment. + + We have different workarounds in place for different versions of Twisted. + """ + + # Twisted version 24 or prior. + Version24 = auto() + # Twisted version 25 or later. + Version25 = auto() + # Twisted version is not available. + NotInstalled = auto() + + +def _get_twisted_version() -> TwistedVersion: + # We need to check if "twisted.trial.unittest" is specifically present in sys.modules. + # This is because we intend to integrate with Trial only when it's actively running + # the test suite, but not needed when only other Twisted components are in use. + if "twisted.trial.unittest" not in sys.modules: + return TwistedVersion.NotInstalled + + import importlib.metadata + + import packaging.version + + version_str = importlib.metadata.version("twisted") + version = packaging.version.parse(version_str) + if version.major <= 24: + return TwistedVersion.Version24 + else: + return TwistedVersion.Version25 + + +# Name of the attribute in `twisted.python.Failure` instances that stores +# the `sys.exc_info()` tuple. +# See twisted.trial support in `pytest_runtest_protocol`. +TWISTED_RAW_EXCINFO_ATTR = "_twisted_raw_excinfo" + + +@hookimpl(wrapper=True) +def pytest_runtest_protocol(item: Item) -> Iterator[None]: + if _get_twisted_version() is TwistedVersion.Version24: + import twisted.python.failure as ut + + # Monkeypatch `Failure.__init__` to store the raw exception info. + original__init__ = ut.Failure.__init__ + + def store_raw_exception_info( + self, exc_value=None, exc_type=None, exc_tb=None, captureVars=None + ): # pragma: no cover + if exc_value is None: + raw_exc_info = sys.exc_info() + else: + if exc_type is None: + exc_type = type(exc_value) + if exc_tb is None: + exc_tb = sys.exc_info()[2] + raw_exc_info = (exc_type, exc_value, exc_tb) + setattr(self, TWISTED_RAW_EXCINFO_ATTR, tuple(raw_exc_info)) + try: + original__init__( + self, exc_value, exc_type, exc_tb, captureVars=captureVars + ) + except TypeError: # pragma: no cover + original__init__(self, exc_value, exc_type, exc_tb) + + with MonkeyPatch.context() as patcher: + patcher.setattr(ut.Failure, "__init__", store_raw_exception_info) + return (yield) + else: + return (yield) + + +def _handle_twisted_exc_info( + rawexcinfo: _SysExcInfoType | BaseException, +) -> _SysExcInfoType: + """ + Twisted passes a custom Failure instance to `addError()` instead of using `sys.exc_info()`. + Therefore, if `rawexcinfo` is a `Failure` instance, convert it into the equivalent `sys.exc_info()` tuple + as expected by pytest. + """ + twisted_version = _get_twisted_version() + if twisted_version is TwistedVersion.NotInstalled: + # Unfortunately, because we cannot import `twisted.python.failure` at the top of the file + # and use it in the signature, we need to use `type:ignore` here because we cannot narrow + # the type properly in the `if` statement above. + return rawexcinfo # type:ignore[return-value] + elif twisted_version is TwistedVersion.Version24: + # Twisted calls addError() passing its own classes (like `twisted.python.Failure`), which violates + # the `addError()` signature, so we extract the original `sys.exc_info()` tuple which is stored + # in the object. + if hasattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR): + saved_exc_info = getattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR) + # Delete the attribute from the original object to avoid leaks. + delattr(rawexcinfo, TWISTED_RAW_EXCINFO_ATTR) + return saved_exc_info # type:ignore[no-any-return] + return rawexcinfo # type:ignore[return-value] + elif twisted_version is TwistedVersion.Version25: + if isinstance(rawexcinfo, BaseException): + import twisted.python.failure + + if isinstance(rawexcinfo, twisted.python.failure.Failure): + tb = rawexcinfo.__traceback__ + if tb is None: + tb = sys.exc_info()[2] + return type(rawexcinfo.value), rawexcinfo.value, tb + + return rawexcinfo # type:ignore[return-value] + else: + # Ideally we would use assert_never() here, but it is not available in all Python versions + # we support, plus we do not require `type_extensions` currently. + assert False, f"Unexpected Twisted version: {twisted_version}" diff --git a/micromamba_root/Lib/site-packages/_pytest/unraisableexception.py b/micromamba_root/Lib/site-packages/_pytest/unraisableexception.py new file mode 100644 index 0000000000000000000000000000000000000000..0faca36aa00e5fe793fb4ff4d1c630eeff540770 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/unraisableexception.py @@ -0,0 +1,163 @@ +from __future__ import annotations + +import collections +from collections.abc import Callable +import functools +import gc +import sys +import traceback +from typing import NamedTuple +from typing import TYPE_CHECKING +import warnings + +from _pytest.config import Config +from _pytest.nodes import Item +from _pytest.stash import StashKey +from _pytest.tracemalloc import tracemalloc_message +import pytest + + +if TYPE_CHECKING: + pass + +if sys.version_info < (3, 11): + from exceptiongroup import ExceptionGroup + + +# This is a stash item and not a simple constant to allow pytester to override it. +gc_collect_iterations_key = StashKey[int]() + + +def gc_collect_harder(iterations: int) -> None: + for _ in range(iterations): + gc.collect() + + +class UnraisableMeta(NamedTuple): + msg: str + cause_msg: str + exc_value: BaseException | None + + +unraisable_exceptions: StashKey[collections.deque[UnraisableMeta | BaseException]] = ( + StashKey() +) + + +def collect_unraisable(config: Config) -> None: + pop_unraisable = config.stash[unraisable_exceptions].pop + errors: list[pytest.PytestUnraisableExceptionWarning | RuntimeError] = [] + meta = None + hook_error = None + try: + while True: + try: + meta = pop_unraisable() + except IndexError: + break + + if isinstance(meta, BaseException): + hook_error = RuntimeError("Failed to process unraisable exception") + hook_error.__cause__ = meta + errors.append(hook_error) + continue + + msg = meta.msg + try: + warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) + except pytest.PytestUnraisableExceptionWarning as e: + # This except happens when the warning is treated as an error (e.g. `-Werror`). + if meta.exc_value is not None: + # Exceptions have a better way to show the traceback, but + # warnings do not, so hide the traceback from the msg and + # set the cause so the traceback shows up in the right place. + e.args = (meta.cause_msg,) + e.__cause__ = meta.exc_value + errors.append(e) + + if len(errors) == 1: + raise errors[0] + if errors: + raise ExceptionGroup("multiple unraisable exception warnings", errors) + finally: + del errors, meta, hook_error + + +def cleanup( + *, config: Config, prev_hook: Callable[[sys.UnraisableHookArgs], object] +) -> None: + # A single collection doesn't necessarily collect everything. + # Constant determined experimentally by the Trio project. + gc_collect_iterations = config.stash.get(gc_collect_iterations_key, 5) + try: + try: + gc_collect_harder(gc_collect_iterations) + collect_unraisable(config) + finally: + sys.unraisablehook = prev_hook + finally: + del config.stash[unraisable_exceptions] + + +def unraisable_hook( + unraisable: sys.UnraisableHookArgs, + /, + *, + append: Callable[[UnraisableMeta | BaseException], object], +) -> None: + try: + # we need to compute these strings here as they might change after + # the unraisablehook finishes and before the metadata object is + # collected by a pytest hook + err_msg = ( + "Exception ignored in" if unraisable.err_msg is None else unraisable.err_msg + ) + summary = f"{err_msg}: {unraisable.object!r}" + traceback_message = "\n\n" + "".join( + traceback.format_exception( + unraisable.exc_type, + unraisable.exc_value, + unraisable.exc_traceback, + ) + ) + tracemalloc_tb = "\n" + tracemalloc_message(unraisable.object) + msg = summary + traceback_message + tracemalloc_tb + cause_msg = summary + tracemalloc_tb + + append( + UnraisableMeta( + msg=msg, + cause_msg=cause_msg, + exc_value=unraisable.exc_value, + ) + ) + except BaseException as e: + append(e) + # Raising this will cause the exception to be logged twice, once in our + # collect_unraisable and once by the unraisablehook calling machinery + # which is fine - this should never happen anyway and if it does + # it should probably be reported as a pytest bug. + raise + + +def pytest_configure(config: Config) -> None: + prev_hook = sys.unraisablehook + deque: collections.deque[UnraisableMeta | BaseException] = collections.deque() + config.stash[unraisable_exceptions] = deque + config.add_cleanup(functools.partial(cleanup, config=config, prev_hook=prev_hook)) + sys.unraisablehook = functools.partial(unraisable_hook, append=deque.append) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_setup(item: Item) -> None: + collect_unraisable(item.config) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_call(item: Item) -> None: + collect_unraisable(item.config) + + +@pytest.hookimpl(trylast=True) +def pytest_runtest_teardown(item: Item) -> None: + collect_unraisable(item.config) diff --git a/micromamba_root/Lib/site-packages/_pytest/warning_types.py b/micromamba_root/Lib/site-packages/_pytest/warning_types.py new file mode 100644 index 0000000000000000000000000000000000000000..93071b4a1b2d3bd2d556d926829728562ad9fd11 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/warning_types.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +import dataclasses +import inspect +from types import FunctionType +from typing import Any +from typing import final +from typing import Generic +from typing import TypeVar +import warnings + + +class PytestWarning(UserWarning): + """Base class for all warnings emitted by pytest.""" + + __module__ = "pytest" + + +@final +class PytestAssertRewriteWarning(PytestWarning): + """Warning emitted by the pytest assert rewrite module.""" + + __module__ = "pytest" + + +@final +class PytestCacheWarning(PytestWarning): + """Warning emitted by the cache plugin in various situations.""" + + __module__ = "pytest" + + +@final +class PytestConfigWarning(PytestWarning): + """Warning emitted for configuration issues.""" + + __module__ = "pytest" + + +@final +class PytestCollectionWarning(PytestWarning): + """Warning emitted when pytest is not able to collect a file or symbol in a module.""" + + __module__ = "pytest" + + +class PytestDeprecationWarning(PytestWarning, DeprecationWarning): + """Warning class for features that will be removed in a future version.""" + + __module__ = "pytest" + + +class PytestRemovedIn9Warning(PytestDeprecationWarning): + """Warning class for features that will be removed in pytest 9.""" + + __module__ = "pytest" + + +class PytestRemovedIn10Warning(PytestDeprecationWarning): + """Warning class for features that will be removed in pytest 10.""" + + __module__ = "pytest" + + +@final +class PytestExperimentalApiWarning(PytestWarning, FutureWarning): + """Warning category used to denote experiments in pytest. + + Use sparingly as the API might change or even be removed completely in a + future version. + """ + + __module__ = "pytest" + + @classmethod + def simple(cls, apiname: str) -> PytestExperimentalApiWarning: + return cls(f"{apiname} is an experimental api that may change over time") + + +@final +class PytestReturnNotNoneWarning(PytestWarning): + """ + Warning emitted when a test function returns a value other than ``None``. + + See :ref:`return-not-none` for details. + """ + + __module__ = "pytest" + + +@final +class PytestUnknownMarkWarning(PytestWarning): + """Warning emitted on use of unknown markers. + + See :ref:`mark` for details. + """ + + __module__ = "pytest" + + +@final +class PytestUnraisableExceptionWarning(PytestWarning): + """An unraisable exception was reported. + + Unraisable exceptions are exceptions raised in :meth:`__del__ ` + implementations and similar situations when the exception cannot be raised + as normal. + """ + + __module__ = "pytest" + + +@final +class PytestUnhandledThreadExceptionWarning(PytestWarning): + """An unhandled exception occurred in a :class:`~threading.Thread`. + + Such exceptions don't propagate normally. + """ + + __module__ = "pytest" + + +_W = TypeVar("_W", bound=PytestWarning) + + +@final +@dataclasses.dataclass +class UnformattedWarning(Generic[_W]): + """A warning meant to be formatted during runtime. + + This is used to hold warnings that need to format their message at runtime, + as opposed to a direct message. + """ + + category: type[_W] + template: str + + def format(self, **kwargs: Any) -> _W: + """Return an instance of the warning category, formatted with given kwargs.""" + return self.category(self.template.format(**kwargs)) + + +@final +class PytestFDWarning(PytestWarning): + """When the lsof plugin finds leaked fds.""" + + __module__ = "pytest" + + +def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnings for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ + lineno = method.__code__.co_firstlineno + filename = inspect.getfile(method) + module = method.__module__ + mod_globals = method.__globals__ + try: + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) + except Warning as w: + # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. + raise type(w)(f"{w}\n at {filename}:{lineno}") from None diff --git a/micromamba_root/Lib/site-packages/_pytest/warnings.py b/micromamba_root/Lib/site-packages/_pytest/warnings.py new file mode 100644 index 0000000000000000000000000000000000000000..1dbf0025a3188b892d245fbf04dafe6af1c2b39e --- /dev/null +++ b/micromamba_root/Lib/site-packages/_pytest/warnings.py @@ -0,0 +1,151 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +from collections.abc import Generator +from contextlib import contextmanager +from contextlib import ExitStack +import sys +from typing import Literal +import warnings + +from _pytest.config import apply_warning_filters +from _pytest.config import Config +from _pytest.config import parse_warning_filter +from _pytest.main import Session +from _pytest.nodes import Item +from _pytest.terminal import TerminalReporter +from _pytest.tracemalloc import tracemalloc_message +import pytest + + +@contextmanager +def catch_warnings_for_item( + config: Config, + ihook, + when: Literal["config", "collect", "runtest"], + item: Item | None, + *, + record: bool = True, +) -> Generator[None]: + """Context manager that catches warnings generated in the contained execution block. + + ``item`` can be None if we are not in the context of an item execution. + + Each warning captured triggers the ``pytest_warning_recorded`` hook. + """ + config_filters = config.getini("filterwarnings") + cmdline_filters = config.known_args_namespace.pythonwarnings or [] + with warnings.catch_warnings(record=record) as log: + if not sys.warnoptions: + # If user is not explicitly configuring warning filters, show deprecation warnings by default (#2908). + warnings.filterwarnings("always", category=DeprecationWarning) + warnings.filterwarnings("always", category=PendingDeprecationWarning) + + warnings.filterwarnings("error", category=pytest.PytestRemovedIn9Warning) + + apply_warning_filters(config_filters, cmdline_filters) + + # apply filters from "filterwarnings" marks + nodeid = "" if item is None else item.nodeid + if item is not None: + for mark in item.iter_markers(name="filterwarnings"): + for arg in mark.args: + warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + + try: + yield + finally: + if record: + # mypy can't infer that record=True means log is not None; help it. + assert log is not None + + for warning_message in log: + ihook.pytest_warning_recorded.call_historic( + kwargs=dict( + warning_message=warning_message, + nodeid=nodeid, + when=when, + location=None, + ) + ) + + +def warning_record_to_str(warning_message: warnings.WarningMessage) -> str: + """Convert a warnings.WarningMessage to a string.""" + return warnings.formatwarning( + str(warning_message.message), + warning_message.category, + warning_message.filename, + warning_message.lineno, + warning_message.line, + ) + tracemalloc_message(warning_message.source) + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + with catch_warnings_for_item( + config=item.config, ihook=item.ihook, when="runtest", item=item + ): + return (yield) + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_collection(session: Session) -> Generator[None, object, object]: + config = session.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="collect", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_terminal_summary( + terminalreporter: TerminalReporter, +) -> Generator[None]: + config = terminalreporter.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="config", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_sessionfinish(session: Session) -> Generator[None]: + config = session.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="config", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_load_initial_conftests( + early_config: Config, +) -> Generator[None]: + with catch_warnings_for_item( + config=early_config, ihook=early_config.hook, when="config", item=None + ): + return (yield) + + +def pytest_configure(config: Config) -> None: + with ExitStack() as stack: + stack.enter_context( + catch_warnings_for_item( + config=config, + ihook=config.hook, + when="config", + item=None, + # this disables recording because the terminalreporter has + # finished by the time it comes to reporting logged warnings + # from the end of config cleanup. So for now, this is only + # useful for setting a warning filter with an 'error' action. + record=False, + ) + ) + config.addinivalue_line( + "markers", + "filterwarnings(warning): add a warning filter to the given test. " + "see https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings ", + ) + config.add_cleanup(stack.pop_all().close) diff --git a/micromamba_root/Lib/site-packages/_yaml/__init__.py b/micromamba_root/Lib/site-packages/_yaml/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7baa8c4b68127d5cdf0be9a799429e61347c2694 --- /dev/null +++ b/micromamba_root/Lib/site-packages/_yaml/__init__.py @@ -0,0 +1,33 @@ +# This is a stub package designed to roughly emulate the _yaml +# extension module, which previously existed as a standalone module +# and has been moved into the `yaml` package namespace. +# It does not perfectly mimic its old counterpart, but should get +# close enough for anyone who's relying on it even when they shouldn't. +import yaml + +# in some circumstances, the yaml module we imoprted may be from a different version, so we need +# to tread carefully when poking at it here (it may not have the attributes we expect) +if not getattr(yaml, '__with_libyaml__', False): + from sys import version_info + + exc = ModuleNotFoundError if version_info >= (3, 6) else ImportError + raise exc("No module named '_yaml'") +else: + from yaml._yaml import * + import warnings + warnings.warn( + 'The _yaml extension module is now located at yaml._yaml' + ' and its location is subject to change. To use the' + ' LibYAML-based parser and emitter, import from `yaml`:' + ' `from yaml import CLoader as Loader, CDumper as Dumper`.', + DeprecationWarning + ) + del warnings + # Don't `del yaml` here because yaml is actually an existing + # namespace member of _yaml. + +__name__ = '_yaml' +# If the module is top-level (i.e. not a part of any specific package) +# then the attribute should be set to ''. +# https://docs.python.org/3.8/library/types.html +__package__ = '' diff --git a/micromamba_root/Lib/site-packages/_yaml/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/_yaml/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f01d60da7e32b3a1c00e3bbb19f178214a3976f Binary files /dev/null and b/micromamba_root/Lib/site-packages/_yaml/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..3dea62032aff25161bb49b38d237376f18fbaec1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/METADATA @@ -0,0 +1,57 @@ +Metadata-Version: 2.4 +Name: Pygments +Version: 2.20.0 +Summary: Pygments is a syntax highlighting package written in Python. +Project-URL: Homepage, https://pygments.org +Project-URL: Documentation, https://pygments.org/docs +Project-URL: Source, https://github.com/pygments/pygments +Project-URL: Bug Tracker, https://github.com/pygments/pygments/issues +Project-URL: Changelog, https://github.com/pygments/pygments/blob/master/CHANGES +Author-email: Georg Brandl +Maintainer: Matthäus G. Chajdas +Maintainer-email: Georg Brandl , Jean Abou Samra +License-Expression: BSD-2-Clause +License-File: AUTHORS +License-File: LICENSE +Keywords: syntax highlighting +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: End Users/Desktop +Classifier: Intended Audience :: System Administrators +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Text Processing :: Filters +Classifier: Topic :: Utilities +Requires-Python: >=3.9 +Provides-Extra: plugins +Provides-Extra: windows-terminal +Requires-Dist: colorama>=0.4.6; extra == 'windows-terminal' +Description-Content-Type: text/x-rst + +Pygments +~~~~~~~~ + +Pygments is a syntax highlighting package written in Python. + +It is a generic syntax highlighter suitable for use in code hosting, forums, +wikis or other applications that need to prettify source code. Highlights +are: + +* a wide range of over 500 languages and other text formats is supported +* special attention is paid to details, increasing quality by a fair amount +* support for new languages and formats are added easily +* a number of output formats, presently HTML, LaTeX, RTF, SVG, all image + formats that PIL supports and ANSI sequences +* it is usable as a command-line tool and as a library + +Copyright 2006-present by the Pygments team, see ``AUTHORS``. +Licensed under the BSD, see ``LICENSE`` for details. diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..684f4ed4373e17198a4493cdbef9fd306963b762 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/RECORD @@ -0,0 +1,688 @@ +../../../bin/pygmentize,sha256=1ey16RhiOwgKxBfd0OzryPsgrbTkDm6MKr_nMRIEOD4,446 +pygments-2.20.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pygments-2.20.0.dist-info/METADATA,sha256=4FKPUbMEJ_rpRyNmK6Yi-NjbKk2NPxNlaY1npSRQqEU,2476 +pygments-2.20.0.dist-info/RECORD,, +pygments-2.20.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pygments-2.20.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87 +pygments-2.20.0.dist-info/direct_url.json,sha256=2e8vlI6a6HO2U4X-AxZmf1yN7k_VVOG_TUoj9jb1BHg,104 +pygments-2.20.0.dist-info/entry_points.txt,sha256=uUXw-XhMKBEX4pWcCtpuTTnPhL3h7OEE2jWi51VQsa8,53 +pygments-2.20.0.dist-info/licenses/AUTHORS,sha256=DbYDpfRJn2kMRCVHf_ZkwWbaMl06zDtajU3j2wckQ9A,10873 +pygments-2.20.0.dist-info/licenses/LICENSE,sha256=qdZvHVJt8C4p3Oc0NtNOVuhjL0bCdbvf_HBWnogvnxc,1331 +pygments/__init__.py,sha256=ZzpnXpvnv0c7r_OIS8h7UeaESqYNKMy__pV7KCiWXxw,2962 +pygments/__main__.py,sha256=QZWj0T6TTRsqr-w-0YvVILo1DyAvzzydGCRONwdEzqo,351 +pygments/__pycache__/__init__.cpython-310.pyc,, +pygments/__pycache__/__main__.cpython-310.pyc,, +pygments/__pycache__/cmdline.cpython-310.pyc,, +pygments/__pycache__/console.cpython-310.pyc,, +pygments/__pycache__/filter.cpython-310.pyc,, +pygments/__pycache__/formatter.cpython-310.pyc,, +pygments/__pycache__/lexer.cpython-310.pyc,, +pygments/__pycache__/modeline.cpython-310.pyc,, +pygments/__pycache__/plugin.cpython-310.pyc,, +pygments/__pycache__/regexopt.cpython-310.pyc,, +pygments/__pycache__/scanner.cpython-310.pyc,, +pygments/__pycache__/sphinxext.cpython-310.pyc,, +pygments/__pycache__/style.cpython-310.pyc,, +pygments/__pycache__/token.cpython-310.pyc,, +pygments/__pycache__/unistring.cpython-310.pyc,, +pygments/__pycache__/util.cpython-310.pyc,, +pygments/cmdline.py,sha256=_dOnrta_2GIe8Jg-1Y0pb5vWi8L6QTiJzyoTuHrYrbM,23542 +pygments/console.py,sha256=C189JAwhC1Qh0AKgshzb1wVDzFqBnv1VZ45kTEDIO30,1721 +pygments/filter.py,sha256=1dnbkq2AdC3AkHt3DaXwnOkTBLChl1kR6naSLwnr_tc,1913 +pygments/filters/__init__.py,sha256=03ZYdIYmxnWCh7gNXD7lEQ869Df4kzHnOGM44iJxan8,40349 +pygments/filters/__pycache__/__init__.cpython-310.pyc,, +pygments/formatter.py,sha256=PTBnTW0EHke2vzlAKuvHJkj3-_CMj8duIx-3yVUie-o,4369 +pygments/formatters/__init__.py,sha256=qPG4q5cuaZRGBglmEJVLP4SDv43QI3tAUskj30M-mOY,5352 +pygments/formatters/__pycache__/__init__.cpython-310.pyc,, +pygments/formatters/__pycache__/_mapping.cpython-310.pyc,, +pygments/formatters/__pycache__/bbcode.cpython-310.pyc,, +pygments/formatters/__pycache__/groff.cpython-310.pyc,, +pygments/formatters/__pycache__/html.cpython-310.pyc,, +pygments/formatters/__pycache__/img.cpython-310.pyc,, +pygments/formatters/__pycache__/irc.cpython-310.pyc,, +pygments/formatters/__pycache__/latex.cpython-310.pyc,, +pygments/formatters/__pycache__/other.cpython-310.pyc,, +pygments/formatters/__pycache__/pangomarkup.cpython-310.pyc,, +pygments/formatters/__pycache__/rtf.cpython-310.pyc,, +pygments/formatters/__pycache__/svg.cpython-310.pyc,, +pygments/formatters/__pycache__/terminal.cpython-310.pyc,, +pygments/formatters/__pycache__/terminal256.cpython-310.pyc,, +pygments/formatters/_mapping.py,sha256=1Cw37FuQlNacnxRKmtlPX4nyLoX9_ttko5ZwscNUZZ4,4176 +pygments/formatters/bbcode.py,sha256=lvG1REZJv0pM6VMe-QwLSuo0Yl1Ra_X51wh93fW8A2k,3299 +pygments/formatters/groff.py,sha256=anF3fNbDYwwOlppOUoKTZg4FzzPbZrE4jcJCMd49_1g,5085 +pygments/formatters/html.py,sha256=qe4P6qIV462HkZovS8s5xKKyYXPQQvUjz6Wj7HX1CxY,36053 +pygments/formatters/img.py,sha256=41uSY0pKg9VmKJYrHuavCVgg0z-mg81p28QEMktwf1o,23304 +pygments/formatters/irc.py,sha256=hdOqAvF02bI8CY8_tutnUptBZpWEBLzVAqS4_YA0tew,4907 +pygments/formatters/latex.py,sha256=cQmE1Nj4E9q5N0XQJBqpc6dLtu5UNOtYq3plPyCX1Hk,19261 +pygments/formatters/other.py,sha256=Hq6qY4POBZ_llAWRr1gzSO9UoeYPONlLMBK60RkW4bg,4989 +pygments/formatters/pangomarkup.py,sha256=L4jU6oO18UqEMqXeN5FkPtkisXrXuXq9wcecgy_6dzo,2209 +pygments/formatters/rtf.py,sha256=YQYW8NTrB4XfOjLbQzutyD4j35TimFNZ0T39dET9DOo,11924 +pygments/formatters/svg.py,sha256=oksXT-ZnTHDsn1WtWgBs9V7qmKFswAKx7jV37tb2tYY,7141 +pygments/formatters/terminal.py,sha256=q7jLLanle33eCZkDr4CoHAN-dHBFf1DBhi4FcBQ8_1E,4629 +pygments/formatters/terminal256.py,sha256=PpA_oATHCih3UTjrbfKqIRUcvsyp_TeBaGw3kpIxeBA,11717 +pygments/lexer.py,sha256=gNMYzmdSkTNyWfqiLJ37oUd1KrN_dMXtsPyaX2-n9EA,35154 +pygments/lexers/__init__.py,sha256=G4dtqE5QMEAqoaaD1rwSZZeuqKhMyS4utlMz1szkrTg,12070 +pygments/lexers/__pycache__/__init__.cpython-310.pyc,, +pygments/lexers/__pycache__/_ada_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_asy_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_cl_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_cocoa_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_csound_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_css_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_googlesql_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_julia_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_lasso_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_lilypond_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_lua_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_luau_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_mapping.cpython-310.pyc,, +pygments/lexers/__pycache__/_mql_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_mysql_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_openedge_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_php_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_postgres_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_qlik_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_scheme_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_scilab_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_sourcemod_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_sql_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_stan_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_stata_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_tsql_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_usd_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_vbscript_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/_vim_builtins.cpython-310.pyc,, +pygments/lexers/__pycache__/actionscript.cpython-310.pyc,, +pygments/lexers/__pycache__/ada.cpython-310.pyc,, +pygments/lexers/__pycache__/agile.cpython-310.pyc,, +pygments/lexers/__pycache__/algebra.cpython-310.pyc,, +pygments/lexers/__pycache__/ambient.cpython-310.pyc,, +pygments/lexers/__pycache__/amdgpu.cpython-310.pyc,, +pygments/lexers/__pycache__/ampl.cpython-310.pyc,, +pygments/lexers/__pycache__/apdlexer.cpython-310.pyc,, +pygments/lexers/__pycache__/apl.cpython-310.pyc,, +pygments/lexers/__pycache__/archetype.cpython-310.pyc,, +pygments/lexers/__pycache__/arrow.cpython-310.pyc,, +pygments/lexers/__pycache__/arturo.cpython-310.pyc,, +pygments/lexers/__pycache__/asc.cpython-310.pyc,, +pygments/lexers/__pycache__/asm.cpython-310.pyc,, +pygments/lexers/__pycache__/asn1.cpython-310.pyc,, +pygments/lexers/__pycache__/automation.cpython-310.pyc,, +pygments/lexers/__pycache__/bare.cpython-310.pyc,, +pygments/lexers/__pycache__/basic.cpython-310.pyc,, +pygments/lexers/__pycache__/bdd.cpython-310.pyc,, +pygments/lexers/__pycache__/berry.cpython-310.pyc,, +pygments/lexers/__pycache__/bibtex.cpython-310.pyc,, +pygments/lexers/__pycache__/blueprint.cpython-310.pyc,, +pygments/lexers/__pycache__/boa.cpython-310.pyc,, +pygments/lexers/__pycache__/bqn.cpython-310.pyc,, +pygments/lexers/__pycache__/business.cpython-310.pyc,, +pygments/lexers/__pycache__/c_cpp.cpython-310.pyc,, +pygments/lexers/__pycache__/c_like.cpython-310.pyc,, +pygments/lexers/__pycache__/capnproto.cpython-310.pyc,, +pygments/lexers/__pycache__/carbon.cpython-310.pyc,, +pygments/lexers/__pycache__/cddl.cpython-310.pyc,, +pygments/lexers/__pycache__/chapel.cpython-310.pyc,, +pygments/lexers/__pycache__/clean.cpython-310.pyc,, +pygments/lexers/__pycache__/codeql.cpython-310.pyc,, +pygments/lexers/__pycache__/comal.cpython-310.pyc,, +pygments/lexers/__pycache__/compiled.cpython-310.pyc,, +pygments/lexers/__pycache__/configs.cpython-310.pyc,, +pygments/lexers/__pycache__/console.cpython-310.pyc,, +pygments/lexers/__pycache__/cplint.cpython-310.pyc,, +pygments/lexers/__pycache__/crystal.cpython-310.pyc,, +pygments/lexers/__pycache__/csound.cpython-310.pyc,, +pygments/lexers/__pycache__/css.cpython-310.pyc,, +pygments/lexers/__pycache__/d.cpython-310.pyc,, +pygments/lexers/__pycache__/dalvik.cpython-310.pyc,, +pygments/lexers/__pycache__/data.cpython-310.pyc,, +pygments/lexers/__pycache__/dax.cpython-310.pyc,, +pygments/lexers/__pycache__/devicetree.cpython-310.pyc,, +pygments/lexers/__pycache__/diff.cpython-310.pyc,, +pygments/lexers/__pycache__/dns.cpython-310.pyc,, +pygments/lexers/__pycache__/dotnet.cpython-310.pyc,, +pygments/lexers/__pycache__/dsls.cpython-310.pyc,, +pygments/lexers/__pycache__/dylan.cpython-310.pyc,, +pygments/lexers/__pycache__/ecl.cpython-310.pyc,, +pygments/lexers/__pycache__/eiffel.cpython-310.pyc,, +pygments/lexers/__pycache__/elm.cpython-310.pyc,, +pygments/lexers/__pycache__/elpi.cpython-310.pyc,, +pygments/lexers/__pycache__/email.cpython-310.pyc,, +pygments/lexers/__pycache__/erlang.cpython-310.pyc,, +pygments/lexers/__pycache__/esoteric.cpython-310.pyc,, +pygments/lexers/__pycache__/ezhil.cpython-310.pyc,, +pygments/lexers/__pycache__/factor.cpython-310.pyc,, +pygments/lexers/__pycache__/fantom.cpython-310.pyc,, +pygments/lexers/__pycache__/felix.cpython-310.pyc,, +pygments/lexers/__pycache__/fift.cpython-310.pyc,, +pygments/lexers/__pycache__/floscript.cpython-310.pyc,, +pygments/lexers/__pycache__/forth.cpython-310.pyc,, +pygments/lexers/__pycache__/fortran.cpython-310.pyc,, +pygments/lexers/__pycache__/foxpro.cpython-310.pyc,, +pygments/lexers/__pycache__/freefem.cpython-310.pyc,, +pygments/lexers/__pycache__/func.cpython-310.pyc,, +pygments/lexers/__pycache__/functional.cpython-310.pyc,, +pygments/lexers/__pycache__/futhark.cpython-310.pyc,, +pygments/lexers/__pycache__/gcodelexer.cpython-310.pyc,, +pygments/lexers/__pycache__/gdscript.cpython-310.pyc,, +pygments/lexers/__pycache__/gleam.cpython-310.pyc,, +pygments/lexers/__pycache__/go.cpython-310.pyc,, +pygments/lexers/__pycache__/grammar_notation.cpython-310.pyc,, +pygments/lexers/__pycache__/graph.cpython-310.pyc,, +pygments/lexers/__pycache__/graphics.cpython-310.pyc,, +pygments/lexers/__pycache__/graphql.cpython-310.pyc,, +pygments/lexers/__pycache__/graphviz.cpython-310.pyc,, +pygments/lexers/__pycache__/gsql.cpython-310.pyc,, +pygments/lexers/__pycache__/hare.cpython-310.pyc,, +pygments/lexers/__pycache__/haskell.cpython-310.pyc,, +pygments/lexers/__pycache__/haxe.cpython-310.pyc,, +pygments/lexers/__pycache__/hdl.cpython-310.pyc,, +pygments/lexers/__pycache__/hexdump.cpython-310.pyc,, +pygments/lexers/__pycache__/html.cpython-310.pyc,, +pygments/lexers/__pycache__/idl.cpython-310.pyc,, +pygments/lexers/__pycache__/igor.cpython-310.pyc,, +pygments/lexers/__pycache__/inferno.cpython-310.pyc,, +pygments/lexers/__pycache__/installers.cpython-310.pyc,, +pygments/lexers/__pycache__/int_fiction.cpython-310.pyc,, +pygments/lexers/__pycache__/iolang.cpython-310.pyc,, +pygments/lexers/__pycache__/j.cpython-310.pyc,, +pygments/lexers/__pycache__/javascript.cpython-310.pyc,, +pygments/lexers/__pycache__/jmespath.cpython-310.pyc,, +pygments/lexers/__pycache__/jslt.cpython-310.pyc,, +pygments/lexers/__pycache__/json5.cpython-310.pyc,, +pygments/lexers/__pycache__/jsonnet.cpython-310.pyc,, +pygments/lexers/__pycache__/jsx.cpython-310.pyc,, +pygments/lexers/__pycache__/julia.cpython-310.pyc,, +pygments/lexers/__pycache__/jvm.cpython-310.pyc,, +pygments/lexers/__pycache__/kuin.cpython-310.pyc,, +pygments/lexers/__pycache__/kusto.cpython-310.pyc,, +pygments/lexers/__pycache__/ldap.cpython-310.pyc,, +pygments/lexers/__pycache__/lean.cpython-310.pyc,, +pygments/lexers/__pycache__/lilypond.cpython-310.pyc,, +pygments/lexers/__pycache__/lisp.cpython-310.pyc,, +pygments/lexers/__pycache__/macaulay2.cpython-310.pyc,, +pygments/lexers/__pycache__/make.cpython-310.pyc,, +pygments/lexers/__pycache__/maple.cpython-310.pyc,, +pygments/lexers/__pycache__/markup.cpython-310.pyc,, +pygments/lexers/__pycache__/math.cpython-310.pyc,, +pygments/lexers/__pycache__/matlab.cpython-310.pyc,, +pygments/lexers/__pycache__/maxima.cpython-310.pyc,, +pygments/lexers/__pycache__/meson.cpython-310.pyc,, +pygments/lexers/__pycache__/mime.cpython-310.pyc,, +pygments/lexers/__pycache__/minecraft.cpython-310.pyc,, +pygments/lexers/__pycache__/mips.cpython-310.pyc,, +pygments/lexers/__pycache__/ml.cpython-310.pyc,, +pygments/lexers/__pycache__/modeling.cpython-310.pyc,, +pygments/lexers/__pycache__/modula2.cpython-310.pyc,, +pygments/lexers/__pycache__/mojo.cpython-310.pyc,, +pygments/lexers/__pycache__/monte.cpython-310.pyc,, +pygments/lexers/__pycache__/mosel.cpython-310.pyc,, +pygments/lexers/__pycache__/ncl.cpython-310.pyc,, +pygments/lexers/__pycache__/nimrod.cpython-310.pyc,, +pygments/lexers/__pycache__/nit.cpython-310.pyc,, +pygments/lexers/__pycache__/nix.cpython-310.pyc,, +pygments/lexers/__pycache__/numbair.cpython-310.pyc,, +pygments/lexers/__pycache__/oberon.cpython-310.pyc,, +pygments/lexers/__pycache__/objective.cpython-310.pyc,, +pygments/lexers/__pycache__/ooc.cpython-310.pyc,, +pygments/lexers/__pycache__/openscad.cpython-310.pyc,, +pygments/lexers/__pycache__/other.cpython-310.pyc,, +pygments/lexers/__pycache__/parasail.cpython-310.pyc,, +pygments/lexers/__pycache__/parsers.cpython-310.pyc,, +pygments/lexers/__pycache__/pascal.cpython-310.pyc,, +pygments/lexers/__pycache__/pawn.cpython-310.pyc,, +pygments/lexers/__pycache__/pddl.cpython-310.pyc,, +pygments/lexers/__pycache__/perl.cpython-310.pyc,, +pygments/lexers/__pycache__/phix.cpython-310.pyc,, +pygments/lexers/__pycache__/php.cpython-310.pyc,, +pygments/lexers/__pycache__/pointless.cpython-310.pyc,, +pygments/lexers/__pycache__/pony.cpython-310.pyc,, +pygments/lexers/__pycache__/praat.cpython-310.pyc,, +pygments/lexers/__pycache__/procfile.cpython-310.pyc,, +pygments/lexers/__pycache__/prolog.cpython-310.pyc,, +pygments/lexers/__pycache__/promql.cpython-310.pyc,, +pygments/lexers/__pycache__/prql.cpython-310.pyc,, +pygments/lexers/__pycache__/ptx.cpython-310.pyc,, +pygments/lexers/__pycache__/python.cpython-310.pyc,, +pygments/lexers/__pycache__/q.cpython-310.pyc,, +pygments/lexers/__pycache__/qlik.cpython-310.pyc,, +pygments/lexers/__pycache__/qvt.cpython-310.pyc,, +pygments/lexers/__pycache__/r.cpython-310.pyc,, +pygments/lexers/__pycache__/rdf.cpython-310.pyc,, +pygments/lexers/__pycache__/rebol.cpython-310.pyc,, +pygments/lexers/__pycache__/rego.cpython-310.pyc,, +pygments/lexers/__pycache__/rell.cpython-310.pyc,, +pygments/lexers/__pycache__/resource.cpython-310.pyc,, +pygments/lexers/__pycache__/ride.cpython-310.pyc,, +pygments/lexers/__pycache__/rita.cpython-310.pyc,, +pygments/lexers/__pycache__/rnc.cpython-310.pyc,, +pygments/lexers/__pycache__/roboconf.cpython-310.pyc,, +pygments/lexers/__pycache__/robotframework.cpython-310.pyc,, +pygments/lexers/__pycache__/ruby.cpython-310.pyc,, +pygments/lexers/__pycache__/rust.cpython-310.pyc,, +pygments/lexers/__pycache__/sas.cpython-310.pyc,, +pygments/lexers/__pycache__/savi.cpython-310.pyc,, +pygments/lexers/__pycache__/scdoc.cpython-310.pyc,, +pygments/lexers/__pycache__/scripting.cpython-310.pyc,, +pygments/lexers/__pycache__/sgf.cpython-310.pyc,, +pygments/lexers/__pycache__/shell.cpython-310.pyc,, +pygments/lexers/__pycache__/sieve.cpython-310.pyc,, +pygments/lexers/__pycache__/slash.cpython-310.pyc,, +pygments/lexers/__pycache__/smalltalk.cpython-310.pyc,, +pygments/lexers/__pycache__/smithy.cpython-310.pyc,, +pygments/lexers/__pycache__/smv.cpython-310.pyc,, +pygments/lexers/__pycache__/snobol.cpython-310.pyc,, +pygments/lexers/__pycache__/solidity.cpython-310.pyc,, +pygments/lexers/__pycache__/soong.cpython-310.pyc,, +pygments/lexers/__pycache__/sophia.cpython-310.pyc,, +pygments/lexers/__pycache__/special.cpython-310.pyc,, +pygments/lexers/__pycache__/spice.cpython-310.pyc,, +pygments/lexers/__pycache__/sql.cpython-310.pyc,, +pygments/lexers/__pycache__/srcinfo.cpython-310.pyc,, +pygments/lexers/__pycache__/stata.cpython-310.pyc,, +pygments/lexers/__pycache__/supercollider.cpython-310.pyc,, +pygments/lexers/__pycache__/tablegen.cpython-310.pyc,, +pygments/lexers/__pycache__/tact.cpython-310.pyc,, +pygments/lexers/__pycache__/tal.cpython-310.pyc,, +pygments/lexers/__pycache__/tcl.cpython-310.pyc,, +pygments/lexers/__pycache__/teal.cpython-310.pyc,, +pygments/lexers/__pycache__/templates.cpython-310.pyc,, +pygments/lexers/__pycache__/teraterm.cpython-310.pyc,, +pygments/lexers/__pycache__/testing.cpython-310.pyc,, +pygments/lexers/__pycache__/text.cpython-310.pyc,, +pygments/lexers/__pycache__/textedit.cpython-310.pyc,, +pygments/lexers/__pycache__/textfmts.cpython-310.pyc,, +pygments/lexers/__pycache__/theorem.cpython-310.pyc,, +pygments/lexers/__pycache__/thingsdb.cpython-310.pyc,, +pygments/lexers/__pycache__/tlb.cpython-310.pyc,, +pygments/lexers/__pycache__/tls.cpython-310.pyc,, +pygments/lexers/__pycache__/tnt.cpython-310.pyc,, +pygments/lexers/__pycache__/trafficscript.cpython-310.pyc,, +pygments/lexers/__pycache__/typoscript.cpython-310.pyc,, +pygments/lexers/__pycache__/typst.cpython-310.pyc,, +pygments/lexers/__pycache__/ul4.cpython-310.pyc,, +pygments/lexers/__pycache__/unicon.cpython-310.pyc,, +pygments/lexers/__pycache__/urbi.cpython-310.pyc,, +pygments/lexers/__pycache__/usd.cpython-310.pyc,, +pygments/lexers/__pycache__/varnish.cpython-310.pyc,, +pygments/lexers/__pycache__/verification.cpython-310.pyc,, +pygments/lexers/__pycache__/verifpal.cpython-310.pyc,, +pygments/lexers/__pycache__/vip.cpython-310.pyc,, +pygments/lexers/__pycache__/vyper.cpython-310.pyc,, +pygments/lexers/__pycache__/web.cpython-310.pyc,, +pygments/lexers/__pycache__/webassembly.cpython-310.pyc,, +pygments/lexers/__pycache__/webidl.cpython-310.pyc,, +pygments/lexers/__pycache__/webmisc.cpython-310.pyc,, +pygments/lexers/__pycache__/wgsl.cpython-310.pyc,, +pygments/lexers/__pycache__/whiley.cpython-310.pyc,, +pygments/lexers/__pycache__/wowtoc.cpython-310.pyc,, +pygments/lexers/__pycache__/wren.cpython-310.pyc,, +pygments/lexers/__pycache__/x10.cpython-310.pyc,, +pygments/lexers/__pycache__/xorg.cpython-310.pyc,, +pygments/lexers/__pycache__/yang.cpython-310.pyc,, +pygments/lexers/__pycache__/yara.cpython-310.pyc,, +pygments/lexers/__pycache__/zig.cpython-310.pyc,, +pygments/lexers/_ada_builtins.py,sha256=dZb-lodsSM6L5emLlgLg-rClm2HumvnHK72CetnSRdA,1546 +pygments/lexers/_asy_builtins.py,sha256=zg54fGhgzWXQUk6-qZ6OW5GTL9d4OrnB8SJQkjrD0xs,27290 +pygments/lexers/_cl_builtins.py,sha256=oBF00ZkJyD14LkYuR603EDFIMyitkze12aT7UzDYLYs,13997 +pygments/lexers/_cocoa_builtins.py,sha256=ab6sq-iy5LapE1cNYyl8PJXLg6EINXx-lMRbwERdKYs,105176 +pygments/lexers/_csound_builtins.py,sha256=wuWiQjmEMhaVvsV8b_efsebgU0YKIoMC0ECpOavTCIM,18417 +pygments/lexers/_css_builtins.py,sha256=qhmC4tRGG53zvzMQE1qn794LvbVODRtVacxWCP3kIkA,12449 +pygments/lexers/_googlesql_builtins.py,sha256=mGfOGuKKjZoHHAAZq6Hpc68x0qKycx-SX_wGDScSOYI,16135 +pygments/lexers/_julia_builtins.py,sha256=u6v0yAzZjqUENjiIQ5qMfcso1r_6ERqGbj3aHwFnyqA,11886 +pygments/lexers/_lasso_builtins.py,sha256=YO_c_f05ZoxspHxCR3oWQCpZhbAJUzBJBhVuuwTjr5c,134513 +pygments/lexers/_lilypond_builtins.py,sha256=-_4i4gpgDgcFHvaZMJL2s1rI9dSNY2ZC6vO6ul7Hml0,115114 +pygments/lexers/_lua_builtins.py,sha256=MsDV9sEbJngKoXSZu0xXawGvd6XjFf125nuXBNoffdU,8111 +pygments/lexers/_luau_builtins.py,sha256=YLUj2bcZ0Cb0SBkIlNXWHFGDUFkpddOJx-ukrZx1cMc,958 +pygments/lexers/_mapping.py,sha256=YbQJB1eqeGk7ol5NgMMPLrD3VGdTwgQCl3TvLwtxwxA,70758 +pygments/lexers/_mql_builtins.py,sha256=CkcvMyHYh4U5rGgV6AgShxRnTOv0tmqEbOiVdpaFLqs,24716 +pygments/lexers/_mysql_builtins.py,sha256=SqiVYVVirtnN4lSgtfeRPxtVpcumjUvvUq9n8JObuQ4,26876 +pygments/lexers/_openedge_builtins.py,sha256=AzF1o6eAkMc6vnvmeVqNnUZUVijzbNYkjzrUdtCQe3M,49401 +pygments/lexers/_php_builtins.py,sha256=9g-WLT3qbSGolQJB_4PS6FW_r7HVXBWvI5OWxKtbwok,108054 +pygments/lexers/_postgres_builtins.py,sha256=QGg2mBTThgv4LdXjFm5wrKaKnCU9DubmJi6lXB7y2Mg,13346 +pygments/lexers/_qlik_builtins.py,sha256=3ZkCSDjtxSxXDI9erigWTLSUct_ap_W0LqfZjFeKQYI,12598 +pygments/lexers/_scheme_builtins.py,sha256=O3BRtt5suTESbZ_bSReQ6D0r0G_Sq_i4wCcUkdUrdS0,32567 +pygments/lexers/_scilab_builtins.py,sha256=E33R0mknNc-5eZ9Ugu7u7Av_vUxAaQoMTtdx3MceyxU,52414 +pygments/lexers/_sourcemod_builtins.py,sha256=8qspLxCLsfN9J7N0SWZRNs0A-qJOIGRBAJaNMeWaOBQ,26780 +pygments/lexers/_sql_builtins.py,sha256=fLphonB6wv6Oit8zanJiExgRoLvZoFW4l9lNH-PTYvw,6770 +pygments/lexers/_stan_builtins.py,sha256=sIoONg4TjLkGN7Ab0tZB1HM7tQ071_Z2c41n9lXZl04,16623 +pygments/lexers/_stata_builtins.py,sha256=ymh8GxEca6eSCgHnqsLqsi9OrfRqYnt5O8yBeinJ7DE,27230 +pygments/lexers/_tsql_builtins.py,sha256=Mw6UnMByju0U-OBgT8af3A4utfrS00Tn5lDnaxBtj9c,15463 +pygments/lexers/_usd_builtins.py,sha256=SGp_ePf2VuktrFV59q6df4mTyxZV7AZYs0TJFSWoBAI,1661 +pygments/lexers/_vbscript_builtins.py,sha256=TFtyc11yvpD_OlNrrFbcCOJoUYkWMq3EeHHCpw_zJNc,4228 +pygments/lexers/_vim_builtins.py,sha256=bB6kdLFM33uoY-sAtsRuUZOoccaa4gDAsdFg4WAEsoU,57069 +pygments/lexers/actionscript.py,sha256=kbHhoDl7JjVzREMv1UuxYBRJaPrxHDkmEAC5COmOIVw,11737 +pygments/lexers/ada.py,sha256=m2O7dYzJVc3iuSgaC-Ti-Gh3CG-JmpZit_DPZpu1IIM,5356 +pygments/lexers/agile.py,sha256=Du-vjnGZEPHuE40XxTMO-XLt56pYcIaKIAxIwcYHFH0,899 +pygments/lexers/algebra.py,sha256=2iQSGxfVuBXBHAJdzbbPvtpvROYTfxfMivDagk9yfh8,10032 +pygments/lexers/ambient.py,sha256=8Nk8WX4qrId9zj_zgjJBuFT40yQXG2OXxFhhF3R00g8,2608 +pygments/lexers/amdgpu.py,sha256=KMDLdb-1aK9RJaNsSkPyiU3DQE_HdjBF0paw_yiJMRA,1726 +pygments/lexers/ampl.py,sha256=IKuMVE6aXsa4S6qpuc_DvEsJmJpyKDNga09BPFLvYxA,4179 +pygments/lexers/apdlexer.py,sha256=puSpLBWevciSc8G0wg2Y_yQIoGgqPes0UBkpFImqvO4,30803 +pygments/lexers/apl.py,sha256=-jhPYsBVT4ckL7CZmukIZNi6tfaJJbBk2vutld372rs,3407 +pygments/lexers/archetype.py,sha256=buhH2WHtxBowy_KD5SPm5vgHpmLoKMdV9tgMs_bE4xU,11577 +pygments/lexers/arrow.py,sha256=e6mb3Ix4jL7TMGNUpk8iRbJy_VF7VY2J0VUknlo1EvA,3567 +pygments/lexers/arturo.py,sha256=GkklOaiEJTOz8E0zdxd_hd1zXwv7lYgp8IJl7uh13hg,11417 +pygments/lexers/asc.py,sha256=CvFSi7FYDW6eu-5oiKGc0MN3aF1XVZDoFI5-3mHpBDk,1696 +pygments/lexers/asm.py,sha256=jHJ3CDtvHgu4hX4kVvvJyciFLWM6FAYFDPG_zjBTyrc,42219 +pygments/lexers/asn1.py,sha256=MLakOeBFkdhKKr42eHFzonpGITEJxR_God8vqjWPva4,4267 +pygments/lexers/automation.py,sha256=gdSYslkW9sblDcvMeK1ay15rb9vRuK56pPOJzdxlIvg,19834 +pygments/lexers/bare.py,sha256=AdqL9Z20nd0bhNGWielLhAHej6V8_8m1OWUkCOrSBx8,3023 +pygments/lexers/basic.py,sha256=NqNxIeHhjBUtenwCdJ88WWEE3N7a16DA9g1_D1mdmF0,27992 +pygments/lexers/bdd.py,sha256=KeuOzXBLJRxxM2gV7aMuYsdV_aJFHyBuF8ptBpWxD5M,1644 +pygments/lexers/berry.py,sha256=vIfT4sBtm6ao64WdNkJTVJmS00BiFdEWvb3obBXBeX8,3212 +pygments/lexers/bibtex.py,sha256=sgfFqXyNyCxROHIe8C0gre69rzbADALnpDtTaqHfSas,4814 +pygments/lexers/blueprint.py,sha256=dW-L5bFIiWxRPDashee2EOYmXIRHdwuCZ1y3iN-a6_0,6191 +pygments/lexers/boa.py,sha256=VqYF1Yg_XdDA5tK_Eiuo1rr7ediBsKUTpB6xza_B5d4,3924 +pygments/lexers/bqn.py,sha256=se4W2XPsNiT36z0Am9X5F4yNLrQvMI5X8miY6R9SEM8,3674 +pygments/lexers/business.py,sha256=MXYomjQiYaTmnUgjQ7LUxjcU1i2iVDjZdXPTeqOlDjM,28348 +pygments/lexers/c_cpp.py,sha256=2ViQoLY22Y6xdzXDmwz30rMcij7EemNq4vpTEsfl7sg,18321 +pygments/lexers/c_like.py,sha256=rafLNQqcEbf-97VpDtSIQZSSmdiMD4oBYeEs7DZyByg,32024 +pygments/lexers/capnproto.py,sha256=kc3rT95GkeQmrW1LeP5HMVb7Nk8sqXkW6OJkkWIHYbA,2177 +pygments/lexers/carbon.py,sha256=_M-0YbofjZMrJIaiXKoT6wpkd3_6fFq-OdSZ7V961I4,3214 +pygments/lexers/cddl.py,sha256=7Wri2q2yKexWo0CD7s2c7AoCAMbrwyEE6f_gz5B6x1Y,5079 +pygments/lexers/chapel.py,sha256=SvZXNJijW0greFToDHZQ0yeo4_3niyTx31Iz_yLctck,5159 +pygments/lexers/clean.py,sha256=_oV3Tbmrpl3S1phPMS6gyMWyGZGj6Wy0q8adpf5vunY,6421 +pygments/lexers/codeql.py,sha256=hAX51uWeG5Zk9JhXSnOxPMaznFOpaX4ZnZHZ2krrPGk,2579 +pygments/lexers/comal.py,sha256=0fcTyV5h36zPlxoQPWWGet2yaYi5ESXiFpx6EbsqP00,3182 +pygments/lexers/compiled.py,sha256=PRimy7eb2weP7X6bEukz1JaSLuQAETO34K7maHLGbxA,1429 +pygments/lexers/configs.py,sha256=YDBIWV_R2SiRb0Cbxol-S8RRieDfAg_YcThc1BmZ90I,50925 +pygments/lexers/console.py,sha256=MrTIkXDYQ71z0yDepwbpO9WwXPQRPHAFAOvt_ngscxU,4183 +pygments/lexers/cplint.py,sha256=wPs_Zh0OJ2_UUeF9_mu_r-X_65DJSWMCTKOmOyjWLz8,1392 +pygments/lexers/crystal.py,sha256=k8Xy8TpfGKTPvsP1WikxILScILD8iXZ5qceLZopsLYE,15757 +pygments/lexers/csound.py,sha256=7KHoJv8wtuIe9dques4mFFkQLULcGQ23dgZ_KBd0f_k,17001 +pygments/lexers/css.py,sha256=OVjsd0Kn9pNH6iltS4ikjy9nnilPlCVx-VAZ26n3UJ8,26439 +pygments/lexers/d.py,sha256=ee5oImP1BcHYZ93UwXoHIzw6BztgR3WCCv3ksu2J-o0,9923 +pygments/lexers/dalvik.py,sha256=0f5mB5y8g0l1ID2liJ_5qM2NjyR_SBs7ckuIDeNbbj8,4609 +pygments/lexers/data.py,sha256=MhLXoZXYMZFmmKlqL8RV5zp-eUwVb0yFzsyzXYrpKiw,27049 +pygments/lexers/dax.py,sha256=N-5fxukBfFtFCT2LJoyg1VJsfldWHxXKLY3ZPLnPrig,8101 +pygments/lexers/devicetree.py,sha256=Tig-tTSrpmGzbGxN2ka4MMTiC344roav9A4hoc9o_kw,4826 +pygments/lexers/diff.py,sha256=-627lmuYpJ2uUVUM_orVGgXJGXIBGSVHbmlqflCEeaM,5385 +pygments/lexers/dns.py,sha256=ElzSN3IEoRs1g6iWMnzVIV8H0x9WSEF1wBjm2a0ByxE,3894 +pygments/lexers/dotnet.py,sha256=GmoaOxSoITkYdAUaVJ0Z1RQa6MvcRxh1gQ3XxgEs4X8,39444 +pygments/lexers/dsls.py,sha256=a6Jdv3w1aF3vpQJrnF32MNHAl6pEZkkeGB1cYv-x2Hw,36753 +pygments/lexers/dylan.py,sha256=fi8mSyni4dnGP5x1crE6BKNqLWJs4dDWdmkur-TbbNc,10412 +pygments/lexers/ecl.py,sha256=XJ66PU9EjkXJwA4f1OfC0RdfP49v8N62RZXnFVVAYNo,6374 +pygments/lexers/eiffel.py,sha256=m2eVPDG9J-VXieCeOy0S7zHPjiFHQB9F6bOIy-K3MDQ,2693 +pygments/lexers/elm.py,sha256=Xj3HlbUTEkEUFwhem4NCujx55tQ2TS61_Kcf6BCPHAI,3155 +pygments/lexers/elpi.py,sha256=RZqAVzdxfA_BqBmtMHj8ATw5f9e24SKL-QeO14QuKk4,7904 +pygments/lexers/email.py,sha256=NPlGc2L6F3KWWDop3ZOJGpUM6LDnOEqKZj1YJG3vP2M,4807 +pygments/lexers/erlang.py,sha256=2aUlVBVFtQdR2QISsDeKTOPjGrV7r1ckyXL17KJot9c,19150 +pygments/lexers/esoteric.py,sha256=tmJ9Pa1wYtYgR6yDqgp3zDYuXPFzXw7SLTHOH_eE3p0,10503 +pygments/lexers/ezhil.py,sha256=tbGYtGnqZAB8ffnyPdeMMJHtKYJ7OAciUFRrR_8QpXM,3275 +pygments/lexers/factor.py,sha256=HBUqNcwd4VplYw30ScuC8YgdipFAYiqjRgWsyT0s4xQ,19533 +pygments/lexers/fantom.py,sha256=w9IU1x61Codd7Oxv5DpvVlkVPn_bfvVLiP8Ae3660zM,10234 +pygments/lexers/felix.py,sha256=DvPOs_Em6fFtUBQCaZWWHWgnvAFeBrDe97Cy9XyQ8ps,9658 +pygments/lexers/fift.py,sha256=Q9OLJivp4ngqFso7APCvX85h-ghdbp9ZqpP8GKHws1M,1647 +pygments/lexers/floscript.py,sha256=TcyuCiv9bAb89x1_7_Zq6nUhsdsHAF2DPsKZ6m1W1NU,2670 +pygments/lexers/forth.py,sha256=4e0OCfJGcElkQrHInmQMucvsI9dljuPx4FYg38dyjno,7196 +pygments/lexers/fortran.py,sha256=ouvOHdMbj56j40Nrj21WCRf4rNKpuwphxmtlUVsnzhc,10385 +pygments/lexers/foxpro.py,sha256=nV8yyES39QoFmTNlM8xl3MteOsvmt6yV1l6x6xnXqIU,26298 +pygments/lexers/freefem.py,sha256=ZmZLIYLXtCK2kWqGzBmrkp7ychOy7vgfaorafUkUl1I,26916 +pygments/lexers/func.py,sha256=ZjOerj3njJcaGnHWc_npWjxb4D5O-udxBRK7RLHEibU,3703 +pygments/lexers/functional.py,sha256=4m9JlAnfpXxSkQQIrNOob2VTwin6hPLAqWuhv9aVkAg,697 +pygments/lexers/futhark.py,sha256=mCU2yvloJF5LN7uRE_8rCVqA8HAINny04HXVxjSiM4g,3746 +pygments/lexers/gcodelexer.py,sha256=t8JMWaaDjWZwdGiRGwrpsYtfjKTmibwlRyOLCiJZ8qw,877 +pygments/lexers/gdscript.py,sha256=VNOwd7KcDREvoBAfw66GjxxQygPsHH2akdzRbPNKqoQ,7569 +pygments/lexers/gleam.py,sha256=Jx6LnUpWV9pmjdSYLUMt16c3UamZ-v5X6CcuEhWxf-8,2395 +pygments/lexers/go.py,sha256=ynHVStw2XUJFlUiTS4UqY65fLkvcJBMNzoYtSNSl_BU,3786 +pygments/lexers/grammar_notation.py,sha256=ZGYcwhSvOolw1J7cA9Pc7hVpcIselaCgxwsvAf5yRgc,8046 +pygments/lexers/graph.py,sha256=X_IsdjxXZn5p9Dq4cLXyqwo4C8emcYA8NP6VZ9ZTBaU,4111 +pygments/lexers/graphics.py,sha256=IeruxvEQR1Wsu-YyLpAjkUnisLDzUrk2cd0xXrDCbjw,39148 +pygments/lexers/graphql.py,sha256=RWE_kfVUDEAnv_-SYyOi9IJUks61NvOakmUfWOlorzo,5604 +pygments/lexers/graphviz.py,sha256=DRNWwetEWasJDtiLkdqkKsQHDryJ5W80wUD2PE6oKCs,1937 +pygments/lexers/gsql.py,sha256=pzSj5Pd4vtNLES-pIdxaG0vOVTqUWE9UuOUw0RrY-oc,3993 +pygments/lexers/hare.py,sha256=eCrRPwcswXL-ZHTWNlhE1A05G9rxzS20_IqSddv2M9Y,2652 +pygments/lexers/haskell.py,sha256=sr5gq3U7xt0D2Bi41xdTsBaponX6otP1qPyRMCuxM7E,33323 +pygments/lexers/haxe.py,sha256=_MzQJTWx18kD9bP_sniBshKbtOZDRm4OZnifaOgw_aY,31169 +pygments/lexers/hdl.py,sha256=2jYX3fRWZ9mAZ_QER1WH58SvJaOdYQt0OmOxo3X2JK0,22741 +pygments/lexers/hexdump.py,sha256=VvYp_NTaE-6NUuSG4FMezwcjxbPnAz0fOWMzr3Y2Gm4,3656 +pygments/lexers/html.py,sha256=O6qkpyOylH2n1Zi1qzlmBsIEW31RfvzBn7jKTaAR2LQ,21999 +pygments/lexers/idl.py,sha256=W2QRH1j9LMaNvC5jb6MkP4dLYo_OQU6lQlCAlQveFH4,15452 +pygments/lexers/igor.py,sha256=Sv5EGBJeKy0UOyl6-GF3lBeeoWArVcMDJtQtl2RXRYo,31636 +pygments/lexers/inferno.py,sha256=cjVMyOg6jhJ6nYX333Z6KaCCeS0pNVHv4WTxyFGY8Tg,3138 +pygments/lexers/installers.py,sha256=ioK2JUPSJk9vcsoe3NASvMt-paXd1_Nn3e8WmaqJ7CE,14494 +pygments/lexers/int_fiction.py,sha256=BUjvXilUiuMF-euXEQDzQZs45jn_aLs17eTKcfEptrI,56547 +pygments/lexers/iolang.py,sha256=kMUBUqVvdHlB79ez0pFZPRf0NgiEC2SdtYUwdjnbE90,1908 +pygments/lexers/j.py,sha256=56qUbs1C7wKdZ6-WpNnxHntNqsxWroqiO7keI2yoR1o,4856 +pygments/lexers/javascript.py,sha256=muyCVZQAsXbhT7IHZkoqAkI5myhRaHze6JMAR4zILNs,63246 +pygments/lexers/jmespath.py,sha256=726PDpRr1g2Ky_x5pZORhbXofXxkfr5HXQ8eHMhX5xg,2085 +pygments/lexers/jslt.py,sha256=UOVw1J3uK-hVRWomoFK2jMS_yeuo5iqga-LhXUJI660,3703 +pygments/lexers/json5.py,sha256=GyeZ58AxKkJJiiH7JuPmakDZXropa6bDkFRguJHifqU,2505 +pygments/lexers/jsonnet.py,sha256=_T7Y16sW7nFuAoGFuyWUKCrUyJAC4FTWZVoeSt0mTXk,5639 +pygments/lexers/jsx.py,sha256=O0evHioyudtWLhVmAXRrIfkEd5KRiokgHu8l9_Kn8sM,2696 +pygments/lexers/julia.py,sha256=F0twMg0iLBNDdedsoJG4Rn5LoMciVu9cufyUVdxKQPY,11713 +pygments/lexers/jvm.py,sha256=cf5V7NOLIvB2s7RM9wghESYRCoCDyrGjRuPmY8bfGAw,72936 +pygments/lexers/kuin.py,sha256=n2lMina8SskpfA2KbPYQFwVJOSHgNYu10U5pz5YiajE,11408 +pygments/lexers/kusto.py,sha256=pyUfWLf9Q0Qwqu74DyPAbRh20lkPDLhxnExD1FVl8Z4,3480 +pygments/lexers/ldap.py,sha256=_ya4_InnSIRj-RYjGagWFZJDy1NdgQUocQzVWjiRp68,6554 +pygments/lexers/lean.py,sha256=qP_iwUQ7MJZ1C5s3KYBW8Wu6-uuVj4PAG3a2Ghjp99U,8588 +pygments/lexers/lilypond.py,sha256=o264ovGZFrcx8ZwpKRX-gjUECK1w5T8T0n6LoTjP92U,9755 +pygments/lexers/lisp.py,sha256=a5MGcmtrWTaeEj_5Uv8YMODr3dVV6s1v1_SMBh_Ch9Q,157903 +pygments/lexers/macaulay2.py,sha256=hLNDs1TdubudvqqovYN6a4Ne9JjnU4FvNE6EE2hPn8Q,34139 +pygments/lexers/make.py,sha256=wAV0KRRXTAFMliLfAKXDihQIE2VAVUvWjFZ-yuM7a08,7834 +pygments/lexers/maple.py,sha256=OBjODNLgqanyw522CE7n9thZctWi47Uua2hPBfj7KF4,7963 +pygments/lexers/markup.py,sha256=4TMRfujXvOE9xiWwTiT_fq1lau4dKSoXYac1hWMLYRs,65264 +pygments/lexers/math.py,sha256=Nspl6IZtCyh9egiYUahboWSmy4cJCVZUBxyVnCuF1ag,698 +pygments/lexers/matlab.py,sha256=QYVBdA-IRNcuWggBJNC9lpq3jgX_1w9GQwpv907VfZM,133030 +pygments/lexers/maxima.py,sha256=ha-f-JzGkjggAr5kxmVq7_uJTCcpHstQWnsLHYIhNwU,2718 +pygments/lexers/meson.py,sha256=ZpNVp7lSHwJHEj7pwXlGcy9Lftdc6MMgJiOoY2TnfM8,4345 +pygments/lexers/mime.py,sha256=l5BsFkad3agJ6KDg_IHI6nU0Ao0Y9EcwjYoYP8vQD-g,7585 +pygments/lexers/minecraft.py,sha256=bBbMbqvsVgTfO7CBxf03oGP_qOAgrw06PSzH1QF7txs,13701 +pygments/lexers/mips.py,sha256=QpgBoMPzsk1t90cIF0W_EV-QZ8LwgTapS-fSISxZcFc,4659 +pygments/lexers/ml.py,sha256=shDPgWARTzTEhGDeblV7ZW2j6yZEeBiYqx2z24SDP7A,35393 +pygments/lexers/modeling.py,sha256=2_ucVFy7Z4yoKx90E9-ASI9t4t1LIoeQ3yHarhghz-c,13764 +pygments/lexers/modula2.py,sha256=dXW0KNFu3ETgABsPMsIhdJI0DKF-KWtT831FKsz2VXw,53075 +pygments/lexers/mojo.py,sha256=imOlg8mQCoKwi_rsuMiifZrzsAsSqT2KckCs_MV5uVE,24236 +pygments/lexers/monte.py,sha256=JTx-jSrFKlWRwA1qzhPd647ETGSElwhP4YMlVrfXyX8,6292 +pygments/lexers/mosel.py,sha256=HEYOmZiANhe9VdkTpBt7mhPi_tPGBUkVsnzTh2HVdVI,9300 +pygments/lexers/ncl.py,sha256=RZXkxOK-iHspLX_sFVT0wc5H6v-pa4kKghP79fJGQPQ,64002 +pygments/lexers/nimrod.py,sha256=L8Ww5CUaP-ojywoQZXnjC08m5Be64fBynSf5aWGIaPw,6416 +pygments/lexers/nit.py,sha256=xwu2P49Hu8YxEL7mgpV5WWFw6OYF1iJg9DVnc7H1SXk,2728 +pygments/lexers/nix.py,sha256=M2E-k--F7pneuMAOae9ag4srJsKhWJ1f1fRueO6PtKM,4424 +pygments/lexers/numbair.py,sha256=KZOw96Tj7Gly-f9F8NA-tdGd53SIt5UgbpokZsfnzWM,1761 +pygments/lexers/oberon.py,sha256=uH1FkPeXCfdd0IQ_--S8SHUNaf2dnjiQZjtIT-jxu4A,4216 +pygments/lexers/objective.py,sha256=KME-J0UL2HJYAk2fHNhf7ApQe4XF8GH6qGOvYA1wPS4,23300 +pygments/lexers/ooc.py,sha256=HEjWHdQDVk7tRb_TuEb1_C5qi-peJwwyYBVAhf49MS0,3005 +pygments/lexers/openscad.py,sha256=te2iL8VkfXul_PYXlz8UK3_QtMjdmNgt0YHCYEvdEtM,3703 +pygments/lexers/other.py,sha256=OAlXzsrVDUx4Ma25fyG98U5LaBEHyt-LJZ2IHvMJJWY,1766 +pygments/lexers/parasail.py,sha256=oPcs7fRYNkV0isPSRmw-2cPfMgzTtNPi6bJOm7vq-9o,2722 +pygments/lexers/parsers.py,sha256=g4tVvf36yhT_aH_b737o0o1joojcf-XckD2HdNoNbsQ,26598 +pygments/lexers/pascal.py,sha256=4dewXkwc12f_iiMfdNDqbxb_oqAEX2dCzb5VIZ62V54,30992 +pygments/lexers/pawn.py,sha256=adsa-7sPuPk7mO7lB08auabEpeZdNewVqTBg6FS8mCk,8256 +pygments/lexers/pddl.py,sha256=a8A2keCF9qNQvVZQirgBV5fH4u3cjrta8-eZJ8tsxmY,2992 +pygments/lexers/perl.py,sha256=uYMj6amZPawLf-KjICg9LLU5-ADKzqEYKqi7VXnvm0k,39195 +pygments/lexers/phix.py,sha256=nEWWt5-OoIDapw4IJ_cNL19Th8Ztt6OIQgeuogVed10,23252 +pygments/lexers/php.py,sha256=U6wmxPM-pS-SY1N3qdv0ebUDBxLH6-EFIFcatUvg74w,13171 +pygments/lexers/pointless.py,sha256=gNcuhhOY9cEpIPyGFjMh2DItNB1UD8CmjceXkDRModE,1977 +pygments/lexers/pony.py,sha256=HKqf5AngUOdXN1N1VvSg0jTj3NUAzGBOPdXwSFamvmM,3282 +pygments/lexers/praat.py,sha256=sfVAd7zfRsI-TcCouuYMWlcU8EBxAwJ4wkh0ZuNsZ34,12679 +pygments/lexers/procfile.py,sha256=fhRTtscyMMPcPbvzjxVtXix1mYlpO-4JuWUL7Db4ENI,1158 +pygments/lexers/prolog.py,sha256=4YvPZbAFLWNZMbZhvtIulWib0PQLA_TB93gjkNywFRA,12869 +pygments/lexers/promql.py,sha256=04fS_R6HBWhpKNe3WPp_QXgIdFvJr5p6KxStZYw7yHU,4741 +pygments/lexers/prql.py,sha256=XJhd8dpEWPBIKmQXx_09-z1NyotLXIskpuzX36HykHo,8750 +pygments/lexers/ptx.py,sha256=dEaNSReAjAymIwVM_MnbdY4hd3muK79q200hYwN72cw,4504 +pygments/lexers/python.py,sha256=79A_yJqjVHp_ZeS1rY8Pcc4cwZ_7-zI2WWkeUmZgUrA,54202 +pygments/lexers/q.py,sha256=2CbJYgRu8uz8wOSp5FMr086KCC7IjSRmIODVY0uKrCA,6939 +pygments/lexers/qlik.py,sha256=9b6Q-6jXeeraIRcWtsKsYWCOlBhfmjNzIN49pUvMR-I,3696 +pygments/lexers/qvt.py,sha256=rpT5oD4awEKMs3uBCbNlzY1zCz7AVeqM-BikLTQHo8k,6106 +pygments/lexers/r.py,sha256=hzgUUH9gCsqqwTG9eCt1JVMd9RW0dy6IY_jTvRntF-U,6477 +pygments/lexers/rdf.py,sha256=FM154fB1lxfOpSpeW6bWOVld5kJBgEuYyT9udt-EcK0,16063 +pygments/lexers/rebol.py,sha256=CQ3pMaAz64UMqiQVrYoREnOgjU5QPeF_H3aaHNdVRC8,18262 +pygments/lexers/rego.py,sha256=Yi0G4secTWOL7CUhLLCzJ9gA6SJzDJpPJNij3hXixC0,1751 +pygments/lexers/rell.py,sha256=0gZStI953aFjFMyMVX_UKfwZmzV3uj3Tnl_5F20BPx0,2487 +pygments/lexers/resource.py,sha256=RDEY7iSv2hgQ3V-I1DeOKVOumNKgFqbV2Me_9Y21o10,2930 +pygments/lexers/ride.py,sha256=1zg7kGYPKRIekyuZY3f6OVqRlXyrX-sR-tHEX1M9nz4,5038 +pygments/lexers/rita.py,sha256=fCNElPik6dDIZzGd96kKgdlY4Qqp_zVI87waTBHMBfg,1130 +pygments/lexers/rnc.py,sha256=PNfnnTlnZjNvvG33BNMCqPzdA9LZEYvDsGoaDd_2mn8,1975 +pygments/lexers/roboconf.py,sha256=l6BeJIS-ZAUb3zc5GEuVIb0edrRpPFmKdffEBx74Zxg,2077 +pygments/lexers/robotframework.py,sha256=8s1U7GldhzRPGR7d8_rMSG0ZJz9ZOm-LGqBTGILwt2U,18451 +pygments/lexers/ruby.py,sha256=BxndG-3gLg7wEGvICiNDAMygQR9Qs0xrmq7DwfoLvMs,22756 +pygments/lexers/rust.py,sha256=7qD3KGVir-tUWf_bPBt4EX8l9aIWe8TblMCFI75oorc,8263 +pygments/lexers/sas.py,sha256=9hmGYhmKo7ri9oCmZdsoEFMz6z3AwKD4LcTUIn52lYU,9459 +pygments/lexers/savi.py,sha256=HCllgBe3rzP_7-2b1hSUEbE2dYz08Iysxc6Dcxj3f2c,4881 +pygments/lexers/scdoc.py,sha256=9n64S-bO1dI4x-2Kzh2jrDM6gEmB5YI7ch6ndPB4-cw,2527 +pygments/lexers/scripting.py,sha256=c-i_cMFhYEHQZZbLgJn0jyiD52vWeZVxUK6wFV2Fib4,82959 +pygments/lexers/sgf.py,sha256=ya_sG4TOvDWwzEM6cIi40XSbhkTuHCqvo-uHnNYfi5Q,1988 +pygments/lexers/shell.py,sha256=si6MAn6S7pHfyX65NkwQdjxtLtEu1M4l7K2lUHvyzWw,36384 +pygments/lexers/sieve.py,sha256=CXR9S1nGeVTln2u5R600hxgkAmJFVVTTTBh_k3aw-pk,2517 +pygments/lexers/slash.py,sha256=molh5sNG8UtheHffQGjjHLxVtyg2oCp4B8cvgDyf004,8487 +pygments/lexers/smalltalk.py,sha256=q52NHegl3pjn1jMkJWA9J0nOA_A5VzUULZAPgb-6uNU,7207 +pygments/lexers/smithy.py,sha256=hqEImo4B-i0hddNo1r0k5eHLOlArtRW4W5PsLBdllk4,2662 +pygments/lexers/smv.py,sha256=D51In9Qr2nWFicYAOX_bJpeFgmJ3BUkEXnvXPmA04D4,2808 +pygments/lexers/snobol.py,sha256=BX_1VPUZi-ckKCYlF2sttQprF2bLUHOi8blhInFHv9s,2781 +pygments/lexers/solidity.py,sha256=pz0DZ0xiHwufhbQ9hdCPrHMjA7NMsa6hxZ1nO-A4Y3E,3166 +pygments/lexers/soong.py,sha256=TVqBJzJxLwCEDmb5Aix2_AVuZILYyPWcAzFbzINNQAM,2342 +pygments/lexers/sophia.py,sha256=MAkWLYxhHJNcc3UUzWD3VDLzVRbf6IAd2uz4q7DY3wI,3379 +pygments/lexers/special.py,sha256=8gpTiLICFNwIcahm282mi8Nqi_6gwYMsAfjJIM2Bq6k,3588 +pygments/lexers/spice.py,sha256=UcrjK2KJDDKSEgEOeLXTayqRwirWdsywrfH9MqwPPIY,2801 +pygments/lexers/sql.py,sha256=zz_TFZtf5R29cvkBFG1PDJ-0KKrY7FjA-RDky-gfNlk,41656 +pygments/lexers/srcinfo.py,sha256=MHj02VB7WP3AcoOz1WVYAqNM_3oFLjEaAda075kXVBU,1749 +pygments/lexers/stata.py,sha256=KojmkxWHlEk-HvmxI313a52nzH_JHNqfv6r3jJoFDy8,6418 +pygments/lexers/supercollider.py,sha256=H-qwP6sUaotemsXxuugpui6KnU3jtIdDfS3bGt3Jvh4,3700 +pygments/lexers/tablegen.py,sha256=ryuzw-ArLdvlY55YJBn6ebOzDo3L8UnbR5xcZB8xMso,4012 +pygments/lexers/tact.py,sha256=YbOWYNp302ZBPM5affzM4-CudJ4xRZyJb-_vSDCozCo,10812 +pygments/lexers/tal.py,sha256=xZYmhv8mBr-A3oeoFkcSP7nDbX1r21kKOnhsLTtL3bE,2907 +pygments/lexers/tcl.py,sha256=MXMAo2wCZeq5oR7VzsNbamawun_vMOk2gOEDnGk6yOc,5515 +pygments/lexers/teal.py,sha256=pgpPi9xWPumSr-heSpGBGDcU5s3qN0aFUj2maHLE3MM,3525 +pygments/lexers/templates.py,sha256=ndJMdue33qQ_thsortAra1fm_-szMN40S5bZXBLY54w,75734 +pygments/lexers/teraterm.py,sha256=YCdvILRq-FdOJ_HfiIkYVToH3c6I2QRbQoH17Q49Hx8,10045 +pygments/lexers/testing.py,sha256=GF5SpanGwjgKKoYari32SdtdOWWXXje8xVX5-ZzTjLg,10813 +pygments/lexers/text.py,sha256=yq6mOLz3PizKNMm4_Y8UHn9vEeBfqEY5W-3M7dk1jYs,1071 +pygments/lexers/textedit.py,sha256=V-Ijh0eULTWtx3S_6vT7JcyjQO-CNirpAbEpkczLGCE,7763 +pygments/lexers/textfmts.py,sha256=WSiJDzNKCcOsBoTU4NCYU33ti5ZHGi0Px29eGjT6pB0,15527 +pygments/lexers/theorem.py,sha256=c-eg6tIYWUbxSYgrOtLZfFxro4g91JcAIwrIJGLPooU,17903 +pygments/lexers/thingsdb.py,sha256=FNKjArS1vadHEN3ZXaZdDLqvcG59GbF6Ak5M8RMsTLU,6257 +pygments/lexers/tlb.py,sha256=vWsFq_MrIrzgG2q-qdzpcoNiv9KkNow4x9ebs9_HAwA,1453 +pygments/lexers/tls.py,sha256=GZ1lvZ8PUk1-LThq1KuiqSEnMqJVqiHo_A-16aKuJOc,1543 +pygments/lexers/tnt.py,sha256=MNYTfkix0x5L1pDV8V8zGLS7GU8z7bt-wpiBap2W09U,10459 +pygments/lexers/trafficscript.py,sha256=1Tawom6bKJM-u1kYey21xFaHep3D9kl62rV3RaHSvcI,1509 +pygments/lexers/typoscript.py,sha256=dWAuOYYk0X4xE_fxKgcXz-sMYlG2wxQR4m_d7PW2PYs,8335 +pygments/lexers/typst.py,sha256=ZtV37NCQCoSqEKrAhffuZtUp1kDahKQx8PxMLrR2G6k,7170 +pygments/lexers/ul4.py,sha256=joM-US0-2BEWRHHK6eyZ-Y--306YgbMrevMY0hg8QTY,10502 +pygments/lexers/unicon.py,sha256=9D-GilKOqIEaowGHmdvHRjhqyigRk320ARAr-G_snew,18628 +pygments/lexers/urbi.py,sha256=j87k6fe60kZdbJ6AJA4g9E0no1EP0bxJY06UVP0YgnU,6085 +pygments/lexers/usd.py,sha256=tP9kHPZUJcE_flPvKEsF7wTck4FuQW75S8ELh4IYJEI,3307 +pygments/lexers/varnish.py,sha256=INCtYbol1yV_NXMh51CMDZDacEHgiB3SmR3H5uW-Fkc,7476 +pygments/lexers/verification.py,sha256=QISJmmz7cmYaXZphW5so4PfdKJo0rdZWuj_de64mafk,3937 +pygments/lexers/verifpal.py,sha256=0iZTQWawF9f7lFZnFNPTwYRiu6L_25PtEI83tuCAmKY,2664 +pygments/lexers/vip.py,sha256=pM5xFoeu-2GPWqAVzZJe6xPYr6WJPlozVI5084SHQ80,5714 +pygments/lexers/vyper.py,sha256=rw2yD9c2L7yPtXqKPd0RdxJSZK-aJbW5jEa0gHfKEO0,5618 +pygments/lexers/web.py,sha256=YMrxoHlKlQwfFJlae9_T9F1Vp03YA7IWsmgqLzh6pgI,916 +pygments/lexers/webassembly.py,sha256=Y48VdBp8b4SI10PEt8biOm-gteYgmNc_bRR-KvulfnQ,5701 +pygments/lexers/webidl.py,sha256=MQMaZFskluB29lMGpiGP2f6fzoja4vV8FtoCGFQH6fM,10519 +pygments/lexers/webmisc.py,sha256=GnSTSHfsAUGy5DYF_qwFmMsyabnzTstaEG96Fub53fk,40567 +pygments/lexers/wgsl.py,sha256=vgDtY_q42TGRvcsyS7viSadU8D3eHvatfoCNNnEP0zE,11883 +pygments/lexers/whiley.py,sha256=MC2V7o1s7LIoLy0Fk-i8OymBoN0dpK2BPjIrdQwsnVk,4020 +pygments/lexers/wowtoc.py,sha256=XnLSSX7p_RkwZIzlmYXO873d4byX9-A3dfvzNL5Eocw,4079 +pygments/lexers/wren.py,sha256=2lhzwpS27xW6nERY_NeODgNN9X6mB7vl3odXSPngqY8,3232 +pygments/lexers/x10.py,sha256=77pAyohtv9PFwPvJPGgq-Vw8tEXo9Sny1MnTchFpTTI,1946 +pygments/lexers/xorg.py,sha256=LUKU91t1Opc3W_F64UGzx0nB-HqKlN3Cn_6tFzt5IYw,928 +pygments/lexers/yang.py,sha256=yIvwteHWBWL2-8zZscnCPJOnq3rMOXh5lxJujywA_Zo,4502 +pygments/lexers/yara.py,sha256=_ISzhko7v9AhJ-1cWINZSyG3my2vJOyFSHxSjm4VdTY,2430 +pygments/lexers/zig.py,sha256=q0tuplpRFAUSS29hg_XiRH22Ctve2EFAT5xo7TNAlrk,3975 +pygments/modeline.py,sha256=me8g5rySidvPtMBOrDy2O1sMqZd02lBHMY5KDZefUws,1008 +pygments/plugin.py,sha256=P6zIw-vkSQ0k1WKHrzbBTjpwlCZPbR-6Qe_dO9Bjdu0,1928 +pygments/regexopt.py,sha256=d2hTvazlow5zzZIOCVnfeEG2CY0GrY_igH1kCSSf7ow,3308 +pygments/scanner.py,sha256=DtoLi1pOKpNu-6jiakJpSQLUi_ep29SQQhv7oAwYWME,3095 +pygments/sphinxext.py,sha256=qmiWv5b7qq6bNUT2Y2wZejV2ImQmvtzGJFg6LcGENl0,7901 +pygments/style.py,sha256=Hrie373bgWU81ZNwVjZM-GNBoxBxVe1W1Tr3MzJLdkY,6411 +pygments/styles/__init__.py,sha256=2vgGKnbyt0nf_CSDEtMhHxppPSAPr2jafzl5FiXFuGs,2009 +pygments/styles/__pycache__/__init__.cpython-310.pyc,, +pygments/styles/__pycache__/_mapping.cpython-310.pyc,, +pygments/styles/__pycache__/abap.cpython-310.pyc,, +pygments/styles/__pycache__/algol.cpython-310.pyc,, +pygments/styles/__pycache__/algol_nu.cpython-310.pyc,, +pygments/styles/__pycache__/arduino.cpython-310.pyc,, +pygments/styles/__pycache__/autumn.cpython-310.pyc,, +pygments/styles/__pycache__/borland.cpython-310.pyc,, +pygments/styles/__pycache__/bw.cpython-310.pyc,, +pygments/styles/__pycache__/coffee.cpython-310.pyc,, +pygments/styles/__pycache__/colorful.cpython-310.pyc,, +pygments/styles/__pycache__/default.cpython-310.pyc,, +pygments/styles/__pycache__/dracula.cpython-310.pyc,, +pygments/styles/__pycache__/emacs.cpython-310.pyc,, +pygments/styles/__pycache__/friendly.cpython-310.pyc,, +pygments/styles/__pycache__/friendly_grayscale.cpython-310.pyc,, +pygments/styles/__pycache__/fruity.cpython-310.pyc,, +pygments/styles/__pycache__/gh_dark.cpython-310.pyc,, +pygments/styles/__pycache__/gruvbox.cpython-310.pyc,, +pygments/styles/__pycache__/igor.cpython-310.pyc,, +pygments/styles/__pycache__/inkpot.cpython-310.pyc,, +pygments/styles/__pycache__/lightbulb.cpython-310.pyc,, +pygments/styles/__pycache__/lilypond.cpython-310.pyc,, +pygments/styles/__pycache__/lovelace.cpython-310.pyc,, +pygments/styles/__pycache__/manni.cpython-310.pyc,, +pygments/styles/__pycache__/material.cpython-310.pyc,, +pygments/styles/__pycache__/monokai.cpython-310.pyc,, +pygments/styles/__pycache__/murphy.cpython-310.pyc,, +pygments/styles/__pycache__/native.cpython-310.pyc,, +pygments/styles/__pycache__/nord.cpython-310.pyc,, +pygments/styles/__pycache__/onedark.cpython-310.pyc,, +pygments/styles/__pycache__/paraiso_dark.cpython-310.pyc,, +pygments/styles/__pycache__/paraiso_light.cpython-310.pyc,, +pygments/styles/__pycache__/pastie.cpython-310.pyc,, +pygments/styles/__pycache__/perldoc.cpython-310.pyc,, +pygments/styles/__pycache__/rainbow_dash.cpython-310.pyc,, +pygments/styles/__pycache__/rrt.cpython-310.pyc,, +pygments/styles/__pycache__/sas.cpython-310.pyc,, +pygments/styles/__pycache__/solarized.cpython-310.pyc,, +pygments/styles/__pycache__/staroffice.cpython-310.pyc,, +pygments/styles/__pycache__/stata_dark.cpython-310.pyc,, +pygments/styles/__pycache__/stata_light.cpython-310.pyc,, +pygments/styles/__pycache__/tango.cpython-310.pyc,, +pygments/styles/__pycache__/trac.cpython-310.pyc,, +pygments/styles/__pycache__/vim.cpython-310.pyc,, +pygments/styles/__pycache__/vs.cpython-310.pyc,, +pygments/styles/__pycache__/xcode.cpython-310.pyc,, +pygments/styles/__pycache__/zenburn.cpython-310.pyc,, +pygments/styles/_mapping.py,sha256=6lovFUE29tz6EsV3XYY4hgozJ7q1JL7cfO3UOlgnS8w,3312 +pygments/styles/abap.py,sha256=T7Ad121Kjz8ZbuphyhulULwXyvXubSS6Czc0MDOFiJ8,752 +pygments/styles/algol.py,sha256=6v6ZXLxPJsm_1qPqOu5ihAuWhVk644NdPXPcZqiOTTI,2265 +pygments/styles/algol_nu.py,sha256=581Lf5db303g7zDb7z-VlvGlFNpbXMIlAnrRBxtjGts,2286 +pygments/styles/arduino.py,sha256=oFF5gjfbQNBigKxFhC7giUIHWl0ieCshhsm9UxCIzqg,4560 +pygments/styles/autumn.py,sha256=P9IX5utjDvdJgevM0kNGwE-wvVysRh1lgMkjO1dhDDE,2198 +pygments/styles/borland.py,sha256=V8qTD8SrS0wLohp2udIirlijbHfPoIlWZkYpqxSdkSw,1614 +pygments/styles/bw.py,sha256=e4Fo6Kyax2aRhqKsjsqvi2CW6lkU9QnjKoPrESZAj-I,1409 +pygments/styles/coffee.py,sha256=0jxdctCEKbR1AqzA59fFQK4sVBdErrRkGCUn6fPF4sg,2311 +pygments/styles/colorful.py,sha256=opkfOcjFTtDn9Fty6ogM7okFMB6bA0iR0VtTdBPE9NE,2835 +pygments/styles/default.py,sha256=WFLDucKJS_ac5Jqutmglbz4ITc4jTTQEOnqLIMpSttA,2591 +pygments/styles/dracula.py,sha256=H-EM1WM3Ixd2OBY9bzoObKl4IzdmhirfDVFbJ9Wsi0Q,2185 +pygments/styles/emacs.py,sha256=iEYWPgQrDQk4RdDf8-g7j4mtoFRzo2xcKvZE1ys9mJU,2538 +pygments/styles/friendly.py,sha256=S43XMczW53tKftmarEL4-nTroPVdN6k8fbNrINzR_QU,2607 +pygments/styles/friendly_grayscale.py,sha256=el2E804DEkKZ6ApXt3N5FTmHAkIhqkJj-omhE1E8mdE,2831 +pygments/styles/fruity.py,sha256=mrNDixp39QIoitRBo-yMOr8tnYLAwGd0EIMw2A6Gd8g,1327 +pygments/styles/gh_dark.py,sha256=yb4EOBAYsQ9g5IGEOqyZ5LKI-MUbwz32l9WB5EcMLaA,3593 +pygments/styles/gruvbox.py,sha256=_QZtRq9y1s3NYADHqek-DXELQqueOnVDXvWJ_1aTGgo,3390 +pygments/styles/igor.py,sha256=QO_M5-Z1xIxVnusEU4LZr4VT--nTERVt-cpfbnOv4yk,740 +pygments/styles/inkpot.py,sha256=bJvNWikqnAWLjx2AH4t_tW4jR0TsrUyVFXFVPAfOgkM,2407 +pygments/styles/lightbulb.py,sha256=CnDv1mF1X5k1msVvRS_diR4tkp06E_jg0tK9cdHEFCQ,3175 +pygments/styles/lilypond.py,sha256=gSCiazPPWfR_9-BV5BYHe6-2gSor4vOHnz3nyFQI2QA,2069 +pygments/styles/lovelace.py,sha256=vZ-S9tS-QUOwfA0RHYBhSTRE3h1ZU-bZnuMW7O6ksyw,3181 +pygments/styles/manni.py,sha256=dpsJC1Zees0e9IcWirqWuSzQxwD0jIbjhFquM23dmWM,2446 +pygments/styles/material.py,sha256=eyyAaJgp1Fnjl4-_D39_l1wH5CW4W0VWScQ3Q0jtAgU,4204 +pygments/styles/monokai.py,sha256=3CwJJm_YVGibzFi8nhK_b5d4cNzgV8z-L6RzC1UVA7Q,5187 +pygments/styles/murphy.py,sha256=HsPd80nObb3Ov3-7yJQbnJr3z9mCyz30Pjn_nkWkMYo,2808 +pygments/styles/native.py,sha256=oazEJUbuaHqqOZR5vx-jIhTPIw7dC6QZnKxW-xLr7fs,2046 +pygments/styles/nord.py,sha256=t7fZj04LUgsLaHpio66FqOGMKb7a2VC3teUlmInPfRg,5394 +pygments/styles/onedark.py,sha256=UXrMzVvA9OVP7OhCQ5gL0CaZrk5jo_I84HJm7LEN5GQ,2126 +pygments/styles/paraiso_dark.py,sha256=rx5_j4gnZRy2j-3hAhFmWpnjnd-Vfz3Z7fcwEXRUGm0,5665 +pygments/styles/paraiso_light.py,sha256=iERjbYRemqgsisv_9TjanBig4bJ_-80xRz5B5puhMc0,5671 +pygments/styles/pastie.py,sha256=mnKebFiJ2do9A_wTPq4tKtgw-TQqpb0lP3kNbemQ2to,2528 +pygments/styles/perldoc.py,sha256=-e1T4QBEQNE_l17RYW-WBowNprg2uL_hFjhSDcaMiDM,2233 +pygments/styles/rainbow_dash.py,sha256=YP2HPVXJLmOy8Yz8p8u5GbkAyuKxLlNmu6ITZBMa1Mc,2393 +pygments/styles/rrt.py,sha256=vs4pnWwmMIQR0eGczp06AYazsYiR0KFcRiRUzSf3rXc,1295 +pygments/styles/sas.py,sha256=ER-JjZgU2wEJWk5K06iHAFPjVYD1iMkvjjE0rlNOt2Y,1443 +pygments/styles/solarized.py,sha256=VdtLYhQ7xDj_iTHP_Ekr6rAdMcE3fRSrglngVSal63M,4250 +pygments/styles/staroffice.py,sha256=peExkIBqPkRhqXFpW99n49t6pMwehI_pDYVUmQwkgdA,834 +pygments/styles/stata_dark.py,sha256=N6imWykqHoT5drOn-sVRUzt1AZMKG3HHU-Q7LKz2d50,1260 +pygments/styles/stata_light.py,sha256=YW7ih4teXoEuUHImOK2rGSCVxfnj43tlcKPXUsrDkRg,1292 +pygments/styles/tango.py,sha256=Af0WVTxpH_cUdHr_ua69JDijTLI5aG1RmBTF7o2KTgk,7140 +pygments/styles/trac.py,sha256=-h5iU-LjSmt-dQ7y5jXwJ5LQ9ABR5QD5RlPRjhnzmv8,1984 +pygments/styles/vim.py,sha256=dWqCVC2YT45dLSpMTwLBPkKYgRsT1-cFf7ZHoc2PQpA,2022 +pygments/styles/vs.py,sha256=7HJehhtiHE5nibjC3r3X-aYHBm5BccL33LgO_4anEiU,1133 +pygments/styles/xcode.py,sha256=HmB6aPkxvmo4za5DijhLb5AXSyv6UbWnwOUoRUNBaZA,1507 +pygments/styles/zenburn.py,sha256=Ax7iBbMzvVQNTpT3YdMwCEkL-nIXnpr60aVrR4Lpa6o,2206 +pygments/token.py,sha256=DVil5T2ltHkTgQTUYy1dMtgyigjavCs1ypE4Qf2CrGo,6229 +pygments/unistring.py,sha256=Z4w4HfOVUhueCURRkfhAqQ2b-69UzkhY4xuHevYEy5g,63211 +pygments/util.py,sha256=zk935tJSpwSA9zxNmV1TuhcEP0MfboXiRZSGQnLPEqk,10046 diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..b1b94fd58e7e9ed0ef3449473bc48de68afcc3fe --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.29.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..720e85bf5034d8abc2c571bad372921352c7e2d1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/pygments_1774796700044/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/entry_points.txt b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..15498e35f53320bd5e1de176928daabf26be0109 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments-2.20.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +pygmentize = pygments.cmdline:main diff --git a/micromamba_root/Lib/site-packages/pygments/__init__.py b/micromamba_root/Lib/site-packages/pygments/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3a5ba538b05cab44263485e2ba88ef466f230259 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/__init__.py @@ -0,0 +1,82 @@ +""" + Pygments + ~~~~~~~~ + + Pygments is a syntax highlighting package written in Python. + + It is a generic syntax highlighter for general use in all kinds of software + such as forum systems, wikis or other applications that need to prettify + source code. Highlights are: + + * a wide range of common languages and markup formats is supported + * special attention is paid to details, increasing quality by a fair amount + * support for new languages and formats are added easily + * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image + formats that PIL supports, and ANSI sequences + * it is usable as a command-line tool and as a library + * ... and it highlights even Brainfuck! + + The `Pygments master branch`_ is installable with ``easy_install Pygments==dev``. + + .. _Pygments master branch: + https://github.com/pygments/pygments/archive/master.zip#egg=Pygments-dev + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +from io import StringIO, BytesIO + +__version__ = '2.20.0' +__docformat__ = 'restructuredtext' + +__all__ = ['lex', 'format', 'highlight'] + + +def lex(code, lexer): + """ + Lex `code` with the `lexer` (must be a `Lexer` instance) + and return an iterable of tokens. Currently, this only calls + `lexer.get_tokens()`. + """ + try: + return lexer.get_tokens(code) + except TypeError: + # Heuristic to catch a common mistake. + from pygments.lexer import RegexLexer + if isinstance(lexer, type) and issubclass(lexer, RegexLexer): + raise TypeError('lex() argument must be a lexer instance, ' + 'not a class') + raise + + +def format(tokens, formatter, outfile=None): # pylint: disable=redefined-builtin + """ + Format ``tokens`` (an iterable of tokens) with the formatter ``formatter`` + (a `Formatter` instance). + + If ``outfile`` is given and a valid file object (an object with a + ``write`` method), the result will be written to it, otherwise it + is returned as a string. + """ + try: + if not outfile: + realoutfile = getattr(formatter, 'encoding', None) and BytesIO() or StringIO() + formatter.format(tokens, realoutfile) + return realoutfile.getvalue() + else: + formatter.format(tokens, outfile) + except TypeError: + # Heuristic to catch a common mistake. + from pygments.formatter import Formatter + if isinstance(formatter, type) and issubclass(formatter, Formatter): + raise TypeError('format() argument must be a formatter instance, ' + 'not a class') + raise + + +def highlight(code, lexer, formatter, outfile=None): + """ + This is the most high-level highlighting function. It combines `lex` and + `format` in one function. + """ + return format(lex(code, lexer), formatter, outfile) diff --git a/micromamba_root/Lib/site-packages/pygments/__main__.py b/micromamba_root/Lib/site-packages/pygments/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..818bfc3ae6ac4b79e029f714c56101ab2b1076ea --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/__main__.py @@ -0,0 +1,17 @@ +""" + pygments.__main__ + ~~~~~~~~~~~~~~~~~ + + Main entry point for ``python -m pygments``. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import sys +import pygments.cmdline + +try: + sys.exit(pygments.cmdline.main(sys.argv)) +except KeyboardInterrupt: + sys.exit(1) diff --git a/micromamba_root/Lib/site-packages/pygments/scanner.py b/micromamba_root/Lib/site-packages/pygments/scanner.py new file mode 100644 index 0000000000000000000000000000000000000000..067ebfa9c65a9ea3b3ac3e1d4cf815eee2f1f32b --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/scanner.py @@ -0,0 +1,104 @@ +""" + pygments.scanner + ~~~~~~~~~~~~~~~~ + + This library implements a regex based scanner. Some languages + like Pascal are easy to parse but have some keywords that + depend on the context. Because of this it's impossible to lex + that just by using a regular expression lexer like the + `RegexLexer`. + + Have a look at the `DelphiLexer` to get an idea of how to use + this scanner. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +import re + + +class EndOfText(RuntimeError): + """ + Raise if end of text is reached and the user + tried to call a match function. + """ + + +class Scanner: + """ + Simple scanner + + All method patterns are regular expression strings (not + compiled expressions!) + """ + + def __init__(self, text, flags=0): + """ + :param text: The text which should be scanned + :param flags: default regular expression flags + """ + self.data = text + self.data_length = len(text) + self.start_pos = 0 + self.pos = 0 + self.flags = flags + self.last = None + self.match = None + self._re_cache = {} + + def eos(self): + """`True` if the scanner reached the end of text.""" + return self.pos >= self.data_length + eos = property(eos, eos.__doc__) + + def check(self, pattern): + """ + Apply `pattern` on the current position and return + the match object. (Doesn't touch pos). Use this for + lookahead. + """ + if self.eos: + raise EndOfText() + if pattern not in self._re_cache: + self._re_cache[pattern] = re.compile(pattern, self.flags) + return self._re_cache[pattern].match(self.data, self.pos) + + def test(self, pattern): + """Apply a pattern on the current position and check + if it patches. Doesn't touch pos. + """ + return self.check(pattern) is not None + + def scan(self, pattern): + """ + Scan the text for the given pattern and update pos/match + and related fields. The return value is a boolean that + indicates if the pattern matched. The matched value is + stored on the instance as ``match``, the last value is + stored as ``last``. ``start_pos`` is the position of the + pointer before the pattern was matched, ``pos`` is the + end position. + """ + if self.eos: + raise EndOfText() + if pattern not in self._re_cache: + self._re_cache[pattern] = re.compile(pattern, self.flags) + self.last = self.match + m = self._re_cache[pattern].match(self.data, self.pos) + if m is None: + return False + self.start_pos = m.start() + self.pos = m.end() + self.match = m.group() + return True + + def get_char(self): + """Scan exactly one char.""" + self.scan('.') + + def __repr__(self): + return '<%s %d/%d>' % ( + self.__class__.__name__, + self.pos, + self.data_length + ) diff --git a/micromamba_root/Lib/site-packages/pygments/sphinxext.py b/micromamba_root/Lib/site-packages/pygments/sphinxext.py new file mode 100644 index 0000000000000000000000000000000000000000..5c03e4c64419af844b0ab0cf9645b5769accb2f8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/sphinxext.py @@ -0,0 +1,247 @@ +""" + pygments.sphinxext + ~~~~~~~~~~~~~~~~~~ + + Sphinx extension to generate automatic documentation of lexers, + formatters and filters. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import sys + +from docutils import nodes +from docutils.statemachine import ViewList +from docutils.parsers.rst import Directive +from sphinx.util.nodes import nested_parse_with_titles + + +MODULEDOC = ''' +.. module:: %s + +%s +%s +''' + +LEXERDOC = ''' +.. class:: %s + + :Short names: %s + :Filenames: %s + :MIME types: %s + + %s + + %s + +''' + +FMTERDOC = ''' +.. class:: %s + + :Short names: %s + :Filenames: %s + + %s + +''' + +FILTERDOC = ''' +.. class:: %s + + :Name: %s + + %s + +''' + + +class PygmentsDoc(Directive): + """ + A directive to collect all lexers/formatters/filters and generate + autoclass directives for them. + """ + has_content = False + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = False + option_spec = {} + + def run(self): + self.filenames = set() + if self.arguments[0] == 'lexers': + out = self.document_lexers() + elif self.arguments[0] == 'formatters': + out = self.document_formatters() + elif self.arguments[0] == 'filters': + out = self.document_filters() + elif self.arguments[0] == 'lexers_overview': + out = self.document_lexers_overview() + else: + raise Exception('invalid argument for "pygmentsdoc" directive') + node = nodes.compound() + vl = ViewList(out.split('\n'), source='') + nested_parse_with_titles(self.state, vl, node) + for fn in self.filenames: + self.state.document.settings.record_dependencies.add(fn) + return node.children + + def document_lexers_overview(self): + """Generate a tabular overview of all lexers. + + The columns are the lexer name, the extensions handled by this lexer + (or "None"), the aliases and a link to the lexer class.""" + from pygments.lexers._mapping import LEXERS + import pygments.lexers + out = [] + + table = [] + + def format_link(name, url): + if url: + return f'`{name} <{url}>`_' + return name + + for classname, data in sorted(LEXERS.items(), key=lambda x: x[1][1].lower()): + lexer_cls = pygments.lexers.find_lexer_class(data[1]) + extensions = lexer_cls.filenames + lexer_cls.alias_filenames + + table.append({ + 'name': format_link(data[1], lexer_cls.url), + 'extensions': ', '.join(extensions).replace('*', '\\*').replace('_', '\\') or 'None', + 'aliases': ', '.join(data[2]), + 'class': f'{data[0]}.{classname}' + }) + + column_names = ['name', 'extensions', 'aliases', 'class'] + column_lengths = [max([len(row[column]) for row in table if row[column]]) + for column in column_names] + + def write_row(*columns): + """Format a table row""" + out = [] + for length, col in zip(column_lengths, columns): + if col: + out.append(col.ljust(length)) + else: + out.append(' '*length) + + return ' '.join(out) + + def write_seperator(): + """Write a table separator row""" + sep = ['='*c for c in column_lengths] + return write_row(*sep) + + out.append(write_seperator()) + out.append(write_row('Name', 'Extension(s)', 'Short name(s)', 'Lexer class')) + out.append(write_seperator()) + for row in table: + out.append(write_row( + row['name'], + row['extensions'], + row['aliases'], + f':class:`~{row["class"]}`')) + out.append(write_seperator()) + + return '\n'.join(out) + + def document_lexers(self): + from pygments.lexers._mapping import LEXERS + import pygments + import inspect + import pathlib + + out = [] + modules = {} + moduledocstrings = {} + for classname, data in sorted(LEXERS.items(), key=lambda x: x[0]): + module = data[0] + mod = __import__(module, None, None, [classname]) + self.filenames.add(mod.__file__) + cls = getattr(mod, classname) + if not cls.__doc__: + print(f"Warning: {classname} does not have a docstring.") + docstring = cls.__doc__ + if isinstance(docstring, bytes): + docstring = docstring.decode('utf8') + + example_file = getattr(cls, '_example', None) + if example_file: + p = pathlib.Path(inspect.getabsfile(pygments)).parent.parent /\ + 'tests' / 'examplefiles' / example_file + content = p.read_text(encoding='utf-8') + if not content: + raise Exception( + f"Empty example file '{example_file}' for lexer " + f"{classname}") + + if data[2]: + lexer_name = data[2][0] + docstring += '\n\n .. admonition:: Example\n' + docstring += f'\n .. code-block:: {lexer_name}\n\n' + for line in content.splitlines(): + docstring += f' {line}\n' + + if cls.version_added: + version_line = f'.. versionadded:: {cls.version_added}' + else: + version_line = '' + + modules.setdefault(module, []).append(( + classname, + ', '.join(data[2]) or 'None', + ', '.join(data[3]).replace('*', '\\*').replace('_', '\\') or 'None', + ', '.join(data[4]) or 'None', + docstring, + version_line)) + if module not in moduledocstrings: + moddoc = mod.__doc__ + if isinstance(moddoc, bytes): + moddoc = moddoc.decode('utf8') + moduledocstrings[module] = moddoc + + for module, lexers in sorted(modules.items(), key=lambda x: x[0]): + if moduledocstrings[module] is None: + raise Exception(f"Missing docstring for {module}") + heading = moduledocstrings[module].splitlines()[4].strip().rstrip('.') + out.append(MODULEDOC % (module, heading, '-'*len(heading))) + for data in lexers: + out.append(LEXERDOC % data) + + return ''.join(out) + + def document_formatters(self): + from pygments.formatters import FORMATTERS + + out = [] + for classname, data in sorted(FORMATTERS.items(), key=lambda x: x[0]): + module = data[0] + mod = __import__(module, None, None, [classname]) + self.filenames.add(mod.__file__) + cls = getattr(mod, classname) + docstring = cls.__doc__ + if isinstance(docstring, bytes): + docstring = docstring.decode('utf8') + heading = cls.__name__ + out.append(FMTERDOC % (heading, ', '.join(data[2]) or 'None', + ', '.join(data[3]).replace('*', '\\*') or 'None', + docstring)) + return ''.join(out) + + def document_filters(self): + from pygments.filters import FILTERS + + out = [] + for name, cls in FILTERS.items(): + self.filenames.add(sys.modules[cls.__module__].__file__) + docstring = cls.__doc__ + if isinstance(docstring, bytes): + docstring = docstring.decode('utf8') + out.append(FILTERDOC % (cls.__name__, name, docstring)) + return ''.join(out) + + +def setup(app): + app.add_directive('pygmentsdoc', PygmentsDoc) diff --git a/micromamba_root/Lib/site-packages/pygments/style.py b/micromamba_root/Lib/site-packages/pygments/style.py new file mode 100644 index 0000000000000000000000000000000000000000..acf25d6d8ef88ba955c165782df889a3ef32a721 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/style.py @@ -0,0 +1,203 @@ +""" + pygments.style + ~~~~~~~~~~~~~~ + + Basic style object. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.token import Token, STANDARD_TYPES + +# Default mapping of ansixxx to RGB colors. +_ansimap = { + # dark + 'ansiblack': '000000', + 'ansired': '7f0000', + 'ansigreen': '007f00', + 'ansiyellow': '7f7fe0', + 'ansiblue': '00007f', + 'ansimagenta': '7f007f', + 'ansicyan': '007f7f', + 'ansigray': 'e5e5e5', + # normal + 'ansibrightblack': '555555', + 'ansibrightred': 'ff0000', + 'ansibrightgreen': '00ff00', + 'ansibrightyellow': 'ffff00', + 'ansibrightblue': '0000ff', + 'ansibrightmagenta': 'ff00ff', + 'ansibrightcyan': '00ffff', + 'ansiwhite': 'ffffff', +} +# mapping of deprecated #ansixxx colors to new color names +_deprecated_ansicolors = { + # dark + '#ansiblack': 'ansiblack', + '#ansidarkred': 'ansired', + '#ansidarkgreen': 'ansigreen', + '#ansibrown': 'ansiyellow', + '#ansidarkblue': 'ansiblue', + '#ansipurple': 'ansimagenta', + '#ansiteal': 'ansicyan', + '#ansilightgray': 'ansigray', + # normal + '#ansidarkgray': 'ansibrightblack', + '#ansired': 'ansibrightred', + '#ansigreen': 'ansibrightgreen', + '#ansiyellow': 'ansibrightyellow', + '#ansiblue': 'ansibrightblue', + '#ansifuchsia': 'ansibrightmagenta', + '#ansiturquoise': 'ansibrightcyan', + '#ansiwhite': 'ansiwhite', +} +ansicolors = set(_ansimap) + + +class StyleMeta(type): + + def __new__(mcs, name, bases, dct): + obj = type.__new__(mcs, name, bases, dct) + for token in STANDARD_TYPES: + if token not in obj.styles: + obj.styles[token] = '' + + def colorformat(text): + if text in ansicolors: + return text + if text[0:1] == '#': + col = text[1:] + if len(col) == 6: + return col + elif len(col) == 3: + return col[0] * 2 + col[1] * 2 + col[2] * 2 + elif text == '': + return '' + elif text.startswith('var') or text.startswith('calc'): + return text + assert False, f"wrong color format {text!r}" + + _styles = obj._styles = {} + + for ttype in obj.styles: + for token in ttype.split(): + if token in _styles: + continue + ndef = _styles.get(token.parent, None) + styledefs = obj.styles.get(token, '').split() + if not ndef or token is None: + ndef = ['', 0, 0, 0, '', '', 0, 0, 0] + elif 'noinherit' in styledefs and token is not Token: + ndef = _styles[Token][:] + else: + ndef = ndef[:] + _styles[token] = ndef + for styledef in obj.styles.get(token, '').split(): + if styledef == 'noinherit': + pass + elif styledef == 'bold': + ndef[1] = 1 + elif styledef == 'nobold': + ndef[1] = 0 + elif styledef == 'italic': + ndef[2] = 1 + elif styledef == 'noitalic': + ndef[2] = 0 + elif styledef == 'underline': + ndef[3] = 1 + elif styledef == 'nounderline': + ndef[3] = 0 + elif styledef[:3] == 'bg:': + ndef[4] = colorformat(styledef[3:]) + elif styledef[:7] == 'border:': + ndef[5] = colorformat(styledef[7:]) + elif styledef == 'roman': + ndef[6] = 1 + elif styledef == 'sans': + ndef[7] = 1 + elif styledef == 'mono': + ndef[8] = 1 + else: + ndef[0] = colorformat(styledef) + + return obj + + def style_for_token(cls, token): + t = cls._styles[token] + ansicolor = bgansicolor = None + color = t[0] + if color in _deprecated_ansicolors: + color = _deprecated_ansicolors[color] + if color in ansicolors: + ansicolor = color + color = _ansimap[color] + bgcolor = t[4] + if bgcolor in _deprecated_ansicolors: + bgcolor = _deprecated_ansicolors[bgcolor] + if bgcolor in ansicolors: + bgansicolor = bgcolor + bgcolor = _ansimap[bgcolor] + + return { + 'color': color or None, + 'bold': bool(t[1]), + 'italic': bool(t[2]), + 'underline': bool(t[3]), + 'bgcolor': bgcolor or None, + 'border': t[5] or None, + 'roman': bool(t[6]) or None, + 'sans': bool(t[7]) or None, + 'mono': bool(t[8]) or None, + 'ansicolor': ansicolor, + 'bgansicolor': bgansicolor, + } + + def list_styles(cls): + return list(cls) + + def styles_token(cls, ttype): + return ttype in cls._styles + + def __iter__(cls): + for token in cls._styles: + yield token, cls.style_for_token(token) + + def __len__(cls): + return len(cls._styles) + + +class Style(metaclass=StyleMeta): + + #: overall background color (``None`` means transparent) + background_color = '#ffffff' + + #: highlight background color + highlight_color = '#ffffcc' + + #: line number font color + line_number_color = 'inherit' + + #: line number background color + line_number_background_color = 'transparent' + + #: special line number font color + line_number_special_color = '#000000' + + #: special line number background color + line_number_special_background_color = '#ffffc0' + + #: Style definitions for individual token types. + styles = {} + + #: user-friendly style name (used when selecting the style, so this + # should be all-lowercase, no spaces, hyphens) + name = 'unnamed' + + aliases = [] + + # Attribute for lexers defined within Pygments. If set + # to True, the style is not shown in the style gallery + # on the website. This is intended for language-specific + # styles. + web_style_gallery_exclude = False diff --git a/micromamba_root/Lib/site-packages/pygments/token.py b/micromamba_root/Lib/site-packages/pygments/token.py new file mode 100644 index 0000000000000000000000000000000000000000..1f756b71130e1c0036d881345ab06968c9f4c464 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/token.py @@ -0,0 +1,214 @@ +""" + pygments.token + ~~~~~~~~~~~~~~ + + Basic token types and the standard tokens. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + + +class _TokenType(tuple): + parent = None + + def split(self): + buf = [] + node = self + while node is not None: + buf.append(node) + node = node.parent + buf.reverse() + return buf + + def __init__(self, *args): + # no need to call super.__init__ + self.subtypes = set() + + def __contains__(self, val): + return self is val or ( + type(val) is self.__class__ and + val[:len(self)] == self + ) + + def __getattr__(self, val): + if not val or not val[0].isupper(): + return tuple.__getattribute__(self, val) + new = _TokenType(self + (val,)) + setattr(self, val, new) + self.subtypes.add(new) + new.parent = self + return new + + def __repr__(self): + return 'Token' + (self and '.' or '') + '.'.join(self) + + def __copy__(self): + # These instances are supposed to be singletons + return self + + def __deepcopy__(self, memo): + # These instances are supposed to be singletons + return self + + +Token = _TokenType() + +# Special token types +Text = Token.Text +Whitespace = Text.Whitespace +Escape = Token.Escape +Error = Token.Error +# Text that doesn't belong to this lexer (e.g. HTML in PHP) +Other = Token.Other + +# Common token types for source code +Keyword = Token.Keyword +Name = Token.Name +Literal = Token.Literal +String = Literal.String +Number = Literal.Number +Punctuation = Token.Punctuation +Operator = Token.Operator +Comment = Token.Comment + +# Generic types for non-source code +Generic = Token.Generic + +# String and some others are not direct children of Token. +# alias them: +Token.Token = Token +Token.String = String +Token.Number = Number + + +def is_token_subtype(ttype, other): + """ + Return True if ``ttype`` is a subtype of ``other``. + + exists for backwards compatibility. use ``ttype in other`` now. + """ + return ttype in other + + +def string_to_tokentype(s): + """ + Convert a string into a token type:: + + >>> string_to_token('String.Double') + Token.Literal.String.Double + >>> string_to_token('Token.Literal.Number') + Token.Literal.Number + >>> string_to_token('') + Token + + Tokens that are already tokens are returned unchanged: + + >>> string_to_token(String) + Token.Literal.String + """ + if isinstance(s, _TokenType): + return s + if not s: + return Token + node = Token + for item in s.split('.'): + node = getattr(node, item) + return node + + +# Map standard token types to short names, used in CSS class naming. +# If you add a new item, please be sure to run this file to perform +# a consistency check for duplicate values. +STANDARD_TYPES = { + Token: '', + + Text: '', + Whitespace: 'w', + Escape: 'esc', + Error: 'err', + Other: 'x', + + Keyword: 'k', + Keyword.Constant: 'kc', + Keyword.Declaration: 'kd', + Keyword.Namespace: 'kn', + Keyword.Pseudo: 'kp', + Keyword.Reserved: 'kr', + Keyword.Type: 'kt', + + Name: 'n', + Name.Attribute: 'na', + Name.Builtin: 'nb', + Name.Builtin.Pseudo: 'bp', + Name.Class: 'nc', + Name.Constant: 'no', + Name.Decorator: 'nd', + Name.Entity: 'ni', + Name.Exception: 'ne', + Name.Function: 'nf', + Name.Function.Magic: 'fm', + Name.Property: 'py', + Name.Label: 'nl', + Name.Namespace: 'nn', + Name.Other: 'nx', + Name.Tag: 'nt', + Name.Variable: 'nv', + Name.Variable.Class: 'vc', + Name.Variable.Global: 'vg', + Name.Variable.Instance: 'vi', + Name.Variable.Magic: 'vm', + + Literal: 'l', + Literal.Date: 'ld', + + String: 's', + String.Affix: 'sa', + String.Backtick: 'sb', + String.Char: 'sc', + String.Delimiter: 'dl', + String.Doc: 'sd', + String.Double: 's2', + String.Escape: 'se', + String.Heredoc: 'sh', + String.Interpol: 'si', + String.Other: 'sx', + String.Regex: 'sr', + String.Single: 's1', + String.Symbol: 'ss', + + Number: 'm', + Number.Bin: 'mb', + Number.Float: 'mf', + Number.Hex: 'mh', + Number.Integer: 'mi', + Number.Integer.Long: 'il', + Number.Oct: 'mo', + + Operator: 'o', + Operator.Word: 'ow', + + Punctuation: 'p', + Punctuation.Marker: 'pm', + + Comment: 'c', + Comment.Hashbang: 'ch', + Comment.Multiline: 'cm', + Comment.Preproc: 'cp', + Comment.PreprocFile: 'cpf', + Comment.Single: 'c1', + Comment.Special: 'cs', + + Generic: 'g', + Generic.Deleted: 'gd', + Generic.Emph: 'ge', + Generic.Error: 'gr', + Generic.Heading: 'gh', + Generic.Inserted: 'gi', + Generic.Output: 'go', + Generic.Prompt: 'gp', + Generic.Strong: 'gs', + Generic.Subheading: 'gu', + Generic.EmphStrong: 'ges', + Generic.Traceback: 'gt', +} diff --git a/micromamba_root/Lib/site-packages/pygments/unistring.py b/micromamba_root/Lib/site-packages/pygments/unistring.py new file mode 100644 index 0000000000000000000000000000000000000000..2a326dff8d7c3594b83b17b8a7705a6ddf2f13fa --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/unistring.py @@ -0,0 +1,153 @@ +""" + pygments.unistring + ~~~~~~~~~~~~~~~~~~ + + Strings of all Unicode characters of a certain category. + Used for matching in Unicode-aware languages. Run to regenerate. + + Inspired by chartypes_create.py from the MoinMoin project. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +Cc = '\x00-\x1f\x7f-\x9f' + +Cf = '\xad\u0600-\u0605\u061c\u06dd\u070f\u08e2\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\ufff9-\ufffb\U000110bd\U000110cd\U0001bca0-\U0001bca3\U0001d173-\U0001d17a\U000e0001\U000e0020-\U000e007f' + +Cn = '\u0378-\u0379\u0380-\u0383\u038b\u038d\u03a2\u0530\u0557-\u0558\u058b-\u058c\u0590\u05c8-\u05cf\u05eb-\u05ee\u05f5-\u05ff\u061d\u070e\u074b-\u074c\u07b2-\u07bf\u07fb-\u07fc\u082e-\u082f\u083f\u085c-\u085d\u085f\u086b-\u089f\u08b5\u08be-\u08d2\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09bb\u09c5-\u09c6\u09c9-\u09ca\u09cf-\u09d6\u09d8-\u09db\u09de\u09e4-\u09e5\u09ff-\u0a00\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a3b\u0a3d\u0a43-\u0a46\u0a49-\u0a4a\u0a4e-\u0a50\u0a52-\u0a58\u0a5d\u0a5f-\u0a65\u0a77-\u0a80\u0a84\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abb\u0ac6\u0aca\u0ace-\u0acf\u0ad1-\u0adf\u0ae4-\u0ae5\u0af2-\u0af8\u0b00\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34\u0b3a-\u0b3b\u0b45-\u0b46\u0b49-\u0b4a\u0b4e-\u0b55\u0b58-\u0b5b\u0b5e\u0b64-\u0b65\u0b78-\u0b81\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bba-\u0bbd\u0bc3-\u0bc5\u0bc9\u0bce-\u0bcf\u0bd1-\u0bd6\u0bd8-\u0be5\u0bfb-\u0bff\u0c0d\u0c11\u0c29\u0c3a-\u0c3c\u0c45\u0c49\u0c4e-\u0c54\u0c57\u0c5b-\u0c5f\u0c64-\u0c65\u0c70-\u0c77\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cbb\u0cc5\u0cc9\u0cce-\u0cd4\u0cd7-\u0cdd\u0cdf\u0ce4-\u0ce5\u0cf0\u0cf3-\u0cff\u0d04\u0d0d\u0d11\u0d45\u0d49\u0d50-\u0d53\u0d64-\u0d65\u0d80-\u0d81\u0d84\u0d97-\u0d99\u0db2\u0dbc\u0dbe-\u0dbf\u0dc7-\u0dc9\u0dcb-\u0dce\u0dd5\u0dd7\u0de0-\u0de5\u0df0-\u0df1\u0df5-\u0e00\u0e3b-\u0e3e\u0e5c-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eba\u0ebe-\u0ebf\u0ec5\u0ec7\u0ece-\u0ecf\u0eda-\u0edb\u0ee0-\u0eff\u0f48\u0f6d-\u0f70\u0f98\u0fbd\u0fcd\u0fdb-\u0fff\u10c6\u10c8-\u10cc\u10ce-\u10cf\u1249\u124e-\u124f\u1257\u1259\u125e-\u125f\u1289\u128e-\u128f\u12b1\u12b6-\u12b7\u12bf\u12c1\u12c6-\u12c7\u12d7\u1311\u1316-\u1317\u135b-\u135c\u137d-\u137f\u139a-\u139f\u13f6-\u13f7\u13fe-\u13ff\u169d-\u169f\u16f9-\u16ff\u170d\u1715-\u171f\u1737-\u173f\u1754-\u175f\u176d\u1771\u1774-\u177f\u17de-\u17df\u17ea-\u17ef\u17fa-\u17ff\u180f\u181a-\u181f\u1879-\u187f\u18ab-\u18af\u18f6-\u18ff\u191f\u192c-\u192f\u193c-\u193f\u1941-\u1943\u196e-\u196f\u1975-\u197f\u19ac-\u19af\u19ca-\u19cf\u19db-\u19dd\u1a1c-\u1a1d\u1a5f\u1a7d-\u1a7e\u1a8a-\u1a8f\u1a9a-\u1a9f\u1aae-\u1aaf\u1abf-\u1aff\u1b4c-\u1b4f\u1b7d-\u1b7f\u1bf4-\u1bfb\u1c38-\u1c3a\u1c4a-\u1c4c\u1c89-\u1c8f\u1cbb-\u1cbc\u1cc8-\u1ccf\u1cfa-\u1cff\u1dfa\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fc5\u1fd4-\u1fd5\u1fdc\u1ff0-\u1ff1\u1ff5\u1fff\u2065\u2072-\u2073\u208f\u209d-\u209f\u20c0-\u20cf\u20f1-\u20ff\u218c-\u218f\u2427-\u243f\u244b-\u245f\u2b74-\u2b75\u2b96-\u2b97\u2bc9\u2bff\u2c2f\u2c5f\u2cf4-\u2cf8\u2d26\u2d28-\u2d2c\u2d2e-\u2d2f\u2d68-\u2d6e\u2d71-\u2d7e\u2d97-\u2d9f\u2da7\u2daf\u2db7\u2dbf\u2dc7\u2dcf\u2dd7\u2ddf\u2e4f-\u2e7f\u2e9a\u2ef4-\u2eff\u2fd6-\u2fef\u2ffc-\u2fff\u3040\u3097-\u3098\u3100-\u3104\u3130\u318f\u31bb-\u31bf\u31e4-\u31ef\u321f\u32ff\u4db6-\u4dbf\u9ff0-\u9fff\ua48d-\ua48f\ua4c7-\ua4cf\ua62c-\ua63f\ua6f8-\ua6ff\ua7ba-\ua7f6\ua82c-\ua82f\ua83a-\ua83f\ua878-\ua87f\ua8c6-\ua8cd\ua8da-\ua8df\ua954-\ua95e\ua97d-\ua97f\ua9ce\ua9da-\ua9dd\ua9ff\uaa37-\uaa3f\uaa4e-\uaa4f\uaa5a-\uaa5b\uaac3-\uaada\uaaf7-\uab00\uab07-\uab08\uab0f-\uab10\uab17-\uab1f\uab27\uab2f\uab66-\uab6f\uabee-\uabef\uabfa-\uabff\ud7a4-\ud7af\ud7c7-\ud7ca\ud7fc-\ud7ff\ufa6e-\ufa6f\ufada-\ufaff\ufb07-\ufb12\ufb18-\ufb1c\ufb37\ufb3d\ufb3f\ufb42\ufb45\ufbc2-\ufbd2\ufd40-\ufd4f\ufd90-\ufd91\ufdc8-\ufdef\ufdfe-\ufdff\ufe1a-\ufe1f\ufe53\ufe67\ufe6c-\ufe6f\ufe75\ufefd-\ufefe\uff00\uffbf-\uffc1\uffc8-\uffc9\uffd0-\uffd1\uffd8-\uffd9\uffdd-\uffdf\uffe7\uffef-\ufff8\ufffe-\uffff\U0001000c\U00010027\U0001003b\U0001003e\U0001004e-\U0001004f\U0001005e-\U0001007f\U000100fb-\U000100ff\U00010103-\U00010106\U00010134-\U00010136\U0001018f\U0001019c-\U0001019f\U000101a1-\U000101cf\U000101fe-\U0001027f\U0001029d-\U0001029f\U000102d1-\U000102df\U000102fc-\U000102ff\U00010324-\U0001032c\U0001034b-\U0001034f\U0001037b-\U0001037f\U0001039e\U000103c4-\U000103c7\U000103d6-\U000103ff\U0001049e-\U0001049f\U000104aa-\U000104af\U000104d4-\U000104d7\U000104fc-\U000104ff\U00010528-\U0001052f\U00010564-\U0001056e\U00010570-\U000105ff\U00010737-\U0001073f\U00010756-\U0001075f\U00010768-\U000107ff\U00010806-\U00010807\U00010809\U00010836\U00010839-\U0001083b\U0001083d-\U0001083e\U00010856\U0001089f-\U000108a6\U000108b0-\U000108df\U000108f3\U000108f6-\U000108fa\U0001091c-\U0001091e\U0001093a-\U0001093e\U00010940-\U0001097f\U000109b8-\U000109bb\U000109d0-\U000109d1\U00010a04\U00010a07-\U00010a0b\U00010a14\U00010a18\U00010a36-\U00010a37\U00010a3b-\U00010a3e\U00010a49-\U00010a4f\U00010a59-\U00010a5f\U00010aa0-\U00010abf\U00010ae7-\U00010aea\U00010af7-\U00010aff\U00010b36-\U00010b38\U00010b56-\U00010b57\U00010b73-\U00010b77\U00010b92-\U00010b98\U00010b9d-\U00010ba8\U00010bb0-\U00010bff\U00010c49-\U00010c7f\U00010cb3-\U00010cbf\U00010cf3-\U00010cf9\U00010d28-\U00010d2f\U00010d3a-\U00010e5f\U00010e7f-\U00010eff\U00010f28-\U00010f2f\U00010f5a-\U00010fff\U0001104e-\U00011051\U00011070-\U0001107e\U000110c2-\U000110cc\U000110ce-\U000110cf\U000110e9-\U000110ef\U000110fa-\U000110ff\U00011135\U00011147-\U0001114f\U00011177-\U0001117f\U000111ce-\U000111cf\U000111e0\U000111f5-\U000111ff\U00011212\U0001123f-\U0001127f\U00011287\U00011289\U0001128e\U0001129e\U000112aa-\U000112af\U000112eb-\U000112ef\U000112fa-\U000112ff\U00011304\U0001130d-\U0001130e\U00011311-\U00011312\U00011329\U00011331\U00011334\U0001133a\U00011345-\U00011346\U00011349-\U0001134a\U0001134e-\U0001134f\U00011351-\U00011356\U00011358-\U0001135c\U00011364-\U00011365\U0001136d-\U0001136f\U00011375-\U000113ff\U0001145a\U0001145c\U0001145f-\U0001147f\U000114c8-\U000114cf\U000114da-\U0001157f\U000115b6-\U000115b7\U000115de-\U000115ff\U00011645-\U0001164f\U0001165a-\U0001165f\U0001166d-\U0001167f\U000116b8-\U000116bf\U000116ca-\U000116ff\U0001171b-\U0001171c\U0001172c-\U0001172f\U00011740-\U000117ff\U0001183c-\U0001189f\U000118f3-\U000118fe\U00011900-\U000119ff\U00011a48-\U00011a4f\U00011a84-\U00011a85\U00011aa3-\U00011abf\U00011af9-\U00011bff\U00011c09\U00011c37\U00011c46-\U00011c4f\U00011c6d-\U00011c6f\U00011c90-\U00011c91\U00011ca8\U00011cb7-\U00011cff\U00011d07\U00011d0a\U00011d37-\U00011d39\U00011d3b\U00011d3e\U00011d48-\U00011d4f\U00011d5a-\U00011d5f\U00011d66\U00011d69\U00011d8f\U00011d92\U00011d99-\U00011d9f\U00011daa-\U00011edf\U00011ef9-\U00011fff\U0001239a-\U000123ff\U0001246f\U00012475-\U0001247f\U00012544-\U00012fff\U0001342f-\U000143ff\U00014647-\U000167ff\U00016a39-\U00016a3f\U00016a5f\U00016a6a-\U00016a6d\U00016a70-\U00016acf\U00016aee-\U00016aef\U00016af6-\U00016aff\U00016b46-\U00016b4f\U00016b5a\U00016b62\U00016b78-\U00016b7c\U00016b90-\U00016e3f\U00016e9b-\U00016eff\U00016f45-\U00016f4f\U00016f7f-\U00016f8e\U00016fa0-\U00016fdf\U00016fe2-\U00016fff\U000187f2-\U000187ff\U00018af3-\U0001afff\U0001b11f-\U0001b16f\U0001b2fc-\U0001bbff\U0001bc6b-\U0001bc6f\U0001bc7d-\U0001bc7f\U0001bc89-\U0001bc8f\U0001bc9a-\U0001bc9b\U0001bca4-\U0001cfff\U0001d0f6-\U0001d0ff\U0001d127-\U0001d128\U0001d1e9-\U0001d1ff\U0001d246-\U0001d2df\U0001d2f4-\U0001d2ff\U0001d357-\U0001d35f\U0001d379-\U0001d3ff\U0001d455\U0001d49d\U0001d4a0-\U0001d4a1\U0001d4a3-\U0001d4a4\U0001d4a7-\U0001d4a8\U0001d4ad\U0001d4ba\U0001d4bc\U0001d4c4\U0001d506\U0001d50b-\U0001d50c\U0001d515\U0001d51d\U0001d53a\U0001d53f\U0001d545\U0001d547-\U0001d549\U0001d551\U0001d6a6-\U0001d6a7\U0001d7cc-\U0001d7cd\U0001da8c-\U0001da9a\U0001daa0\U0001dab0-\U0001dfff\U0001e007\U0001e019-\U0001e01a\U0001e022\U0001e025\U0001e02b-\U0001e7ff\U0001e8c5-\U0001e8c6\U0001e8d7-\U0001e8ff\U0001e94b-\U0001e94f\U0001e95a-\U0001e95d\U0001e960-\U0001ec70\U0001ecb5-\U0001edff\U0001ee04\U0001ee20\U0001ee23\U0001ee25-\U0001ee26\U0001ee28\U0001ee33\U0001ee38\U0001ee3a\U0001ee3c-\U0001ee41\U0001ee43-\U0001ee46\U0001ee48\U0001ee4a\U0001ee4c\U0001ee50\U0001ee53\U0001ee55-\U0001ee56\U0001ee58\U0001ee5a\U0001ee5c\U0001ee5e\U0001ee60\U0001ee63\U0001ee65-\U0001ee66\U0001ee6b\U0001ee73\U0001ee78\U0001ee7d\U0001ee7f\U0001ee8a\U0001ee9c-\U0001eea0\U0001eea4\U0001eeaa\U0001eebc-\U0001eeef\U0001eef2-\U0001efff\U0001f02c-\U0001f02f\U0001f094-\U0001f09f\U0001f0af-\U0001f0b0\U0001f0c0\U0001f0d0\U0001f0f6-\U0001f0ff\U0001f10d-\U0001f10f\U0001f16c-\U0001f16f\U0001f1ad-\U0001f1e5\U0001f203-\U0001f20f\U0001f23c-\U0001f23f\U0001f249-\U0001f24f\U0001f252-\U0001f25f\U0001f266-\U0001f2ff\U0001f6d5-\U0001f6df\U0001f6ed-\U0001f6ef\U0001f6fa-\U0001f6ff\U0001f774-\U0001f77f\U0001f7d9-\U0001f7ff\U0001f80c-\U0001f80f\U0001f848-\U0001f84f\U0001f85a-\U0001f85f\U0001f888-\U0001f88f\U0001f8ae-\U0001f8ff\U0001f90c-\U0001f90f\U0001f93f\U0001f971-\U0001f972\U0001f977-\U0001f979\U0001f97b\U0001f9a3-\U0001f9af\U0001f9ba-\U0001f9bf\U0001f9c3-\U0001f9cf\U0001fa00-\U0001fa5f\U0001fa6e-\U0001ffff\U0002a6d7-\U0002a6ff\U0002b735-\U0002b73f\U0002b81e-\U0002b81f\U0002cea2-\U0002ceaf\U0002ebe1-\U0002f7ff\U0002fa1e-\U000e0000\U000e0002-\U000e001f\U000e0080-\U000e00ff\U000e01f0-\U000effff\U000ffffe-\U000fffff\U0010fffe-\U0010ffff' + +Co = '\ue000-\uf8ff\U000f0000-\U000ffffd\U00100000-\U0010fffd' + +Cs = '\ud800-\udbff\\\udc00\udc01-\udfff' + +Ll = 'a-z\xb5\xdf-\xf6\xf8-\xff\u0101\u0103\u0105\u0107\u0109\u010b\u010d\u010f\u0111\u0113\u0115\u0117\u0119\u011b\u011d\u011f\u0121\u0123\u0125\u0127\u0129\u012b\u012d\u012f\u0131\u0133\u0135\u0137-\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148-\u0149\u014b\u014d\u014f\u0151\u0153\u0155\u0157\u0159\u015b\u015d\u015f\u0161\u0163\u0165\u0167\u0169\u016b\u016d\u016f\u0171\u0173\u0175\u0177\u017a\u017c\u017e-\u0180\u0183\u0185\u0188\u018c-\u018d\u0192\u0195\u0199-\u019b\u019e\u01a1\u01a3\u01a5\u01a8\u01aa-\u01ab\u01ad\u01b0\u01b4\u01b6\u01b9-\u01ba\u01bd-\u01bf\u01c6\u01c9\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da\u01dc-\u01dd\u01df\u01e1\u01e3\u01e5\u01e7\u01e9\u01eb\u01ed\u01ef-\u01f0\u01f3\u01f5\u01f9\u01fb\u01fd\u01ff\u0201\u0203\u0205\u0207\u0209\u020b\u020d\u020f\u0211\u0213\u0215\u0217\u0219\u021b\u021d\u021f\u0221\u0223\u0225\u0227\u0229\u022b\u022d\u022f\u0231\u0233-\u0239\u023c\u023f-\u0240\u0242\u0247\u0249\u024b\u024d\u024f-\u0293\u0295-\u02af\u0371\u0373\u0377\u037b-\u037d\u0390\u03ac-\u03ce\u03d0-\u03d1\u03d5-\u03d7\u03d9\u03db\u03dd\u03df\u03e1\u03e3\u03e5\u03e7\u03e9\u03eb\u03ed\u03ef-\u03f3\u03f5\u03f8\u03fb-\u03fc\u0430-\u045f\u0461\u0463\u0465\u0467\u0469\u046b\u046d\u046f\u0471\u0473\u0475\u0477\u0479\u047b\u047d\u047f\u0481\u048b\u048d\u048f\u0491\u0493\u0495\u0497\u0499\u049b\u049d\u049f\u04a1\u04a3\u04a5\u04a7\u04a9\u04ab\u04ad\u04af\u04b1\u04b3\u04b5\u04b7\u04b9\u04bb\u04bd\u04bf\u04c2\u04c4\u04c6\u04c8\u04ca\u04cc\u04ce-\u04cf\u04d1\u04d3\u04d5\u04d7\u04d9\u04db\u04dd\u04df\u04e1\u04e3\u04e5\u04e7\u04e9\u04eb\u04ed\u04ef\u04f1\u04f3\u04f5\u04f7\u04f9\u04fb\u04fd\u04ff\u0501\u0503\u0505\u0507\u0509\u050b\u050d\u050f\u0511\u0513\u0515\u0517\u0519\u051b\u051d\u051f\u0521\u0523\u0525\u0527\u0529\u052b\u052d\u052f\u0560-\u0588\u10d0-\u10fa\u10fd-\u10ff\u13f8-\u13fd\u1c80-\u1c88\u1d00-\u1d2b\u1d6b-\u1d77\u1d79-\u1d9a\u1e01\u1e03\u1e05\u1e07\u1e09\u1e0b\u1e0d\u1e0f\u1e11\u1e13\u1e15\u1e17\u1e19\u1e1b\u1e1d\u1e1f\u1e21\u1e23\u1e25\u1e27\u1e29\u1e2b\u1e2d\u1e2f\u1e31\u1e33\u1e35\u1e37\u1e39\u1e3b\u1e3d\u1e3f\u1e41\u1e43\u1e45\u1e47\u1e49\u1e4b\u1e4d\u1e4f\u1e51\u1e53\u1e55\u1e57\u1e59\u1e5b\u1e5d\u1e5f\u1e61\u1e63\u1e65\u1e67\u1e69\u1e6b\u1e6d\u1e6f\u1e71\u1e73\u1e75\u1e77\u1e79\u1e7b\u1e7d\u1e7f\u1e81\u1e83\u1e85\u1e87\u1e89\u1e8b\u1e8d\u1e8f\u1e91\u1e93\u1e95-\u1e9d\u1e9f\u1ea1\u1ea3\u1ea5\u1ea7\u1ea9\u1eab\u1ead\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1eb9\u1ebb\u1ebd\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ec9\u1ecb\u1ecd\u1ecf\u1ed1\u1ed3\u1ed5\u1ed7\u1ed9\u1edb\u1edd\u1edf\u1ee1\u1ee3\u1ee5\u1ee7\u1ee9\u1eeb\u1eed\u1eef\u1ef1\u1ef3\u1ef5\u1ef7\u1ef9\u1efb\u1efd\u1eff-\u1f07\u1f10-\u1f15\u1f20-\u1f27\u1f30-\u1f37\u1f40-\u1f45\u1f50-\u1f57\u1f60-\u1f67\u1f70-\u1f7d\u1f80-\u1f87\u1f90-\u1f97\u1fa0-\u1fa7\u1fb0-\u1fb4\u1fb6-\u1fb7\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fc7\u1fd0-\u1fd3\u1fd6-\u1fd7\u1fe0-\u1fe7\u1ff2-\u1ff4\u1ff6-\u1ff7\u210a\u210e-\u210f\u2113\u212f\u2134\u2139\u213c-\u213d\u2146-\u2149\u214e\u2184\u2c30-\u2c5e\u2c61\u2c65-\u2c66\u2c68\u2c6a\u2c6c\u2c71\u2c73-\u2c74\u2c76-\u2c7b\u2c81\u2c83\u2c85\u2c87\u2c89\u2c8b\u2c8d\u2c8f\u2c91\u2c93\u2c95\u2c97\u2c99\u2c9b\u2c9d\u2c9f\u2ca1\u2ca3\u2ca5\u2ca7\u2ca9\u2cab\u2cad\u2caf\u2cb1\u2cb3\u2cb5\u2cb7\u2cb9\u2cbb\u2cbd\u2cbf\u2cc1\u2cc3\u2cc5\u2cc7\u2cc9\u2ccb\u2ccd\u2ccf\u2cd1\u2cd3\u2cd5\u2cd7\u2cd9\u2cdb\u2cdd\u2cdf\u2ce1\u2ce3-\u2ce4\u2cec\u2cee\u2cf3\u2d00-\u2d25\u2d27\u2d2d\ua641\ua643\ua645\ua647\ua649\ua64b\ua64d\ua64f\ua651\ua653\ua655\ua657\ua659\ua65b\ua65d\ua65f\ua661\ua663\ua665\ua667\ua669\ua66b\ua66d\ua681\ua683\ua685\ua687\ua689\ua68b\ua68d\ua68f\ua691\ua693\ua695\ua697\ua699\ua69b\ua723\ua725\ua727\ua729\ua72b\ua72d\ua72f-\ua731\ua733\ua735\ua737\ua739\ua73b\ua73d\ua73f\ua741\ua743\ua745\ua747\ua749\ua74b\ua74d\ua74f\ua751\ua753\ua755\ua757\ua759\ua75b\ua75d\ua75f\ua761\ua763\ua765\ua767\ua769\ua76b\ua76d\ua76f\ua771-\ua778\ua77a\ua77c\ua77f\ua781\ua783\ua785\ua787\ua78c\ua78e\ua791\ua793-\ua795\ua797\ua799\ua79b\ua79d\ua79f\ua7a1\ua7a3\ua7a5\ua7a7\ua7a9\ua7af\ua7b5\ua7b7\ua7b9\ua7fa\uab30-\uab5a\uab60-\uab65\uab70-\uabbf\ufb00-\ufb06\ufb13-\ufb17\uff41-\uff5a\U00010428-\U0001044f\U000104d8-\U000104fb\U00010cc0-\U00010cf2\U000118c0-\U000118df\U00016e60-\U00016e7f\U0001d41a-\U0001d433\U0001d44e-\U0001d454\U0001d456-\U0001d467\U0001d482-\U0001d49b\U0001d4b6-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d4cf\U0001d4ea-\U0001d503\U0001d51e-\U0001d537\U0001d552-\U0001d56b\U0001d586-\U0001d59f\U0001d5ba-\U0001d5d3\U0001d5ee-\U0001d607\U0001d622-\U0001d63b\U0001d656-\U0001d66f\U0001d68a-\U0001d6a5\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6e1\U0001d6fc-\U0001d714\U0001d716-\U0001d71b\U0001d736-\U0001d74e\U0001d750-\U0001d755\U0001d770-\U0001d788\U0001d78a-\U0001d78f\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7c9\U0001d7cb\U0001e922-\U0001e943' + +Lm = '\u02b0-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0374\u037a\u0559\u0640\u06e5-\u06e6\u07f4-\u07f5\u07fa\u081a\u0824\u0828\u0971\u0e46\u0ec6\u10fc\u17d7\u1843\u1aa7\u1c78-\u1c7d\u1d2c-\u1d6a\u1d78\u1d9b-\u1dbf\u2071\u207f\u2090-\u209c\u2c7c-\u2c7d\u2d6f\u2e2f\u3005\u3031-\u3035\u303b\u309d-\u309e\u30fc-\u30fe\ua015\ua4f8-\ua4fd\ua60c\ua67f\ua69c-\ua69d\ua717-\ua71f\ua770\ua788\ua7f8-\ua7f9\ua9cf\ua9e6\uaa70\uaadd\uaaf3-\uaaf4\uab5c-\uab5f\uff70\uff9e-\uff9f\U00016b40-\U00016b43\U00016f93-\U00016f9f\U00016fe0-\U00016fe1' + +Lo = '\xaa\xba\u01bb\u01c0-\u01c3\u0294\u05d0-\u05ea\u05ef-\u05f2\u0620-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u0800-\u0815\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16f1-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17dc\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5-\u1cf6\u2135-\u2138\u2d30-\u2d67\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3006\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua014\ua016-\ua48c\ua4d0-\ua4f7\ua500-\ua60b\ua610-\ua61f\ua62a-\ua62b\ua66e\ua6a0-\ua6e5\ua78f\ua7f7\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9e0-\ua9e4\ua9e7-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa6f\uaa71-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadc\uaae0-\uaaea\uaaf2\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff66-\uff6f\uff71-\uff9d\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010280-\U0001029c\U000102a0-\U000102d0\U00010300-\U0001031f\U0001032d-\U00010340\U00010342-\U00010349\U00010350-\U00010375\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U00010450-\U0001049d\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00\U00010a10-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae4\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010d00-\U00010d23\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f45\U00011003-\U00011037\U00011083-\U000110af\U000110d0-\U000110e8\U00011103-\U00011126\U00011144\U00011150-\U00011172\U00011176\U00011183-\U000111b2\U000111c1-\U000111c4\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U0001122b\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112de\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133d\U00011350\U0001135d-\U00011361\U00011400-\U00011434\U00011447-\U0001144a\U00011480-\U000114af\U000114c4-\U000114c5\U000114c7\U00011580-\U000115ae\U000115d8-\U000115db\U00011600-\U0001162f\U00011644\U00011680-\U000116aa\U00011700-\U0001171a\U00011800-\U0001182b\U000118ff\U00011a00\U00011a0b-\U00011a32\U00011a3a\U00011a50\U00011a5c-\U00011a83\U00011a86-\U00011a89\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c2e\U00011c40\U00011c72-\U00011c8f\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d30\U00011d46\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d89\U00011d98\U00011ee0-\U00011ef2\U00012000-\U00012399\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016ad0-\U00016aed\U00016b00-\U00016b2f\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016f00-\U00016f44\U00016f50\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001e800-\U0001e8c4\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d' + +Lt = '\u01c5\u01c8\u01cb\u01f2\u1f88-\u1f8f\u1f98-\u1f9f\u1fa8-\u1faf\u1fbc\u1fcc\u1ffc' + +Lu = 'A-Z\xc0-\xd6\xd8-\xde\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u037f\u0386\u0388-\u038a\u038c\u038e-\u038f\u0391-\u03a1\u03a3-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0524\u0526\u0528\u052a\u052c\u052e\u0531-\u0556\u10a0-\u10c5\u10c7\u10cd\u13a0-\u13f5\u1c90-\u1cba\u1cbd-\u1cbf\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59\u1f5b\u1f5d\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c70\u2c72\u2c75\u2c7e-\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\u2ceb\u2ced\u2cf2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua660\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua698\ua69a\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\ua78d\ua790\ua792\ua796\ua798\ua79a\ua79c\ua79e\ua7a0\ua7a2\ua7a4\ua7a6\ua7a8\ua7aa-\ua7ae\ua7b0-\ua7b4\ua7b6\ua7b8\uff21-\uff3a\U00010400-\U00010427\U000104b0-\U000104d3\U00010c80-\U00010cb2\U000118a0-\U000118bf\U00016e40-\U00016e5f\U0001d400-\U0001d419\U0001d434-\U0001d44d\U0001d468-\U0001d481\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b5\U0001d4d0-\U0001d4e9\U0001d504-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d538-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d56c-\U0001d585\U0001d5a0-\U0001d5b9\U0001d5d4-\U0001d5ed\U0001d608-\U0001d621\U0001d63c-\U0001d655\U0001d670-\U0001d689\U0001d6a8-\U0001d6c0\U0001d6e2-\U0001d6fa\U0001d71c-\U0001d734\U0001d756-\U0001d76e\U0001d790-\U0001d7a8\U0001d7ca\U0001e900-\U0001e921' + +Mc = '\u0903\u093b\u093e-\u0940\u0949-\u094c\u094e-\u094f\u0982-\u0983\u09be-\u09c0\u09c7-\u09c8\u09cb-\u09cc\u09d7\u0a03\u0a3e-\u0a40\u0a83\u0abe-\u0ac0\u0ac9\u0acb-\u0acc\u0b02-\u0b03\u0b3e\u0b40\u0b47-\u0b48\u0b4b-\u0b4c\u0b57\u0bbe-\u0bbf\u0bc1-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01-\u0c03\u0c41-\u0c44\u0c82-\u0c83\u0cbe\u0cc0-\u0cc4\u0cc7-\u0cc8\u0cca-\u0ccb\u0cd5-\u0cd6\u0d02-\u0d03\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c\u0d57\u0d82-\u0d83\u0dcf-\u0dd1\u0dd8-\u0ddf\u0df2-\u0df3\u0f3e-\u0f3f\u0f7f\u102b-\u102c\u1031\u1038\u103b-\u103c\u1056-\u1057\u1062-\u1064\u1067-\u106d\u1083-\u1084\u1087-\u108c\u108f\u109a-\u109c\u17b6\u17be-\u17c5\u17c7-\u17c8\u1923-\u1926\u1929-\u192b\u1930-\u1931\u1933-\u1938\u1a19-\u1a1a\u1a55\u1a57\u1a61\u1a63-\u1a64\u1a6d-\u1a72\u1b04\u1b35\u1b3b\u1b3d-\u1b41\u1b43-\u1b44\u1b82\u1ba1\u1ba6-\u1ba7\u1baa\u1be7\u1bea-\u1bec\u1bee\u1bf2-\u1bf3\u1c24-\u1c2b\u1c34-\u1c35\u1ce1\u1cf2-\u1cf3\u1cf7\u302e-\u302f\ua823-\ua824\ua827\ua880-\ua881\ua8b4-\ua8c3\ua952-\ua953\ua983\ua9b4-\ua9b5\ua9ba-\ua9bb\ua9bd-\ua9c0\uaa2f-\uaa30\uaa33-\uaa34\uaa4d\uaa7b\uaa7d\uaaeb\uaaee-\uaaef\uaaf5\uabe3-\uabe4\uabe6-\uabe7\uabe9-\uabea\uabec\U00011000\U00011002\U00011082\U000110b0-\U000110b2\U000110b7-\U000110b8\U0001112c\U00011145-\U00011146\U00011182\U000111b3-\U000111b5\U000111bf-\U000111c0\U0001122c-\U0001122e\U00011232-\U00011233\U00011235\U000112e0-\U000112e2\U00011302-\U00011303\U0001133e-\U0001133f\U00011341-\U00011344\U00011347-\U00011348\U0001134b-\U0001134d\U00011357\U00011362-\U00011363\U00011435-\U00011437\U00011440-\U00011441\U00011445\U000114b0-\U000114b2\U000114b9\U000114bb-\U000114be\U000114c1\U000115af-\U000115b1\U000115b8-\U000115bb\U000115be\U00011630-\U00011632\U0001163b-\U0001163c\U0001163e\U000116ac\U000116ae-\U000116af\U000116b6\U00011720-\U00011721\U00011726\U0001182c-\U0001182e\U00011838\U00011a39\U00011a57-\U00011a58\U00011a97\U00011c2f\U00011c3e\U00011ca9\U00011cb1\U00011cb4\U00011d8a-\U00011d8e\U00011d93-\U00011d94\U00011d96\U00011ef5-\U00011ef6\U00016f51-\U00016f7e\U0001d165-\U0001d166\U0001d16d-\U0001d172' + +Me = '\u0488-\u0489\u1abe\u20dd-\u20e0\u20e2-\u20e4\ua670-\ua672' + +Mn = '\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09c1-\u09c4\u09cd\u09e2-\u09e3\u09fe\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0afa-\u0aff\u0b01\u0b3c\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b62-\u0b63\u0b82\u0bc0\u0bcd\u0c00\u0c04\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc6\u0ccc-\u0ccd\u0ce2-\u0ce3\u0d00-\u0d01\u0d3b-\u0d3c\u0d41-\u0d44\u0d4d\u0d62-\u0d63\u0dca\u0dd2-\u0dd4\u0dd6\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u1885-\u1886\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u3099-\u309a\ua66f\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4-\ua8c5\ua8e0-\ua8f1\ua8ff\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\U000101fd\U000102e0\U00010376-\U0001037a\U00010a01-\U00010a03\U00010a05-\U00010a06\U00010a0c-\U00010a0f\U00010a38-\U00010a3a\U00010a3f\U00010ae5-\U00010ae6\U00010d24-\U00010d27\U00010f46-\U00010f50\U00011001\U00011038-\U00011046\U0001107f-\U00011081\U000110b3-\U000110b6\U000110b9-\U000110ba\U00011100-\U00011102\U00011127-\U0001112b\U0001112d-\U00011134\U00011173\U00011180-\U00011181\U000111b6-\U000111be\U000111c9-\U000111cc\U0001122f-\U00011231\U00011234\U00011236-\U00011237\U0001123e\U000112df\U000112e3-\U000112ea\U00011300-\U00011301\U0001133b-\U0001133c\U00011340\U00011366-\U0001136c\U00011370-\U00011374\U00011438-\U0001143f\U00011442-\U00011444\U00011446\U0001145e\U000114b3-\U000114b8\U000114ba\U000114bf-\U000114c0\U000114c2-\U000114c3\U000115b2-\U000115b5\U000115bc-\U000115bd\U000115bf-\U000115c0\U000115dc-\U000115dd\U00011633-\U0001163a\U0001163d\U0001163f-\U00011640\U000116ab\U000116ad\U000116b0-\U000116b5\U000116b7\U0001171d-\U0001171f\U00011722-\U00011725\U00011727-\U0001172b\U0001182f-\U00011837\U00011839-\U0001183a\U00011a01-\U00011a0a\U00011a33-\U00011a38\U00011a3b-\U00011a3e\U00011a47\U00011a51-\U00011a56\U00011a59-\U00011a5b\U00011a8a-\U00011a96\U00011a98-\U00011a99\U00011c30-\U00011c36\U00011c38-\U00011c3d\U00011c3f\U00011c92-\U00011ca7\U00011caa-\U00011cb0\U00011cb2-\U00011cb3\U00011cb5-\U00011cb6\U00011d31-\U00011d36\U00011d3a\U00011d3c-\U00011d3d\U00011d3f-\U00011d45\U00011d47\U00011d90-\U00011d91\U00011d95\U00011d97\U00011ef3-\U00011ef4\U00016af0-\U00016af4\U00016b30-\U00016b36\U00016f8f-\U00016f92\U0001bc9d-\U0001bc9e\U0001d167-\U0001d169\U0001d17b-\U0001d182\U0001d185-\U0001d18b\U0001d1aa-\U0001d1ad\U0001d242-\U0001d244\U0001da00-\U0001da36\U0001da3b-\U0001da6c\U0001da75\U0001da84\U0001da9b-\U0001da9f\U0001daa1-\U0001daaf\U0001e000-\U0001e006\U0001e008-\U0001e018\U0001e01b-\U0001e021\U0001e023-\U0001e024\U0001e026-\U0001e02a\U0001e8d0-\U0001e8d6\U0001e944-\U0001e94a\U000e0100-\U000e01ef' + +Nd = '0-9\u0660-\u0669\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0de6-\u0def\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\ua9f0-\ua9f9\uaa50-\uaa59\uabf0-\uabf9\uff10-\uff19\U000104a0-\U000104a9\U00010d30-\U00010d39\U00011066-\U0001106f\U000110f0-\U000110f9\U00011136-\U0001113f\U000111d0-\U000111d9\U000112f0-\U000112f9\U00011450-\U00011459\U000114d0-\U000114d9\U00011650-\U00011659\U000116c0-\U000116c9\U00011730-\U00011739\U000118e0-\U000118e9\U00011c50-\U00011c59\U00011d50-\U00011d59\U00011da0-\U00011da9\U00016a60-\U00016a69\U00016b50-\U00016b59\U0001d7ce-\U0001d7ff\U0001e950-\U0001e959' + +Nl = '\u16ee-\u16f0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303a\ua6e6-\ua6ef\U00010140-\U00010174\U00010341\U0001034a\U000103d1-\U000103d5\U00012400-\U0001246e' + +No = '\xb2-\xb3\xb9\xbc-\xbe\u09f4-\u09f9\u0b72-\u0b77\u0bf0-\u0bf2\u0c78-\u0c7e\u0d58-\u0d5e\u0d70-\u0d78\u0f2a-\u0f33\u1369-\u137c\u17f0-\u17f9\u19da\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215f\u2189\u2460-\u249b\u24ea-\u24ff\u2776-\u2793\u2cfd\u3192-\u3195\u3220-\u3229\u3248-\u324f\u3251-\u325f\u3280-\u3289\u32b1-\u32bf\ua830-\ua835\U00010107-\U00010133\U00010175-\U00010178\U0001018a-\U0001018b\U000102e1-\U000102fb\U00010320-\U00010323\U00010858-\U0001085f\U00010879-\U0001087f\U000108a7-\U000108af\U000108fb-\U000108ff\U00010916-\U0001091b\U000109bc-\U000109bd\U000109c0-\U000109cf\U000109d2-\U000109ff\U00010a40-\U00010a48\U00010a7d-\U00010a7e\U00010a9d-\U00010a9f\U00010aeb-\U00010aef\U00010b58-\U00010b5f\U00010b78-\U00010b7f\U00010ba9-\U00010baf\U00010cfa-\U00010cff\U00010e60-\U00010e7e\U00010f1d-\U00010f26\U00010f51-\U00010f54\U00011052-\U00011065\U000111e1-\U000111f4\U0001173a-\U0001173b\U000118ea-\U000118f2\U00011c5a-\U00011c6c\U00016b5b-\U00016b61\U00016e80-\U00016e96\U0001d2e0-\U0001d2f3\U0001d360-\U0001d378\U0001e8c7-\U0001e8cf\U0001ec71-\U0001ecab\U0001ecad-\U0001ecaf\U0001ecb1-\U0001ecb4\U0001f100-\U0001f10c' + +Pc = '_\u203f-\u2040\u2054\ufe33-\ufe34\ufe4d-\ufe4f\uff3f' + +Pd = '\\-\u058a\u05be\u1400\u1806\u2010-\u2015\u2e17\u2e1a\u2e3a-\u2e3b\u2e40\u301c\u3030\u30a0\ufe31-\ufe32\ufe58\ufe63\uff0d' + +Pe = ')\\]}\u0f3b\u0f3d\u169c\u2046\u207e\u208e\u2309\u230b\u232a\u2769\u276b\u276d\u276f\u2771\u2773\u2775\u27c6\u27e7\u27e9\u27eb\u27ed\u27ef\u2984\u2986\u2988\u298a\u298c\u298e\u2990\u2992\u2994\u2996\u2998\u29d9\u29db\u29fd\u2e23\u2e25\u2e27\u2e29\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\u301e-\u301f\ufd3e\ufe18\ufe36\ufe38\ufe3a\ufe3c\ufe3e\ufe40\ufe42\ufe44\ufe48\ufe5a\ufe5c\ufe5e\uff09\uff3d\uff5d\uff60\uff63' + +Pf = '\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d\u2e1d\u2e21' + +Pi = '\xab\u2018\u201b-\u201c\u201f\u2039\u2e02\u2e04\u2e09\u2e0c\u2e1c\u2e20' + +Po = "!-#%-'*,.-/:-;?-@\\\\\xa1\xa7\xb6-\xb7\xbf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964-\u0965\u0970\u09fd\u0a76\u0af0\u0c84\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9-\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d-\u166e\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944-\u1945\u1a1e-\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e-\u1c7f\u1cc0-\u1cc7\u1cd3\u2016-\u2017\u2020-\u2027\u2030-\u2038\u203b-\u203e\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205e\u2cf9-\u2cfc\u2cfe-\u2cff\u2d70\u2e00-\u2e01\u2e06-\u2e08\u2e0b\u2e0e-\u2e16\u2e18-\u2e19\u2e1b\u2e1e-\u2e1f\u2e2a-\u2e2e\u2e30-\u2e39\u2e3c-\u2e3f\u2e41\u2e43-\u2e4e\u3001-\u3003\u303d\u30fb\ua4fe-\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce-\ua8cf\ua8f8-\ua8fa\ua8fc\ua92e-\ua92f\ua95f\ua9c1-\ua9cd\ua9de-\ua9df\uaa5c-\uaa5f\uaade-\uaadf\uaaf0-\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45-\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3c\uff61\uff64-\uff65\U00010100-\U00010102\U0001039f\U000103d0\U0001056f\U00010857\U0001091f\U0001093f\U00010a50-\U00010a58\U00010a7f\U00010af0-\U00010af6\U00010b39-\U00010b3f\U00010b99-\U00010b9c\U00010f55-\U00010f59\U00011047-\U0001104d\U000110bb-\U000110bc\U000110be-\U000110c1\U00011140-\U00011143\U00011174-\U00011175\U000111c5-\U000111c8\U000111cd\U000111db\U000111dd-\U000111df\U00011238-\U0001123d\U000112a9\U0001144b-\U0001144f\U0001145b\U0001145d\U000114c6\U000115c1-\U000115d7\U00011641-\U00011643\U00011660-\U0001166c\U0001173c-\U0001173e\U0001183b\U00011a3f-\U00011a46\U00011a9a-\U00011a9c\U00011a9e-\U00011aa2\U00011c41-\U00011c45\U00011c70-\U00011c71\U00011ef7-\U00011ef8\U00012470-\U00012474\U00016a6e-\U00016a6f\U00016af5\U00016b37-\U00016b3b\U00016b44\U00016e97-\U00016e9a\U0001bc9f\U0001da87-\U0001da8b\U0001e95e-\U0001e95f" + +Ps = '(\\[{\u0f3a\u0f3c\u169b\u201a\u201e\u2045\u207d\u208d\u2308\u230a\u2329\u2768\u276a\u276c\u276e\u2770\u2772\u2774\u27c5\u27e6\u27e8\u27ea\u27ec\u27ee\u2983\u2985\u2987\u2989\u298b\u298d\u298f\u2991\u2993\u2995\u2997\u29d8\u29da\u29fc\u2e22\u2e24\u2e26\u2e28\u2e42\u3008\u300a\u300c\u300e\u3010\u3014\u3016\u3018\u301a\u301d\ufd3f\ufe17\ufe35\ufe37\ufe39\ufe3b\ufe3d\ufe3f\ufe41\ufe43\ufe47\ufe59\ufe5b\ufe5d\uff08\uff3b\uff5b\uff5f\uff62' + +Sc = '$\xa2-\xa5\u058f\u060b\u07fe-\u07ff\u09f2-\u09f3\u09fb\u0af1\u0bf9\u0e3f\u17db\u20a0-\u20bf\ua838\ufdfc\ufe69\uff04\uffe0-\uffe1\uffe5-\uffe6\U0001ecb0' + +Sk = '\\^`\xa8\xaf\xb4\xb8\u02c2-\u02c5\u02d2-\u02df\u02e5-\u02eb\u02ed\u02ef-\u02ff\u0375\u0384-\u0385\u1fbd\u1fbf-\u1fc1\u1fcd-\u1fcf\u1fdd-\u1fdf\u1fed-\u1fef\u1ffd-\u1ffe\u309b-\u309c\ua700-\ua716\ua720-\ua721\ua789-\ua78a\uab5b\ufbb2-\ufbc1\uff3e\uff40\uffe3\U0001f3fb-\U0001f3ff' + +Sm = '+<->|~\xac\xb1\xd7\xf7\u03f6\u0606-\u0608\u2044\u2052\u207a-\u207c\u208a-\u208c\u2118\u2140-\u2144\u214b\u2190-\u2194\u219a-\u219b\u21a0\u21a3\u21a6\u21ae\u21ce-\u21cf\u21d2\u21d4\u21f4-\u22ff\u2320-\u2321\u237c\u239b-\u23b3\u23dc-\u23e1\u25b7\u25c1\u25f8-\u25ff\u266f\u27c0-\u27c4\u27c7-\u27e5\u27f0-\u27ff\u2900-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2aff\u2b30-\u2b44\u2b47-\u2b4c\ufb29\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe9-\uffec\U0001d6c1\U0001d6db\U0001d6fb\U0001d715\U0001d735\U0001d74f\U0001d76f\U0001d789\U0001d7a9\U0001d7c3\U0001eef0-\U0001eef1' + +So = '\xa6\xa9\xae\xb0\u0482\u058d-\u058e\u060e-\u060f\u06de\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0d4f\u0d79\u0f01-\u0f03\u0f13\u0f15-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce-\u0fcf\u0fd5-\u0fd8\u109e-\u109f\u1390-\u1399\u1940\u19de-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2117\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u214a\u214c-\u214d\u214f\u218a-\u218b\u2195-\u2199\u219c-\u219f\u21a1-\u21a2\u21a4-\u21a5\u21a7-\u21ad\u21af-\u21cd\u21d0-\u21d1\u21d3\u21d5-\u21f3\u2300-\u2307\u230c-\u231f\u2322-\u2328\u232b-\u237b\u237d-\u239a\u23b4-\u23db\u23e2-\u2426\u2440-\u244a\u249c-\u24e9\u2500-\u25b6\u25b8-\u25c0\u25c2-\u25f7\u2600-\u266e\u2670-\u2767\u2794-\u27bf\u2800-\u28ff\u2b00-\u2b2f\u2b45-\u2b46\u2b4d-\u2b73\u2b76-\u2b95\u2b98-\u2bc8\u2bca-\u2bfe\u2ce5-\u2cea\u2e80-\u2e99\u2e9b-\u2ef3\u2f00-\u2fd5\u2ff0-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3247\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u32fe\u3300-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ua836-\ua837\ua839\uaa77-\uaa79\ufdfd\uffe4\uffe8\uffed-\uffee\ufffc-\ufffd\U00010137-\U0001013f\U00010179-\U00010189\U0001018c-\U0001018e\U00010190-\U0001019b\U000101a0\U000101d0-\U000101fc\U00010877-\U00010878\U00010ac8\U0001173f\U00016b3c-\U00016b3f\U00016b45\U0001bc9c\U0001d000-\U0001d0f5\U0001d100-\U0001d126\U0001d129-\U0001d164\U0001d16a-\U0001d16c\U0001d183-\U0001d184\U0001d18c-\U0001d1a9\U0001d1ae-\U0001d1e8\U0001d200-\U0001d241\U0001d245\U0001d300-\U0001d356\U0001d800-\U0001d9ff\U0001da37-\U0001da3a\U0001da6d-\U0001da74\U0001da76-\U0001da83\U0001da85-\U0001da86\U0001ecac\U0001f000-\U0001f02b\U0001f030-\U0001f093\U0001f0a0-\U0001f0ae\U0001f0b1-\U0001f0bf\U0001f0c1-\U0001f0cf\U0001f0d1-\U0001f0f5\U0001f110-\U0001f16b\U0001f170-\U0001f1ac\U0001f1e6-\U0001f202\U0001f210-\U0001f23b\U0001f240-\U0001f248\U0001f250-\U0001f251\U0001f260-\U0001f265\U0001f300-\U0001f3fa\U0001f400-\U0001f6d4\U0001f6e0-\U0001f6ec\U0001f6f0-\U0001f6f9\U0001f700-\U0001f773\U0001f780-\U0001f7d8\U0001f800-\U0001f80b\U0001f810-\U0001f847\U0001f850-\U0001f859\U0001f860-\U0001f887\U0001f890-\U0001f8ad\U0001f900-\U0001f90b\U0001f910-\U0001f93e\U0001f940-\U0001f970\U0001f973-\U0001f976\U0001f97a\U0001f97c-\U0001f9a2\U0001f9b0-\U0001f9b9\U0001f9c0-\U0001f9c2\U0001f9d0-\U0001f9ff\U0001fa60-\U0001fa6d' + +Zl = '\u2028' + +Zp = '\u2029' + +Zs = ' \xa0\u1680\u2000-\u200a\u202f\u205f\u3000' + +xid_continue = '0-9A-Z_a-z\xaa\xb5\xb7\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376-\u0377\u037b-\u037d\u037f\u0386-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u05d0-\u05ea\u05ef-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u07fd\u0800-\u082d\u0840-\u085b\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u08d3-\u08e1\u08e3-\u0963\u0966-\u096f\u0971-\u0983\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7-\u09c8\u09cb-\u09ce\u09d7\u09dc-\u09dd\u09df-\u09e3\u09e6-\u09f1\u09fc\u09fe\u0a01-\u0a03\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a3c\u0a3e-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0af9-\u0aff\u0b01-\u0b03\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47-\u0b48\u0b4b-\u0b4d\u0b56-\u0b57\u0b5c-\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82-\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c00-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c58-\u0c5a\u0c60-\u0c63\u0c66-\u0c6f\u0c80-\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5-\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1-\u0cf2\u0d00-\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d54-\u0d57\u0d5f-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82-\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18-\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1369-\u1371\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772-\u1773\u1780-\u17d3\u17d7\u17dc-\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1878\u1880-\u18aa\u18b0-\u18f5\u1900-\u191e\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1ab0-\u1abd\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1cd0-\u1cd2\u1cd4-\u1cf9\u1d00-\u1df9\u1dfb-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u203f-\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099-\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua827\ua840-\ua873\ua880-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua8fd-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\ua9e0-\ua9fe\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabea\uabec-\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufc5d\ufc64-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdf9\ufe00-\ufe0f\ufe20-\ufe2f\ufe33-\ufe34\ufe4d-\ufe4f\ufe71\ufe73\ufe77\ufe79\ufe7b\ufe7d\ufe7f-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010140-\U00010174\U000101fd\U00010280-\U0001029c\U000102a0-\U000102d0\U000102e0\U00010300-\U0001031f\U0001032d-\U0001034a\U00010350-\U0001037a\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U000103d1-\U000103d5\U00010400-\U0001049d\U000104a0-\U000104a9\U000104b0-\U000104d3\U000104d8-\U000104fb\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00-\U00010a03\U00010a05-\U00010a06\U00010a0c-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a38-\U00010a3a\U00010a3f\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae6\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010c80-\U00010cb2\U00010cc0-\U00010cf2\U00010d00-\U00010d27\U00010d30-\U00010d39\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f50\U00011000-\U00011046\U00011066-\U0001106f\U0001107f-\U000110ba\U000110d0-\U000110e8\U000110f0-\U000110f9\U00011100-\U00011134\U00011136-\U0001113f\U00011144-\U00011146\U00011150-\U00011173\U00011176\U00011180-\U000111c4\U000111c9-\U000111cc\U000111d0-\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U00011237\U0001123e\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112ea\U000112f0-\U000112f9\U00011300-\U00011303\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133b-\U00011344\U00011347-\U00011348\U0001134b-\U0001134d\U00011350\U00011357\U0001135d-\U00011363\U00011366-\U0001136c\U00011370-\U00011374\U00011400-\U0001144a\U00011450-\U00011459\U0001145e\U00011480-\U000114c5\U000114c7\U000114d0-\U000114d9\U00011580-\U000115b5\U000115b8-\U000115c0\U000115d8-\U000115dd\U00011600-\U00011640\U00011644\U00011650-\U00011659\U00011680-\U000116b7\U000116c0-\U000116c9\U00011700-\U0001171a\U0001171d-\U0001172b\U00011730-\U00011739\U00011800-\U0001183a\U000118a0-\U000118e9\U000118ff\U00011a00-\U00011a3e\U00011a47\U00011a50-\U00011a83\U00011a86-\U00011a99\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c36\U00011c38-\U00011c40\U00011c50-\U00011c59\U00011c72-\U00011c8f\U00011c92-\U00011ca7\U00011ca9-\U00011cb6\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d36\U00011d3a\U00011d3c-\U00011d3d\U00011d3f-\U00011d47\U00011d50-\U00011d59\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d8e\U00011d90-\U00011d91\U00011d93-\U00011d98\U00011da0-\U00011da9\U00011ee0-\U00011ef6\U00012000-\U00012399\U00012400-\U0001246e\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016a60-\U00016a69\U00016ad0-\U00016aed\U00016af0-\U00016af4\U00016b00-\U00016b36\U00016b40-\U00016b43\U00016b50-\U00016b59\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016e40-\U00016e7f\U00016f00-\U00016f44\U00016f50-\U00016f7e\U00016f8f-\U00016f9f\U00016fe0-\U00016fe1\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001bc9d-\U0001bc9e\U0001d165-\U0001d169\U0001d16d-\U0001d172\U0001d17b-\U0001d182\U0001d185-\U0001d18b\U0001d1aa-\U0001d1ad\U0001d242-\U0001d244\U0001d400-\U0001d454\U0001d456-\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d51e-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d552-\U0001d6a5\U0001d6a8-\U0001d6c0\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6fa\U0001d6fc-\U0001d714\U0001d716-\U0001d734\U0001d736-\U0001d74e\U0001d750-\U0001d76e\U0001d770-\U0001d788\U0001d78a-\U0001d7a8\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7cb\U0001d7ce-\U0001d7ff\U0001da00-\U0001da36\U0001da3b-\U0001da6c\U0001da75\U0001da84\U0001da9b-\U0001da9f\U0001daa1-\U0001daaf\U0001e000-\U0001e006\U0001e008-\U0001e018\U0001e01b-\U0001e021\U0001e023-\U0001e024\U0001e026-\U0001e02a\U0001e800-\U0001e8c4\U0001e8d0-\U0001e8d6\U0001e900-\U0001e94a\U0001e950-\U0001e959\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d\U000e0100-\U000e01ef' + +xid_start = 'A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376-\u0377\u037b-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4-\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09f0-\u09f1\u09fc\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0af9\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60-\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0cf1-\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e40-\u0e46\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5-\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a-\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7b9\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd-\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5-\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufc5d\ufc64-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdf9\ufe71\ufe73\ufe77\ufe79\ufe7b\ufe7d\ufe7f-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uff9d\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc\U00010000-\U0001000b\U0001000d-\U00010026\U00010028-\U0001003a\U0001003c-\U0001003d\U0001003f-\U0001004d\U00010050-\U0001005d\U00010080-\U000100fa\U00010140-\U00010174\U00010280-\U0001029c\U000102a0-\U000102d0\U00010300-\U0001031f\U0001032d-\U0001034a\U00010350-\U00010375\U00010380-\U0001039d\U000103a0-\U000103c3\U000103c8-\U000103cf\U000103d1-\U000103d5\U00010400-\U0001049d\U000104b0-\U000104d3\U000104d8-\U000104fb\U00010500-\U00010527\U00010530-\U00010563\U00010600-\U00010736\U00010740-\U00010755\U00010760-\U00010767\U00010800-\U00010805\U00010808\U0001080a-\U00010835\U00010837-\U00010838\U0001083c\U0001083f-\U00010855\U00010860-\U00010876\U00010880-\U0001089e\U000108e0-\U000108f2\U000108f4-\U000108f5\U00010900-\U00010915\U00010920-\U00010939\U00010980-\U000109b7\U000109be-\U000109bf\U00010a00\U00010a10-\U00010a13\U00010a15-\U00010a17\U00010a19-\U00010a35\U00010a60-\U00010a7c\U00010a80-\U00010a9c\U00010ac0-\U00010ac7\U00010ac9-\U00010ae4\U00010b00-\U00010b35\U00010b40-\U00010b55\U00010b60-\U00010b72\U00010b80-\U00010b91\U00010c00-\U00010c48\U00010c80-\U00010cb2\U00010cc0-\U00010cf2\U00010d00-\U00010d23\U00010f00-\U00010f1c\U00010f27\U00010f30-\U00010f45\U00011003-\U00011037\U00011083-\U000110af\U000110d0-\U000110e8\U00011103-\U00011126\U00011144\U00011150-\U00011172\U00011176\U00011183-\U000111b2\U000111c1-\U000111c4\U000111da\U000111dc\U00011200-\U00011211\U00011213-\U0001122b\U00011280-\U00011286\U00011288\U0001128a-\U0001128d\U0001128f-\U0001129d\U0001129f-\U000112a8\U000112b0-\U000112de\U00011305-\U0001130c\U0001130f-\U00011310\U00011313-\U00011328\U0001132a-\U00011330\U00011332-\U00011333\U00011335-\U00011339\U0001133d\U00011350\U0001135d-\U00011361\U00011400-\U00011434\U00011447-\U0001144a\U00011480-\U000114af\U000114c4-\U000114c5\U000114c7\U00011580-\U000115ae\U000115d8-\U000115db\U00011600-\U0001162f\U00011644\U00011680-\U000116aa\U00011700-\U0001171a\U00011800-\U0001182b\U000118a0-\U000118df\U000118ff\U00011a00\U00011a0b-\U00011a32\U00011a3a\U00011a50\U00011a5c-\U00011a83\U00011a86-\U00011a89\U00011a9d\U00011ac0-\U00011af8\U00011c00-\U00011c08\U00011c0a-\U00011c2e\U00011c40\U00011c72-\U00011c8f\U00011d00-\U00011d06\U00011d08-\U00011d09\U00011d0b-\U00011d30\U00011d46\U00011d60-\U00011d65\U00011d67-\U00011d68\U00011d6a-\U00011d89\U00011d98\U00011ee0-\U00011ef2\U00012000-\U00012399\U00012400-\U0001246e\U00012480-\U00012543\U00013000-\U0001342e\U00014400-\U00014646\U00016800-\U00016a38\U00016a40-\U00016a5e\U00016ad0-\U00016aed\U00016b00-\U00016b2f\U00016b40-\U00016b43\U00016b63-\U00016b77\U00016b7d-\U00016b8f\U00016e40-\U00016e7f\U00016f00-\U00016f44\U00016f50\U00016f93-\U00016f9f\U00016fe0-\U00016fe1\U00017000-\U000187f1\U00018800-\U00018af2\U0001b000-\U0001b11e\U0001b170-\U0001b2fb\U0001bc00-\U0001bc6a\U0001bc70-\U0001bc7c\U0001bc80-\U0001bc88\U0001bc90-\U0001bc99\U0001d400-\U0001d454\U0001d456-\U0001d49c\U0001d49e-\U0001d49f\U0001d4a2\U0001d4a5-\U0001d4a6\U0001d4a9-\U0001d4ac\U0001d4ae-\U0001d4b9\U0001d4bb\U0001d4bd-\U0001d4c3\U0001d4c5-\U0001d505\U0001d507-\U0001d50a\U0001d50d-\U0001d514\U0001d516-\U0001d51c\U0001d51e-\U0001d539\U0001d53b-\U0001d53e\U0001d540-\U0001d544\U0001d546\U0001d54a-\U0001d550\U0001d552-\U0001d6a5\U0001d6a8-\U0001d6c0\U0001d6c2-\U0001d6da\U0001d6dc-\U0001d6fa\U0001d6fc-\U0001d714\U0001d716-\U0001d734\U0001d736-\U0001d74e\U0001d750-\U0001d76e\U0001d770-\U0001d788\U0001d78a-\U0001d7a8\U0001d7aa-\U0001d7c2\U0001d7c4-\U0001d7cb\U0001e800-\U0001e8c4\U0001e900-\U0001e943\U0001ee00-\U0001ee03\U0001ee05-\U0001ee1f\U0001ee21-\U0001ee22\U0001ee24\U0001ee27\U0001ee29-\U0001ee32\U0001ee34-\U0001ee37\U0001ee39\U0001ee3b\U0001ee42\U0001ee47\U0001ee49\U0001ee4b\U0001ee4d-\U0001ee4f\U0001ee51-\U0001ee52\U0001ee54\U0001ee57\U0001ee59\U0001ee5b\U0001ee5d\U0001ee5f\U0001ee61-\U0001ee62\U0001ee64\U0001ee67-\U0001ee6a\U0001ee6c-\U0001ee72\U0001ee74-\U0001ee77\U0001ee79-\U0001ee7c\U0001ee7e\U0001ee80-\U0001ee89\U0001ee8b-\U0001ee9b\U0001eea1-\U0001eea3\U0001eea5-\U0001eea9\U0001eeab-\U0001eebb\U00020000-\U0002a6d6\U0002a700-\U0002b734\U0002b740-\U0002b81d\U0002b820-\U0002cea1\U0002ceb0-\U0002ebe0\U0002f800-\U0002fa1d' + +cats = ['Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu', 'Mc', 'Me', 'Mn', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs'] + +# Generated from unidata 11.0.0 + +def combine(*args): + return ''.join(globals()[cat] for cat in args) + + +def allexcept(*args): + newcats = cats[:] + for arg in args: + newcats.remove(arg) + return ''.join(globals()[cat] for cat in newcats) + + +def _handle_runs(char_list): # pragma: no cover + buf = [] + for c in char_list: + if len(c) == 1: + if buf and buf[-1][1] == chr(ord(c)-1): + buf[-1] = (buf[-1][0], c) + else: + buf.append((c, c)) + else: + buf.append((c, c)) + for a, b in buf: + if a == b: + yield a + else: + yield f'{a}-{b}' + + +if __name__ == '__main__': # pragma: no cover + import unicodedata + + categories = {'xid_start': [], 'xid_continue': []} + + with open(__file__, encoding='utf-8') as fp: + content = fp.read() + + header = content[:content.find('Cc =')] + footer = content[content.find("def combine("):] + + for code in range(0x110000): + c = chr(code) + cat = unicodedata.category(c) + if ord(c) == 0xdc00: + # Hack to avoid combining this combining with the preceding high + # surrogate, 0xdbff, when doing a repr. + c = '\\' + c + elif ord(c) in (0x2d, 0x5b, 0x5c, 0x5d, 0x5e): + # Escape regex metachars. + c = '\\' + c + categories.setdefault(cat, []).append(c) + # XID_START and XID_CONTINUE are special categories used for matching + # identifiers in Python 3. + if c.isidentifier(): + categories['xid_start'].append(c) + if ('a' + c).isidentifier(): + categories['xid_continue'].append(c) + + with open(__file__, 'w', encoding='utf-8') as fp: + fp.write(header) + + for cat in sorted(categories): + val = ''.join(_handle_runs(categories[cat])) + fp.write(f'{cat} = {val!a}\n\n') + + cats = sorted(categories) + cats.remove('xid_start') + cats.remove('xid_continue') + fp.write(f'cats = {cats!r}\n\n') + + fp.write(f'# Generated from unidata {unicodedata.unidata_version}\n\n') + + fp.write(footer) diff --git a/micromamba_root/Lib/site-packages/pygments/util.py b/micromamba_root/Lib/site-packages/pygments/util.py new file mode 100644 index 0000000000000000000000000000000000000000..548d9d7af2865b23cf59369d25b98221daf34b95 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pygments/util.py @@ -0,0 +1,324 @@ +""" + pygments.util + ~~~~~~~~~~~~~ + + Utility functions. + + :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +from io import TextIOWrapper + + +split_path_re = re.compile(r'[/\\ ]') +doctype_lookup_re = re.compile(r''' + ]*> +''', re.DOTALL | re.MULTILINE | re.VERBOSE) +tag_re = re.compile(r'<(.+?)(\s.*?)?>.*?', + re.IGNORECASE | re.DOTALL | re.MULTILINE) +xml_decl_re = re.compile(r'\s*<\?xml[^>]*\?>', re.I) + + +class ClassNotFound(ValueError): + """Raised if one of the lookup functions didn't find a matching class.""" + + +class OptionError(Exception): + """ + This exception will be raised by all option processing functions if + the type or value of the argument is not correct. + """ + +def get_choice_opt(options, optname, allowed, default=None, normcase=False): + """ + If the key `optname` from the dictionary is not in the sequence + `allowed`, raise an error, otherwise return it. + """ + string = options.get(optname, default) + if normcase: + string = string.lower() + if string not in allowed: + raise OptionError('Value for option {} must be one of {}'.format(optname, ', '.join(map(str, allowed)))) + return string + + +def get_bool_opt(options, optname, default=None): + """ + Intuitively, this is `options.get(optname, default)`, but restricted to + Boolean value. The Booleans can be represented as string, in order to accept + Boolean value from the command line arguments. If the key `optname` is + present in the dictionary `options` and is not associated with a Boolean, + raise an `OptionError`. If it is absent, `default` is returned instead. + + The valid string values for ``True`` are ``1``, ``yes``, ``true`` and + ``on``, the ones for ``False`` are ``0``, ``no``, ``false`` and ``off`` + (matched case-insensitively). + """ + string = options.get(optname, default) + if isinstance(string, bool): + return string + elif isinstance(string, int): + return bool(string) + elif not isinstance(string, str): + raise OptionError(f'Invalid type {string!r} for option {optname}; use ' + '1/0, yes/no, true/false, on/off') + elif string.lower() in ('1', 'yes', 'true', 'on'): + return True + elif string.lower() in ('0', 'no', 'false', 'off'): + return False + else: + raise OptionError(f'Invalid value {string!r} for option {optname}; use ' + '1/0, yes/no, true/false, on/off') + + +def get_int_opt(options, optname, default=None): + """As :func:`get_bool_opt`, but interpret the value as an integer.""" + string = options.get(optname, default) + try: + return int(string) + except TypeError: + raise OptionError(f'Invalid type {string!r} for option {optname}; you ' + 'must give an integer value') + except ValueError: + raise OptionError(f'Invalid value {string!r} for option {optname}; you ' + 'must give an integer value') + +def get_list_opt(options, optname, default=None): + """ + If the key `optname` from the dictionary `options` is a string, + split it at whitespace and return it. If it is already a list + or a tuple, it is returned as a list. + """ + val = options.get(optname, default) + if isinstance(val, str): + return val.split() + elif isinstance(val, (list, tuple)): + return list(val) + else: + raise OptionError(f'Invalid type {val!r} for option {optname}; you ' + 'must give a list value') + + +def docstring_headline(obj): + if not obj.__doc__: + return '' + res = [] + for line in obj.__doc__.strip().splitlines(): + if line.strip(): + res.append(" " + line.strip()) + else: + break + return ''.join(res).lstrip() + + +def make_analysator(f): + """Return a static text analyser function that returns float values.""" + def text_analyse(text): + try: + rv = f(text) + except Exception: + return 0.0 + if not rv: + return 0.0 + try: + return min(1.0, max(0.0, float(rv))) + except (ValueError, TypeError): + return 0.0 + text_analyse.__doc__ = f.__doc__ + return staticmethod(text_analyse) + + +def shebang_matches(text, regex): + r"""Check if the given regular expression matches the last part of the + shebang if one exists. + + >>> from pygments.util import shebang_matches + >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?') + True + >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?') + True + >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?') + False + >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?') + False + >>> shebang_matches('#!/usr/bin/startsomethingwith python', + ... r'python(2\.\d)?') + True + + It also checks for common windows executable file extensions:: + + >>> shebang_matches('#!C:\\Python2.4\\Python.exe', r'python(2\.\d)?') + True + + Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does + the same as ``'perl -e'``) + + Note that this method automatically searches the whole string (eg: + the regular expression is wrapped in ``'^$'``) + """ + index = text.find('\n') + if index >= 0: + first_line = text[:index].lower() + else: + first_line = text.lower() + if first_line.startswith('#!'): + try: + found = [x for x in split_path_re.split(first_line[2:].strip()) + if x and not x.startswith('-')][-1] + except IndexError: + return False + regex = re.compile(rf'^{regex}(\.(exe|cmd|bat|bin))?$', re.IGNORECASE) + if regex.search(found) is not None: + return True + return False + + +def doctype_matches(text, regex): + """Check if the doctype matches a regular expression (if present). + + Note that this method only checks the first part of a DOCTYPE. + eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' + """ + m = doctype_lookup_re.search(text) + if m is None: + return False + doctype = m.group(1) + return re.compile(regex, re.I).match(doctype.strip()) is not None + + +def html_doctype_matches(text): + """Check if the file looks like it has a html doctype.""" + return doctype_matches(text, r'html') + + +_looks_like_xml_cache = {} + + +def looks_like_xml(text): + """Check if a doctype exists or if we have some tags.""" + if xml_decl_re.match(text): + return True + key = hash(text) + try: + return _looks_like_xml_cache[key] + except KeyError: + m = doctype_lookup_re.search(text) + if m is not None: + return True + rv = tag_re.search(text[:1000]) is not None + _looks_like_xml_cache[key] = rv + return rv + + +def surrogatepair(c): + """Given a unicode character code with length greater than 16 bits, + return the two 16 bit surrogate pair. + """ + # From example D28 of: + # http://www.unicode.org/book/ch03.pdf + return (0xd7c0 + (c >> 10), (0xdc00 + (c & 0x3ff))) + + +def format_lines(var_name, seq, raw=False, indent_level=0): + """Formats a sequence of strings for output.""" + lines = [] + base_indent = ' ' * indent_level * 4 + inner_indent = ' ' * (indent_level + 1) * 4 + lines.append(base_indent + var_name + ' = (') + if raw: + # These should be preformatted reprs of, say, tuples. + for i in seq: + lines.append(inner_indent + i + ',') + else: + for i in seq: + # Force use of single quotes + r = repr(i + '"') + lines.append(inner_indent + r[:-2] + r[-1] + ',') + lines.append(base_indent + ')') + return '\n'.join(lines) + + +def duplicates_removed(it, already_seen=()): + """ + Returns a list with duplicates removed from the iterable `it`. + + Order is preserved. + """ + lst = [] + seen = set() + for i in it: + if i in seen or i in already_seen: + continue + lst.append(i) + seen.add(i) + return lst + + +class Future: + """Generic class to defer some work. + + Handled specially in RegexLexerMeta, to support regex string construction at + first use. + """ + def get(self): + raise NotImplementedError + + +def guess_decode(text): + """Decode *text* with guessed encoding. + + First try UTF-8; this should fail for non-UTF-8 encodings. + Then try the preferred locale encoding. + Fall back to latin-1, which always works. + """ + try: + text = text.decode('utf-8') + return text, 'utf-8' + except UnicodeDecodeError: + try: + import locale + prefencoding = locale.getpreferredencoding() + text = text.decode(prefencoding) + return text, prefencoding + except (UnicodeDecodeError, LookupError): + text = text.decode('latin1') + return text, 'latin1' + + +def guess_decode_from_terminal(text, term): + """Decode *text* coming from terminal *term*. + + First try the terminal encoding, if given. + Then try UTF-8. Then try the preferred locale encoding. + Fall back to latin-1, which always works. + """ + if getattr(term, 'encoding', None): + try: + text = text.decode(term.encoding) + except UnicodeDecodeError: + pass + else: + return text, term.encoding + return guess_decode(text) + + +def terminal_encoding(term): + """Return our best guess of encoding for the given *term*.""" + if getattr(term, 'encoding', None): + return term.encoding + import locale + return locale.getpreferredencoding() + + +class UnclosingTextIOWrapper(TextIOWrapper): + # Don't close underlying buffer on destruction. + def close(self): + self.flush() diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/METADATA b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..15f2e23cfc564ac15376fd1c6da0a3aa443da057 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/METADATA @@ -0,0 +1,64 @@ +Metadata-Version: 2.4 +Name: pymdown-extensions +Version: 10.21.2 +Summary: Extension pack for Python Markdown. +Project-URL: Homepage, https://github.com/facelessuser/pymdown-extensions +Author-email: Isaac Muse +License-Expression: MIT +License-File: LICENSE.md +Keywords: extensions,markdown +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing :: Filters +Classifier: Topic :: Text Processing :: Markup :: HTML +Requires-Python: >=3.9 +Requires-Dist: markdown>=3.6 +Requires-Dist: pyyaml +Provides-Extra: extra +Requires-Dist: pygments>=2.19.1; extra == 'extra' +Description-Content-Type: text/markdown + +[![Donate via PayPal][donate-image]][donate-link] +[![Build][github-ci-image]][github-ci-link] +[![Coverage Status][codecov-image]][codecov-link] +[![PyPI Version][pypi-image]][pypi-link] +[![PyPI Downloads][pypi-down]][pypi-link] +[![PyPI - Python Version][python-image]][pypi-link] +[![License][license-image-mit]][license-link] + +# PyMdown Extensions + +Extensions for [Python Markdown](https://python-markdown.github.io). + +## Documentation + +Extension documentation is found here: https://facelessuser.github.io/pymdown-extensions/. + +## License + +License is MIT. See [LICENSE](https://github.com/facelessuser/pymdown-extensions/blob/master/LICENSE.md) for more info. + +[github-ci-image]: https://github.com/facelessuser/pymdown-extensions/workflows/build/badge.svg?branch=main&event=push +[github-ci-link]: https://github.com/facelessuser/pymdown-extensions/actions?query=workflow%3Abuild+branch%3Amain +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/pymdown-extensions/main.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[codecov-link]: https://codecov.io/github/facelessuser/pymdown-extensions +[pypi-image]: https://img.shields.io/pypi/v/pymdown-extensions.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 +[pypi-link]: https://pypi.python.org/pypi/pymdown-extensions +[python-image]: https://img.shields.io/pypi/pyversions/pymdown-extensions?logo=python&logoColor=aaaaaa&labelColor=333333 +[pypi-down]: https://img.shields.io/pypi/dm/pymdown-extensions.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 +[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333 +[license-link]: https://github.com/facelessuser/pymdown-extensions/blob/main/LICENSE.md +[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal +[donate-link]: https://www.paypal.me/facelessuser diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/RECORD b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..1c5fade9f198405e0fa104189ac212cac33abd7e --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/RECORD @@ -0,0 +1,93 @@ +pymdown_extensions-10.21.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pymdown_extensions-10.21.2.dist-info/METADATA,sha256=_DjHDgBltj60lOEhEtMd762THB7r5Q5WSLWO_B9kBEY,3146 +pymdown_extensions-10.21.2.dist-info/RECORD,, +pymdown_extensions-10.21.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pymdown_extensions-10.21.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87 +pymdown_extensions-10.21.2.dist-info/direct_url.json,sha256=5aX2BmBoOlQgsnwva6xqQd7BQ6vOGNuNsJGZgBHa3ew,114 +pymdown_extensions-10.21.2.dist-info/licenses/LICENSE.md,sha256=5mRfkU-65bxVdBn8r76rnjdYl-gnTFTisXeVPpNU-T4,4292 +pymdownx/__init__.py,sha256=-gtdCtfm7EY48vYxLRcr3fcmpnBcWYqRW9ohvHk__6Q,141 +pymdownx/__meta__.py,sha256=Yz8RpZ33WC8gEMqHy8OEonSY3dV3Y5TfnmuaPRo5vjU,6788 +pymdownx/__pycache__/__init__.cpython-310.pyc,, +pymdownx/__pycache__/__meta__.cpython-310.pyc,, +pymdownx/__pycache__/_bypassnorm.cpython-310.pyc,, +pymdownx/__pycache__/arithmatex.cpython-310.pyc,, +pymdownx/__pycache__/b64.cpython-310.pyc,, +pymdownx/__pycache__/betterem.cpython-310.pyc,, +pymdownx/__pycache__/caret.cpython-310.pyc,, +pymdownx/__pycache__/critic.cpython-310.pyc,, +pymdownx/__pycache__/details.cpython-310.pyc,, +pymdownx/__pycache__/emoji.cpython-310.pyc,, +pymdownx/__pycache__/emoji1_db.cpython-310.pyc,, +pymdownx/__pycache__/escapeall.cpython-310.pyc,, +pymdownx/__pycache__/extra.cpython-310.pyc,, +pymdownx/__pycache__/fancylists.cpython-310.pyc,, +pymdownx/__pycache__/gemoji_db.cpython-310.pyc,, +pymdownx/__pycache__/highlight.cpython-310.pyc,, +pymdownx/__pycache__/inlinehilite.cpython-310.pyc,, +pymdownx/__pycache__/keymap_db.cpython-310.pyc,, +pymdownx/__pycache__/keys.cpython-310.pyc,, +pymdownx/__pycache__/magiclink.cpython-310.pyc,, +pymdownx/__pycache__/mark.cpython-310.pyc,, +pymdownx/__pycache__/pathconverter.cpython-310.pyc,, +pymdownx/__pycache__/progressbar.cpython-310.pyc,, +pymdownx/__pycache__/quotes.cpython-310.pyc,, +pymdownx/__pycache__/saneheaders.cpython-310.pyc,, +pymdownx/__pycache__/slugs.cpython-310.pyc,, +pymdownx/__pycache__/smartsymbols.cpython-310.pyc,, +pymdownx/__pycache__/snippets.cpython-310.pyc,, +pymdownx/__pycache__/striphtml.cpython-310.pyc,, +pymdownx/__pycache__/superfences.cpython-310.pyc,, +pymdownx/__pycache__/tabbed.cpython-310.pyc,, +pymdownx/__pycache__/tasklist.cpython-310.pyc,, +pymdownx/__pycache__/tilde.cpython-310.pyc,, +pymdownx/__pycache__/twemoji_db.cpython-310.pyc,, +pymdownx/__pycache__/util.cpython-310.pyc,, +pymdownx/_bypassnorm.py,sha256=DasWeVE_xao3zf0tUdAFjIqV0-fH6Y_bauq3-7CwWIk,2035 +pymdownx/arithmatex.py,sha256=AVfWmgboI4QcgSaGqG81aKiJRkzV3eSR9jhJvfhdTsM,14770 +pymdownx/b64.py,sha256=8RDjM26GO9hWdkAfaNWT1Q4qtnhPjUc3B50BgHQ4eJQ,4414 +pymdownx/betterem.py,sha256=OzPdm2Hf6_a4trTGDos_jaPJZr1d-5Sc-nMLtwee1uI,12491 +pymdownx/blocks/__init__.py,sha256=ZgFDypjXp13xfKzVov44Im4t9yEm26r56L9iMdcMUd4,19700 +pymdownx/blocks/__pycache__/__init__.cpython-310.pyc,, +pymdownx/blocks/__pycache__/admonition.cpython-310.pyc,, +pymdownx/blocks/__pycache__/block.cpython-310.pyc,, +pymdownx/blocks/__pycache__/caption.cpython-310.pyc,, +pymdownx/blocks/__pycache__/definition.cpython-310.pyc,, +pymdownx/blocks/__pycache__/details.cpython-310.pyc,, +pymdownx/blocks/__pycache__/html.cpython-310.pyc,, +pymdownx/blocks/__pycache__/tab.cpython-310.pyc,, +pymdownx/blocks/admonition.py,sha256=Su2P1aS3rdVX830kD0SiGsdWyBP3I9lzSTHGEp49F_Y,3629 +pymdownx/blocks/block.py,sha256=6Bh9p15YgpNa_4wuSLBfyqWnGPuk6dIMkd8m9TO3IiU,11814 +pymdownx/blocks/caption.py,sha256=gjaBpxaL3tVRlBfu79it78SDjvbN0v2qG5gt1gJFQq0,14871 +pymdownx/blocks/definition.py,sha256=aI-5HbkgV778o5GaiBR0BzKUMCVXH_qWIlXUc_coN5w,1754 +pymdownx/blocks/details.py,sha256=RXo1qE5i0Ej9b_S2aL8kbWlzRI_kH9Nymkb6jCJ46Bk,3864 +pymdownx/blocks/html.py,sha256=hw3CBSWbRvTZEZVWYWFQerRuOQkDsVy3221KvwzQlZs,6589 +pymdownx/blocks/tab.py,sha256=G8MaLAI98un4xe2kWSMazgldKcV6ZJX38vVvsUXlkEI,9928 +pymdownx/caret.py,sha256=7-Z8GSrRNDeNMpg8zlv-_eoAj0Iqg9yqbA1l29JH484,7425 +pymdownx/critic.py,sha256=AhaqmspjhDFE2qUE1DOZzj-3pqt0GCnwzzpQsrmh4Lc,9881 +pymdownx/details.py,sha256=Lddu4iib01BkponpBV01hkldAIbMWVjXENO4pntv09U,6728 +pymdownx/emoji.py,sha256=x_1HEs2cYLYR3iPJXVXAdQL2TQJbZXF9u2VYfWsRSVg,13990 +pymdownx/emoji1_db.py,sha256=KH05pUO2zfaqTtgvs8p55Jy27vghCl_ALkcAfmzNZ0Q,259076 +pymdownx/escapeall.py,sha256=cSknFnzjezf2M8OTo3xSXxZtvC5wYybnUqvg7AfKyPU,3486 +pymdownx/extra.py,sha256=qN6bDwh6gLjQRfyzVHlSUfQ7cZDv_uZvCzvyevWEibw,2229 +pymdownx/fancylists.py,sha256=YjX1WLgGN7RwTQTFzlrLn7j2JiUuWJIzztRZsfeQ1xY,18695 +pymdownx/gemoji_db.py,sha256=cOFiCdtKB0COeN7JBVXayj7CZ89rgzUrMBIdnbMUc_8,256380 +pymdownx/highlight.py,sha256=HE6nEocfLyQ3psABJnoqqfKu1b2V0YXT4COBycKqjCE,22029 +pymdownx/inlinehilite.py,sha256=neBbec801goeCs_KVIctBa-rwMRs3RKtuYnUAZNwJVs,7577 +pymdownx/keymap_db.py,sha256=DDemaVfbhFzrPE_zmnO6nZMZndOEqn5KQsF-XIc0kvA,7541 +pymdownx/keys.py,sha256=SJPglY1SjuKme2NeIQWOd5eDhOJWof-MZI8hmsF-74M,8007 +pymdownx/magiclink.py,sha256=AU8axUo20eH_zFWTGDZbfTMR8oDeVbvtub1imkPN5iQ,48868 +pymdownx/mark.py,sha256=p2fUL6oDKQ2MV9HAXUGJcaxd-ZHSQdglA7hTAEm5zKM,3096 +pymdownx/pathconverter.py,sha256=zD96m6hKAC35wf8c4ToaHhS7mrVnSVHxuOfCRyBcTQg,6837 +pymdownx/progressbar.py,sha256=nYFDfksIGQ9Xws9tdRvJLVdEy_zxNxIx_gE0Bqte62M,7580 +pymdownx/quotes.py,sha256=CMdPqKYvApvVk_oKkOUo0ledk56YzJ5yzif8gZEUiq8,5598 +pymdownx/saneheaders.py,sha256=B0R0k8n3mDThCLEHmqiRvh9EPhF0wkQGTxlEwrAtyHw,965 +pymdownx/slugs.py,sha256=1HZ4JiNwyUBFzXGQgpPA-CrQj_w--ZlFjhaowsl6c98,4209 +pymdownx/smartsymbols.py,sha256=0SaSxZnyodGbDlxWGd5vQU9cBxpy6W-NkdU7sVs-drw,5427 +pymdownx/snippets.py,sha256=o3IhEgv0nMkW6-VTCxDbkUHrDB77aP3lfsx_dtjudNM,18509 +pymdownx/striphtml.py,sha256=lojq4xzABDeoz1VuaoiBB-K_Q4HyFGxqD2JaF0-_27A,5202 +pymdownx/superfences.py,sha256=PgHoQP9Hjs_cLMo7dvRPFIXXtQ5ycUpi46IgONtBFlk,36485 +pymdownx/tabbed.py,sha256=lUOp2qyiAQFGeR5l3B7WoFgHV7E8-R64EyCgPbBIOVk,16168 +pymdownx/tasklist.py,sha256=smN6qFvIk7y-AfBdWo4pnip7gIg2NdevkHv0z67jKE4,5359 +pymdownx/tilde.py,sha256=N_LdMthuhAwGfzn9498VpuexvMSCnv8onHF2Ydn8XO0,7333 +pymdownx/twemoji_db.py,sha256=1VZ-gvdVlMpA_39Q1nHWc2wPgCsWjugMKttUYMNSOg0,725342 +pymdownx/util.py,sha256=B6lzOnM5OsWB5PzMia2EnAtylrCTuZA5GgcmPt_5a8c,11220 diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..b1b94fd58e7e9ed0ef3449473bc48de68afcc3fe --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.29.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..78905b0c7b876e2f00485d1311fcd46a0c013fd1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/pymdown-extensions_1774802963025/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/licenses/LICENSE.md b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/licenses/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..bd7fbbb470d5661399a9e1b86488c0f918427add --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdown_extensions-10.21.2.dist-info/licenses/LICENSE.md @@ -0,0 +1,113 @@ +# License + +## PyMdown Extensions + +The MIT License (MIT) + +Copyright (c) 2014 - 2025 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## SuperFences + +`superfences.py` is derived from Python Markdown's fenced_code extension. + +``` +Fenced Code Extension for Python Markdown + ========================================= +This extension adds Fenced Code Blocks to Python-Markdown. +See +for documentation. +Original code Copyright 2007-2008 [Waylan Limberg](https://github.com/waylan). +All changes Copyright 2008-2014 The Python Markdown Project +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) +``` + +## Highlight + +`highlight.py` is derived from Python Markdown's CodeHilite extension. + +``` +CodeHilite Extension for Python-Markdown + ======================================== +Adds code/syntax highlighting to standard Python-Markdown code blocks. +See +for documentation. +Original code Copyright 2006-2008 [Waylan Limberg](https://github.com/waylan). +All changes Copyright 2008-2014 The Python Markdown Project +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) +``` + +## FancyLists + +`fancylists.py` is derived from Python Markdown's list handler. + +``` +Started by Manfred Stienstra (http://www.dwerg.net/). +Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). +Currently maintained by Waylan Limberg (https://github.com/waylan), +Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). + +Copyright 2007-2023 The Python Markdown Project (v. 1.7 and later) +Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) +Copyright 2004 Manfred Stienstra (the original version) + +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) +``` + +## Gemoji Index + +`gemoji_db.py` is generated from Gemoji's source code: @github/gemoji. + +``` +Copyright (c) 2013 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +``` + +## EmojiOne Index + +`emoji1_db.py` is generated from EmojiOne's source code: @Ranks/emojione + +``` +EmojiOne Non-Artwork + +Applies to the JavaScript, JSON, PHP, CSS, HTML files, and everything else not covered under the artwork license above. +License: MIT +Complete Legal Terms: http://opensource.org/licenses/MIT +``` diff --git a/micromamba_root/Lib/site-packages/pymdownx/__init__.py b/micromamba_root/Lib/site-packages/pymdownx/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9f97bc48070cf62c3a9aea5f1430c912f8b84eb --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/__init__.py @@ -0,0 +1,5 @@ +"""PyMdown extra extensions.""" +from .__meta__ import __version__, __version_info__ # noqa: F401 + +# Nothing to import with all +__all__ = () diff --git a/micromamba_root/Lib/site-packages/pymdownx/__meta__.py b/micromamba_root/Lib/site-packages/pymdownx/__meta__.py new file mode 100644 index 0000000000000000000000000000000000000000..c494473a6759e12f1157970d85085526cf2b9fb2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/__meta__.py @@ -0,0 +1,197 @@ +"""Meta related things.""" +from __future__ import annotations +from collections import namedtuple +import re + +RE_VER = re.compile( + r'''(?x) + (?P\d+)(?:\.(?P\d+))?(?:\.(?P\d+))? + (?:(?Pa|b|rc)(?P
\d+))?
+    (?:\.post(?P\d+))?
+    (?:\.dev(?P\d+))?
+    '''
+)
+
+REL_MAP = {
+    ".dev": "",
+    ".dev-alpha": "a",
+    ".dev-beta": "b",
+    ".dev-candidate": "rc",
+    "alpha": "a",
+    "beta": "b",
+    "candidate": "rc",
+    "final": ""
+}
+
+DEV_STATUS = {
+    ".dev": "2 - Pre-Alpha",
+    ".dev-alpha": "2 - Pre-Alpha",
+    ".dev-beta": "2 - Pre-Alpha",
+    ".dev-candidate": "2 - Pre-Alpha",
+    "alpha": "3 - Alpha",
+    "beta": "4 - Beta",
+    "candidate": "4 - Beta",
+    "final": "5 - Production/Stable"
+}
+
+PRE_REL_MAP = {"a": 'alpha', "b": 'beta', "rc": 'candidate'}
+
+
+class Version(namedtuple("Version", ["major", "minor", "micro", "release", "pre", "post", "dev"])):
+    """
+    Get the version (PEP 440).
+
+    A biased approach to the PEP 440 semantic version.
+
+    Provides a tuple structure which is sorted for comparisons `v1 > v2` etc.
+      (major, minor, micro, release type, pre-release build, post-release build, development release build)
+    Release types are named in is such a way they are comparable with ease.
+    Accessors to check if a development, pre-release, or post-release build. Also provides accessor to get
+    development status for setup files.
+
+    How it works (currently):
+
+    - You must specify a release type as either `final`, `alpha`, `beta`, or `candidate`.
+    - To define a development release, you can use either `.dev`, `.dev-alpha`, `.dev-beta`, or `.dev-candidate`.
+      The dot is used to ensure all development specifiers are sorted before `alpha`.
+      You can specify a `dev` number for development builds, but do not have to as implicit development releases
+      are allowed.
+    - You must specify a `pre` value greater than zero if using a prerelease as this project (not PEP 440) does not
+      allow implicit prereleases.
+    - You can optionally set `post` to a value greater than zero to make the build a post release. While post releases
+      are technically allowed in prereleases, it is strongly discouraged, so we are rejecting them. It should be
+      noted that we do not allow `post0` even though PEP 440 does not restrict this. This project specifically
+      does not allow implicit post releases.
+    - It should be noted that we do not support epochs `1!` or local versions `+some-custom.version-1`.
+
+    Acceptable version releases:
+
+    ```
+    Version(1, 0, 0, "final")                    1.0
+    Version(1, 2, 0, "final")                    1.2
+    Version(1, 2, 3, "final")                    1.2.3
+    Version(1, 2, 0, "alpha", pre=4)             1.2a4
+    Version(1, 2, 0, "beta", pre=4)              1.2b4
+    Version(1, 2, 0, "candidate", pre=4)         1.2rc4
+    Version(1, 2, 0, "final", post=1)            1.2.post1
+    Version(1, 2, 3, ".dev")                     1.2.3.dev0
+    Version(1, 2, 3, ".dev", dev=1)              1.2.3.dev1
+    ```
+
+    """
+
+    def __new__(
+        cls,
+        major: int, minor: int, micro: int, release: str = "final",
+        pre: int = 0, post: int = 0, dev: int = 0
+    ) -> Version:
+        """Validate version info."""
+
+        # Ensure all parts are positive integers.
+        for value in (major, minor, micro, pre, post):
+            if not (isinstance(value, int) and value >= 0):
+                raise ValueError("All version parts except 'release' should be integers.")
+
+        if release not in REL_MAP:
+            raise ValueError(f"'{release}' is not a valid release type.")
+
+        # Ensure valid pre-release (we do not allow implicit pre-releases).
+        if ".dev-candidate" < release < "final":
+            if pre == 0:
+                raise ValueError("Implicit pre-releases not allowed.")
+            elif dev:
+                raise ValueError("Version is not a development release.")
+            elif post:
+                raise ValueError("Post-releases are not allowed with pre-releases.")
+
+        # Ensure valid development or development/pre release
+        elif release < "alpha":
+            if release > ".dev" and pre == 0:
+                raise ValueError("Implicit pre-release not allowed.")
+            elif post:
+                raise ValueError("Post-releases are not allowed with pre-releases.")
+
+        # Ensure a valid normal release
+        else:
+            if pre:
+                raise ValueError("Version is not a pre-release.")
+            elif dev:
+                raise ValueError("Version is not a development release.")
+
+        return super().__new__(cls, major, minor, micro, release, pre, post, dev)
+
+    def _is_pre(self) -> bool:
+        """Is prerelease."""
+
+        return bool(self.pre > 0)
+
+    def _is_dev(self) -> bool:
+        """Is development."""
+
+        return bool(self.release < "alpha")
+
+    def _is_post(self) -> bool:
+        """Is post."""
+
+        return bool(self.post > 0)
+
+    def _get_dev_status(self) -> str:  # pragma: no cover
+        """Get development status string."""
+
+        return DEV_STATUS[self.release]
+
+    def _get_canonical(self) -> str:
+        """Get the canonical output string."""
+
+        # Assemble major, minor, micro version and append `pre`, `post`, or `dev` if needed..
+        if self.micro == 0 and self.major != 0:
+            ver = f"{self.major}.{self.minor}"
+        else:
+            ver = f"{self.major}.{self.minor}.{self.micro}"
+        if self._is_pre():
+            ver += f'{REL_MAP[self.release]}{self.pre}'
+        if self._is_post():
+            ver += f".post{self.post}"
+        if self._is_dev():
+            ver += f".dev{self.dev}"
+
+        return ver
+
+
+def parse_version(ver: str) -> Version:
+    """Parse version into a comparable Version tuple."""
+
+    m = RE_VER.match(ver)
+
+    if m is None:
+        raise ValueError(f"'{ver}' is not a valid version")
+
+    # Handle major, minor, micro
+    major = int(m.group('major'))
+    minor = int(m.group('minor')) if m.group('minor') else 0
+    micro = int(m.group('micro')) if m.group('micro') else 0
+
+    # Handle pre releases
+    if m.group('type'):
+        release = PRE_REL_MAP[m.group('type')]
+        pre = int(m.group('pre'))
+    else:
+        release = "final"
+        pre = 0
+
+    # Handle development releases
+    dev = m.group('dev') if m.group('dev') else 0
+    if m.group('dev'):
+        dev = int(m.group('dev'))
+        release = '.dev-' + release if pre else '.dev'
+    else:
+        dev = 0
+
+    # Handle post
+    post = int(m.group('post')) if m.group('post') else 0
+
+    return Version(major, minor, micro, release, pre, post, dev)
+
+
+__version_info__ = Version(10, 21, 2, "final")
+__version__ = __version_info__._get_canonical()
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/arithmatex.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/arithmatex.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3d11318b91d93efb810df6e87dc5c2bf8fde1b80
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/arithmatex.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/b64.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/b64.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..425de6212b183d899519329ba7a8be17f1137946
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/b64.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/betterem.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/betterem.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a914d171bdc162251c29fd3b5d2327e06c7bc6b7
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/betterem.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/caret.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/caret.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..11be8886502e5ef83d81347cc667298ca07b3bfe
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/caret.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/critic.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/critic.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1cbcadb25ab98c3bdcdaf113f1cb787ec4259910
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/critic.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/details.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/details.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fd01b82bf2d38ec5f683ed3c1cb7d61b5aa4095d
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/details.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/emoji.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/emoji.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..31a562211a8ccf3cb8b66e881b884093452113ec
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/emoji.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/escapeall.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/escapeall.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1857553f3aa248790ccbabce7c7fc5d4360b4b53
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/escapeall.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/extra.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/extra.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e1b0ea70f47d983ce58ade0e6938651c877334bb
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/extra.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/fancylists.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/fancylists.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..77b146e65bcf5bfe3615446b4829b1bd2f5b255a
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/fancylists.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/highlight.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/highlight.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..89b5dd13aa3f144d5236d788cf799b9032ecaabe
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/highlight.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/inlinehilite.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/inlinehilite.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3a68720d9e827ec7a29fbd1116fd2e9ce953297b
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/inlinehilite.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keymap_db.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keymap_db.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3f46085e2a6a534ef2c842631ec78ef786ff8cae
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keymap_db.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keys.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keys.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0cea643c689d245695d920ddf9ed50aac3940a52
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/keys.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/magiclink.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/magiclink.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..18b2601d0067d856225ccfc9c3d6db3e6dfba016
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/magiclink.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/mark.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/mark.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e78f88b55acadee1dc1afe6fd34a33834d2ee523
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/mark.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/pathconverter.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/pathconverter.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7c37a4f7b9aac444dc90edd0c29d428324e647fd
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/pathconverter.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/progressbar.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/progressbar.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2d3ed98b0f35596e023e7938c2ed9d6cdc1e2309
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/progressbar.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/quotes.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/quotes.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bf45eb4e7e033f730ffdd658470354d39fc053e2
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/quotes.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/saneheaders.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/saneheaders.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..abdccb25da050ab175e63af9747d6922c51701ce
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/saneheaders.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/__pycache__/slugs.cpython-314.pyc b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/slugs.cpython-314.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e9cb547f9d4206c212f5af57f8756302726b9f1a
Binary files /dev/null and b/micromamba_root/Lib/site-packages/pymdownx/__pycache__/slugs.cpython-314.pyc differ
diff --git a/micromamba_root/Lib/site-packages/pymdownx/_bypassnorm.py b/micromamba_root/Lib/site-packages/pymdownx/_bypassnorm.py
new file mode 100644
index 0000000000000000000000000000000000000000..6003f5ee9fcb31c6b73485ff515759ef45fa29aa
--- /dev/null
+++ b/micromamba_root/Lib/site-packages/pymdownx/_bypassnorm.py
@@ -0,0 +1,66 @@
+"""
+Bypass whitespace normalization.
+
+pymdownx._bypassnorm
+
+Strips `SOH` and `EOT` characters before whitespace normalization
+allowing other extensions to then create preprocessors that stash HTML
+with `SOH` and `EOT`  After whitespace normalization, all `SOH` and
+`EOT` characters will be converted to the Python Markdown standard
+`STX` and `ETX` convention since whitespace normalization usually
+strips out the `STX` and `ETX` characters.
+
+Copyright 2014 - 2018 Isaac Muse 
+"""
+
+from markdown import Extension
+from markdown.util import STX, ETX
+from markdown.preprocessors import Preprocessor
+
+SOH = '\u0001'  # start
+EOT = '\u0004'  # end
+
+
+class PreNormalizePreprocessor(Preprocessor):
+    """Preprocessor to remove workaround symbols."""
+
+    def run(self, lines):
+        """Remove workaround placeholder markers before adding actual workaround placeholders."""
+
+        source = '\n'.join(lines)
+        source = source.replace(SOH, '').replace(EOT, '')
+        return source.split('\n')
+
+
+class PostNormalizePreprocessor(Preprocessor):
+    """Preprocessor to clean up normalization bypass hack."""
+
+    def run(self, lines):
+        """Convert alternate placeholder symbols to actual placeholder symbols."""
+
+        source = '\n'.join(lines)
+        source = source.replace(SOH, STX).replace(EOT, ETX)
+        return source.split('\n')
+
+
+class BypassNormExtension(Extension):
+    """Bypass whitespace normalization."""
+
+    def __init__(self, *args, **kwargs):
+        """Initialize."""
+
+        self.inlinehilite = []
+        self.config = {}
+        super().__init__(*args, **kwargs)
+
+    def extendMarkdown(self, md):
+        """Add extensions that help with bypassing whitespace normalization."""
+
+        md.preprocessors.register(PreNormalizePreprocessor(md), "pymdownx-pre-norm-ws", 35)
+        md.preprocessors.register(PostNormalizePreprocessor(md), "pymdownx-post-norm-ws", 29.9)
+
+
+def makeExtension(*args, **kwargs):
+    """Return extension."""
+
+    return BypassNormExtension(*args, **kwargs)
diff --git a/micromamba_root/Lib/site-packages/pymdownx/arithmatex.py b/micromamba_root/Lib/site-packages/pymdownx/arithmatex.py
new file mode 100644
index 0000000000000000000000000000000000000000..1fcb4299f3b750bd1371030d916e10783932b826
--- /dev/null
+++ b/micromamba_root/Lib/site-packages/pymdownx/arithmatex.py
@@ -0,0 +1,409 @@
+r"""
+Arithmatex.
+
+pymdownx.arithmatex
+Extension that preserves the following for MathJax use:
+
+```
+$Equation$, \(Equation\)
+
+$$
+  Display Equations
+$$
+
+\[
+  Display Equations
+\]
+
+\begin{align}
+  Display Equations
+\end{align}
+```
+
+and `$Inline MathJax Equations$`
+
+Inline and display equations are converted to scripts tags. You can optionally generate previews.
+
+MIT license.
+
+Copyright (c) 2014 - 2017 Isaac Muse 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+"""
+from markdown import Extension
+from markdown.inlinepatterns import InlineProcessor
+from markdown.blockprocessors import BlockProcessor
+from markdown import util as md_util
+from functools import partial
+import xml.etree.ElementTree as etree
+from . import util
+import re
+
+RE_SMART_DOLLAR_INLINE = r'(?:(?[$]{2})(?P((?:\\.|[^\\])+?))(?P=dollar)'
+RE_TEX_BLOCK = r'(?P\\begin\{(?P[a-z]+\*?)\}(?:\\.|[^\\])+?\\end\{(?P=env)\})'
+RE_BRACKET_BLOCK = r'\\\[(?P(?:\\[^\]]|[^\\])+?)\\\]'
+
+
+def _escape(txt):
+    """Basic html escaping."""
+
+    txt = txt.replace('&', '&')
+    txt = txt.replace('<', '<')
+    txt = txt.replace('>', '>')
+    txt = txt.replace('"', '"')
+    return txt
+
+
+# Formatters usable with InlineHilite
+@util.deprecated(
+    "The inline MathJax Preview formatter has been deprecated in favor of the configurable 'arithmatex_fenced_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def inline_mathjax_preview_format(math, language='math', class_name='arithmatex', md=None):
+    """Inline math formatter with preview."""
+
+    return _inline_mathjax_format(math, preview=True)
+
+
+@util.deprecated(
+    "The inline MathJax formatter has been deprecated in favor of the configurable 'arithmatex_fenced_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def inline_mathjax_format(math, language='math', class_name='arithmatex', md=None):
+    """Inline math formatter."""
+
+    return _inline_mathjax_format(math, preview=False)
+
+
+@util.deprecated(
+    "The inline generic math formatter has been deprecated in favor of the configurable 'arithmatex_inline_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def inline_generic_format(math, language='math', class_name='arithmatex', md=None, **kwargs):
+    """Inline generic formatter."""
+
+    return _inline_generic_format(math, language, class_name, md, **kwargs)
+
+
+def _inline_mathjax_format(math, language='math', class_name='arithmatex', md=None, tag='span', preview=False):
+    """Inline math formatter."""
+
+    el = etree.Element(tag, {'class': 'arithmatex'})
+    if preview:
+        pre = etree.SubElement(el, 'span', {'class': 'MathJax_Preview'})
+        pre.text = md_util.AtomicString(math)
+    script = etree.SubElement(el, 'script', {'type': 'math/tex'})
+    script.text = md_util.AtomicString(math)
+    return el
+
+
+def _inline_generic_format(math, language='math', class_name='arithmatex', md=None, wrap='\\({}\\)', tag='span'):
+    """Inline generic formatter."""
+
+    el = etree.Element(tag, {'class': class_name})
+    el.text = md_util.AtomicString(wrap.format(math))
+    return el
+
+
+def arithmatex_inline_format(**kwargs):
+    """Specify which type of formatter you want and the wrapping tag."""
+
+    mode = kwargs.get('mode', 'generic')
+    tag = kwargs.get('tag', 'span')
+    preview = kwargs.get('preview', False)
+
+    if mode == 'generic':
+        return partial(_inline_generic_format, tag=tag)
+    elif mode == 'mathjax':
+        return partial(_inline_mathjax_format, preview=preview)
+
+
+# Formatters usable with SuperFences
+@util.deprecated(
+    "The fenced MathJax preview formatter has been deprecated in favor of the configurable 'arithmatex_fenced_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def fence_mathjax_preview_format(math, language='math', class_name='arithmatex', options=None, md=None, **kwargs):
+    """Block MathJax formatter with preview."""
+
+    return _fence_mathjax_format(math, preview=True)
+
+
+@util.deprecated(
+    "The fenced MathJax preview formatter has been deprecated in favor of the configurable 'arithmatex_fenced_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def fence_mathjax_format(math, language='math', class_name='arithmatex', options=None, md=None, **kwargs):
+    """Block MathJax formatter."""
+
+    return _fence_mathjax_format(math, preview=False)
+
+
+@util.deprecated(
+    "The generic math formatter has been deprecated in favor of the configurable 'arithmatex_fenced_format'. "
+    "Please see relevant documentation for more information on how to switch before this function is "
+    "removed in the future."
+)
+def fence_generic_format(math, language='math', class_name='arithmatex', options=None, md=None, **kwargs):
+    """Generic block formatter."""
+
+    return _fence_generic_format(math, language, class_name, options, md, **kwargs)
+
+
+def _fence_mathjax_format(
+    math, language='math', class_name='arithmatex', options=None, md=None, preview=False, tag="div", **kwargs
+):
+    """Block math formatter."""
+
+    text = f'<{tag} class="arithmatex">\n'
+    if preview:
+        text += (
+            '
\n' + + _escape(math) + + '\n
\n' + ) + + text += ( + '\n' + ) + text += '' + + return text + + +def _fence_generic_format( + math, language='math', class_name='arithmatex', options=None, md=None, wrap='\\[\n{}\n\\]', tag='div', **kwargs +): + """Generic block formatter.""" + + classes = kwargs['classes'] + id_value = kwargs['id_value'] + attrs = kwargs['attrs'] + + classes.insert(0, class_name) + + id_value = f' id="{id_value}"' if id_value else '' + classes = ' class="{}"'.format(' '.join(classes)) + attrs = ' ' + ' '.join(f'{k}="{v}"' for k, v in attrs.items()) if attrs else '' + + return f'<{tag}{id_value}{classes}{attrs}>{wrap.format(math)}' + + +def arithmatex_fenced_format(**kwargs): + """Specify which type of formatter you want and the wrapping tag.""" + + mode = kwargs.get('mode', 'generic') + tag = kwargs.get('tag', 'div') + preview = kwargs.get('preview', False) + + if mode == 'generic': + return partial(_fence_generic_format, tag=tag) + elif mode == 'mathjax': + return partial(_fence_mathjax_format, tag=tag, preview=preview) + + +class InlineArithmatexPattern(InlineProcessor): + """Arithmatex inline pattern handler.""" + + ESCAPED_BSLASH = '{}{}{}'.format(md_util.STX, ord('\\'), md_util.ETX) + + def __init__(self, pattern, config): + """Initialize.""" + + # Generic setup + self.generic = config.get('generic', False) + wrap = config.get('tex_inline_wrap', ["\\(", "\\)"]) + self.wrap = ( + wrap[0].replace('{', '}}').replace('}', '}}') + '{}' + wrap[1].replace('{', '}}').replace('}', '}}') + ) + self.inline_tag = config.get('inline_tag', 'span') + + # Default setup + self.preview = config.get('preview', True) + InlineProcessor.__init__(self, pattern) + + def handleMatch(self, m, data): + """Handle notations and switch them to something that will be more detectable in HTML.""" + + # Handle escapes + groups = m.groups() + escapes = groups[0] + if not escapes and len(groups) > 3: + escapes = groups[3] + if escapes: + return escapes.replace('\\\\', self.ESCAPED_BSLASH), m.start(0), m.end(0) + + # Handle Tex + math = groups[2] + if not math and len(groups) > 3: + math = groups[5] + + if self.generic: + return _inline_generic_format(math, wrap=self.wrap, tag=self.inline_tag), m.start(0), m.end(0) + else: + return _inline_mathjax_format(math, tag=self.inline_tag, preview=self.preview), m.start(0), m.end(0) + + +class BlockArithmatexProcessor(BlockProcessor): + """MathJax block processor to find $$MathJax$$ content.""" + + def __init__(self, pattern, config, md): + """Initialize.""" + + # Generic setup + self.generic = config.get('generic', False) + wrap = config.get('tex_block_wrap', ['\\[', '\\]']) + self.wrap = ( + wrap[0].replace('{', '}}').replace('}', '}}') + '{}' + wrap[1].replace('{', '}}').replace('}', '}}') + ) + self.block_tag = config.get('block_tag', 'div') + + # Default setup + self.preview = config.get('preview', False) + + self.match = None + self.pattern = re.compile(pattern) + + BlockProcessor.__init__(self, md.parser) + + def test(self, parent, block): + """Return 'True' for future Python Markdown block compatibility.""" + + self.match = self.pattern.match(block) if self.pattern is not None else None + return self.match is not None + + def mathjax_output(self, parent, math): + """Default MathJax output.""" + + grandparent = parent + parent = etree.SubElement(grandparent, self.block_tag, {'class': 'arithmatex'}) + if self.preview: + preview = etree.SubElement(parent, 'div', {'class': 'MathJax_Preview'}) + preview.text = md_util.AtomicString(math) + el = etree.SubElement(parent, 'script', {'type': 'math/tex; mode=display'}) + el.text = md_util.AtomicString(math) + + def generic_output(self, parent, math): + """Generic output.""" + + el = etree.SubElement(parent, self.block_tag, {'class': 'arithmatex'}) + el.text = md_util.AtomicString(self.wrap.format(math)) + + def run(self, parent, blocks): + """Find and handle block content.""" + + blocks.pop(0) + + groups = self.match.groupdict() + math = groups.get('math', '') + if not math: + math = groups.get('math2', '') + if not math: + math = groups.get('math3', '') + + if self.generic: + self.generic_output(parent, math) + else: + self.mathjax_output(parent, math) + + return True + + +class ArithmatexExtension(Extension): + """Adds delete extension to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'tex_inline_wrap': [ + ["\\(", "\\)"], + "Wrap inline content with the provided text ['open', 'close'] - Default: ['', '']" + ], + 'tex_block_wrap': [ + ["\\[", "\\]"], + "Wrap blick content with the provided text ['open', 'close'] - Default: ['', '']" + ], + "smart_dollar": [True, "Use Arithmatex's smart dollars - Default True"], + "block_syntax": [ + ['dollar', 'square', 'begin'], + 'Enable block syntax: "dollar" ($$...$$), "square" (\\[...\\]), and ' + '"begin" (\\begin{env}...\\end{env}). - Default: ["dollar", "square", "begin"]' + ], + "inline_syntax": [ + ['dollar', 'round'], + 'Enable block syntax: "dollar" ($$...$$), "bracket" (\\(...\\)) ' + ' - Default: ["dollar", "round"]' + ], + 'generic': [False, "Output in a generic format for non MathJax libraries - Default: False"], + 'preview': [ + True, + "Insert a preview for scripts. - Default: False" + ], + 'block_tag': ['div', "Specify wrapper tag - Default 'div'"], + 'inline_tag': ['span', "Specify wrapper tag - Default 'span'"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Extend the inline and block processor objects.""" + + md.registerExtension(self) + util.escape_chars(md, ['$']) + + config = self.getConfigs() + + # Inline patterns + allowed_inline = set(config.get('inline_syntax', ['dollar', 'round'])) + smart_dollar = config.get('smart_dollar', True) + inline_patterns = [] + if 'dollar' in allowed_inline: + inline_patterns.append(RE_SMART_DOLLAR_INLINE if smart_dollar else RE_DOLLAR_INLINE) + if 'round' in allowed_inline: + inline_patterns.append(RE_BRACKET_INLINE) + if inline_patterns: + inline = InlineArithmatexPattern('(?:%s)' % '|'.join(inline_patterns), config) + md.inlinePatterns.register(inline, 'arithmatex-inline', 189.9) + + # Block patterns + allowed_block = set(config.get('block_syntax', ['dollar', 'square', 'begin'])) + block_pattern = [] + if 'dollar' in allowed_block: + block_pattern.append(RE_DOLLAR_BLOCK) + if 'square' in allowed_block: + block_pattern.append(RE_BRACKET_BLOCK) + if 'begin' in allowed_block: + block_pattern.append(RE_TEX_BLOCK) + if block_pattern: + block = BlockArithmatexProcessor(r'(?s)^(?:%s)[ ]*$' % '|'.join(block_pattern), config, md) + md.parser.blockprocessors.register(block, "arithmatex-block", 79.9) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return ArithmatexExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/b64.py b/micromamba_root/Lib/site-packages/pymdownx/b64.py new file mode 100644 index 0000000000000000000000000000000000000000..a99e136efd6c33c26e296fc24ef827e4237da1c8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/b64.py @@ -0,0 +1,146 @@ +""" +B64. + +An extension for Python Markdown. +Given an absolute base path, this extension searches for image tags, +and if the images are local, will embed the images in base64. + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.postprocessors import Postprocessor +from . import util +import os +import base64 +import re + +RE_SLASH_WIN_DRIVE = re.compile(r"^/[A-Za-z]{1}:/.*") + +file_types = { + (".png",): "image/png", + (".jpg", ".jpeg"): "image/jpeg", + (".gif",): "image/gif", + (".svg",): "image/svg+xml", +} + +RE_TAG_HTML = re.compile( + r'''(?xus) + (?: + (?P + <\s*(?Pscript|style)[^>]*>.*? | + (?:(\r?\n?\s*)(\s*)(?=\r?\n)|) + )| + (?P<\s*(?Pimg)) + (?P(?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'))?)*) + (?P\s*(?:\/?)>) + ) + ''' +) + +RE_TAG_LINK_ATTR = re.compile( + r'''(?xus) + (?P + (?: + (?P\s+src\s*=\s*) + (?P"[^"]*"|'[^']*') + ) + ) + ''' +) + + +def repl_path(m, base_path): + """Replace path with b64 encoded data.""" + + link = m.group(0) + try: + _, _, path, _, _, _, is_url, is_absolute = util.parse_url(m.group('path')[1:-1]) + if not is_url: + path = util.url2path(path) + + if is_absolute: + file_name = os.path.normpath(path) + else: + file_name = os.path.normpath(os.path.join(base_path, path)) + + if os.path.exists(file_name): + ext = os.path.splitext(file_name)[1].lower() + for b64_ext in file_types: + if ext in b64_ext: + with open(file_name, "rb") as f: + link = " src=\"data:{};base64,{}\"".format( + file_types[b64_ext], + base64.b64encode(f.read()).decode('ascii') + ) + break + except Exception: # pragma: no cover + # Parsing crashed and burned; no need to continue. + pass + + return link + + +def repl(m, base_path): + """Replace.""" + + if m.group('avoid'): + tag = m.group('avoid') + else: + tag = m.group('open') + tag += RE_TAG_LINK_ATTR.sub(lambda m2: repl_path(m2, base_path), m.group('attr')) + tag += m.group('close') + return tag + + +class B64Postprocessor(Postprocessor): + """Post processor for B64.""" + + def run(self, text): + """Find and replace paths with base64 encoded file.""" + + basepath = self.config['base_path'] + text = RE_TAG_HTML.sub(lambda m: repl(m, basepath), text) + return text + + +class B64Extension(Extension): + """B64 extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'base_path': [".", "Base path for b64 to use to resolve paths - Default: \".\""] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add base 64 tree processor to Markdown instance.""" + + b64 = B64Postprocessor(md) + b64.config = self.getConfigs() + md.postprocessors.register(b64, "b64", 2) + md.registerExtension(self) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return B64Extension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/betterem.py b/micromamba_root/Lib/site-packages/pymdownx/betterem.py new file mode 100644 index 0000000000000000000000000000000000000000..f6a4e4b0d3e9c130a1a6578d80aae5bef0da29f3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/betterem.py @@ -0,0 +1,252 @@ +""" +Better Emphasis. + +pymdownx.betterem +Add intelligent handling of to em and strong notations + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import re +from markdown import Extension +from markdown.inlinepatterns import SimpleTextInlineProcessor +from . import util + +SMART_UNDER_CONTENT = r'(.+?_*?)' +SMART_STAR_CONTENT = r'(.+?\**?)' +SMART_STAR_LIMITED_CONTENT = r'((?:[^\*]|(?<=\w)\*+?(?=\w)|(?<=\s)\*+?(?=\s))+?)' +SMART_UNDER_LIMITED_CONTENT = r'((?:[^_]|(?<=[^\W_])_+?(?=[^\W_])|(?<=\s)_+?(?=\s))+?)' +UNDER_CONTENT = r'(_|(?:(?<=\s)_|[^_])+?)' +UNDER_CONTENT2 = r'((?:[^_]|(? ]*){}({}){}$'.format( + mutil.HTML_PLACEHOLDER[0], + mutil.HTML_PLACEHOLDER[1:-1] % r'([0-9]+)', + mutil.HTML_PLACEHOLDER[-1] + ) +) + +# Block start/end +RE_START = re.compile( + r'(?:^|\n)[ ]{0,3}(/{3,})[ ]*([\w-]+)[ ]*(?:\|[ ]*(.*?)[ ]*)?(?:\n|$)' +) + +RE_END = re.compile( + r'(?m)(?:^|\n)[ ]{0,3}(/{3,})[ ]*(?:\n|$)' +) + +# Frontmatter patterns +RE_YAML_START = re.compile(r'(?m)^[ ]{0,3}(-{3})[ ]*(?:\n|$)') + +RE_YAML_END = re.compile( + r'(?m)^[ ]{0,3}(-{3})[ ]*(?:\n|$)' +) + +RE_INDENT_YAML_LINE = re.compile(r'(?m)^(?:[ ]{4,}(?!\s).*?(?:\n|$))+') + + +class BlockEntry: + """Track Block entries.""" + + def __init__(self, block: Block, el: etree.Element, parent: etree.Element) -> None: + """Block entry.""" + + self.block: 'Block' = block + self.el: etree.Element = el + self.parent: etree.Element = parent + self.hungry: bool = False + + +def get_frontmatter(string: str) -> dict[str, Any] | None: + """ + Get frontmatter from string. + + YAML-ish key value pairs. + """ + + frontmatter = None + + try: + frontmatter = yaml.safe_load(string) + if frontmatter is None: + frontmatter = {} + if not isinstance(frontmatter, dict): + frontmatter = None + except Exception: + pass + + return cast('dict[str, Any]', frontmatter) + + +def reindent(text: str, pos: int, level: int) -> list[str]: + """Reindent the code to where it is supposed to be.""" + + indented = [] + for line in text.split('\n'): + index = pos - level + indented.append(line[index:]) + return indented + + +def unescape_markdown(md: Markdown, blocks: list[str], is_raw: bool) -> list[str]: + """Look for SuperFences code placeholders and other HTML stash placeholders and revert them back to plain text.""" + + superfences = None + try: + from ..superfences import SuperFencesBlockPreprocessor + processor = md.preprocessors['fenced_code_block'] + if isinstance(processor, SuperFencesBlockPreprocessor): + superfences = processor.extension # type: ignore[attr-defined] + except Exception: + pass + + new_blocks = [] + for block in blocks: + new_lines = [] + for line in block.split('\n'): + m = FENCED_BLOCK_RE.match(line) + if m: + key = m.group(2) + + # Extract SuperFences content + indent_level = len(m.group(1)) + original = None + if superfences is not None: + original, pos = superfences.stash.get(key, (None, None)) + if original is not None: + code = reindent(original, pos, indent_level) + new_lines.extend(code) + superfences.stash.remove(key) + + # Extract other HTML stashed content + if original is None and is_raw: + index = int(key.split(':')[1]) + if index < len(md.htmlStash.rawHtmlBlocks): + original = md.htmlStash.rawHtmlBlocks[index] + if isinstance(original, etree.Element): + original = etree.tostring(original, encoding='unicode', method='html') + new_lines.append(original) + + # Couldn't find anything to extract + if original is None: # pragma: no cover + new_lines.append(line) + else: + new_lines.append(line) + new_blocks.append('\n'.join(new_lines)) + + return new_blocks + + +class BlocksTreeprocessor(Treeprocessor): + """Blocks tree processor.""" + + def __init__(self, md: Markdown, blocks: BlocksProcessor): + """Initialize.""" + + super().__init__(md) + + self.blocks = blocks + + def run(self, root: etree.Element) -> None: + """Update tab IDs.""" + + while self.blocks.inline_stack: + entry = self.blocks.inline_stack.pop(0) + entry.block.on_inline_end(entry.el) + + +class BlocksProcessor(BlockProcessor): + """Generic block processor.""" + + def __init__(self, parser: BlockParser, md: Markdown) -> None: + """Initialization.""" + + self.md = md + + # The Block classes indexable by name + self.blocks: dict[str, type[Block]] = {} + self.config: dict[str, dict[str, Any]] = {} + self.empty_tags = {'hr',} + self.block_level_tags = set(md.block_level_elements.copy()) + self.block_level_tags.add('html') + + # Block-level tags in which the content only gets span level parsing + self.span_tags = { + 'address', 'dd', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'li', 'p', 'summary', 'td', 'th' + } + # Block-level tags which never get their content parsed. + self.raw_tags = {'canvas', 'math', 'option', 'pre', 'script', 'style', 'textarea', 'code'} + # Block-level tags in which the content gets parsed as blocks + self.block_tags = set(self.block_level_tags) - (self.span_tags | self.raw_tags | self.empty_tags) + self.span_and_blocks_tags = self.block_tags | self.span_tags + + super().__init__(parser) + + # Persistent storage across a document for blocks + self.trackers: dict[str, dict[str, Any]] = {} + # Currently queued up blocks + self.stack: list[BlockEntry] = [] + # Blocks that should be processed after inline. + self.inline_stack: list[BlockEntry] = [] + # When set, the assigned block is actively parsing blocks. + self.working: BlockEntry | None = None + # Cached the found parent when testing + # so we can quickly retrieve it when running + self.cached_parent: etree.Element | None = None + self.cached_block: tuple['Block', str] | None = None + + # Used during the alpha/beta stage + self.start = RE_START + self.end = RE_END + self.yaml_line = RE_INDENT_YAML_LINE + + def detab_by_length(self, text: str, length: int) -> tuple[str, str]: + """Remove a tab from the front of each line of the given text.""" + + newtext = [] + lines = text.split('\n') + for line in lines: + if line.startswith(' ' * length): + newtext.append(line[length:]) + elif not line.strip(): + newtext.append('') # pragma: no cover + else: + break + if newtext: + return '\n'.join(newtext), '\n'.join(lines[len(newtext):]) + return '\n'.join(lines[len(newtext):]), '' + + def register(self, b: type[Block], config: dict[str, Any]) -> None: + """Register a block.""" + + if b.NAME in self.blocks: + raise ValueError(f'The block name {b.NAME} is already registered!') + self.blocks[b.NAME] = b + self.config[b.NAME] = config + self.trackers[b.NAME] = {} + + def test(self, parent: etree.Element, block: str) -> bool: + """Test to see if we should process the block.""" + + # Are we hungry for more? + if self.get_parent(parent) is not None: + return True + + # Is this the start of a new block? + m = self.start.search(block) + if m: + + pre_text = block[:m.start()] if m.start() > 0 else None + + # Create a block object + name = m.group(2).lower() + if name in self.blocks: + generic_block = self.blocks[name](len(m.group(1)), self.trackers[name], self, self.config[name]) + + # Remove first line + block = block[m.end():] + + # Get frontmatter and argument(s) + options, the_rest = self.split_header(block, generic_block.length) + arguments = m.group(3) + + # Options must be valid + status = options is not None + + # Update the config for the Block + if status: + status = generic_block._validate(parent, arguments, **options) # type: ignore[arg-type] + + # Cache the found Block and any remaining content + if status: + self.cached_block = (generic_block, the_rest) + + # Any text before the block should get handled + if pre_text is not None: + self.parser.parseBlocks(parent, [pre_text]) + + return status + return False + + def _reset(self) -> None: + """Reset.""" + + self.stack.clear() + self.inline_stack.clear() + self.working = None + self.trackers = {d: {} for d in self.blocks.keys()} + + def split_end(self, block: str, length: int) -> tuple[str | None, str | None, bool]: + """Search for end and split the blocks while removing the end.""" + + good = None + bad = None + end = False + + # Find the end of the Block + m = None + for match in self.end.finditer(block): + if len(match.group(1)) == length: + m = match + break + + # Separate everything from before the "end" and after + if m: + temp = block[:m.start(0)] + if temp: + good = temp[:-1] if temp.endswith('\n') else temp + end = True + + # Since we found our end, everything after is unwanted + temp = block[m.end(0):] + if temp: + bad = temp + else: + # Gather blocks until we find our end + good = block + + # Send back the new list of blocks to parse and note whether we found our end + return good, bad, end + + def split_header(self, block: str, length: int) -> tuple[dict[str, Any] | None, str]: + """Split, YAML-ish header out.""" + + # Search for end in first block + m = None + blocks: list[str] = [] + for match in self.end.finditer(block): + if len(match.group(1)) == length: + m = match + break + + # Move block ending to be parsed later + if m: + end = block[m.start(0):] + blocks.insert(0, end) + block = block[:m.start(0)] + + m = self.yaml_line.match(block) + if m is not None: + config = textwrap.dedent(m.group(0)) + blocks.insert(0, block[m.end():]) + if config.strip(): + return get_frontmatter(config), '\n'.join(blocks) + + blocks.insert(0, block) + + return {}, '\n'.join(blocks) + + def get_parent(self, parent: etree.Element) -> etree.Element | None: + """Get parent.""" + + # Returned the cached parent from our last attempt + if self.cached_parent is not None: + parent = self.cached_parent + self.cached_parent = None + return parent + + temp: etree.Element | None = parent + while temp is not None: + if not self.stack: + break + if self.stack[-1].hungry and self.stack[-1].parent is temp: + self.cached_parent = temp + return temp + if temp is not None: + temp = self.lastChild(temp) + return None + + def is_raw(self, tag: etree.Element) -> bool: + """Is tag raw.""" + + return tag.tag in self.raw_tags + + def is_block(self, tag: etree.Element) -> bool: + """Is tag block.""" + + return tag.tag in self.block_tags + + def parse_blocks(self, blocks: list[str], current_parent: etree.Element) -> None: + """Parse the blocks.""" + + # Get the target element and parse + while blocks and self.stack: + b: str | None = blocks.pop(0) + + # Get the latest block on the stack + # This is required to avoid some issues with `md_in_html` + entry = self.stack[-1] + target = entry.block.on_add(entry.el) + + # Since we are juggling the block parsers on the stack, the pipeline + # has not fully adjusted list indentation, so look at how many + # list item parents we have on the stack and adjust the content + # accordingly. + parent_map = {c: p for p in current_parent.iter() for c in p} + # Only need to count lists between nested blocks + parent = self.stack[-1].el if len(self.stack) > 1 else None + li = 0 + while parent is not None: + parent = parent_map.get(parent, None) + if parent is not None: + if parent.tag in ('li', 'dd'): + li += 1 + continue + break + + b, a = self.detab_by_length(cast(str, b), li * self.tab_length) + if a: + blocks.insert(0, a) + + # Split out blocks we care about + b, bad, end = self.split_end(b, entry.block.length) + if bad is not None: + blocks.insert(0, bad) + + # Parse the block under the given target + if b is not None and target is not None: + # Resolve modes + mode = entry.block.on_markdown() + if mode not in ('block', 'inline', 'raw'): + mode = 'auto' + is_block = mode == 'block' or (mode == 'auto' and self.is_block(target)) + is_atomic = mode == 'raw' or (mode == 'auto' and self.is_raw(target)) + + # We should revert fenced code in spans or atomic tags. + # Make sure atomic tags have content wrapped as `AtomicString`. + if is_atomic or not is_block: + child = list(target)[-1] if len(target) else None + text = target.text if child is None else child.tail + b = '\n\n'.join(unescape_markdown(self.md, [b], is_atomic)).strip('\n') + + if text: + text += b if not b else '\n\n' + b + else: + text = b + + if child is None: + target.text = mutil.AtomicString(text) if is_atomic else text + else: # pragma: no cover + # TODO: We would need to build a special plugin to test this, + # as none of the default ones do this, but we have verified this + # locally. Once we've written a test, we can remove this. + child.tail = mutil.AtomicString(text) if is_atomic else text + + # Block tags should have content go through the normal block processor + else: + self.parser.state.set('blocks') + working = self.working + self.working = entry + self.parser.parseChunk(target, b) + self.parser.state.reset() + self.working = working + + # Run "on end" event when we finish a block + if end: + entry.block._end(entry.el) + self.inline_stack.append(entry) + del self.stack[-1] + + # The Block does not or no longer accepts more content + if target is None: # pragma: no cover + break + + if self.stack: + self.stack[-1].hungry = True + + def capture_leaked_content(self, parent: etree.Element, entry: BlockEntry) -> None: + """ + Capture leaked content. + + Old school, non-block admonitions, details, + and content tabs strongly control where there content is inserted and + can cause content leakage outside of the Blocks container. + Look for such content and pull it back into the container if found. + """ + + last_child = self.lastChild(parent) + if last_child is not None and last_child is not entry.el: + target = entry.block.on_add(entry.el) + parent.remove(last_child) + target.append(last_child) + + def run(self, parent: etree.Element, blocks: list[str]) -> None: + """Convert to details/summary block.""" + + # Get the appropriate parent for this Block + temp = self.get_parent(parent) + if temp is not None: + parent = temp + + # Did we find a new Block? + if self.cached_block: + # Get cached Block and reset the cache + generic_block, block = self.cached_block + self.cached_block = None + + # Discard first block as we've already processed what we need from it + blocks.pop(0) + if block: + blocks.insert(0, block) + + # Ensure a "tight" parent list item is converted to "loose". + if parent is not None and parent.tag in ('li', 'dd'): # pragma: no cover + text = parent.text + if parent.text: + parent.text = '' + p = etree.SubElement(parent, 'p') + p.text = text + + # Create the block element + el = generic_block._create(parent) + + # Push a Block entry on the stack. + self.stack.append(BlockEntry(generic_block, el, parent)) + + # Parse the text blocks under the Block + self.parse_blocks(blocks, parent) + + else: + for r in range(len(self.stack)): + entry = self.stack[r] + if entry.hungry and parent is entry.parent: + + # Capture leaked content from old-school extensions: admonition, details, tabbed, etc. + self.capture_leaked_content(parent, entry) + + # Get the target element and parse + entry.hungry = False + self.parse_blocks(blocks, parent) + + break + + +class BlocksMgrExtension(Extension): + """Add generic Blocks extension.""" + + def extendMarkdown(self, md: Markdown) -> None: + """Add Blocks to Markdown instance.""" + + md.registerExtension(self) + util.escape_chars(md, ['/']) + self.extension = BlocksProcessor(md.parser, md) + # We want to be right after list indentations are processed + md.parser.blockprocessors.register(self.extension, "blocks", 89.99) + + tree = BlocksTreeprocessor(md, self.extension) + md.treeprocessors.register(tree, 'blocks_on_inline_end', 19.99) + + def reset(self) -> None: + """Reset.""" + + self.extension._reset() + + +class BlocksExtension(Extension): + """Blocks Extension.""" + + def register_block_mgr(self, md: Markdown) -> BlocksProcessor: + """Add Blocks to Markdown instance.""" + + if 'blocks' not in md.parser.blockprocessors: + ext = BlocksMgrExtension() + ext.extendMarkdown(md) + mgr = ext.extension + else: + mgr = cast('BlocksProcessor', md.parser.blockprocessors['blocks']) + return mgr + + def extendMarkdown(self, md: Markdown) -> None: + """Extend markdown.""" + + mgr = self.register_block_mgr(md) + self.extendMarkdownBlocks(md, mgr) + + def extendMarkdownBlocks(self, md: Markdown, block_mgr: BlocksProcessor) -> None: + """Extend Markdown blocks.""" diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/admonition.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/admonition.py new file mode 100644 index 0000000000000000000000000000000000000000..b078fbe7859ff1cfff6ec6e0513a6bed7ec0b6bf --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/admonition.py @@ -0,0 +1,125 @@ +"""Admonitions.""" +import xml.etree.ElementTree as etree +from .block import Block, type_html_identifier +from .. blocks import BlocksExtension +import re + +RE_SEP = re.compile(r'[_-]+') + + +class Admonition(Block): + """ + Admonition. + + Arguments (1 optional): + - A title. + + Options: + - `type` (string): Attach a single special class for styling purposes. If more are needed, + use the built-in `attributes` options to apply as many classes as desired. + + Content: + Detail body. + """ + + NAME = 'admonition' + ARGUMENT = None + OPTIONS = { + 'type': ('', type_html_identifier), + } + DEF_TITLE = None + DEF_CLASS = None + + def on_validate(self, parent): + """Handle on validate event.""" + + if self.NAME != 'admonition': + self.options['type'] = {'name': self.NAME} + if self.DEF_TITLE: + self.options['type']['title'] = self.DEF_TITLE + if self.DEF_TITLE: + self.options['type']['class'] = self.DEF_CLASS + return True + + def on_create(self, parent): + """Create the element.""" + + # Set classes + classes = ['admonition'] + obj = self.options['type'] + atype = def_title = class_name = '' + if isinstance(obj, dict): + atype = obj['name'] + class_name = obj.get('class', atype) + def_title = obj.get('title', RE_SEP.sub(' ', class_name).title()) + elif isinstance(obj, str): + atype = obj + class_name = atype + def_title = RE_SEP.sub(' ', atype).title() + + if atype and atype != 'admonition': + classes.append(class_name) + + # Create the admonition + el = etree.SubElement(parent, 'div', {'class': ' '.join(classes)}) + + # Create the title + title = None + if self.argument is None: + if atype: + title = def_title + elif self.argument: + title = self.argument + + if title is not None: + ad_title = etree.SubElement(el, 'p', {'class': 'admonition-title'}) + ad_title.text = title + + return el + + +class AdmonitionExtension(BlocksExtension): + """Admonition Blocks Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + "types": [ + ['note', 'attention', 'caution', 'danger', 'error', 'tip', 'hint', 'warning', 'important'], + "Generate Admonition block extensions for the given types." + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + block_mgr.register(Admonition, self.getConfigs()) + + # Generate an admonition subclass based on the given names. + for obj in self.getConfig('types', []): + if isinstance(obj, dict): + name = obj['name'] + class_name = obj.get('class', name) + title = obj.get('title', RE_SEP.sub(' ', class_name).title()) + else: + name = obj + class_name = name + title = RE_SEP.sub(' ', class_name).title() + subclass = RE_SEP.sub('', name).title() + block_mgr.register( + type( + subclass, + (Admonition,), + {'OPTIONS': {}, 'NAME': name, 'DEF_TITLE': title, 'DEF_CLASS': class_name} + ), + {} + ) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return AdmonitionExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/block.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/block.py new file mode 100644 index 0000000000000000000000000000000000000000..3e937d8adcddfc25db9357546379fea09585cdfa --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/block.py @@ -0,0 +1,401 @@ +"""Block class.""" +from __future__ import annotations +from abc import ABCMeta, abstractmethod +import functools +import copy +import re +import sys +from markdown import util as mutil +import xml.etree.ElementTree as etree +from typing import Any, Callable, TypeVar, TYPE_CHECKING +from collections.abc import Iterable + +if TYPE_CHECKING: # pragma: no cover + from ..blocks import BlocksProcessor + +RE_IDENT = re.compile( + r''' + (?:(?:-?(?:[^\x00-\x2f\x30-\x40\x5B-\x5E\x60\x7B-\x9f])+|--) + (?:[^\x00-\x2c\x2e\x2f\x3A-\x40\x5B-\x5E\x60\x7B-\x9f])*) + ''', + re.I | re.X +) + +RE_INDENT = re.compile(r'(?m)^([ ]*)[^ \n]') + +RE_DEDENT = re.compile(r'(?m)^([ ]*)($)?') + +_T = TypeVar("_T") + + +def _type_multi(value: Any, types: Iterable[Callable[[Any], _T]] = ()) -> _T: + """Multi types.""" + + for t in types: + try: + return t(value) + except ValueError: # noqa: PERF203 + pass + + raise ValueError(f"Type '{type(value)}' did not match any of the provided types") + + +def type_multi(*args: Callable[[Any], _T]) -> Callable[[Any], _T]: + """Validate a type with multiple type functions.""" + + return functools.partial(_type_multi, types=args) + + +def type_any(value: _T) -> _T: + """Accepts any type.""" + + return value + + +def type_none(value: Any) -> None: + """Ensure type None or fail.""" + + if value is not None: + raise ValueError(f'{type(value)} is not None') + + +def _ranged_number( + value: Any, + minimum: int | float | None, + maximum: int | float | None, + number_type: Callable[[Any], int | float] +) -> int | float: + """Check the range of the given number type.""" + + _value = number_type(value) + if minimum is not None and _value < minimum: + raise ValueError(f'{_value} is not greater than {minimum}') + + if maximum is not None and _value > maximum: + raise ValueError(f'{_value} is not greater than {minimum}') + + return _value + + +def type_number(value: Any) -> int | float: + """Ensure type number or fail.""" + + if not isinstance(value, (float, int)): + raise ValueError(f"Could not convert type {type(value)} to a number") + + return value + + +def type_integer(value: Any) -> int: + """Ensure type integer or fail.""" + + if isinstance(value, int): + return value + + if not isinstance(value, float) or not value.is_integer(): + raise ValueError(f"Could not convert type {type(value)} to an integer") + return int(value) + + +def type_ranged_number(minimum: int | None = None, maximum: int | None = None) -> Callable[[Any], int | float]: + """Ensure typed number is within range.""" + + return functools.partial(_ranged_number, minimum=minimum, maximum=maximum, number_type=type_number) + + +def type_ranged_integer(minimum: int | None = None, maximum: int | None = None) -> Callable[[Any], int | float]: + """Ensured type integer is within range.""" + + return functools.partial(_ranged_number, minimum=minimum, maximum=maximum, number_type=type_integer) + + +def type_boolean(value: Any) -> bool: + """Ensure type boolean or fail.""" + + if not isinstance(value, bool): + raise ValueError(f"Could not convert type {type(value)} to a boolean") + return value + + +type_ternary = type_multi(type_none, type_boolean) + + +def type_string(value: Any) -> str: + """Ensure type string or fail.""" + + if isinstance(value, str): + return value + + raise ValueError(f"Could not convert type {type(value)} to a string") + + +def type_string_insensitive(value: Any) -> str: + """Ensure type string and normalize case.""" + + return type_string(value).lower() + + +def type_html_identifier(value: Any) -> str: + """Ensure type HTML attribute name or fail.""" + + value = type_string(value) + m = RE_IDENT.fullmatch(value) + if m is None: + raise ValueError('A valid attribute name must be provided') + return m.group(0) + + +def _delimiter(string: Any, split: str, string_type: Callable[[Any], str]) -> list[str]: + """Split the string by the delimiter and then parse with the parser.""" + + l = [] + # Ensure input is a string + _string = type_string(string) + for s in _string.split(split): + s = s.strip() + if not s: + continue + # Ensure each part conforms to the desired string type + s = string_type(s) + l.append(s) + return l + + +def _string_in(value: Any, accepted: Iterable[str], string_type: Callable[[Any], str]) -> str: + """Ensure type string is within the accepted values.""" + + _value = string_type(value) + if _value not in accepted: + raise ValueError(f'{_value} not found in {accepted!s}') + return _value + + +def type_string_in(accepted: Iterable[str], insensitive: bool = True) -> Callable[[Any], str]: + """Ensure type string is within the accepted list.""" + + return functools.partial( + _string_in, + accepted=accepted, + string_type=type_string_insensitive if insensitive else type_string + ) + + +def type_string_delimiter(split: str, string_type: Callable[[Any], str] = type_string) -> Callable[[Any], list[str]]: + """String delimiter function.""" + + return functools.partial(_delimiter, split=split, string_type=string_type) + + +def type_html_attribute_dict(value: Any) -> dict[str, str | list[str]]: + """Attribute dictionary.""" + + if not isinstance(value, dict): + raise ValueError('Attributes should be contained within a dictionary') + + attributes = {} + for k, v in value.items(): + k = type_html_identifier(k) + if k.lower() == 'class': + k = 'class' + v = type_html_classes(v) + elif k.lower() == 'id': + k = 'id' + v = type_html_identifier(v) + else: + v = type_string(v) + attributes[k] = v + + return attributes + + +# Ensure class(es) or fail +type_html_classes = type_string_delimiter(' ', type_html_identifier) + + +class Block(metaclass=ABCMeta): + """Block.""" + + # Set to something if argument should be split. + # Arguments will be split and white space stripped. + NAME = '' + + # Instance arguments and options + ARGUMENT: bool | None = False + OPTIONS: dict[str, tuple[Any, Callable[[Any], Any]]] = {} + + def __init__(self, length: int, tracker: Any, block_mgr: BlocksProcessor, config: Any): + """ + Initialize. + + - `length` specifies the length (number of slashes) that the header used + - `tracker` is a persistent storage for the life of the current Markdown page. + It is a dictionary where we can keep references until the parent extension is reset. + - `md` is the Markdown object just in case access is needed to something we + didn't think about. + + """ + + # Setup up the argument and options spec + # Note that `attributes` is handled special and we always override it + self.arg_spec = self.ARGUMENT + self.option_spec = copy.deepcopy(self.OPTIONS) + if 'attrs' in self.option_spec: # pragma: no cover + raise ValueError("'attrs' is a reserved option name and cannot be overriden") + self.option_spec['attrs'] = ({}, type_html_attribute_dict) + + self._block_mgr = block_mgr + self.length = length + self.tracker = tracker + self.md = block_mgr.md + self.arguments: list[Any] = [] + self.options: dict[str, Any] = {} + self.config = config + self.on_init() + + def is_raw(self, tag: etree.Element) -> bool: + """Is raw element.""" + + return self._block_mgr.is_raw(tag) + + def is_block(self, tag: etree.Element) -> bool: # pragma: no cover + """Is block element.""" + + return self._block_mgr.is_block(tag) + + def html_escape(self, text: str) -> str: + """Basic html escaping.""" + + text = text.replace('&', '&') + text = text.replace('<', '<') + text = text.replace('>', '>') + return text + + def dedent(self, text: str, length: int | None = None) -> str: + """Dedent raw text.""" + + if length is None: + length = self.md.tab_length + + min_length = sys.maxsize + for x in RE_INDENT.findall(text): + min_length = min(len(x), min_length) + min_length = min(min_length, length) + + def on_match(m: re.Match[str], l: int = min_length) -> str: + return '' if m.group(2) is not None else m.group(1)[l:] + + return RE_DEDENT.sub(on_match, text) + + def on_init(self) -> None: + """On initialize.""" + + return + + def on_markdown(self) -> str: + """Check how element should be treated by the Markdown parser.""" + + return "auto" + + def _validate(self, parent: etree.Element, arg: Any, **options: Any) -> bool: + """Parse configuration.""" + + # Check argument + if (self.arg_spec is not None and ((arg and not self.arg_spec) or (not arg and self.arg_spec))): + return False + + self.argument = arg + + # Fill in defaults options + spec = self.option_spec + parsed = {} + for k, v in spec.items(): + parsed[k] = v[0] + + # Parse provided options + for k, v in options.items(): + + # Parameter not in spec + if k not in spec: + # Unrecognized parameter name + return False + + # Spec explicitly handles parameter + else: + parser = spec[k][1] + if parser is not None: + try: + v = parser(v) + except Exception: + # Invalid parameter value + return False + parsed[k] = v + + # Add parsed options to options + self.options = parsed + + return self.on_validate(parent) + + def on_validate(self, parent: etree.Element) -> bool: + """ + Handle validation event. + + Run after config parsing completes and allows for the opportunity + to invalidate the block if argument, options, or even the parent + element do not meet certain criteria. + + Return `False` to invalidate the block. + """ + + return True + + @abstractmethod + def on_create(self, parent: etree.Element) -> etree.Element: + """Create the needed element and return it.""" + + def _create(self, parent: etree.Element) -> etree.Element: + """Create the element.""" + + el = self.on_create(parent) + + # Handle general HTML attributes + attrib = el.attrib + for k, v in self.options['attrs'].items(): + if k == 'class': + if k in attrib: + # Don't validate what the developer as already attached + v = type_string_delimiter(' ')(attrib['class']) + v + attrib['class'] = ' '.join(v) + else: + attrib[k] = v + return el + + def _end(self, block: etree.Element) -> None: + """Reached end of the block, dedent raw blocks and call `on_end` hook.""" + + mode = self.on_markdown() + add = self.on_add(block) + if mode == 'raw' or (mode == 'auto' and self.is_raw(add)): + text = add.text if add.text is not None else '' + add.text = mutil.AtomicString(self.dedent(text)) + + self.on_end(block) + + def on_end(self, block: etree.Element) -> None: + """Perform any action on end.""" + + return + + def on_add(self, block: etree.Element) -> etree.Element: + """ + Adjust where the content is added and return the desired element. + + Is there a sub-element where this content should go? + This runs before processing every new block. + """ + + return block + + def on_inline_end(self, block: etree.Element) -> None: + """Perform action on the block after inline parsing.""" + + return diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/caption.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/caption.py new file mode 100644 index 0000000000000000000000000000000000000000..81d6bba40530dae414931bf826e17ffd39715127 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/caption.py @@ -0,0 +1,417 @@ +""" +Captions. + +Captions should be placed after a block, that block will be wrapped in a `figure` +and captions will be inserted either at the end of the figure or at the beginning. +If the preceding block happens to be a `figure`, if no `figcaption` is detected +within, the caption will be injected into that figure instead of wrapping. +Keep in mind that when `md_in_html` is used and raw HTML is used, if `markdown=1` +is not present on the caption, the caption will be invisible to this extension. + +Class, IDs, or other attributes will be attached to the figure, not the caption. + +`types`: + A dictionary with figure type names and prefix templates. A template will be + used depending on whether the current type is assumed or directly specified. +`prepend`: + Will prepend `figcaption` at the start of a `figure` instead of the end. +`auto`: + Will generate IDs and prefixes via the provided template for all figures of + a given type as long as they also define a prefix template. +`auto_level`: + Auto number will not be shown below the given level depth. A value of 0, the + default, disables the feature, 1 would show only auto-generate IDs and + prefixes for the outermost figures with prefixes, etc. This level is only + considered for each figure type individually. + +""" +import xml.etree.ElementTree as etree +from .block import Block, type_html_identifier +from .. blocks import BlocksExtension +from .html import parse_selectors +from markdown.treeprocessors import Treeprocessor +import re + +RE_FIG_NUM = re.compile(r'^(\^)?([1-9][0-9]*(?:\.[1-9][0-9]*)*)(?= |$)') +RE_SEP = re.compile(r'[_-]+') + + +def update_tag(el, fig_type, fig_num, template, prepend, md): + """Update tag ID and caption prefix.""" + + # Auto add an ID + if 'id' not in el.attrib: + el.attrib['id'] = f'__{fig_type}_' + '_'.join(str(x) for x in fig_num.split('.')) + + # Prefix the caption with a given numbered prefix + if template: + for child in list(el) if prepend else reversed(el): + if child.tag == 'figcaption': + children = list(child) + value = md.htmlStash.store(template.format(fig_num)) + if not len(children) or children[0].tag != 'p': + p = etree.Element('p') + span = etree.SubElement(p, 'span', {'class': 'caption-prefix'}) + span.text = value + p.tail = child.text + child.text = None + child.insert(0, p) + else: + p = children[0] + span = etree.Element('span', {'class': 'caption-prefix'}) + span.text = value + empty = not bool(p.text) + span.tail = (' ' + p.text) if not empty else p.text + p.text = None + p.insert(0, span) + + +class CaptionTreeprocessor(Treeprocessor): + """Caption tree processor.""" + + def __init__(self, md, types, config): + """Initialize.""" + + super().__init__(md) + + self.auto = config['auto'] + self.prepend = config['prepend'] + self.type = '' + self.auto_level = max(0, config['auto_level']) + self.fig_types = types + + def run(self, doc): + """Update caption IDs and prefixes.""" + + parent_map = {c: p for p in doc.iter() for c in p} + last = dict.fromkeys(self.fig_types, 0) + counters = {k: [0] for k in self.fig_types} + fig_type = last_type = self.type + figs = [] + fig_num = '' + + # Calculate the depth and iteration at that depth of the given figure. + for el in doc.iter(): + fig_num = '' + stack = -1 + if el.tag == 'figure': + fig_type = last_type + prepend = False + skip = False + + # Find caption appended or prepended + if '__figure_prepend' in el.attrib: + prepend = True + del el.attrib['__figure_prepend'] + + # Determine figure type + if '__figure_type' in el.attrib: + fig_type = el.attrib['__figure_type'] + figs.append(el) + # See if we have an unknown type or the type has no prefix template. + if fig_type not in self.fig_types or not self.fig_types[fig_type]: + continue + else: + # Found a figure that was not generated by this plugin. + continue + + # Handle a specified relative nesting depth + if '__figure_level' in el.attrib: + stack += int(el.attrib['__figure_level']) + 1 + if self.auto_level and stack >= self.auto_level: + continue + else: + stack += 1 + + current = el + while True: + parent = parent_map.get(current, None) + + # No more parents + if parent is None: + break + + # Check if parent element is a figure of the current type + if parent.tag == 'figure' and parent.attrib['__figure_type'] == fig_type: + # See if position in stack is manually specified + level = '__figure_level' in parent.attrib + if level: + stack += int(parent.attrib['__figure_level']) + 1 + else: + stack += 1 + if level: + el.attrib['__figure_level'] = str(stack + 1) + # Ensure position in stack is not deeper than the specified level + if self.auto_level and stack >= self.auto_level: + skip = True + break + + current = parent + + if skip: + # Parent has been skipped so all children are also skipped + continue + + # Found an appropriate figure at an acceptable depth + if stack > -1: + # Handle a manual number + if '__figure_num' in el.attrib: + fig_num = [int(x) for x in el.attrib['__figure_num'].split('.')] + del el.attrib['__figure_num'] + new_stack = len(fig_num) - 1 + el.attrib['__figure_level'] = new_stack - stack + stack = new_stack + + # Increment counter + l = last[fig_type] + counter = counters[fig_type] + if stack > l: + counter.extend([1] * (stack - l)) + elif stack == l: + counter[stack] += 1 + else: + del counter[stack + 1:] + counter[-1] += 1 + last[fig_type] = stack + last_type = fig_type + + # Determine if manual number is not smaller than existing figure numbers at that depth + if fig_num and fig_num > counter: + counter[:] = fig_num[:] + + # Apply prefix and ID + update_tag( + el, + fig_type, + '.'.join(str(x) for x in counter[:stack + 1]), + self.fig_types.get(fig_type, ''), + prepend, + self.md + ) + + # Clean up attributes + for fig in figs: + del fig.attrib['__figure_type'] + if '__figure_level' in fig.attrib: + del fig.attrib['__figure_level'] + + +class Caption(Block): + """Figure captions.""" + + NAME = '' + PREFIX = '' + CLASSES = '' + ARGUMENT = None + OPTIONS = { + 'type': ('', type_html_identifier) + } + + def on_init(self): + """Initialize.""" + + self.auto = self.config['auto'] + self.prepend = self.config['prepend'] + self.caption = None + self.fig_num = '' + self.level = '' + self.classes = self.CLASSES.split() + + def on_validate(self, parent): + """Handle on validate event.""" + + argument = self.argument + if argument: + if argument.startswith('>'): + self.prepend = False + argument = argument[1:].lstrip() + elif argument.startswith('<'): + self.prepend = True + argument = argument[1:].lstrip() + + m = RE_FIG_NUM.match(argument) + if m: + if m.group(1): + self.level = m.group(2) + else: + self.fig_num = m.group(2) + argument = argument[m.end():].lstrip() + + if argument: + + try: + _, attrs = parse_selectors(argument, require_tag=False) + except ValueError: + return False + attrs_original = dict(self.options['attrs']) + for k, v in attrs.items(): + if k == 'class': + classes = {x for x in attrs_original.get('class', []) if x} + classes |= {x for x in v.split(' ') if x} + attrs_original['class'] = sorted(classes) + elif k not in attrs_original: + attrs_original[k] = v + self.options['attrs'] = attrs_original + return True + + return True + + def on_create(self, parent): + """Create the element.""" + + # Find sibling to add caption to. + fig = None + child = None + children = list(parent) + if children: + child = children[-1] + # Do we have a figure with no caption? + if child.tag == 'figure': + fig = child + for c in list(child): + if c.tag == 'figcaption': + fig = None + break + + # Create a new figure if sibling is not a figure or already has a caption. + # Add sibling to the new figure. + if fig is None: + attrib = {} if not self.classes else {'class': ' '.join(self.classes)} + fig = etree.SubElement(parent, 'figure', attrib) + if child is not None: + fig.append(child) + parent.remove(child) + + # Add classes to existing figure + elif self.CLASSES: + classes = fig.attrib.get('class', '').strip() + if classes: + class_list = classes.split() + for c in self.classes: + if c not in class_list: + classes += " " + c + else: + classes = ' '.join(self.classes) + fig.attrib['class'] = classes + + if self.auto: + fig.attrib['__figure_type'] = self.NAME + if self.level: + fig.attrib['__figure_level'] = self.level + if self.fig_num: + fig.attrib['__figure_num'] = self.fig_num + + # Add caption to the target figure. + if self.prepend: + if self.auto: + fig.attrib['__figure_prepend'] = "1" + self.caption = etree.Element('figcaption') + fig.insert(0, self.caption) + else: + self.caption = etree.SubElement(fig, 'figcaption') + + return fig + + def on_add(self, block): + """Return caption as the target container for content.""" + + return self.caption + + def on_end(self, block): + """Handle explicit, manual prefixes on block end.""" + + prefix = self.PREFIX + if prefix and not self.auto: + # Levels should not be used in manual mode, but if they are, give a generic result. + if self.level: + self.fig_num = '.'.join(['1'] * (int(self.level) + 1)) + if self.fig_num: + update_tag( + block, + self.NAME, + self.fig_num, + prefix, + self.prepend, + self.md + ) + + +class CaptionExtension(BlocksExtension): + """Caption Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + "types": [ + [ + 'caption', + { + 'name': 'figure-caption', + 'prefix': 'Figure {}.' + }, + { + 'name': 'table-caption', + 'prefix': 'Table {}.' + } + ], + "Configure types a list of types, each type is a dictionary that defines a 'name' and 'prefix' " + "A template must contain '{}' for numerical insertions unless the template is an empty string " + "which will assume no prefix should be used." + ], + "auto_level": [ + 0, + "Depth of children to add prefixes to - Default: 0" + ], + "auto": [ + True, + "Auto add IDs with prefixes (prefixes are only added if prefix template is defined) - Default: False" + ], + "prepend": [ + False, + "Prepend captions opposed to appending - Default: False" + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + config = self.getConfigs() + + # Generate an details subclass based on the given names. + types = {} + for obj in config['types']: + if isinstance(obj, dict): + name = obj['name'] + prefix = obj.get('prefix', '') + classes = obj.get('classes', '') + else: + name = obj + prefix = '' + classes = '' + types[name] = prefix + subclass = RE_SEP.sub('', name).title() + block_mgr.register( + type( + subclass, + (Caption,), + { + 'OPTIONS': {}, + 'NAME': name, + 'PREFIX': prefix, + 'CLASSES': classes + } + ), + {'auto_level': config['auto_level'], 'auto': config['auto'], 'prepend': config['prepend']} + ) + + if config['auto']: + md.treeprocessors.register(CaptionTreeprocessor(md, types, config), 'caption-auto', 4) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return CaptionExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/definition.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/definition.py new file mode 100644 index 0000000000000000000000000000000000000000..56b61058c16da1e56bf4126eed04001655a3c280 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/definition.py @@ -0,0 +1,65 @@ +"""Definition.""" +import xml.etree.ElementTree as etree +from .block import Block +from ..blocks import BlocksExtension + + +class Definition(Block): + """ + Definition. + + Converts non `ul`, `ol` blocks (ideally `p` tags) into `dt` + and will convert first level `li` elements of `ul` and `ol` + elements to `dd` tags. When done, the `ul`, and `ol` elements + will be removed. + """ + + NAME = 'define' + + def on_create(self, parent): + """Create the element.""" + + return etree.SubElement(parent, 'dl') + + def on_end(self, block): + """Convert non list items to details.""" + + remove = [] + offset = 0 + for i, child in enumerate(list(block)): + if child.tag.lower() in ('dt', 'dd'): + continue + + elif child.tag.lower() not in ('ul', 'ol'): + if child.tag.lower() == 'p': + child.tag = 'dt' + else: + dt = etree.Element('dt') + dt.append(child) + block.insert(i + offset, dt) + block.remove(child) + else: + for li in list(child): + offset += 1 + li.tag = 'dd' + block.insert(i + offset, li) + child.remove(li) + remove.append(child) + + for el in remove: + block.remove(el) + + +class DefinitionExtension(BlocksExtension): + """Definition Blocks Extension.""" + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + block_mgr.register(Definition, self.getConfigs()) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return DefinitionExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/details.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/details.py new file mode 100644 index 0000000000000000000000000000000000000000..58677234443eb85ff3ee03cdd04f82f7a5470687 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/details.py @@ -0,0 +1,138 @@ +"""Details.""" +import xml.etree.ElementTree as etree +from .block import Block, type_boolean, type_html_identifier +from ..blocks import BlocksExtension +import re + +RE_SEP = re.compile(r'[_-]+') + + +class Details(Block): + """ + Details. + + Arguments (1 optional): + - A summary. + + Options: + - `open` (boolean): force the details block to be in an open state opposed to collapsed. + - `type` (string): Attach a single special class for styling purposes. If more are needed, + use the built-in `attributes` options to apply as many classes as desired. + + Content: + Detail body. + """ + + NAME = 'details' + + ARGUMENT = None + OPTIONS = { + 'open': (False, type_boolean), + 'type': ('', type_html_identifier) + } + + DEF_TITLE = None + DEF_CLASS = None + + def on_validate(self, parent): + """Handle on validate event.""" + + if self.NAME != 'details': + self.options['type'] = {'name': self.NAME} + if self.DEF_TITLE: + self.options['type']['title'] = self.DEF_TITLE + if self.DEF_TITLE: + self.options['type']['class'] = self.DEF_CLASS + return True + + def on_create(self, parent): + """Create the element.""" + + # Is it open? + attributes = {} + if self.options['open']: + attributes['open'] = 'open' + + # Set classes + obj = self.options['type'] + dtype = def_title = class_name = '' + if isinstance(obj, dict): + dtype = obj['name'] + class_name = obj.get('class', dtype) + def_title = obj.get('title', RE_SEP.sub(' ', class_name).title()) + elif isinstance(obj, str): + dtype = obj + class_name = dtype + def_title = RE_SEP.sub(' ', class_name).title() + if dtype: + attributes['class'] = class_name + + # Create Detail element + el = etree.SubElement(parent, 'details', attributes) + + # Create the summary + summary = None + if self.argument is None: + if dtype: + summary = def_title + elif self.argument: + summary = self.argument + + # Create the summary + if summary is not None: + s = etree.SubElement(el, 'summary') + s.text = summary + + return el + + +class DetailsExtension(BlocksExtension): + """Admonition Blocks Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + "types": [ + [], + "Generate Admonition block extensions for the given types." + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + block_mgr.register(Details, self.getConfigs()) + + # Generate an details subclass based on the given names. + for obj in self.getConfig('types', []): + if isinstance(obj, dict): + name = obj['name'] + class_name = obj.get('class', name) + title = obj.get('title', RE_SEP.sub(' ', class_name).title()) + else: + name = obj + class_name = name + title = RE_SEP.sub(' ', class_name).title() + subclass = RE_SEP.sub('', name).title() + block_mgr.register( + type( + subclass, + (Details,), + { + 'OPTIONS': {'open': [False, type_boolean]}, + 'NAME': name, + 'DEF_TITLE': title, + 'DEF_CLASS': class_name + } + ), + {} + ) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return DetailsExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/html.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/html.py new file mode 100644 index 0000000000000000000000000000000000000000..c0750731dbce4f395191943a6d87afa410637493 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/html.py @@ -0,0 +1,219 @@ +"""HTML.""" +import xml.etree.ElementTree as etree +from .block import Block, type_string_in +from ..blocks import BlocksExtension +import re + +# Sub-patterns parts +# Whitespace +WS = r'(?:[ \t])' +# CSS escapes +CSS_ESCAPES = fr'(?:\\(?:[a-f0-9]{{1,6}}{WS}?|[^\r\n\f]|$))' +# CSS Identifier +IDENTIFIER = r''' +(?:(?:-?(?:[^\x00-\x2f\x30-\x40\x5B-\x5E\x60\x7B-\x9f])+|--) +(?:[^\x00-\x2c\x2e\x2f\x3A-\x40\x5B-\x5E\x60\x7B-\x9f])*) +''' +# Value: quoted string or identifier +VALUE = r''' +(?:"(?:\\(?:.)|[^\\"\r\n\f]+)*?"|'(?:\\(?:.)|[^\\'\r\n\f]+)*?'|{ident}+) +'''.format(ident=IDENTIFIER) +# Attribute value comparison. +ATTR = r''' +(?:{ws}*(?P=){ws}*(?P{value}))? +'''.format(ws=WS, value=VALUE) +# Selector patterns +# IDs (`#id`) +PAT_ID = fr'\#{IDENTIFIER}' +# Classes (`.class`) +PAT_CLASS = fr'\.{IDENTIFIER}' +# Attributes (`[attr]`, `[attr=value]`, etc.) +PAT_ATTR = r''' +\[(?:{ws}*(?P{ident}){attr})+{ws}*\] +'''.format(ws=WS, ident=IDENTIFIER, attr=ATTR) + +RE_IDENT = re.compile(IDENTIFIER, flags=re.I | re.X) +RE_ID = re.compile(PAT_ID, flags=re.I | re.X) +RE_CLASS = re.compile(PAT_CLASS, flags=re.I | re.X) +RE_ATTRS = re.compile(PAT_ATTR, flags=re.I | re.X) +RE_ATTR = re.compile(fr'(?P{IDENTIFIER}){ATTR}', flags=re.I | re.X) + +ATTRIBUTES = {'id': RE_ID, 'class': RE_CLASS, 'attr': RE_ATTRS} +VALID_MODES = {'auto', 'inline', 'block', 'raw', 'html'} + + +def parse_selectors(selector, require_tag=True): + """Parse the selector.""" + + eol = len(selector) + tag = None + attrs = {} + end = 0 + m = None + + if require_tag: + m = RE_IDENT.match(selector) + if m is None: + raise ValueError('No defined tag') + tag = m.group(0) + end = m.end() + + found_id = False + while end < eol: + for atype, pat in ATTRIBUTES.items(): + m = pat.match(selector, end) + if m is not None: + if atype == 'id': + if not found_id: + attrs[atype] = m.group(0)[1:] + end = m.end() + found_id = True + else: + raise ValueError('Only one ID is allowed') + elif atype == 'class': + if atype not in attrs: + attrs[atype] = [m.group(0)[1:]] + else: + attrs[atype].append(m.group(0)[1:]) + end = m.end() + else: + results = m.group(0) + m2 = RE_ATTR.search(results) + while m2 is not None: + pos = m2.end() + name = m2.group('attr_name').lower() + value = m2.group('value') + if value is None: + value = name if name != 'class' else '' + elif value.startswith(('"', "'")): + value = value[1:-1] + + if name == 'class': + value = [v for v in value.split(' ') if v] + if value: + if name in attrs: + attrs[name].extend(value) + else: + attrs[name] = value + else: + value = value + attrs[name] = value + m2 = RE_ATTR.search(results, pos) + end = m.end() + break + + if m is None: + raise ValueError('Invalid selector') + + if 'class' in attrs: + attrs['class'] = ' '.join(sorted(attrs['class'])) + + return tag, attrs + + +class HTML(Block): + """ + HTML. + + Arguments (1 required): + - HTML tag name + + Options: + - `markdown` (string): specify how content inside the element should be treated: + - `auto`: will automatically determine how an element's content should be handled. + - `inline`: treat content as an inline element's content. + - `block`: treat content as a block element's content. + - `raw`: treat the content as raw content (atomic). + + Content: + HTML element content. + """ + + NAME = 'html' + ARGUMENT = True + OPTIONS = { + 'markdown': ('auto', type_string_in(VALID_MODES)) + } + + def __init__(self, length, tracker, md, config): + """Initialize.""" + + self.markdown = None + self.custom = {} + for entry in config.get('custom'): + mode = entry.get('mode', 'auto') + self.custom[entry['tag']] = mode if mode in VALID_MODES else 'auto' + super().__init__(length, tracker, md, config) + + def on_validate(self, parent): + """Handle argument parsing.""" + + try: + self.tag, self.attr = parse_selectors(self.argument) + except ValueError: + return False + + return True + + def on_markdown(self): + """Check if this is atomic.""" + + mode = self.options['markdown'] + if mode == 'auto': + tag = self.tag.lower() + mode = self.custom.get(tag, mode) + + if mode == 'html': + mode = 'raw' + return mode + + def on_create(self, parent): + """Create the element.""" + + # Create element + return etree.SubElement(parent, self.tag.lower(), self.attr) + + def is_html(self, tag): + """Does tag require no processing and no HTML escaping.""" + + return tag.tag in ('script', 'style') + + def on_end(self, block): + """On end event.""" + + mode = self.options['markdown'] + if mode == 'auto': + tag = self.tag.lower() + mode = self.custom.get(tag, mode) + + if (mode == 'auto' and self.is_html(block)) or mode == 'html': + block.text = self.md.htmlStash.store(block.text) + elif (mode == 'auto' and self.is_raw(block)) or mode == 'raw': + block.text = self.md.htmlStash.store(self.html_escape(block.text)) + + +class HTMLExtension(BlocksExtension): + """HTML Blocks Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + "custom": [ + [], + "Specify handling for custom blocks." + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + block_mgr.register(HTML, self.getConfigs()) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return HTMLExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/blocks/tab.py b/micromamba_root/Lib/site-packages/pymdownx/blocks/tab.py new file mode 100644 index 0000000000000000000000000000000000000000..52042393da972f9f6b901689b08fc59e2e55f916 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/blocks/tab.py @@ -0,0 +1,303 @@ +"""Tabs.""" +import xml.etree.ElementTree as etree +from markdown.extensions import toc +from markdown.treeprocessors import Treeprocessor +from .block import Block, type_boolean +from ..blocks import BlocksExtension +import html + +HEADERS = {'h1', 'h2', 'h3', 'h4', 'h5', 'h6'} + + +class TabbedTreeprocessor(Treeprocessor): + """Tab tree processor.""" + + def __init__(self, md, config): + """Initialize.""" + + super().__init__(md) + + self.alternate = config['alternate_style'] + self.slugify = config['slugify'] + self.combine_header_slug = config['combine_header_slug'] + self.sep = config["separator"] + + def get_parent_header_slug(self, root, header_map, parent_map, el): + """Attempt retrieval of parent header slug.""" + + parent = el + last_parent = parent + while parent is not root: + last_parent = parent + parent = parent_map[parent] + if parent in header_map: + headers = header_map[parent] + header = None + for i in list(parent): + if i is el and header is None: + break + if i is last_parent and header is not None: + return header.attrib.get("id", '') + if i in headers: + header = i + return '' + + def run(self, doc): + """Update tab IDs.""" + + # Get a list of id attributes + used_ids = set() + parent_map = {} + header_map = {} + + if self.combine_header_slug: + parent_map = {c: p for p in doc.iter() for c in p} + + for el in doc.iter(): + if "id" in el.attrib: + if self.combine_header_slug and el.tag in HEADERS: + parent = parent_map[el] + if parent in header_map: + header_map[parent].append(el) + else: + header_map[parent] = [el] + used_ids.add(el.attrib["id"]) + + for el in doc.iter(): + if isinstance(el.tag, str) and el.tag.lower() == 'div': + classes = el.attrib.get('class', '').split() + if 'tabbed-set' in classes and (not self.alternate or 'tabbed-alternate' in classes): + inputs = [] + labels = [] + if self.alternate: + for i in list(el): + if i.tag == 'input': + inputs.append(i) + if i.tag == 'div' and i.attrib.get('class', '') == 'tabbed-labels': + labels = [j for j in list(i) if j.tag == 'label'] + else: + for i in list(el): + if i.tag == 'input': + inputs.append(i) + if i.tag == 'label': + labels.append(i) + + # Generate slugged IDs + for inpt, label in zip(inputs, labels): + innerhtml = toc.render_inner_html(toc.remove_fnrefs(label), self.md) + innertext = html.unescape(toc.strip_tags(innerhtml)) + if self.combine_header_slug: + parent_slug = self.get_parent_header_slug(doc, header_map, parent_map, el) + else: + parent_slug = '' + slug = self.slugify(innertext, self.sep) + if parent_slug: + slug = parent_slug + self.sep + slug + slug = toc.unique(slug, used_ids) + inpt.attrib["id"] = slug + label.attrib["for"] = slug + + +class Tab(Block): + """ + Tabbed container. + + Arguments (1 required): + - A tab title. + + Options: + - `new` (boolean): since consecutive tabs are automatically grouped, `new` can force a tab + to start a new tab container. + + Content: + Detail body. + """ + + NAME = 'tab' + + ARGUMENT = True + OPTIONS = { + 'new': (False, type_boolean), + 'select': (False, type_boolean) + } + + def on_init(self): + """Handle initialization.""" + + self.alternate_style = self.config['alternate_style'] + self.slugify = callable(self.config['slugify']) + + # Track tab group count across the entire page. + if 'tab_group_count' not in self.tracker: + self.tracker['tab_group_count'] = 0 + + self.tab_content = None + + def last_child(self, parent): + """Return the last child of an `etree` element.""" + + if len(parent): + return parent[-1] + else: + return None + + def on_add(self, block): + """Adjust where the content is added.""" + + if self.tab_content is None: + if self.alternate_style: + for d in block.findall('div'): + c = d.attrib['class'] + if c == 'tabbed-content' or c.startswith('tabbed-content '): + self.tab_content = list(d)[-1] + break + else: + self.tab_content = list(block)[-1] + + return self.tab_content + + def on_create(self, parent): + """Create the element.""" + + new_group = self.options['new'] + select = self.options['select'] + title = self.argument + sibling = self.last_child(parent) + tabbed_set = 'tabbed-set' if not self.alternate_style else 'tabbed-set tabbed-alternate' + index = 0 + labels = None + content = None + + if ( + sibling is not None and sibling.tag.lower() == 'div' and + sibling.attrib.get('class', '') == tabbed_set and + not new_group + ): + first = False + tab_group = sibling + + if self.alternate_style: + index = [index for index, _ in enumerate(tab_group.findall('input'), 1)][-1] + for d in tab_group.findall('div'): + if d.attrib['class'] == 'tabbed-labels': + labels = d + elif d.attrib['class'] == 'tabbed-content': + content = d + if labels is not None and content is not None: + break + else: + first = True + self.tracker['tab_group_count'] += 1 + tab_group = etree.SubElement( + parent, + 'div', + {'class': tabbed_set, 'data-tabs': '%d:0' % self.tracker['tab_group_count']} + ) + + if self.alternate_style: + labels = etree.SubElement( + tab_group, + 'div', + {'class': 'tabbed-labels'} + ) + content = etree.SubElement( + tab_group, + 'div', + {'class': 'tabbed-content'} + ) + + data = tab_group.attrib['data-tabs'].split(':') + tab_set = int(data[0]) + tab_count = int(data[1]) + 1 + + attributes = { + "name": "__tabbed_%d" % tab_set, + "type": "radio" + } + + if not self.slugify: + attributes['id'] = "__tabbed_%d_%d" % (tab_set, tab_count) + + attributes2 = {"for": "__tabbed_%d_%d" % (tab_set, tab_count)} if not self.slugify else {} + + if first or select: + attributes['checked'] = 'checked' + # Remove any previously assigned "checked states" to siblings + for i in tab_group.findall('input'): + if i.attrib.get('name', '') == f'__tabbed_{tab_set}': + if 'checked' in i.attrib: + del i.attrib['checked'] + + if self.alternate_style: + input_el = etree.Element( + 'input', + attributes + ) + tab_group.insert(index, input_el) + lab = etree.SubElement( + labels, + "label", + attributes2 + ) + lab.text = title + + attrib = {'class': 'tabbed-block'} + etree.SubElement( + content, + "div", + attrib + ) + else: + etree.SubElement( + tab_group, + 'input', + attributes + ) + lab = etree.SubElement( + tab_group, + "label", + attributes2 + ) + lab.text = title + + etree.SubElement( + tab_group, + "div", + { + "class": "tabbed-content" + } + ) + + tab_group.attrib['data-tabs'] = '%d:%d' % (tab_set, tab_count) + + return tab_group + + +class TabExtension(BlocksExtension): + """Admonition Blocks Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'alternate_style': [False, "Use alternate style - Default: False"], + 'slugify': [0, "Slugify function used to create tab specific IDs - Default: None"], + 'combine_header_slug': [False, "Combine the tab slug with the slug of the parent header - Default: False"], + 'separator': ['-', "Slug separator - Default: '-'"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, block_mgr): + """Extend Markdown blocks.""" + + block_mgr.register(Tab, self.getConfigs()) + if callable(self.getConfig('slugify')): + slugs = TabbedTreeprocessor(md, self.getConfigs()) + md.treeprocessors.register(slugs, 'tab_slugs', 4) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return TabExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/caret.py b/micromamba_root/Lib/site-packages/pymdownx/caret.py new file mode 100644 index 0000000000000000000000000000000000000000..747bc7ece40e4dee81da727adbc397190b0f3021 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/caret.py @@ -0,0 +1,186 @@ +""" +Caret. + +pymdownx.caret +Really simple plugin to add support for + +`test` tags as `^^test^^` and +`test` tags as `^test^` + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import re +from markdown import Extension +from markdown.inlinepatterns import SimpleTextInlineProcessor +from . import util + +SMART_CONTENT = r'(.+?\^*?)' +SMART_LIMITED_CONTENT = r'((?:[^\^]|(?<=\w)\^+?(?=\w)|(?<=\s)\^+?(?=\s))+?)' +CONTENT = r'(\^|[^\s]+?)' +CONTENT2 = r'((?:[^\^]|(?test` tags as `^^test^^` and `test` tags as `^test^`.""" + + config = self.getConfigs() + insert = bool(config.get('insert', True)) + superscript = bool(config.get('superscript', True)) + smart = bool(config.get('smart_insert', True)) + + md.registerExtension(self) + + escape_chars = [] + if insert or superscript: + escape_chars.append('^') + if superscript: + escape_chars.append(' ') + util.escape_chars(md, escape_chars) + + caret = None + md.inlinePatterns.register(SimpleTextInlineProcessor(NOT_CARET), 'not_tilde', 70) + if insert and superscript: + caret = CaretSmartProcessor(r'\^') if smart else CaretProcessor(r'\^') + elif insert: + caret = CaretSmartInsertProcessor(r'\^') if smart else CaretInsertProcessor(r'\^') + elif superscript: + caret = CaretSupProcessor(r'\^') + + if caret is not None: + md.inlinePatterns.register(caret, "sup_ins", 65) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return InsertSupExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/critic.py b/micromamba_root/Lib/site-packages/pymdownx/critic.py new file mode 100644 index 0000000000000000000000000000000000000000..808b5fb30d2eb632a17738eb8c7f51d1219c3d1a --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/critic.py @@ -0,0 +1,327 @@ +""" +Critic. + +pymdownx.critic +Parses critic markup and outputs the file in a more visual HTML. +Must be the last extension loaded. + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.preprocessors import Preprocessor +from markdown.postprocessors import Postprocessor +from markdown.util import STX, ETX +import re + +SOH = '\u0001' # start +EOT = '\u0004' # end + +CRITIC_KEY = "czjqqkd:%s" +CRITIC_PLACEHOLDER = CRITIC_KEY % r'[0-9]+' +SINGLE_CRITIC_PLACEHOLDER = r'{stx}(?P{key}){etx}'.format( + key=CRITIC_PLACEHOLDER, stx=STX, etx=ETX +) +CRITIC_PLACEHOLDERS = r'''(?x) +(?: + (?P\(?P(?:{stx}{key}{etx})+)\) | + {single} +) +'''.format( + key=CRITIC_PLACEHOLDER, single=SINGLE_CRITIC_PLACEHOLDER, + stx=STX, etx=ETX +) +ALL_CRITICS = r'''(?x) +((?P(?P\{) + (?: + (?P\+{2}) + (?P.*?) + (?P\+{2}) + + | (?P\-{2}) + (?P.*?) + (?P\-{2}) + + | (?P\={2}) + (?P.*?) + (?P\={2}) + + | (?P + (?P\>{2}) + (?P.*?) + (?P\<{2}) + ) + + | (?P\~{2}) + (?P.*?) + (?P\~\>) + (?P.*?) + (?P\~{2}) + ) +(?P\}))) +''' + +RE_CRITIC = re.compile(ALL_CRITICS, re.DOTALL) +RE_CRITIC_PLACEHOLDER = re.compile(CRITIC_PLACEHOLDERS) +RE_CRITIC_SUB_PLACEHOLDER = re.compile(SINGLE_CRITIC_PLACEHOLDER) +RE_CRITIC_BLOCK = re.compile(r'((?:ins|del|mark)\s+)(class=([\'"]))(.*?)(\3)') +RE_BLOCK_SEP = re.compile(r'^(?:\r?\n){2,}$') + + +class CriticStash: + """Stash critic marks until ready.""" + + def __init__(self, stash_key): + """Initialize.""" + + self.stash_key = stash_key + self.stash = {} + self.count = 0 + + def __len__(self): # pragma: no cover + """Get length of stash.""" + return len(self.stash) + + def get(self, key, default=None): + """Get the specified item from the stash.""" + + code = self.stash.get(key, default) + return code + + def remove(self, key): # pragma: no cover + """Remove the specified item from the stash.""" + + del self.stash[key] + + def store(self, code): + """ + Store the code in the stash with the placeholder. + + Return placeholder. + """ + key = self.stash_key % str(self.count) + self.stash[key] = code + self.count += 1 + return SOH + key + EOT + + def clear(self): + """Clear the stash.""" + + self.stash = {} + self.count = 0 + + +class CriticsPostprocessor(Postprocessor): + """Handle cleanup on post process for viewing critic marks.""" + + def __init__(self, critic_stash): + """Initialize.""" + + super().__init__() + self.critic_stash = critic_stash + + def subrestore(self, m): + """Replace all critic tags in the paragraph block `

(critic del close)(critic ins close)

` etc.""" + content = None + key = m.group('key') + if key is not None: + content = self.critic_stash.get(key) + return content + + def block_edit(self, m): + """Handle block edits.""" + + if 'break' in m.group(4).split(' '): + return m.group(0) + else: + return m.group(1) + m.group(2) + m.group(4) + ' block' + m.group(5) + + def restore(self, m): + """Replace placeholders with actual critic tags.""" + + content = None + if m.group('block_keys') is not None: + content = RE_CRITIC_SUB_PLACEHOLDER.sub( + self.subrestore, m.group('block_keys') + ) + if content is not None: + content = RE_CRITIC_BLOCK.sub(self.block_edit, content) + else: + text = self.critic_stash.get(m.group('key')) + if text is not None: + content = text + return content if content is not None else m.group(0) + + def run(self, text): + """Replace critic placeholders.""" + + text = RE_CRITIC_PLACEHOLDER.sub(self.restore, text) + + return text + + +class CriticViewPreprocessor(Preprocessor): + """Handle viewing critic marks in Markdown content.""" + + def __init__(self, critic_stash): + """Initialize.""" + + super().__init__() + self.critic_stash = critic_stash + + def _ins(self, text): + """Handle critic inserts.""" + + if RE_BLOCK_SEP.match(text): + return '\n\n%s\n\n' % self.critic_stash.store(' ') + return ( + self.critic_stash.store('') + + text + + self.critic_stash.store('') + ) + + def _del(self, text): + """Handle critic deletes.""" + + if RE_BLOCK_SEP.match(text): + return self.critic_stash.store(' ') + return ( + self.critic_stash.store('') + + text + + self.critic_stash.store('') + ) + + def _mark(self, text): + """Handle critic marks.""" + + return ( + self.critic_stash.store('') + + text + + self.critic_stash.store('') + ) + + def _comment(self, text): + """Handle critic comments.""" + + return ( + self.critic_stash.store( + '' + + self.html_escape(text, strip_nl=True) + + '' + ) + ) + + def critic_view(self, m): + """Insert appropriate HTML to tags to visualize Critic marks.""" + + if m.group('ins_open'): + return self._ins(m.group('ins_text')) + elif m.group('del_open'): + return self._del(m.group('del_text')) + elif m.group('sub_open'): + return ( + self._del(m.group('sub_del_text')) + + self._ins(m.group('sub_ins_text')) + ) + elif m.group('mark_open'): + return self._mark(m.group('mark_text')) + elif m.group('com_open'): + return self._comment(m.group('com_text')) + + def critic_parse(self, m): + """ + Normal critic parser. + + Either removes accepted or rejected critic marks and replaces with the opposite. + Comments are removed and marks are replaced with their content. + """ + accept = self.config["mode"] == 'accept' + if m.group('ins_open'): + return m.group('ins_text') if accept else '' + elif m.group('del_open'): + return '' if accept else m.group('del_text') + elif m.group('mark_open'): + return m.group('mark_text') + elif m.group('com_open'): + return '' + elif m.group('sub_open'): + return m.group('sub_ins_text') if accept else m.group('sub_del_text') + + def html_escape(self, txt, strip_nl=False): + """Basic html escaping.""" + + txt = txt.replace('&', '&') + txt = txt.replace('<', '<') + txt = txt.replace('>', '>') + txt = txt.replace('"', '"') + txt = txt.replace("\n", "
" if not strip_nl else ' ') + return txt + + def run(self, lines): + """Process critic marks.""" + + # Determine processor type to use + if self.config['mode'] == "view": + processor = self.critic_view + else: + processor = self.critic_parse + + # Find and process critic marks + text = RE_CRITIC.sub(processor, '\n'.join(lines)) + + return text.split('\n') + + +class CriticExtension(Extension): + """Critic extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'mode': [ + 'view', + "Critic mode to run in: 'view', 'accept', or 'reject' - Default: view " + ], + 'raw_view': [False, "Raw view keeps the output as the raw markup for view mode - Default False"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Register the extension.""" + + md.registerExtension(self) + self.critic_stash = CriticStash(CRITIC_KEY) + post = CriticsPostprocessor(self.critic_stash) + critic = CriticViewPreprocessor(self.critic_stash) + critic.config = self.getConfigs() + md.preprocessors.register(critic, "critic", 31.1) + md.postprocessors.register(post, "critic-post", 25) + md.registerExtensions(["pymdownx._bypassnorm"], {}) + + def reset(self): + """Clear stash.""" + + self.critic_stash.clear() + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return CriticExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/details.py b/micromamba_root/Lib/site-packages/pymdownx/details.py new file mode 100644 index 0000000000000000000000000000000000000000..9694211aa623d7c53dfff61f2cdaace8d5ac3e6d --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/details.py @@ -0,0 +1,189 @@ +""" +Details. + +pymdownx.details + +MIT license. + +Copyright (c) 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.blockprocessors import BlockProcessor +import xml.etree.ElementTree as etree +import re + + +class DetailsProcessor(BlockProcessor): + """Details block processor.""" + + START = re.compile( + r'(?:^|\n)\?{3}(\+)? ?(?:([\w\-]+(?: +[\w\-]+)*?)?(?: +"(.*?)")|([\w\-]+(?: +[\w\-]+)*?)) *(?:\n|$)' + ) + COMPRESS_SPACES = re.compile(r' {2,}') + + def __init__(self, parser): + """Initialization.""" + + super().__init__(parser) + + self.current_sibling = None + self.content_indention = 0 + + def detab_by_length(self, text, length): + """Remove a tab from the front of each line of the given text.""" + + newtext = [] + lines = text.split('\n') + for line in lines: + if line.startswith(' ' * length): + newtext.append(line[length:]) + elif not line.strip(): + newtext.append('') # pragma: no cover + else: + break + return '\n'.join(newtext), '\n'.join(lines[len(newtext):]) + + def parse_content(self, parent, block): + """ + Get sibling details. + + Retrieve the appropriate sibling element. This can get tricky when + dealing with lists. + + """ + + old_block = block + non_details = '' + + # We already acquired the block via test + if self.current_sibling is not None: + sibling = self.current_sibling + block, non_details = self.detab_by_length(block, self.content_indent) + self.current_sibling = None + self.content_indent = 0 + return sibling, block, non_details + + sibling = self.lastChild(parent) + + if sibling is None or sibling.tag.lower() != 'details': + sibling = None + else: + # If the last child is a list and the content is indented sufficient + # to be under it, then the content's is sibling is in the list. + last_child = self.lastChild(sibling) + indent = 0 + while last_child is not None: + if ( + sibling is not None and block.startswith(' ' * self.tab_length * 2) and + last_child is not None and last_child.tag in ('ul', 'ol', 'dl') + ): + + # The expectation is that we'll find an `
  • `. + # We should get it's last child as well. + sibling = self.lastChild(last_child) + last_child = self.lastChild(sibling) if sibling is not None else None + + # Context has been lost at this point, so we must adjust the + # text's indentation level so it will be evaluated correctly + # under the list. + block = block[self.tab_length:] + indent += self.tab_length + else: + last_child = None + + if not block.startswith(' ' * self.tab_length): + sibling = None + + if sibling is not None: + indent += self.tab_length + block, non_details = self.detab_by_length(old_block, indent) + self.current_sibling = sibling + self.content_indent = indent + + return sibling, block, non_details + + def test(self, parent, block): + """Test block.""" + + if self.START.search(block): + return True + else: + return self.parse_content(parent, block)[0] is not None + + def run(self, parent, blocks): + """Convert to details/summary block.""" + + block = blocks.pop(0) + m = self.START.search(block) + + if m: + # remove the first line + if m.start() > 0: + self.parser.parseBlocks(parent, [block[:m.start()]]) + block = block[m.end():] + block, non_details = self.detab(block) + else: + sibling, block, non_details = self.parse_content(parent, block) + + if m: + state = m.group(1) + is_open = state is not None + + if m.group(4): + class_name = self.COMPRESS_SPACES.sub(' ', m.group(4).lower()) + title = class_name.split(' ')[0].capitalize() + else: + classes = m.group(2) + class_name = '' if classes is None else self.COMPRESS_SPACES.sub(' ', classes.lower()) + title = m.group(3) + + div = etree.SubElement(parent, 'details', ({'open': 'open'} if is_open else {})) + if class_name: + div.set('class', class_name) + summary = etree.SubElement(div, 'summary') + summary.text = title + else: + # Sibling is a list item, but we need to wrap it's content should be wrapped in

    + if sibling.tag in ('li', 'dd') and sibling.text: + text = sibling.text + sibling.text = '' + p = etree.SubElement(sibling, 'p') + p.text = text + + div = sibling + + self.parser.parseChunk(div, block) + + if non_details: + # Insert the non-details content back into blocks + blocks.insert(0, non_details) + + +class DetailsExtension(Extension): + """Add Details extension.""" + + def extendMarkdown(self, md): + """Add Details to Markdown instance.""" + md.registerExtension(self) + + md.parser.blockprocessors.register(DetailsProcessor(md.parser), "details", 105) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return DetailsExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/emoji.py b/micromamba_root/Lib/site-packages/pymdownx/emoji.py new file mode 100644 index 0000000000000000000000000000000000000000..d6180ee5c775b296745733fae2aab7d9d994e386 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/emoji.py @@ -0,0 +1,441 @@ +""" +Emoji. + +pymdownx.emoji +Emoji extension for EmojiOne's, GitHub's, or Twemoji's gemoji. + +MIT license. + +Copyright (c) 2016 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.inlinepatterns import InlineProcessor +from markdown.postprocessors import Postprocessor +from markdown import util as md_util +import xml.etree.ElementTree as etree +import inspect +import copy +from . import util + +RE_EMOJI = r'(:[+\-\w]+:)' +SUPPORTED_INDEXES = ('emojione', 'gemoji', 'twemoji') +UNICODE_VARIATION_SELECTOR_16 = 'fe0f' +EMOJIONE_SVG_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/assets/svg/' +EMOJIONE_PNG_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/assets/png/' +TWEMOJI_SVG_CDN = 'https://cdn.jsdelivr.net/gh/jdecked/twemoji@16.0.1/assets/svg/' +TWEMOJI_PNG_CDN = 'https://cdn.jsdelivr.net/gh/jdecked/twemoji@16.0.1/assets/72x72/' +GITHUB_UNICODE_CDN = 'https://github.githubassets.com/images/icons/emoji/unicode/' +GITHUB_CDN = 'https://github.githubassets.com/images/icons/emoji/' +NO_TITLE = 'none' +LONG_TITLE = 'long' +SHORT_TITLE = 'short' +VALID_TITLE = (LONG_TITLE, SHORT_TITLE, NO_TITLE) +UNICODE_ENTITY = 'html_entity' +UNICODE_ALT = ('unicode', UNICODE_ENTITY) +LEGACY_ARG_COUNT = 8 + +MSG_INDEX_WARN = """Using emoji indexes with no arguments is now deprecated. +Emoji indexes now take 2 arguments: 'options' and 'md'. +Please update your custom index accordingly. +""" + +MSG_BAD_EMOJI = """ +Emoji Extension (strict mode): The following emoji were detected and either had +their name change, were removed, or have never existed. + +{} +""" + + +def add_attributes(options, attributes): + """Add additional attributes from options.""" + + attr = options.get('attributes', {}) + if attr: + for k, v in attr.items(): + attributes[k] = v + + +# Exists for backwards compatibility as this function +# was initially spelled incorrectly. +add_attriubtes = add_attributes + + +def emojione(options, md): + """The EmojiOne index.""" + + from . import emoji1_db as emoji_map + return { + "name": emoji_map.name, + "emoji": copy.deepcopy(emoji_map.emoji), + "aliases": copy.deepcopy(emoji_map.aliases) + } + + +def gemoji(options, md): + """The Gemoji index.""" + + from . import gemoji_db as emoji_map + return { + "name": emoji_map.name, + "emoji": copy.deepcopy(emoji_map.emoji), + "aliases": copy.deepcopy(emoji_map.aliases) + } + + +def twemoji(options, md): + """The Twemoji index.""" + + from . import twemoji_db as emoji_map + return { + "name": emoji_map.name, + "emoji": copy.deepcopy(emoji_map.emoji), + "aliases": copy.deepcopy(emoji_map.aliases) + } + + +################### +# Converters +################### +def to_png(index, shortname, alias, uc, alt, title, category, options, md): + """Return PNG element.""" + + if index == 'gemoji': + def_image_path = GITHUB_UNICODE_CDN + def_non_std_image_path = GITHUB_CDN + elif index == 'twemoji': + def_image_path = TWEMOJI_PNG_CDN + def_non_std_image_path = TWEMOJI_PNG_CDN + else: + def_image_path = EMOJIONE_PNG_CDN + def_non_std_image_path = EMOJIONE_PNG_CDN + + is_unicode = uc is not None + classes = options.get('classes', index) + + # In general we can use the alias, but github specific images don't have one for each alias. + # We can tell we have a github specific if there is no Unicode value. + if is_unicode: + image_path = options.get('image_path', def_image_path) + else: # pragma: no cover + image_path = options.get('non_standard_image_path', def_non_std_image_path) + + src = "{}{}.png".format( + image_path, + uc if is_unicode else shortname[1:-1] + ) + + attributes = { + "class": classes, + "alt": alt, + "src": src + } + + if title: + attributes['title'] = title + + add_attributes(options, attributes) + + return etree.Element("img", attributes) + + +def to_svg(index, shortname, alias, uc, alt, title, category, options, md): + """Return SVG element.""" + + if index == 'twemoji': + svg_path = TWEMOJI_SVG_CDN + else: + svg_path = EMOJIONE_SVG_CDN + + attributes = { + "class": options.get('classes', index), + "alt": alt, + "src": "{}{}.svg".format( + options.get('image_path', svg_path), + uc + ) + } + + if title: + attributes['title'] = title + + add_attributes(options, attributes) + + return etree.Element("img", attributes) + + +def to_png_sprite(index, shortname, alias, uc, alt, title, category, options, md): + """Return PNG sprite element.""" + + attributes = { + "class": '%(class)s-%(size)s-%(category)s _%(unicode)s' % { + "class": options.get('classes', index), + "size": options.get('size', '64'), + "category": (category if category else ''), + "unicode": uc + } + } + + if title: + attributes['title'] = title + + add_attributes(options, attributes) + + el = etree.Element("span", attributes) + el.text = md_util.AtomicString(alt) + + return el + + +def to_svg_sprite(index, shortname, alias, uc, alt, title, category, options, md): + """ + Return SVG sprite element. + + ``` + %(alt)s + + ``` + """ + + xlink_href = '{}#emoji-{}'.format( + options.get('image_path', './../assets/sprites/emojione.sprites.svg'), uc + ) + svg = etree.Element("svg", {"class": options.get('classes', index)}) + desc = etree.SubElement(svg, 'description') + desc.text = md_util.AtomicString(alt) + etree.SubElement(svg, 'use', {'xlink:href': xlink_href}) + + return svg + + +def to_alt(index, shortname, alias, uc, alt, title, category, options, md): + """Return html entities.""" + + return md.htmlStash.store(alt) + + +################### +# Classes +################### +class EmojiPattern(InlineProcessor): + """Return element of type `tag` with a text attribute of group(2) of an `InlineProcessor`.""" + + def __init__(self, pattern, config, strict_mode, md): + """Initialize.""" + + InlineProcessor.__init__(self, pattern, md) + + title = config['title'] + alt = config['alt'] + self.options = config['options'] + self._set_index(config["emoji_index"]) + self.unicode_alt = alt in UNICODE_ALT + self.encoded_alt = alt == UNICODE_ENTITY + self.remove_var_sel = config['remove_variation_selector'] + self.title = title if title in VALID_TITLE else NO_TITLE + self.generator = config['emoji_generator'] + self.strict = config['strict'] + self.strict_cache = strict_mode + + def _set_index(self, index): + """Set the index.""" + + if len(inspect.getfullargspec(index).args): + self.emoji_index = index(self.options, self.md) + else: + util.warn_deprecated(MSG_INDEX_WARN) + self.emoji_index = index() + + def _remove_variation_selector(self, value): + """Remove variation selectors.""" + + return value.replace('-' + UNICODE_VARIATION_SELECTOR_16, '') + + def _get_unicode_char(self, value): + """Get the Unicode char.""" + + return ''.join([util.get_char(int(c, 16)) for c in value.split('-')]) + + def _get_unicode(self, emoji): + """ + Get Unicode and Unicode alt. + + Unicode: This is the stripped down form of the Unicode, no joining chars and no variation chars. + Unicode code points are not always valid. If this is present and there is no 'unicode_alt', + Unicode code points can be counted on as valid. For the most part, the returned `uc` should + be used to reference image files, or create classes, but for inserting actual Unicode, 'uc_alt' + should be used. + + Unicode Alt: When present, this will always be valid Unicode points. This contains not just the + needed characters to identify the Unicode emoji, but the formatting as well. Joining characters + and variation characters will be present. If you don't want variation chars, enable the global + 'remove_variation_selector' option. + """ + + uc = emoji.get('unicode') + uc_alt = emoji.get('unicode_alt', uc) + if uc_alt and self.remove_var_sel: + uc_alt = self._remove_variation_selector(uc_alt) + + return uc, uc_alt + + def _get_title(self, shortname, emoji): + """Get the title.""" + + if self.title == LONG_TITLE: + title = emoji['name'] + elif self.title == SHORT_TITLE: + title = shortname + else: + title = None + return title + + def _get_alt(self, shortname, uc_alt): + """Get alt form.""" + + if uc_alt is None or not self.unicode_alt: + alt = shortname + else: + alt = self._get_unicode_char(uc_alt) + if self.encoded_alt: + alt = ''.join( + [md_util.AMP_SUBSTITUTE + ('#x%04x;' % util.get_ord(point)) for point in util.get_code_points(alt)] + ) + return alt + + def _get_category(self, emoji): + """Get the category.""" + + return emoji.get('category') + + def handleMatch(self, m, data): + """Handle emoji pattern matches.""" + + el = m.group(1) + + shortname = self.emoji_index['aliases'].get(el, el) + alias = None if shortname == el else el + emoji = self.emoji_index['emoji'].get(shortname, None) + if emoji: + uc, uc_alt = self._get_unicode(emoji) + title = self._get_title(el, emoji) + alt = self._get_alt(el, uc_alt) + category = self._get_category(emoji) + el = self.generator( + self.emoji_index['name'], + shortname, + alias, + uc, + alt, + title, + category, + self.options, + self.md + ) + elif self.strict: + self.strict_cache.add(shortname) + + return el, m.start(0), m.end(0) + + +class EmojiAlertPostprocessor(Postprocessor): + """Post processor to strip out unwanted content.""" + + def __init__(self, strict_cache, md): + """Initialize.""" + + self.strict_cache = strict_cache + + def run(self, text): + """Strip out ids and classes for a simplified HTML output.""" + + if len(self.strict_cache): + raise RuntimeError( + MSG_BAD_EMOJI.format('\n'.join([f'- {x}' for x in sorted(self.strict_cache)])) + ) + return text + + +class EmojiExtension(Extension): + """Add emoji extension to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'emoji_index': [ + emojione, + "Function that returns the desired emoji index. - Default: 'pymdownx.emoji.emojione'" + ], + 'emoji_generator': [ + to_png, + "Emoji generator method. - Default: pymdownx.emoji.to_png" + ], + 'title': [ + 'short', + "What title to use on images. You can use 'long' which shows the long name, " + "'short' which shows the shortname (:short:), or 'none' which shows no title. " + "- Default: 'short'" + ], + 'alt': [ + 'unicode', + "Control alt form. 'short' sets alt to the shortname (:short:), 'uniocde' sets " + "alt to the raw Unicode value, and 'html_entity' sets alt to the HTML entity. " + "- Default: 'unicode'" + ], + 'remove_variation_selector': [ + False, + "Remove variation selector 16 from unicode. - Default: False" + ], + 'strict': [ + False, + "When enabled, if an emoji with a missing name is detected, an exception will be raised." + ], + 'options': [ + {}, + "Emoji options see documentation for options for github and emojione." + ] + } + super().__init__(*args, **kwargs) + + def reset(self): + """Reset.""" + + self.strict_cache.clear() + + def extendMarkdown(self, md): + """Add support for emoji.""" + + md.registerExtension(self) + + config = self.getConfigs() + + util.escape_chars(md, [':']) + + self.strict_cache = set() + md.inlinePatterns.register(EmojiPattern(RE_EMOJI, config, self.strict_cache, md), "emoji", 75) + if config['strict']: + md.postprocessors.register(EmojiAlertPostprocessor(self.strict_cache, md), "emoji-alert", 50) + + +################### +# Make Available +################### +def makeExtension(*args, **kwargs): + """Return extension.""" + + return EmojiExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/emoji1_db.py b/micromamba_root/Lib/site-packages/pymdownx/emoji1_db.py new file mode 100644 index 0000000000000000000000000000000000000000..a57fc5e19ce9288591dfd8c34872916b75b07b09 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/emoji1_db.py @@ -0,0 +1,9938 @@ +"""Emojione autogen. + +Generated from emojione source. Do not edit by hand. + +MIT license. + +Copyright (c) http://www.emojione.com +""" +version = "v2.2.7" +name = "emojione" +emoji = { + ":100:": { + "category": "symbols", + "name": "hundred points symbol", + "unicode": "1f4af" + }, + ":1234:": { + "category": "symbols", + "name": "input symbol for numbers", + "unicode": "1f522" + }, + ":8ball:": { + "category": "activity", + "name": "billiards", + "unicode": "1f3b1" + }, + ":a:": { + "category": "symbols", + "name": "negative squared latin capital letter a", + "unicode": "1f170" + }, + ":ab:": { + "category": "symbols", + "name": "negative squared ab", + "unicode": "1f18e" + }, + ":abc:": { + "category": "symbols", + "name": "input symbol for latin letters", + "unicode": "1f524" + }, + ":abcd:": { + "category": "symbols", + "name": "input symbol for latin small letters", + "unicode": "1f521" + }, + ":accept:": { + "category": "symbols", + "name": "circled ideograph accept", + "unicode": "1f251" + }, + ":aerial_tramway:": { + "category": "travel", + "name": "aerial tramway", + "unicode": "1f6a1" + }, + ":airplane:": { + "category": "travel", + "name": "airplane", + "unicode": "2708", + "unicode_alt": "2708-fe0f" + }, + ":airplane_arriving:": { + "category": "travel", + "name": "airplane arriving", + "unicode": "1f6ec" + }, + ":airplane_departure:": { + "category": "travel", + "name": "airplane departure", + "unicode": "1f6eb" + }, + ":airplane_small:": { + "category": "travel", + "name": "small airplane", + "unicode": "1f6e9", + "unicode_alt": "1f6e9-fe0f" + }, + ":alarm_clock:": { + "category": "objects", + "name": "alarm clock", + "unicode": "23f0" + }, + ":alembic:": { + "category": "objects", + "name": "alembic", + "unicode": "2697", + "unicode_alt": "2697-fe0f" + }, + ":alien:": { + "category": "people", + "name": "extraterrestrial alien", + "unicode": "1f47d" + }, + ":ambulance:": { + "category": "travel", + "name": "ambulance", + "unicode": "1f691" + }, + ":amphora:": { + "category": "objects", + "name": "amphora", + "unicode": "1f3fa" + }, + ":anchor:": { + "category": "travel", + "name": "anchor", + "unicode": "2693", + "unicode_alt": "2693-fe0f" + }, + ":angel:": { + "category": "people", + "name": "baby angel", + "unicode": "1f47c" + }, + ":angel_tone1:": { + "category": "people", + "name": "baby angel tone 1", + "unicode": "1f47c-1f3fb" + }, + ":angel_tone2:": { + "category": "people", + "name": "baby angel tone 2", + "unicode": "1f47c-1f3fc" + }, + ":angel_tone3:": { + "category": "people", + "name": "baby angel tone 3", + "unicode": "1f47c-1f3fd" + }, + ":angel_tone4:": { + "category": "people", + "name": "baby angel tone 4", + "unicode": "1f47c-1f3fe" + }, + ":angel_tone5:": { + "category": "people", + "name": "baby angel tone 5", + "unicode": "1f47c-1f3ff" + }, + ":anger:": { + "category": "symbols", + "name": "anger symbol", + "unicode": "1f4a2" + }, + ":anger_right:": { + "category": "symbols", + "name": "right anger bubble", + "unicode": "1f5ef", + "unicode_alt": "1f5ef-fe0f" + }, + ":angry:": { + "category": "people", + "name": "angry face", + "unicode": "1f620" + }, + ":anguished:": { + "category": "people", + "name": "anguished face", + "unicode": "1f627" + }, + ":ant:": { + "category": "nature", + "name": "ant", + "unicode": "1f41c" + }, + ":apple:": { + "category": "food", + "name": "red apple", + "unicode": "1f34e" + }, + ":aquarius:": { + "category": "symbols", + "name": "aquarius", + "unicode": "2652", + "unicode_alt": "2652-fe0f" + }, + ":aries:": { + "category": "symbols", + "name": "aries", + "unicode": "2648", + "unicode_alt": "2648-fe0f" + }, + ":arrow_backward:": { + "category": "symbols", + "name": "black left-pointing triangle", + "unicode": "25c0", + "unicode_alt": "25c0-fe0f" + }, + ":arrow_double_down:": { + "category": "symbols", + "name": "black down-pointing double triangle", + "unicode": "23ec" + }, + ":arrow_double_up:": { + "category": "symbols", + "name": "black up-pointing double triangle", + "unicode": "23eb" + }, + ":arrow_down:": { + "category": "symbols", + "name": "downwards black arrow", + "unicode": "2b07", + "unicode_alt": "2b07-fe0f" + }, + ":arrow_down_small:": { + "category": "symbols", + "name": "down-pointing small red triangle", + "unicode": "1f53d" + }, + ":arrow_forward:": { + "category": "symbols", + "name": "black right-pointing triangle", + "unicode": "25b6", + "unicode_alt": "25b6-fe0f" + }, + ":arrow_heading_down:": { + "category": "symbols", + "name": "arrow pointing rightwards then curving downwards", + "unicode": "2935", + "unicode_alt": "2935-fe0f" + }, + ":arrow_heading_up:": { + "category": "symbols", + "name": "arrow pointing rightwards then curving upwards", + "unicode": "2934", + "unicode_alt": "2934-fe0f" + }, + ":arrow_left:": { + "category": "symbols", + "name": "leftwards black arrow", + "unicode": "2b05", + "unicode_alt": "2b05-fe0f" + }, + ":arrow_lower_left:": { + "category": "symbols", + "name": "south west arrow", + "unicode": "2199", + "unicode_alt": "2199-fe0f" + }, + ":arrow_lower_right:": { + "category": "symbols", + "name": "south east arrow", + "unicode": "2198", + "unicode_alt": "2198-fe0f" + }, + ":arrow_right:": { + "category": "symbols", + "name": "black rightwards arrow", + "unicode": "27a1", + "unicode_alt": "27a1-fe0f" + }, + ":arrow_right_hook:": { + "category": "symbols", + "name": "rightwards arrow with hook", + "unicode": "21aa", + "unicode_alt": "21aa-fe0f" + }, + ":arrow_up:": { + "category": "symbols", + "name": "upwards black arrow", + "unicode": "2b06", + "unicode_alt": "2b06-fe0f" + }, + ":arrow_up_down:": { + "category": "symbols", + "name": "up down arrow", + "unicode": "2195", + "unicode_alt": "2195-fe0f" + }, + ":arrow_up_small:": { + "category": "symbols", + "name": "up-pointing small red triangle", + "unicode": "1f53c" + }, + ":arrow_upper_left:": { + "category": "symbols", + "name": "north west arrow", + "unicode": "2196", + "unicode_alt": "2196-fe0f" + }, + ":arrow_upper_right:": { + "category": "symbols", + "name": "north east arrow", + "unicode": "2197", + "unicode_alt": "2197-fe0f" + }, + ":arrows_clockwise:": { + "category": "symbols", + "name": "clockwise downwards and upwards open circle arrows", + "unicode": "1f503" + }, + ":arrows_counterclockwise:": { + "category": "symbols", + "name": "anticlockwise downwards and upwards open circle arrows", + "unicode": "1f504" + }, + ":art:": { + "category": "activity", + "name": "artist palette", + "unicode": "1f3a8" + }, + ":articulated_lorry:": { + "category": "travel", + "name": "articulated lorry", + "unicode": "1f69b" + }, + ":asterisk:": { + "category": "symbols", + "name": "keycap asterisk", + "unicode": "002a-20e3", + "unicode_alt": "002a-fe0f-20e3" + }, + ":astonished:": { + "category": "people", + "name": "astonished face", + "unicode": "1f632" + }, + ":athletic_shoe:": { + "category": "people", + "name": "athletic shoe", + "unicode": "1f45f" + }, + ":atm:": { + "category": "symbols", + "name": "automated teller machine", + "unicode": "1f3e7" + }, + ":atom:": { + "category": "symbols", + "name": "atom symbol", + "unicode": "269b", + "unicode_alt": "269b-fe0f" + }, + ":avocado:": { + "category": "food", + "name": "avocado", + "unicode": "1f951" + }, + ":b:": { + "category": "symbols", + "name": "negative squared latin capital letter b", + "unicode": "1f171" + }, + ":baby:": { + "category": "people", + "name": "baby", + "unicode": "1f476" + }, + ":baby_bottle:": { + "category": "food", + "name": "baby bottle", + "unicode": "1f37c" + }, + ":baby_chick:": { + "category": "nature", + "name": "baby chick", + "unicode": "1f424" + }, + ":baby_symbol:": { + "category": "symbols", + "name": "baby symbol", + "unicode": "1f6bc" + }, + ":baby_tone1:": { + "category": "people", + "name": "baby tone 1", + "unicode": "1f476-1f3fb" + }, + ":baby_tone2:": { + "category": "people", + "name": "baby tone 2", + "unicode": "1f476-1f3fc" + }, + ":baby_tone3:": { + "category": "people", + "name": "baby tone 3", + "unicode": "1f476-1f3fd" + }, + ":baby_tone4:": { + "category": "people", + "name": "baby tone 4", + "unicode": "1f476-1f3fe" + }, + ":baby_tone5:": { + "category": "people", + "name": "baby tone 5", + "unicode": "1f476-1f3ff" + }, + ":back:": { + "category": "symbols", + "name": "back with leftwards arrow above", + "unicode": "1f519" + }, + ":bacon:": { + "category": "food", + "name": "bacon", + "unicode": "1f953" + }, + ":badminton:": { + "category": "activity", + "name": "badminton racquet", + "unicode": "1f3f8" + }, + ":baggage_claim:": { + "category": "symbols", + "name": "baggage claim", + "unicode": "1f6c4" + }, + ":balloon:": { + "category": "objects", + "name": "balloon", + "unicode": "1f388" + }, + ":ballot_box:": { + "category": "objects", + "name": "ballot box with ballot", + "unicode": "1f5f3", + "unicode_alt": "1f5f3-fe0f" + }, + ":ballot_box_with_check:": { + "category": "symbols", + "name": "ballot box with check", + "unicode": "2611", + "unicode_alt": "2611-fe0f" + }, + ":bamboo:": { + "category": "nature", + "name": "pine decoration", + "unicode": "1f38d" + }, + ":banana:": { + "category": "food", + "name": "banana", + "unicode": "1f34c" + }, + ":bangbang:": { + "category": "symbols", + "name": "double exclamation mark", + "unicode": "203c", + "unicode_alt": "203c-fe0f" + }, + ":bank:": { + "category": "travel", + "name": "bank", + "unicode": "1f3e6" + }, + ":bar_chart:": { + "category": "objects", + "name": "bar chart", + "unicode": "1f4ca" + }, + ":barber:": { + "category": "objects", + "name": "barber pole", + "unicode": "1f488" + }, + ":baseball:": { + "category": "activity", + "name": "baseball", + "unicode": "26be", + "unicode_alt": "26be-fe0f" + }, + ":basketball:": { + "category": "activity", + "name": "basketball and hoop", + "unicode": "1f3c0" + }, + ":basketball_player:": { + "category": "activity", + "name": "person with ball", + "unicode": "26f9", + "unicode_alt": "26f9-fe0f" + }, + ":basketball_player_tone1:": { + "category": "activity", + "name": "person with ball tone 1", + "unicode": "26f9-1f3fb" + }, + ":basketball_player_tone2:": { + "category": "activity", + "name": "person with ball tone 2", + "unicode": "26f9-1f3fc" + }, + ":basketball_player_tone3:": { + "category": "activity", + "name": "person with ball tone 3", + "unicode": "26f9-1f3fd" + }, + ":basketball_player_tone4:": { + "category": "activity", + "name": "person with ball tone 4", + "unicode": "26f9-1f3fe" + }, + ":basketball_player_tone5:": { + "category": "activity", + "name": "person with ball tone 5", + "unicode": "26f9-1f3ff" + }, + ":bat:": { + "category": "nature", + "name": "bat", + "unicode": "1f987" + }, + ":bath:": { + "category": "activity", + "name": "bath", + "unicode": "1f6c0" + }, + ":bath_tone1:": { + "category": "activity", + "name": "bath tone 1", + "unicode": "1f6c0-1f3fb" + }, + ":bath_tone2:": { + "category": "activity", + "name": "bath tone 2", + "unicode": "1f6c0-1f3fc" + }, + ":bath_tone3:": { + "category": "activity", + "name": "bath tone 3", + "unicode": "1f6c0-1f3fd" + }, + ":bath_tone4:": { + "category": "activity", + "name": "bath tone 4", + "unicode": "1f6c0-1f3fe" + }, + ":bath_tone5:": { + "category": "activity", + "name": "bath tone 5", + "unicode": "1f6c0-1f3ff" + }, + ":bathtub:": { + "category": "objects", + "name": "bathtub", + "unicode": "1f6c1" + }, + ":battery:": { + "category": "objects", + "name": "battery", + "unicode": "1f50b" + }, + ":beach:": { + "category": "travel", + "name": "beach with umbrella", + "unicode": "1f3d6", + "unicode_alt": "1f3d6-fe0f" + }, + ":beach_umbrella:": { + "category": "objects", + "name": "umbrella on ground", + "unicode": "26f1", + "unicode_alt": "26f1-fe0f" + }, + ":bear:": { + "category": "nature", + "name": "bear face", + "unicode": "1f43b" + }, + ":bed:": { + "category": "objects", + "name": "bed", + "unicode": "1f6cf", + "unicode_alt": "1f6cf-fe0f" + }, + ":bee:": { + "category": "nature", + "name": "honeybee", + "unicode": "1f41d" + }, + ":beer:": { + "category": "food", + "name": "beer mug", + "unicode": "1f37a" + }, + ":beers:": { + "category": "food", + "name": "clinking beer mugs", + "unicode": "1f37b" + }, + ":beetle:": { + "category": "nature", + "name": "lady beetle", + "unicode": "1f41e" + }, + ":beginner:": { + "category": "symbols", + "name": "japanese symbol for beginner", + "unicode": "1f530" + }, + ":bell:": { + "category": "symbols", + "name": "bell", + "unicode": "1f514" + }, + ":bellhop:": { + "category": "objects", + "name": "bellhop bell", + "unicode": "1f6ce", + "unicode_alt": "1f6ce-fe0f" + }, + ":bento:": { + "category": "food", + "name": "bento box", + "unicode": "1f371" + }, + ":bicyclist:": { + "category": "activity", + "name": "bicyclist", + "unicode": "1f6b4" + }, + ":bicyclist_tone1:": { + "category": "activity", + "name": "bicyclist tone 1", + "unicode": "1f6b4-1f3fb" + }, + ":bicyclist_tone2:": { + "category": "activity", + "name": "bicyclist tone 2", + "unicode": "1f6b4-1f3fc" + }, + ":bicyclist_tone3:": { + "category": "activity", + "name": "bicyclist tone 3", + "unicode": "1f6b4-1f3fd" + }, + ":bicyclist_tone4:": { + "category": "activity", + "name": "bicyclist tone 4", + "unicode": "1f6b4-1f3fe" + }, + ":bicyclist_tone5:": { + "category": "activity", + "name": "bicyclist tone 5", + "unicode": "1f6b4-1f3ff" + }, + ":bike:": { + "category": "travel", + "name": "bicycle", + "unicode": "1f6b2" + }, + ":bikini:": { + "category": "people", + "name": "bikini", + "unicode": "1f459" + }, + ":biohazard:": { + "category": "symbols", + "name": "biohazard sign", + "unicode": "2623", + "unicode_alt": "2623-fe0f" + }, + ":bird:": { + "category": "nature", + "name": "bird", + "unicode": "1f426" + }, + ":birthday:": { + "category": "food", + "name": "birthday cake", + "unicode": "1f382" + }, + ":black_circle:": { + "category": "symbols", + "name": "black circle", + "unicode": "26ab", + "unicode_alt": "26ab-fe0f" + }, + ":black_heart:": { + "category": "symbols", + "name": "black heart", + "unicode": "1f5a4" + }, + ":black_joker:": { + "category": "symbols", + "name": "playing card black joker", + "unicode": "1f0cf" + }, + ":black_large_square:": { + "category": "symbols", + "name": "black large square", + "unicode": "2b1b", + "unicode_alt": "2b1b-fe0f" + }, + ":black_medium_small_square:": { + "category": "symbols", + "name": "black medium small square", + "unicode": "25fe", + "unicode_alt": "25fe-fe0f" + }, + ":black_medium_square:": { + "category": "symbols", + "name": "black medium square", + "unicode": "25fc", + "unicode_alt": "25fc-fe0f" + }, + ":black_nib:": { + "category": "objects", + "name": "black nib", + "unicode": "2712", + "unicode_alt": "2712-fe0f" + }, + ":black_small_square:": { + "category": "symbols", + "name": "black small square", + "unicode": "25aa", + "unicode_alt": "25aa-fe0f" + }, + ":black_square_button:": { + "category": "symbols", + "name": "black square button", + "unicode": "1f532" + }, + ":blossom:": { + "category": "nature", + "name": "blossom", + "unicode": "1f33c" + }, + ":blowfish:": { + "category": "nature", + "name": "blowfish", + "unicode": "1f421" + }, + ":blue_book:": { + "category": "objects", + "name": "blue book", + "unicode": "1f4d8" + }, + ":blue_car:": { + "category": "travel", + "name": "recreational vehicle", + "unicode": "1f699" + }, + ":blue_circle:": { + "category": "symbols", + "name": "blue circle", + "unicode": "1f535" + }, + ":blue_heart:": { + "category": "symbols", + "name": "blue heart", + "unicode": "1f499" + }, + ":blush:": { + "category": "people", + "name": "smiling face with smiling eyes", + "unicode": "1f60a" + }, + ":boar:": { + "category": "nature", + "name": "boar", + "unicode": "1f417" + }, + ":bomb:": { + "category": "objects", + "name": "bomb", + "unicode": "1f4a3" + }, + ":book:": { + "category": "objects", + "name": "open book", + "unicode": "1f4d6" + }, + ":bookmark:": { + "category": "objects", + "name": "bookmark", + "unicode": "1f516" + }, + ":bookmark_tabs:": { + "category": "objects", + "name": "bookmark tabs", + "unicode": "1f4d1" + }, + ":books:": { + "category": "objects", + "name": "books", + "unicode": "1f4da" + }, + ":boom:": { + "category": "symbols", + "name": "collision symbol", + "unicode": "1f4a5" + }, + ":boot:": { + "category": "people", + "name": "womans boots", + "unicode": "1f462" + }, + ":bouquet:": { + "category": "nature", + "name": "bouquet", + "unicode": "1f490" + }, + ":bow:": { + "category": "people", + "name": "person bowing deeply", + "unicode": "1f647" + }, + ":bow_and_arrow:": { + "category": "activity", + "name": "bow and arrow", + "unicode": "1f3f9" + }, + ":bow_tone1:": { + "category": "people", + "name": "person bowing deeply tone 1", + "unicode": "1f647-1f3fb" + }, + ":bow_tone2:": { + "category": "people", + "name": "person bowing deeply tone 2", + "unicode": "1f647-1f3fc" + }, + ":bow_tone3:": { + "category": "people", + "name": "person bowing deeply tone 3", + "unicode": "1f647-1f3fd" + }, + ":bow_tone4:": { + "category": "people", + "name": "person bowing deeply tone 4", + "unicode": "1f647-1f3fe" + }, + ":bow_tone5:": { + "category": "people", + "name": "person bowing deeply tone 5", + "unicode": "1f647-1f3ff" + }, + ":bowling:": { + "category": "activity", + "name": "bowling", + "unicode": "1f3b3" + }, + ":boxing_glove:": { + "category": "activity", + "name": "boxing glove", + "unicode": "1f94a" + }, + ":boy:": { + "category": "people", + "name": "boy", + "unicode": "1f466" + }, + ":boy_tone1:": { + "category": "people", + "name": "boy tone 1", + "unicode": "1f466-1f3fb" + }, + ":boy_tone2:": { + "category": "people", + "name": "boy tone 2", + "unicode": "1f466-1f3fc" + }, + ":boy_tone3:": { + "category": "people", + "name": "boy tone 3", + "unicode": "1f466-1f3fd" + }, + ":boy_tone4:": { + "category": "people", + "name": "boy tone 4", + "unicode": "1f466-1f3fe" + }, + ":boy_tone5:": { + "category": "people", + "name": "boy tone 5", + "unicode": "1f466-1f3ff" + }, + ":bread:": { + "category": "food", + "name": "bread", + "unicode": "1f35e" + }, + ":bride_with_veil:": { + "category": "people", + "name": "bride with veil", + "unicode": "1f470" + }, + ":bride_with_veil_tone1:": { + "category": "people", + "name": "bride with veil tone 1", + "unicode": "1f470-1f3fb" + }, + ":bride_with_veil_tone2:": { + "category": "people", + "name": "bride with veil tone 2", + "unicode": "1f470-1f3fc" + }, + ":bride_with_veil_tone3:": { + "category": "people", + "name": "bride with veil tone 3", + "unicode": "1f470-1f3fd" + }, + ":bride_with_veil_tone4:": { + "category": "people", + "name": "bride with veil tone 4", + "unicode": "1f470-1f3fe" + }, + ":bride_with_veil_tone5:": { + "category": "people", + "name": "bride with veil tone 5", + "unicode": "1f470-1f3ff" + }, + ":bridge_at_night:": { + "category": "travel", + "name": "bridge at night", + "unicode": "1f309" + }, + ":briefcase:": { + "category": "people", + "name": "briefcase", + "unicode": "1f4bc" + }, + ":broken_heart:": { + "category": "symbols", + "name": "broken heart", + "unicode": "1f494" + }, + ":bug:": { + "category": "nature", + "name": "bug", + "unicode": "1f41b" + }, + ":bulb:": { + "category": "objects", + "name": "electric light bulb", + "unicode": "1f4a1" + }, + ":bullettrain_front:": { + "category": "travel", + "name": "high-speed train with bullet nose", + "unicode": "1f685" + }, + ":bullettrain_side:": { + "category": "travel", + "name": "high-speed train", + "unicode": "1f684" + }, + ":burrito:": { + "category": "food", + "name": "burrito", + "unicode": "1f32f" + }, + ":bus:": { + "category": "travel", + "name": "bus", + "unicode": "1f68c" + }, + ":busstop:": { + "category": "travel", + "name": "bus stop", + "unicode": "1f68f" + }, + ":bust_in_silhouette:": { + "category": "people", + "name": "bust in silhouette", + "unicode": "1f464" + }, + ":busts_in_silhouette:": { + "category": "people", + "name": "busts in silhouette", + "unicode": "1f465" + }, + ":butterfly:": { + "category": "nature", + "name": "butterfly", + "unicode": "1f98b" + }, + ":cactus:": { + "category": "nature", + "name": "cactus", + "unicode": "1f335" + }, + ":cake:": { + "category": "food", + "name": "shortcake", + "unicode": "1f370" + }, + ":calendar:": { + "category": "objects", + "name": "tear-off calendar", + "unicode": "1f4c6" + }, + ":calendar_spiral:": { + "category": "objects", + "name": "spiral calendar pad", + "unicode": "1f5d3", + "unicode_alt": "1f5d3-fe0f" + }, + ":call_me:": { + "category": "people", + "name": "call me hand", + "unicode": "1f919" + }, + ":call_me_tone1:": { + "category": "people", + "name": "call me hand tone 1", + "unicode": "1f919-1f3fb" + }, + ":call_me_tone2:": { + "category": "people", + "name": "call me hand tone 2", + "unicode": "1f919-1f3fc" + }, + ":call_me_tone3:": { + "category": "people", + "name": "call me hand tone 3", + "unicode": "1f919-1f3fd" + }, + ":call_me_tone4:": { + "category": "people", + "name": "call me hand tone 4", + "unicode": "1f919-1f3fe" + }, + ":call_me_tone5:": { + "category": "people", + "name": "call me hand tone 5", + "unicode": "1f919-1f3ff" + }, + ":calling:": { + "category": "objects", + "name": "mobile phone with rightwards arrow at left", + "unicode": "1f4f2" + }, + ":camel:": { + "category": "nature", + "name": "bactrian camel", + "unicode": "1f42b" + }, + ":camera:": { + "category": "objects", + "name": "camera", + "unicode": "1f4f7" + }, + ":camera_with_flash:": { + "category": "objects", + "name": "camera with flash", + "unicode": "1f4f8" + }, + ":camping:": { + "category": "travel", + "name": "camping", + "unicode": "1f3d5", + "unicode_alt": "1f3d5-fe0f" + }, + ":cancer:": { + "category": "symbols", + "name": "cancer", + "unicode": "264b", + "unicode_alt": "264b-fe0f" + }, + ":candle:": { + "category": "objects", + "name": "candle", + "unicode": "1f56f", + "unicode_alt": "1f56f-fe0f" + }, + ":candy:": { + "category": "food", + "name": "candy", + "unicode": "1f36c" + }, + ":canoe:": { + "category": "travel", + "name": "canoe", + "unicode": "1f6f6" + }, + ":capital_abcd:": { + "category": "symbols", + "name": "input symbol for latin capital letters", + "unicode": "1f520" + }, + ":capricorn:": { + "category": "symbols", + "name": "capricorn", + "unicode": "2651", + "unicode_alt": "2651-fe0f" + }, + ":card_box:": { + "category": "objects", + "name": "card file box", + "unicode": "1f5c3", + "unicode_alt": "1f5c3-fe0f" + }, + ":card_index:": { + "category": "objects", + "name": "card index", + "unicode": "1f4c7" + }, + ":carousel_horse:": { + "category": "travel", + "name": "carousel horse", + "unicode": "1f3a0" + }, + ":carrot:": { + "category": "food", + "name": "carrot", + "unicode": "1f955" + }, + ":cartwheel:": { + "category": "activity", + "name": "person doing cartwheel", + "unicode": "1f938" + }, + ":cartwheel_tone1:": { + "category": "activity", + "name": "person doing cartwheel tone 1", + "unicode": "1f938-1f3fb" + }, + ":cartwheel_tone2:": { + "category": "activity", + "name": "person doing cartwheel tone 2", + "unicode": "1f938-1f3fc" + }, + ":cartwheel_tone3:": { + "category": "activity", + "name": "person doing cartwheel tone 3", + "unicode": "1f938-1f3fd" + }, + ":cartwheel_tone4:": { + "category": "activity", + "name": "person doing cartwheel tone 4", + "unicode": "1f938-1f3fe" + }, + ":cartwheel_tone5:": { + "category": "activity", + "name": "person doing cartwheel tone 5", + "unicode": "1f938-1f3ff" + }, + ":cat2:": { + "category": "nature", + "name": "cat", + "unicode": "1f408" + }, + ":cat:": { + "category": "nature", + "name": "cat face", + "unicode": "1f431" + }, + ":cd:": { + "category": "objects", + "name": "optical disc", + "unicode": "1f4bf" + }, + ":chains:": { + "category": "objects", + "name": "chains", + "unicode": "26d3", + "unicode_alt": "26d3-fe0f" + }, + ":champagne:": { + "category": "food", + "name": "bottle with popping cork", + "unicode": "1f37e" + }, + ":champagne_glass:": { + "category": "food", + "name": "clinking glasses", + "unicode": "1f942" + }, + ":chart:": { + "category": "symbols", + "name": "chart with upwards trend and yen sign", + "unicode": "1f4b9" + }, + ":chart_with_downwards_trend:": { + "category": "objects", + "name": "chart with downwards trend", + "unicode": "1f4c9" + }, + ":chart_with_upwards_trend:": { + "category": "objects", + "name": "chart with upwards trend", + "unicode": "1f4c8" + }, + ":checkered_flag:": { + "category": "travel", + "name": "chequered flag", + "unicode": "1f3c1" + }, + ":cheese:": { + "category": "food", + "name": "cheese wedge", + "unicode": "1f9c0" + }, + ":cherries:": { + "category": "food", + "name": "cherries", + "unicode": "1f352" + }, + ":cherry_blossom:": { + "category": "nature", + "name": "cherry blossom", + "unicode": "1f338" + }, + ":chestnut:": { + "category": "nature", + "name": "chestnut", + "unicode": "1f330" + }, + ":chicken:": { + "category": "nature", + "name": "chicken", + "unicode": "1f414" + }, + ":children_crossing:": { + "category": "symbols", + "name": "children crossing", + "unicode": "1f6b8" + }, + ":chipmunk:": { + "category": "nature", + "name": "chipmunk", + "unicode": "1f43f", + "unicode_alt": "1f43f-fe0f" + }, + ":chocolate_bar:": { + "category": "food", + "name": "chocolate bar", + "unicode": "1f36b" + }, + ":christmas_tree:": { + "category": "nature", + "name": "christmas tree", + "unicode": "1f384" + }, + ":church:": { + "category": "travel", + "name": "church", + "unicode": "26ea", + "unicode_alt": "26ea-fe0f" + }, + ":cinema:": { + "category": "symbols", + "name": "cinema", + "unicode": "1f3a6" + }, + ":circus_tent:": { + "category": "activity", + "name": "circus tent", + "unicode": "1f3aa" + }, + ":city_dusk:": { + "category": "travel", + "name": "cityscape at dusk", + "unicode": "1f306" + }, + ":city_sunset:": { + "category": "travel", + "name": "sunset over buildings", + "unicode": "1f307" + }, + ":cityscape:": { + "category": "travel", + "name": "cityscape", + "unicode": "1f3d9", + "unicode_alt": "1f3d9-fe0f" + }, + ":cl:": { + "category": "symbols", + "name": "squared cl", + "unicode": "1f191" + }, + ":clap:": { + "category": "people", + "name": "clapping hands sign", + "unicode": "1f44f" + }, + ":clap_tone1:": { + "category": "people", + "name": "clapping hands sign tone 1", + "unicode": "1f44f-1f3fb" + }, + ":clap_tone2:": { + "category": "people", + "name": "clapping hands sign tone 2", + "unicode": "1f44f-1f3fc" + }, + ":clap_tone3:": { + "category": "people", + "name": "clapping hands sign tone 3", + "unicode": "1f44f-1f3fd" + }, + ":clap_tone4:": { + "category": "people", + "name": "clapping hands sign tone 4", + "unicode": "1f44f-1f3fe" + }, + ":clap_tone5:": { + "category": "people", + "name": "clapping hands sign tone 5", + "unicode": "1f44f-1f3ff" + }, + ":clapper:": { + "category": "activity", + "name": "clapper board", + "unicode": "1f3ac" + }, + ":classical_building:": { + "category": "travel", + "name": "classical building", + "unicode": "1f3db", + "unicode_alt": "1f3db-fe0f" + }, + ":clipboard:": { + "category": "objects", + "name": "clipboard", + "unicode": "1f4cb" + }, + ":clock1030:": { + "category": "symbols", + "name": "clock face ten-thirty", + "unicode": "1f565" + }, + ":clock10:": { + "category": "symbols", + "name": "clock face ten oclock", + "unicode": "1f559" + }, + ":clock1130:": { + "category": "symbols", + "name": "clock face eleven-thirty", + "unicode": "1f566" + }, + ":clock11:": { + "category": "symbols", + "name": "clock face eleven oclock", + "unicode": "1f55a" + }, + ":clock1230:": { + "category": "symbols", + "name": "clock face twelve-thirty", + "unicode": "1f567" + }, + ":clock12:": { + "category": "symbols", + "name": "clock face twelve oclock", + "unicode": "1f55b" + }, + ":clock130:": { + "category": "symbols", + "name": "clock face one-thirty", + "unicode": "1f55c" + }, + ":clock1:": { + "category": "symbols", + "name": "clock face one oclock", + "unicode": "1f550" + }, + ":clock230:": { + "category": "symbols", + "name": "clock face two-thirty", + "unicode": "1f55d" + }, + ":clock2:": { + "category": "symbols", + "name": "clock face two oclock", + "unicode": "1f551" + }, + ":clock330:": { + "category": "symbols", + "name": "clock face three-thirty", + "unicode": "1f55e" + }, + ":clock3:": { + "category": "symbols", + "name": "clock face three oclock", + "unicode": "1f552" + }, + ":clock430:": { + "category": "symbols", + "name": "clock face four-thirty", + "unicode": "1f55f" + }, + ":clock4:": { + "category": "symbols", + "name": "clock face four oclock", + "unicode": "1f553" + }, + ":clock530:": { + "category": "symbols", + "name": "clock face five-thirty", + "unicode": "1f560" + }, + ":clock5:": { + "category": "symbols", + "name": "clock face five oclock", + "unicode": "1f554" + }, + ":clock630:": { + "category": "symbols", + "name": "clock face six-thirty", + "unicode": "1f561" + }, + ":clock6:": { + "category": "symbols", + "name": "clock face six oclock", + "unicode": "1f555" + }, + ":clock730:": { + "category": "symbols", + "name": "clock face seven-thirty", + "unicode": "1f562" + }, + ":clock7:": { + "category": "symbols", + "name": "clock face seven oclock", + "unicode": "1f556" + }, + ":clock830:": { + "category": "symbols", + "name": "clock face eight-thirty", + "unicode": "1f563" + }, + ":clock8:": { + "category": "symbols", + "name": "clock face eight oclock", + "unicode": "1f557" + }, + ":clock930:": { + "category": "symbols", + "name": "clock face nine-thirty", + "unicode": "1f564" + }, + ":clock9:": { + "category": "symbols", + "name": "clock face nine oclock", + "unicode": "1f558" + }, + ":clock:": { + "category": "objects", + "name": "mantlepiece clock", + "unicode": "1f570", + "unicode_alt": "1f570-fe0f" + }, + ":closed_book:": { + "category": "objects", + "name": "closed book", + "unicode": "1f4d5" + }, + ":closed_lock_with_key:": { + "category": "objects", + "name": "closed lock with key", + "unicode": "1f510" + }, + ":closed_umbrella:": { + "category": "people", + "name": "closed umbrella", + "unicode": "1f302" + }, + ":cloud:": { + "category": "nature", + "name": "cloud", + "unicode": "2601", + "unicode_alt": "2601-fe0f" + }, + ":cloud_lightning:": { + "category": "nature", + "name": "cloud with lightning", + "unicode": "1f329", + "unicode_alt": "1f329-fe0f" + }, + ":cloud_rain:": { + "category": "nature", + "name": "cloud with rain", + "unicode": "1f327", + "unicode_alt": "1f327-fe0f" + }, + ":cloud_snow:": { + "category": "nature", + "name": "cloud with snow", + "unicode": "1f328", + "unicode_alt": "1f328-fe0f" + }, + ":cloud_tornado:": { + "category": "nature", + "name": "cloud with tornado", + "unicode": "1f32a", + "unicode_alt": "1f32a-fe0f" + }, + ":clown:": { + "category": "people", + "name": "clown face", + "unicode": "1f921" + }, + ":clubs:": { + "category": "symbols", + "name": "black club suit", + "unicode": "2663", + "unicode_alt": "2663-fe0f" + }, + ":cocktail:": { + "category": "food", + "name": "cocktail glass", + "unicode": "1f378" + }, + ":coffee:": { + "category": "food", + "name": "hot beverage", + "unicode": "2615", + "unicode_alt": "2615-fe0f" + }, + ":coffin:": { + "category": "objects", + "name": "coffin", + "unicode": "26b0", + "unicode_alt": "26b0-fe0f" + }, + ":cold_sweat:": { + "category": "people", + "name": "face with open mouth and cold sweat", + "unicode": "1f630" + }, + ":comet:": { + "category": "nature", + "name": "comet", + "unicode": "2604", + "unicode_alt": "2604-fe0f" + }, + ":compression:": { + "category": "objects", + "name": "compression", + "unicode": "1f5dc", + "unicode_alt": "1f5dc-fe0f" + }, + ":computer:": { + "category": "objects", + "name": "personal computer", + "unicode": "1f4bb" + }, + ":confetti_ball:": { + "category": "objects", + "name": "confetti ball", + "unicode": "1f38a" + }, + ":confounded:": { + "category": "people", + "name": "confounded face", + "unicode": "1f616" + }, + ":confused:": { + "category": "people", + "name": "confused face", + "unicode": "1f615" + }, + ":congratulations:": { + "category": "symbols", + "name": "circled ideograph congratulation", + "unicode": "3297", + "unicode_alt": "3297-fe0f" + }, + ":construction:": { + "category": "travel", + "name": "construction sign", + "unicode": "1f6a7" + }, + ":construction_site:": { + "category": "travel", + "name": "building construction", + "unicode": "1f3d7", + "unicode_alt": "1f3d7-fe0f" + }, + ":construction_worker:": { + "category": "people", + "name": "construction worker", + "unicode": "1f477" + }, + ":construction_worker_tone1:": { + "category": "people", + "name": "construction worker tone 1", + "unicode": "1f477-1f3fb" + }, + ":construction_worker_tone2:": { + "category": "people", + "name": "construction worker tone 2", + "unicode": "1f477-1f3fc" + }, + ":construction_worker_tone3:": { + "category": "people", + "name": "construction worker tone 3", + "unicode": "1f477-1f3fd" + }, + ":construction_worker_tone4:": { + "category": "people", + "name": "construction worker tone 4", + "unicode": "1f477-1f3fe" + }, + ":construction_worker_tone5:": { + "category": "people", + "name": "construction worker tone 5", + "unicode": "1f477-1f3ff" + }, + ":control_knobs:": { + "category": "objects", + "name": "control knobs", + "unicode": "1f39b", + "unicode_alt": "1f39b-fe0f" + }, + ":convenience_store:": { + "category": "travel", + "name": "convenience store", + "unicode": "1f3ea" + }, + ":cookie:": { + "category": "food", + "name": "cookie", + "unicode": "1f36a" + }, + ":cooking:": { + "category": "food", + "name": "cooking", + "unicode": "1f373" + }, + ":cool:": { + "category": "symbols", + "name": "squared cool", + "unicode": "1f192" + }, + ":cop:": { + "category": "people", + "name": "police officer", + "unicode": "1f46e" + }, + ":cop_tone1:": { + "category": "people", + "name": "police officer tone 1", + "unicode": "1f46e-1f3fb" + }, + ":cop_tone2:": { + "category": "people", + "name": "police officer tone 2", + "unicode": "1f46e-1f3fc" + }, + ":cop_tone3:": { + "category": "people", + "name": "police officer tone 3", + "unicode": "1f46e-1f3fd" + }, + ":cop_tone4:": { + "category": "people", + "name": "police officer tone 4", + "unicode": "1f46e-1f3fe" + }, + ":cop_tone5:": { + "category": "people", + "name": "police officer tone 5", + "unicode": "1f46e-1f3ff" + }, + ":copyright:": { + "category": "symbols", + "name": "copyright sign", + "unicode": "00a9", + "unicode_alt": "00a9-fe0f" + }, + ":corn:": { + "category": "food", + "name": "ear of maize", + "unicode": "1f33d" + }, + ":couch:": { + "category": "objects", + "name": "couch and lamp", + "unicode": "1f6cb", + "unicode_alt": "1f6cb-fe0f" + }, + ":couple:": { + "category": "people", + "name": "man and woman holding hands", + "unicode": "1f46b" + }, + ":couple_mm:": { + "category": "people", + "name": "couple (man,man)", + "unicode": "1f468-2764-1f468", + "unicode_alt": "1f468-200d-2764-fe0f-200d-1f468" + }, + ":couple_with_heart:": { + "category": "people", + "name": "couple with heart", + "unicode": "1f491" + }, + ":couple_ww:": { + "category": "people", + "name": "couple (woman,woman)", + "unicode": "1f469-2764-1f469", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f469" + }, + ":couplekiss:": { + "category": "people", + "name": "kiss", + "unicode": "1f48f" + }, + ":cow2:": { + "category": "nature", + "name": "cow", + "unicode": "1f404" + }, + ":cow:": { + "category": "nature", + "name": "cow face", + "unicode": "1f42e" + }, + ":cowboy:": { + "category": "people", + "name": "face with cowboy hat", + "unicode": "1f920" + }, + ":crab:": { + "category": "nature", + "name": "crab", + "unicode": "1f980" + }, + ":crayon:": { + "category": "objects", + "name": "lower left crayon", + "unicode": "1f58d", + "unicode_alt": "1f58d-fe0f" + }, + ":credit_card:": { + "category": "objects", + "name": "credit card", + "unicode": "1f4b3" + }, + ":crescent_moon:": { + "category": "nature", + "name": "crescent moon", + "unicode": "1f319" + }, + ":cricket:": { + "category": "activity", + "name": "cricket bat and ball", + "unicode": "1f3cf" + }, + ":crocodile:": { + "category": "nature", + "name": "crocodile", + "unicode": "1f40a" + }, + ":croissant:": { + "category": "food", + "name": "croissant", + "unicode": "1f950" + }, + ":cross:": { + "category": "symbols", + "name": "latin cross", + "unicode": "271d", + "unicode_alt": "271d-fe0f" + }, + ":crossed_flags:": { + "category": "objects", + "name": "crossed flags", + "unicode": "1f38c" + }, + ":crossed_swords:": { + "category": "objects", + "name": "crossed swords", + "unicode": "2694", + "unicode_alt": "2694-fe0f" + }, + ":crown:": { + "category": "people", + "name": "crown", + "unicode": "1f451" + }, + ":cruise_ship:": { + "category": "travel", + "name": "passenger ship", + "unicode": "1f6f3", + "unicode_alt": "1f6f3-fe0f" + }, + ":cry:": { + "category": "people", + "name": "crying face", + "unicode": "1f622" + }, + ":crying_cat_face:": { + "category": "people", + "name": "crying cat face", + "unicode": "1f63f" + }, + ":crystal_ball:": { + "category": "objects", + "name": "crystal ball", + "unicode": "1f52e" + }, + ":cucumber:": { + "category": "food", + "name": "cucumber", + "unicode": "1f952" + }, + ":cupid:": { + "category": "symbols", + "name": "heart with arrow", + "unicode": "1f498" + }, + ":curly_loop:": { + "category": "symbols", + "name": "curly loop", + "unicode": "27b0" + }, + ":currency_exchange:": { + "category": "symbols", + "name": "currency exchange", + "unicode": "1f4b1" + }, + ":curry:": { + "category": "food", + "name": "curry and rice", + "unicode": "1f35b" + }, + ":custard:": { + "category": "food", + "name": "custard", + "unicode": "1f36e" + }, + ":customs:": { + "category": "symbols", + "name": "customs", + "unicode": "1f6c3" + }, + ":cyclone:": { + "category": "symbols", + "name": "cyclone", + "unicode": "1f300" + }, + ":dagger:": { + "category": "objects", + "name": "dagger knife", + "unicode": "1f5e1", + "unicode_alt": "1f5e1-fe0f" + }, + ":dancer:": { + "category": "people", + "name": "dancer", + "unicode": "1f483" + }, + ":dancer_tone1:": { + "category": "people", + "name": "dancer tone 1", + "unicode": "1f483-1f3fb" + }, + ":dancer_tone2:": { + "category": "people", + "name": "dancer tone 2", + "unicode": "1f483-1f3fc" + }, + ":dancer_tone3:": { + "category": "people", + "name": "dancer tone 3", + "unicode": "1f483-1f3fd" + }, + ":dancer_tone4:": { + "category": "people", + "name": "dancer tone 4", + "unicode": "1f483-1f3fe" + }, + ":dancer_tone5:": { + "category": "people", + "name": "dancer tone 5", + "unicode": "1f483-1f3ff" + }, + ":dancers:": { + "category": "people", + "name": "woman with bunny ears", + "unicode": "1f46f" + }, + ":dango:": { + "category": "food", + "name": "dango", + "unicode": "1f361" + }, + ":dark_sunglasses:": { + "category": "people", + "name": "dark sunglasses", + "unicode": "1f576", + "unicode_alt": "1f576-fe0f" + }, + ":dart:": { + "category": "activity", + "name": "direct hit", + "unicode": "1f3af" + }, + ":dash:": { + "category": "nature", + "name": "dash symbol", + "unicode": "1f4a8" + }, + ":date:": { + "category": "objects", + "name": "calendar", + "unicode": "1f4c5" + }, + ":deciduous_tree:": { + "category": "nature", + "name": "deciduous tree", + "unicode": "1f333" + }, + ":deer:": { + "category": "nature", + "name": "deer", + "unicode": "1f98c" + }, + ":department_store:": { + "category": "travel", + "name": "department store", + "unicode": "1f3ec" + }, + ":desert:": { + "category": "travel", + "name": "desert", + "unicode": "1f3dc", + "unicode_alt": "1f3dc-fe0f" + }, + ":desktop:": { + "category": "objects", + "name": "desktop computer", + "unicode": "1f5a5", + "unicode_alt": "1f5a5-fe0f" + }, + ":diamond_shape_with_a_dot_inside:": { + "category": "symbols", + "name": "diamond shape with a dot inside", + "unicode": "1f4a0" + }, + ":diamonds:": { + "category": "symbols", + "name": "black diamond suit", + "unicode": "2666", + "unicode_alt": "2666-fe0f" + }, + ":disappointed:": { + "category": "people", + "name": "disappointed face", + "unicode": "1f61e" + }, + ":disappointed_relieved:": { + "category": "people", + "name": "disappointed but relieved face", + "unicode": "1f625" + }, + ":dividers:": { + "category": "objects", + "name": "card index dividers", + "unicode": "1f5c2", + "unicode_alt": "1f5c2-fe0f" + }, + ":dizzy:": { + "category": "symbols", + "name": "dizzy symbol", + "unicode": "1f4ab" + }, + ":dizzy_face:": { + "category": "people", + "name": "dizzy face", + "unicode": "1f635" + }, + ":do_not_litter:": { + "category": "symbols", + "name": "do not litter symbol", + "unicode": "1f6af" + }, + ":dog2:": { + "category": "nature", + "name": "dog", + "unicode": "1f415" + }, + ":dog:": { + "category": "nature", + "name": "dog face", + "unicode": "1f436" + }, + ":dollar:": { + "category": "objects", + "name": "banknote with dollar sign", + "unicode": "1f4b5" + }, + ":dolls:": { + "category": "objects", + "name": "japanese dolls", + "unicode": "1f38e" + }, + ":dolphin:": { + "category": "nature", + "name": "dolphin", + "unicode": "1f42c" + }, + ":door:": { + "category": "objects", + "name": "door", + "unicode": "1f6aa" + }, + ":doughnut:": { + "category": "food", + "name": "doughnut", + "unicode": "1f369" + }, + ":dove:": { + "category": "nature", + "name": "dove of peace", + "unicode": "1f54a", + "unicode_alt": "1f54a-fe0f" + }, + ":dragon:": { + "category": "nature", + "name": "dragon", + "unicode": "1f409" + }, + ":dragon_face:": { + "category": "nature", + "name": "dragon face", + "unicode": "1f432" + }, + ":dress:": { + "category": "people", + "name": "dress", + "unicode": "1f457" + }, + ":dromedary_camel:": { + "category": "nature", + "name": "dromedary camel", + "unicode": "1f42a" + }, + ":drooling_face:": { + "category": "people", + "name": "drooling face", + "unicode": "1f924" + }, + ":droplet:": { + "category": "nature", + "name": "droplet", + "unicode": "1f4a7" + }, + ":drum:": { + "category": "activity", + "name": "drum with drumsticks", + "unicode": "1f941" + }, + ":duck:": { + "category": "nature", + "name": "duck", + "unicode": "1f986" + }, + ":dvd:": { + "category": "objects", + "name": "dvd", + "unicode": "1f4c0" + }, + ":e-mail:": { + "category": "objects", + "name": "e-mail symbol", + "unicode": "1f4e7" + }, + ":eagle:": { + "category": "nature", + "name": "eagle", + "unicode": "1f985" + }, + ":ear:": { + "category": "people", + "name": "ear", + "unicode": "1f442" + }, + ":ear_of_rice:": { + "category": "nature", + "name": "ear of rice", + "unicode": "1f33e" + }, + ":ear_tone1:": { + "category": "people", + "name": "ear tone 1", + "unicode": "1f442-1f3fb" + }, + ":ear_tone2:": { + "category": "people", + "name": "ear tone 2", + "unicode": "1f442-1f3fc" + }, + ":ear_tone3:": { + "category": "people", + "name": "ear tone 3", + "unicode": "1f442-1f3fd" + }, + ":ear_tone4:": { + "category": "people", + "name": "ear tone 4", + "unicode": "1f442-1f3fe" + }, + ":ear_tone5:": { + "category": "people", + "name": "ear tone 5", + "unicode": "1f442-1f3ff" + }, + ":earth_africa:": { + "category": "nature", + "name": "earth globe europe-africa", + "unicode": "1f30d" + }, + ":earth_americas:": { + "category": "nature", + "name": "earth globe americas", + "unicode": "1f30e" + }, + ":earth_asia:": { + "category": "nature", + "name": "earth globe asia-australia", + "unicode": "1f30f" + }, + ":egg:": { + "category": "food", + "name": "egg", + "unicode": "1f95a" + }, + ":eggplant:": { + "category": "food", + "name": "aubergine", + "unicode": "1f346" + }, + ":eight:": { + "category": "symbols", + "name": "keycap digit eight", + "unicode": "0038-20e3", + "unicode_alt": "0038-fe0f-20e3" + }, + ":eight_pointed_black_star:": { + "category": "symbols", + "name": "eight pointed black star", + "unicode": "2734", + "unicode_alt": "2734-fe0f" + }, + ":eight_spoked_asterisk:": { + "category": "symbols", + "name": "eight spoked asterisk", + "unicode": "2733", + "unicode_alt": "2733-fe0f" + }, + ":eject:": { + "category": "symbols", + "name": "eject symbol", + "unicode": "23cf", + "unicode_alt": "23cf-fe0f" + }, + ":electric_plug:": { + "category": "objects", + "name": "electric plug", + "unicode": "1f50c" + }, + ":elephant:": { + "category": "nature", + "name": "elephant", + "unicode": "1f418" + }, + ":end:": { + "category": "symbols", + "name": "end with leftwards arrow above", + "unicode": "1f51a" + }, + ":envelope:": { + "category": "objects", + "name": "envelope", + "unicode": "2709", + "unicode_alt": "2709-fe0f" + }, + ":envelope_with_arrow:": { + "category": "objects", + "name": "envelope with downwards arrow above", + "unicode": "1f4e9" + }, + ":euro:": { + "category": "objects", + "name": "banknote with euro sign", + "unicode": "1f4b6" + }, + ":european_castle:": { + "category": "travel", + "name": "european castle", + "unicode": "1f3f0" + }, + ":european_post_office:": { + "category": "travel", + "name": "european post office", + "unicode": "1f3e4" + }, + ":evergreen_tree:": { + "category": "nature", + "name": "evergreen tree", + "unicode": "1f332" + }, + ":exclamation:": { + "category": "symbols", + "name": "heavy exclamation mark symbol", + "unicode": "2757", + "unicode_alt": "2757-fe0f" + }, + ":expressionless:": { + "category": "people", + "name": "expressionless face", + "unicode": "1f611" + }, + ":eye:": { + "category": "people", + "name": "eye", + "unicode": "1f441", + "unicode_alt": "1f441-fe0f" + }, + ":eye_in_speech_bubble:": { + "category": "symbols", + "name": "eye in speech bubble", + "unicode": "1f441-1f5e8", + "unicode_alt": "1f441-200d-1f5e8" + }, + ":eyeglasses:": { + "category": "people", + "name": "eyeglasses", + "unicode": "1f453" + }, + ":eyes:": { + "category": "people", + "name": "eyes", + "unicode": "1f440" + }, + ":face_palm:": { + "category": "people", + "name": "face palm", + "unicode": "1f926" + }, + ":face_palm_tone1:": { + "category": "people", + "name": "face palm tone 1", + "unicode": "1f926-1f3fb" + }, + ":face_palm_tone2:": { + "category": "people", + "name": "face palm tone 2", + "unicode": "1f926-1f3fc" + }, + ":face_palm_tone3:": { + "category": "people", + "name": "face palm tone 3", + "unicode": "1f926-1f3fd" + }, + ":face_palm_tone4:": { + "category": "people", + "name": "face palm tone 4", + "unicode": "1f926-1f3fe" + }, + ":face_palm_tone5:": { + "category": "people", + "name": "face palm tone 5", + "unicode": "1f926-1f3ff" + }, + ":factory:": { + "category": "travel", + "name": "factory", + "unicode": "1f3ed" + }, + ":fallen_leaf:": { + "category": "nature", + "name": "fallen leaf", + "unicode": "1f342" + }, + ":family:": { + "category": "people", + "name": "family", + "unicode": "1f46a" + }, + ":family_mmb:": { + "category": "people", + "name": "family (man,man,boy)", + "unicode": "1f468-1f468-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f466" + }, + ":family_mmbb:": { + "category": "people", + "name": "family (man,man,boy,boy)", + "unicode": "1f468-1f468-1f466-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f466-200d-1f466" + }, + ":family_mmg:": { + "category": "people", + "name": "family (man,man,girl)", + "unicode": "1f468-1f468-1f467", + "unicode_alt": "1f468-200d-1f468-200d-1f467" + }, + ":family_mmgb:": { + "category": "people", + "name": "family (man,man,girl,boy)", + "unicode": "1f468-1f468-1f467-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f467-200d-1f466" + }, + ":family_mmgg:": { + "category": "people", + "name": "family (man,man,girl,girl)", + "unicode": "1f468-1f468-1f467-1f467", + "unicode_alt": "1f468-200d-1f468-200d-1f467-200d-1f467" + }, + ":family_mwbb:": { + "category": "people", + "name": "family (man,woman,boy,boy)", + "unicode": "1f468-1f469-1f466-1f466", + "unicode_alt": "1f468-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_mwg:": { + "category": "people", + "name": "family (man,woman,girl)", + "unicode": "1f468-1f469-1f467", + "unicode_alt": "1f468-200d-1f469-200d-1f467" + }, + ":family_mwgb:": { + "category": "people", + "name": "family (man,woman,girl,boy)", + "unicode": "1f468-1f469-1f467-1f466", + "unicode_alt": "1f468-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_mwgg:": { + "category": "people", + "name": "family (man,woman,girl,girl)", + "unicode": "1f468-1f469-1f467-1f467", + "unicode_alt": "1f468-200d-1f469-200d-1f467-200d-1f467" + }, + ":family_wwb:": { + "category": "people", + "name": "family (woman,woman,boy)", + "unicode": "1f469-1f469-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f466" + }, + ":family_wwbb:": { + "category": "people", + "name": "family (woman,woman,boy,boy)", + "unicode": "1f469-1f469-1f466-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_wwg:": { + "category": "people", + "name": "family (woman,woman,girl)", + "unicode": "1f469-1f469-1f467", + "unicode_alt": "1f469-200d-1f469-200d-1f467" + }, + ":family_wwgb:": { + "category": "people", + "name": "family (woman,woman,girl,boy)", + "unicode": "1f469-1f469-1f467-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_wwgg:": { + "category": "people", + "name": "family (woman,woman,girl,girl)", + "unicode": "1f469-1f469-1f467-1f467", + "unicode_alt": "1f469-200d-1f469-200d-1f467-200d-1f467" + }, + ":fast_forward:": { + "category": "symbols", + "name": "black right-pointing double triangle", + "unicode": "23e9" + }, + ":fax:": { + "category": "objects", + "name": "fax machine", + "unicode": "1f4e0" + }, + ":fearful:": { + "category": "people", + "name": "fearful face", + "unicode": "1f628" + }, + ":feet:": { + "category": "nature", + "name": "paw prints", + "unicode": "1f43e" + }, + ":fencer:": { + "category": "activity", + "name": "fencer", + "unicode": "1f93a" + }, + ":ferris_wheel:": { + "category": "travel", + "name": "ferris wheel", + "unicode": "1f3a1" + }, + ":ferry:": { + "category": "travel", + "name": "ferry", + "unicode": "26f4", + "unicode_alt": "26f4-fe0f" + }, + ":field_hockey:": { + "category": "activity", + "name": "field hockey stick and ball", + "unicode": "1f3d1" + }, + ":file_cabinet:": { + "category": "objects", + "name": "file cabinet", + "unicode": "1f5c4", + "unicode_alt": "1f5c4-fe0f" + }, + ":file_folder:": { + "category": "objects", + "name": "file folder", + "unicode": "1f4c1" + }, + ":film_frames:": { + "category": "objects", + "name": "film frames", + "unicode": "1f39e", + "unicode_alt": "1f39e-fe0f" + }, + ":fingers_crossed:": { + "category": "people", + "name": "hand with first and index finger crossed", + "unicode": "1f91e" + }, + ":fingers_crossed_tone1:": { + "category": "people", + "name": "hand with index and middle fingers crossed tone 1", + "unicode": "1f91e-1f3fb" + }, + ":fingers_crossed_tone2:": { + "category": "people", + "name": "hand with index and middle fingers crossed tone 2", + "unicode": "1f91e-1f3fc" + }, + ":fingers_crossed_tone3:": { + "category": "people", + "name": "hand with index and middle fingers crossed tone 3", + "unicode": "1f91e-1f3fd" + }, + ":fingers_crossed_tone4:": { + "category": "people", + "name": "hand with index and middle fingers crossed tone 4", + "unicode": "1f91e-1f3fe" + }, + ":fingers_crossed_tone5:": { + "category": "people", + "name": "hand with index and middle fingers crossed tone 5", + "unicode": "1f91e-1f3ff" + }, + ":fire:": { + "category": "nature", + "name": "fire", + "unicode": "1f525" + }, + ":fire_engine:": { + "category": "travel", + "name": "fire engine", + "unicode": "1f692" + }, + ":fireworks:": { + "category": "travel", + "name": "fireworks", + "unicode": "1f386" + }, + ":first_place:": { + "category": "activity", + "name": "first place medal", + "unicode": "1f947" + }, + ":first_quarter_moon:": { + "category": "nature", + "name": "first quarter moon symbol", + "unicode": "1f313" + }, + ":first_quarter_moon_with_face:": { + "category": "nature", + "name": "first quarter moon with face", + "unicode": "1f31b" + }, + ":fish:": { + "category": "nature", + "name": "fish", + "unicode": "1f41f" + }, + ":fish_cake:": { + "category": "food", + "name": "fish cake with swirl design", + "unicode": "1f365" + }, + ":fishing_pole_and_fish:": { + "category": "activity", + "name": "fishing pole and fish", + "unicode": "1f3a3" + }, + ":fist:": { + "category": "people", + "name": "raised fist", + "unicode": "270a" + }, + ":fist_tone1:": { + "category": "people", + "name": "raised fist tone 1", + "unicode": "270a-1f3fb" + }, + ":fist_tone2:": { + "category": "people", + "name": "raised fist tone 2", + "unicode": "270a-1f3fc" + }, + ":fist_tone3:": { + "category": "people", + "name": "raised fist tone 3", + "unicode": "270a-1f3fd" + }, + ":fist_tone4:": { + "category": "people", + "name": "raised fist tone 4", + "unicode": "270a-1f3fe" + }, + ":fist_tone5:": { + "category": "people", + "name": "raised fist tone 5", + "unicode": "270a-1f3ff" + }, + ":five:": { + "category": "symbols", + "name": "keycap digit five", + "unicode": "0035-20e3", + "unicode_alt": "0035-fe0f-20e3" + }, + ":flag_ac:": { + "category": "flags", + "name": "ascension", + "unicode": "1f1e6-1f1e8" + }, + ":flag_ad:": { + "category": "flags", + "name": "andorra", + "unicode": "1f1e6-1f1e9" + }, + ":flag_ae:": { + "category": "flags", + "name": "the united arab emirates", + "unicode": "1f1e6-1f1ea" + }, + ":flag_af:": { + "category": "flags", + "name": "afghanistan", + "unicode": "1f1e6-1f1eb" + }, + ":flag_ag:": { + "category": "flags", + "name": "antigua and barbuda", + "unicode": "1f1e6-1f1ec" + }, + ":flag_ai:": { + "category": "flags", + "name": "anguilla", + "unicode": "1f1e6-1f1ee" + }, + ":flag_al:": { + "category": "flags", + "name": "albania", + "unicode": "1f1e6-1f1f1" + }, + ":flag_am:": { + "category": "flags", + "name": "armenia", + "unicode": "1f1e6-1f1f2" + }, + ":flag_ao:": { + "category": "flags", + "name": "angola", + "unicode": "1f1e6-1f1f4" + }, + ":flag_aq:": { + "category": "flags", + "name": "antarctica", + "unicode": "1f1e6-1f1f6" + }, + ":flag_ar:": { + "category": "flags", + "name": "argentina", + "unicode": "1f1e6-1f1f7" + }, + ":flag_as:": { + "category": "flags", + "name": "american samoa", + "unicode": "1f1e6-1f1f8" + }, + ":flag_at:": { + "category": "flags", + "name": "austria", + "unicode": "1f1e6-1f1f9" + }, + ":flag_au:": { + "category": "flags", + "name": "australia", + "unicode": "1f1e6-1f1fa" + }, + ":flag_aw:": { + "category": "flags", + "name": "aruba", + "unicode": "1f1e6-1f1fc" + }, + ":flag_ax:": { + "category": "flags", + "name": "\u00e5land islands", + "unicode": "1f1e6-1f1fd" + }, + ":flag_az:": { + "category": "flags", + "name": "azerbaijan", + "unicode": "1f1e6-1f1ff" + }, + ":flag_ba:": { + "category": "flags", + "name": "bosnia and herzegovina", + "unicode": "1f1e7-1f1e6" + }, + ":flag_bb:": { + "category": "flags", + "name": "barbados", + "unicode": "1f1e7-1f1e7" + }, + ":flag_bd:": { + "category": "flags", + "name": "bangladesh", + "unicode": "1f1e7-1f1e9" + }, + ":flag_be:": { + "category": "flags", + "name": "belgium", + "unicode": "1f1e7-1f1ea" + }, + ":flag_bf:": { + "category": "flags", + "name": "burkina faso", + "unicode": "1f1e7-1f1eb" + }, + ":flag_bg:": { + "category": "flags", + "name": "bulgaria", + "unicode": "1f1e7-1f1ec" + }, + ":flag_bh:": { + "category": "flags", + "name": "bahrain", + "unicode": "1f1e7-1f1ed" + }, + ":flag_bi:": { + "category": "flags", + "name": "burundi", + "unicode": "1f1e7-1f1ee" + }, + ":flag_bj:": { + "category": "flags", + "name": "benin", + "unicode": "1f1e7-1f1ef" + }, + ":flag_bl:": { + "category": "flags", + "name": "saint barth\u00e9lemy", + "unicode": "1f1e7-1f1f1" + }, + ":flag_black:": { + "category": "objects", + "name": "waving black flag", + "unicode": "1f3f4" + }, + ":flag_bm:": { + "category": "flags", + "name": "bermuda", + "unicode": "1f1e7-1f1f2" + }, + ":flag_bn:": { + "category": "flags", + "name": "brunei", + "unicode": "1f1e7-1f1f3" + }, + ":flag_bo:": { + "category": "flags", + "name": "bolivia", + "unicode": "1f1e7-1f1f4" + }, + ":flag_bq:": { + "category": "flags", + "name": "caribbean netherlands", + "unicode": "1f1e7-1f1f6" + }, + ":flag_br:": { + "category": "flags", + "name": "brazil", + "unicode": "1f1e7-1f1f7" + }, + ":flag_bs:": { + "category": "flags", + "name": "the bahamas", + "unicode": "1f1e7-1f1f8" + }, + ":flag_bt:": { + "category": "flags", + "name": "bhutan", + "unicode": "1f1e7-1f1f9" + }, + ":flag_bv:": { + "category": "flags", + "name": "bouvet island", + "unicode": "1f1e7-1f1fb" + }, + ":flag_bw:": { + "category": "flags", + "name": "botswana", + "unicode": "1f1e7-1f1fc" + }, + ":flag_by:": { + "category": "flags", + "name": "belarus", + "unicode": "1f1e7-1f1fe" + }, + ":flag_bz:": { + "category": "flags", + "name": "belize", + "unicode": "1f1e7-1f1ff" + }, + ":flag_ca:": { + "category": "flags", + "name": "canada", + "unicode": "1f1e8-1f1e6" + }, + ":flag_cc:": { + "category": "flags", + "name": "cocos (keeling) islands", + "unicode": "1f1e8-1f1e8" + }, + ":flag_cd:": { + "category": "flags", + "name": "the democratic republic of the congo", + "unicode": "1f1e8-1f1e9" + }, + ":flag_cf:": { + "category": "flags", + "name": "central african republic", + "unicode": "1f1e8-1f1eb" + }, + ":flag_cg:": { + "category": "flags", + "name": "the republic of the congo", + "unicode": "1f1e8-1f1ec" + }, + ":flag_ch:": { + "category": "flags", + "name": "switzerland", + "unicode": "1f1e8-1f1ed" + }, + ":flag_ci:": { + "category": "flags", + "name": "c\u00f4te d\u2019ivoire", + "unicode": "1f1e8-1f1ee" + }, + ":flag_ck:": { + "category": "flags", + "name": "cook islands", + "unicode": "1f1e8-1f1f0" + }, + ":flag_cl:": { + "category": "flags", + "name": "chile", + "unicode": "1f1e8-1f1f1" + }, + ":flag_cm:": { + "category": "flags", + "name": "cameroon", + "unicode": "1f1e8-1f1f2" + }, + ":flag_cn:": { + "category": "flags", + "name": "china", + "unicode": "1f1e8-1f1f3" + }, + ":flag_co:": { + "category": "flags", + "name": "colombia", + "unicode": "1f1e8-1f1f4" + }, + ":flag_cp:": { + "category": "flags", + "name": "clipperton island", + "unicode": "1f1e8-1f1f5" + }, + ":flag_cr:": { + "category": "flags", + "name": "costa rica", + "unicode": "1f1e8-1f1f7" + }, + ":flag_cu:": { + "category": "flags", + "name": "cuba", + "unicode": "1f1e8-1f1fa" + }, + ":flag_cv:": { + "category": "flags", + "name": "cape verde", + "unicode": "1f1e8-1f1fb" + }, + ":flag_cw:": { + "category": "flags", + "name": "cura\u00e7ao", + "unicode": "1f1e8-1f1fc" + }, + ":flag_cx:": { + "category": "flags", + "name": "christmas island", + "unicode": "1f1e8-1f1fd" + }, + ":flag_cy:": { + "category": "flags", + "name": "cyprus", + "unicode": "1f1e8-1f1fe" + }, + ":flag_cz:": { + "category": "flags", + "name": "the czech republic", + "unicode": "1f1e8-1f1ff" + }, + ":flag_de:": { + "category": "flags", + "name": "germany", + "unicode": "1f1e9-1f1ea" + }, + ":flag_dg:": { + "category": "flags", + "name": "diego garcia", + "unicode": "1f1e9-1f1ec" + }, + ":flag_dj:": { + "category": "flags", + "name": "djibouti", + "unicode": "1f1e9-1f1ef" + }, + ":flag_dk:": { + "category": "flags", + "name": "denmark", + "unicode": "1f1e9-1f1f0" + }, + ":flag_dm:": { + "category": "flags", + "name": "dominica", + "unicode": "1f1e9-1f1f2" + }, + ":flag_do:": { + "category": "flags", + "name": "the dominican republic", + "unicode": "1f1e9-1f1f4" + }, + ":flag_dz:": { + "category": "flags", + "name": "algeria", + "unicode": "1f1e9-1f1ff" + }, + ":flag_ea:": { + "category": "flags", + "name": "ceuta, melilla", + "unicode": "1f1ea-1f1e6" + }, + ":flag_ec:": { + "category": "flags", + "name": "ecuador", + "unicode": "1f1ea-1f1e8" + }, + ":flag_ee:": { + "category": "flags", + "name": "estonia", + "unicode": "1f1ea-1f1ea" + }, + ":flag_eg:": { + "category": "flags", + "name": "egypt", + "unicode": "1f1ea-1f1ec" + }, + ":flag_eh:": { + "category": "flags", + "name": "western sahara", + "unicode": "1f1ea-1f1ed" + }, + ":flag_er:": { + "category": "flags", + "name": "eritrea", + "unicode": "1f1ea-1f1f7" + }, + ":flag_es:": { + "category": "flags", + "name": "spain", + "unicode": "1f1ea-1f1f8" + }, + ":flag_et:": { + "category": "flags", + "name": "ethiopia", + "unicode": "1f1ea-1f1f9" + }, + ":flag_eu:": { + "category": "flags", + "name": "european union", + "unicode": "1f1ea-1f1fa" + }, + ":flag_fi:": { + "category": "flags", + "name": "finland", + "unicode": "1f1eb-1f1ee" + }, + ":flag_fj:": { + "category": "flags", + "name": "fiji", + "unicode": "1f1eb-1f1ef" + }, + ":flag_fk:": { + "category": "flags", + "name": "falkland islands", + "unicode": "1f1eb-1f1f0" + }, + ":flag_fm:": { + "category": "flags", + "name": "micronesia", + "unicode": "1f1eb-1f1f2" + }, + ":flag_fo:": { + "category": "flags", + "name": "faroe islands", + "unicode": "1f1eb-1f1f4" + }, + ":flag_fr:": { + "category": "flags", + "name": "france", + "unicode": "1f1eb-1f1f7" + }, + ":flag_ga:": { + "category": "flags", + "name": "gabon", + "unicode": "1f1ec-1f1e6" + }, + ":flag_gb:": { + "category": "flags", + "name": "great britain", + "unicode": "1f1ec-1f1e7" + }, + ":flag_gd:": { + "category": "flags", + "name": "grenada", + "unicode": "1f1ec-1f1e9" + }, + ":flag_ge:": { + "category": "flags", + "name": "georgia", + "unicode": "1f1ec-1f1ea" + }, + ":flag_gf:": { + "category": "flags", + "name": "french guiana", + "unicode": "1f1ec-1f1eb" + }, + ":flag_gg:": { + "category": "flags", + "name": "guernsey", + "unicode": "1f1ec-1f1ec" + }, + ":flag_gh:": { + "category": "flags", + "name": "ghana", + "unicode": "1f1ec-1f1ed" + }, + ":flag_gi:": { + "category": "flags", + "name": "gibraltar", + "unicode": "1f1ec-1f1ee" + }, + ":flag_gl:": { + "category": "flags", + "name": "greenland", + "unicode": "1f1ec-1f1f1" + }, + ":flag_gm:": { + "category": "flags", + "name": "the gambia", + "unicode": "1f1ec-1f1f2" + }, + ":flag_gn:": { + "category": "flags", + "name": "guinea", + "unicode": "1f1ec-1f1f3" + }, + ":flag_gp:": { + "category": "flags", + "name": "guadeloupe", + "unicode": "1f1ec-1f1f5" + }, + ":flag_gq:": { + "category": "flags", + "name": "equatorial guinea", + "unicode": "1f1ec-1f1f6" + }, + ":flag_gr:": { + "category": "flags", + "name": "greece", + "unicode": "1f1ec-1f1f7" + }, + ":flag_gs:": { + "category": "flags", + "name": "south georgia", + "unicode": "1f1ec-1f1f8" + }, + ":flag_gt:": { + "category": "flags", + "name": "guatemala", + "unicode": "1f1ec-1f1f9" + }, + ":flag_gu:": { + "category": "flags", + "name": "guam", + "unicode": "1f1ec-1f1fa" + }, + ":flag_gw:": { + "category": "flags", + "name": "guinea-bissau", + "unicode": "1f1ec-1f1fc" + }, + ":flag_gy:": { + "category": "flags", + "name": "guyana", + "unicode": "1f1ec-1f1fe" + }, + ":flag_hk:": { + "category": "flags", + "name": "hong kong", + "unicode": "1f1ed-1f1f0" + }, + ":flag_hm:": { + "category": "flags", + "name": "heard island and mcdonald islands", + "unicode": "1f1ed-1f1f2" + }, + ":flag_hn:": { + "category": "flags", + "name": "honduras", + "unicode": "1f1ed-1f1f3" + }, + ":flag_hr:": { + "category": "flags", + "name": "croatia", + "unicode": "1f1ed-1f1f7" + }, + ":flag_ht:": { + "category": "flags", + "name": "haiti", + "unicode": "1f1ed-1f1f9" + }, + ":flag_hu:": { + "category": "flags", + "name": "hungary", + "unicode": "1f1ed-1f1fa" + }, + ":flag_ic:": { + "category": "flags", + "name": "canary islands", + "unicode": "1f1ee-1f1e8" + }, + ":flag_id:": { + "category": "flags", + "name": "indonesia", + "unicode": "1f1ee-1f1e9" + }, + ":flag_ie:": { + "category": "flags", + "name": "ireland", + "unicode": "1f1ee-1f1ea" + }, + ":flag_il:": { + "category": "flags", + "name": "israel", + "unicode": "1f1ee-1f1f1" + }, + ":flag_im:": { + "category": "flags", + "name": "isle of man", + "unicode": "1f1ee-1f1f2" + }, + ":flag_in:": { + "category": "flags", + "name": "india", + "unicode": "1f1ee-1f1f3" + }, + ":flag_io:": { + "category": "flags", + "name": "british indian ocean territory", + "unicode": "1f1ee-1f1f4" + }, + ":flag_iq:": { + "category": "flags", + "name": "iraq", + "unicode": "1f1ee-1f1f6" + }, + ":flag_ir:": { + "category": "flags", + "name": "iran", + "unicode": "1f1ee-1f1f7" + }, + ":flag_is:": { + "category": "flags", + "name": "iceland", + "unicode": "1f1ee-1f1f8" + }, + ":flag_it:": { + "category": "flags", + "name": "italy", + "unicode": "1f1ee-1f1f9" + }, + ":flag_je:": { + "category": "flags", + "name": "jersey", + "unicode": "1f1ef-1f1ea" + }, + ":flag_jm:": { + "category": "flags", + "name": "jamaica", + "unicode": "1f1ef-1f1f2" + }, + ":flag_jo:": { + "category": "flags", + "name": "jordan", + "unicode": "1f1ef-1f1f4" + }, + ":flag_jp:": { + "category": "flags", + "name": "japan", + "unicode": "1f1ef-1f1f5" + }, + ":flag_ke:": { + "category": "flags", + "name": "kenya", + "unicode": "1f1f0-1f1ea" + }, + ":flag_kg:": { + "category": "flags", + "name": "kyrgyzstan", + "unicode": "1f1f0-1f1ec" + }, + ":flag_kh:": { + "category": "flags", + "name": "cambodia", + "unicode": "1f1f0-1f1ed" + }, + ":flag_ki:": { + "category": "flags", + "name": "kiribati", + "unicode": "1f1f0-1f1ee" + }, + ":flag_km:": { + "category": "flags", + "name": "the comoros", + "unicode": "1f1f0-1f1f2" + }, + ":flag_kn:": { + "category": "flags", + "name": "saint kitts and nevis", + "unicode": "1f1f0-1f1f3" + }, + ":flag_kp:": { + "category": "flags", + "name": "north korea", + "unicode": "1f1f0-1f1f5" + }, + ":flag_kr:": { + "category": "flags", + "name": "korea", + "unicode": "1f1f0-1f1f7" + }, + ":flag_kw:": { + "category": "flags", + "name": "kuwait", + "unicode": "1f1f0-1f1fc" + }, + ":flag_ky:": { + "category": "flags", + "name": "cayman islands", + "unicode": "1f1f0-1f1fe" + }, + ":flag_kz:": { + "category": "flags", + "name": "kazakhstan", + "unicode": "1f1f0-1f1ff" + }, + ":flag_la:": { + "category": "flags", + "name": "laos", + "unicode": "1f1f1-1f1e6" + }, + ":flag_lb:": { + "category": "flags", + "name": "lebanon", + "unicode": "1f1f1-1f1e7" + }, + ":flag_lc:": { + "category": "flags", + "name": "saint lucia", + "unicode": "1f1f1-1f1e8" + }, + ":flag_li:": { + "category": "flags", + "name": "liechtenstein", + "unicode": "1f1f1-1f1ee" + }, + ":flag_lk:": { + "category": "flags", + "name": "sri lanka", + "unicode": "1f1f1-1f1f0" + }, + ":flag_lr:": { + "category": "flags", + "name": "liberia", + "unicode": "1f1f1-1f1f7" + }, + ":flag_ls:": { + "category": "flags", + "name": "lesotho", + "unicode": "1f1f1-1f1f8" + }, + ":flag_lt:": { + "category": "flags", + "name": "lithuania", + "unicode": "1f1f1-1f1f9" + }, + ":flag_lu:": { + "category": "flags", + "name": "luxembourg", + "unicode": "1f1f1-1f1fa" + }, + ":flag_lv:": { + "category": "flags", + "name": "latvia", + "unicode": "1f1f1-1f1fb" + }, + ":flag_ly:": { + "category": "flags", + "name": "libya", + "unicode": "1f1f1-1f1fe" + }, + ":flag_ma:": { + "category": "flags", + "name": "morocco", + "unicode": "1f1f2-1f1e6" + }, + ":flag_mc:": { + "category": "flags", + "name": "monaco", + "unicode": "1f1f2-1f1e8" + }, + ":flag_md:": { + "category": "flags", + "name": "moldova", + "unicode": "1f1f2-1f1e9" + }, + ":flag_me:": { + "category": "flags", + "name": "montenegro", + "unicode": "1f1f2-1f1ea" + }, + ":flag_mf:": { + "category": "flags", + "name": "saint martin", + "unicode": "1f1f2-1f1eb" + }, + ":flag_mg:": { + "category": "flags", + "name": "madagascar", + "unicode": "1f1f2-1f1ec" + }, + ":flag_mh:": { + "category": "flags", + "name": "the marshall islands", + "unicode": "1f1f2-1f1ed" + }, + ":flag_mk:": { + "category": "flags", + "name": "macedonia", + "unicode": "1f1f2-1f1f0" + }, + ":flag_ml:": { + "category": "flags", + "name": "mali", + "unicode": "1f1f2-1f1f1" + }, + ":flag_mm:": { + "category": "flags", + "name": "myanmar", + "unicode": "1f1f2-1f1f2" + }, + ":flag_mn:": { + "category": "flags", + "name": "mongolia", + "unicode": "1f1f2-1f1f3" + }, + ":flag_mo:": { + "category": "flags", + "name": "macau", + "unicode": "1f1f2-1f1f4" + }, + ":flag_mp:": { + "category": "flags", + "name": "northern mariana islands", + "unicode": "1f1f2-1f1f5" + }, + ":flag_mq:": { + "category": "flags", + "name": "martinique", + "unicode": "1f1f2-1f1f6" + }, + ":flag_mr:": { + "category": "flags", + "name": "mauritania", + "unicode": "1f1f2-1f1f7" + }, + ":flag_ms:": { + "category": "flags", + "name": "montserrat", + "unicode": "1f1f2-1f1f8" + }, + ":flag_mt:": { + "category": "flags", + "name": "malta", + "unicode": "1f1f2-1f1f9" + }, + ":flag_mu:": { + "category": "flags", + "name": "mauritius", + "unicode": "1f1f2-1f1fa" + }, + ":flag_mv:": { + "category": "flags", + "name": "maldives", + "unicode": "1f1f2-1f1fb" + }, + ":flag_mw:": { + "category": "flags", + "name": "malawi", + "unicode": "1f1f2-1f1fc" + }, + ":flag_mx:": { + "category": "flags", + "name": "mexico", + "unicode": "1f1f2-1f1fd" + }, + ":flag_my:": { + "category": "flags", + "name": "malaysia", + "unicode": "1f1f2-1f1fe" + }, + ":flag_mz:": { + "category": "flags", + "name": "mozambique", + "unicode": "1f1f2-1f1ff" + }, + ":flag_na:": { + "category": "flags", + "name": "namibia", + "unicode": "1f1f3-1f1e6" + }, + ":flag_nc:": { + "category": "flags", + "name": "new caledonia", + "unicode": "1f1f3-1f1e8" + }, + ":flag_ne:": { + "category": "flags", + "name": "niger", + "unicode": "1f1f3-1f1ea" + }, + ":flag_nf:": { + "category": "flags", + "name": "norfolk island", + "unicode": "1f1f3-1f1eb" + }, + ":flag_ng:": { + "category": "flags", + "name": "nigeria", + "unicode": "1f1f3-1f1ec" + }, + ":flag_ni:": { + "category": "flags", + "name": "nicaragua", + "unicode": "1f1f3-1f1ee" + }, + ":flag_nl:": { + "category": "flags", + "name": "the netherlands", + "unicode": "1f1f3-1f1f1" + }, + ":flag_no:": { + "category": "flags", + "name": "norway", + "unicode": "1f1f3-1f1f4" + }, + ":flag_np:": { + "category": "flags", + "name": "nepal", + "unicode": "1f1f3-1f1f5" + }, + ":flag_nr:": { + "category": "flags", + "name": "nauru", + "unicode": "1f1f3-1f1f7" + }, + ":flag_nu:": { + "category": "flags", + "name": "niue", + "unicode": "1f1f3-1f1fa" + }, + ":flag_nz:": { + "category": "flags", + "name": "new zealand", + "unicode": "1f1f3-1f1ff" + }, + ":flag_om:": { + "category": "flags", + "name": "oman", + "unicode": "1f1f4-1f1f2" + }, + ":flag_pa:": { + "category": "flags", + "name": "panama", + "unicode": "1f1f5-1f1e6" + }, + ":flag_pe:": { + "category": "flags", + "name": "peru", + "unicode": "1f1f5-1f1ea" + }, + ":flag_pf:": { + "category": "flags", + "name": "french polynesia", + "unicode": "1f1f5-1f1eb" + }, + ":flag_pg:": { + "category": "flags", + "name": "papua new guinea", + "unicode": "1f1f5-1f1ec" + }, + ":flag_ph:": { + "category": "flags", + "name": "the philippines", + "unicode": "1f1f5-1f1ed" + }, + ":flag_pk:": { + "category": "flags", + "name": "pakistan", + "unicode": "1f1f5-1f1f0" + }, + ":flag_pl:": { + "category": "flags", + "name": "poland", + "unicode": "1f1f5-1f1f1" + }, + ":flag_pm:": { + "category": "flags", + "name": "saint pierre and miquelon", + "unicode": "1f1f5-1f1f2" + }, + ":flag_pn:": { + "category": "flags", + "name": "pitcairn", + "unicode": "1f1f5-1f1f3" + }, + ":flag_pr:": { + "category": "flags", + "name": "puerto rico", + "unicode": "1f1f5-1f1f7" + }, + ":flag_ps:": { + "category": "flags", + "name": "palestinian authority", + "unicode": "1f1f5-1f1f8" + }, + ":flag_pt:": { + "category": "flags", + "name": "portugal", + "unicode": "1f1f5-1f1f9" + }, + ":flag_pw:": { + "category": "flags", + "name": "palau", + "unicode": "1f1f5-1f1fc" + }, + ":flag_py:": { + "category": "flags", + "name": "paraguay", + "unicode": "1f1f5-1f1fe" + }, + ":flag_qa:": { + "category": "flags", + "name": "qatar", + "unicode": "1f1f6-1f1e6" + }, + ":flag_re:": { + "category": "flags", + "name": "r\u00e9union", + "unicode": "1f1f7-1f1ea" + }, + ":flag_ro:": { + "category": "flags", + "name": "romania", + "unicode": "1f1f7-1f1f4" + }, + ":flag_rs:": { + "category": "flags", + "name": "serbia", + "unicode": "1f1f7-1f1f8" + }, + ":flag_ru:": { + "category": "flags", + "name": "russia", + "unicode": "1f1f7-1f1fa" + }, + ":flag_rw:": { + "category": "flags", + "name": "rwanda", + "unicode": "1f1f7-1f1fc" + }, + ":flag_sa:": { + "category": "flags", + "name": "saudi arabia", + "unicode": "1f1f8-1f1e6" + }, + ":flag_sb:": { + "category": "flags", + "name": "the solomon islands", + "unicode": "1f1f8-1f1e7" + }, + ":flag_sc:": { + "category": "flags", + "name": "the seychelles", + "unicode": "1f1f8-1f1e8" + }, + ":flag_sd:": { + "category": "flags", + "name": "sudan", + "unicode": "1f1f8-1f1e9" + }, + ":flag_se:": { + "category": "flags", + "name": "sweden", + "unicode": "1f1f8-1f1ea" + }, + ":flag_sg:": { + "category": "flags", + "name": "singapore", + "unicode": "1f1f8-1f1ec" + }, + ":flag_sh:": { + "category": "flags", + "name": "saint helena", + "unicode": "1f1f8-1f1ed" + }, + ":flag_si:": { + "category": "flags", + "name": "slovenia", + "unicode": "1f1f8-1f1ee" + }, + ":flag_sj:": { + "category": "flags", + "name": "svalbard and jan mayen", + "unicode": "1f1f8-1f1ef" + }, + ":flag_sk:": { + "category": "flags", + "name": "slovakia", + "unicode": "1f1f8-1f1f0" + }, + ":flag_sl:": { + "category": "flags", + "name": "sierra leone", + "unicode": "1f1f8-1f1f1" + }, + ":flag_sm:": { + "category": "flags", + "name": "san marino", + "unicode": "1f1f8-1f1f2" + }, + ":flag_sn:": { + "category": "flags", + "name": "senegal", + "unicode": "1f1f8-1f1f3" + }, + ":flag_so:": { + "category": "flags", + "name": "somalia", + "unicode": "1f1f8-1f1f4" + }, + ":flag_sr:": { + "category": "flags", + "name": "suriname", + "unicode": "1f1f8-1f1f7" + }, + ":flag_ss:": { + "category": "flags", + "name": "south sudan", + "unicode": "1f1f8-1f1f8" + }, + ":flag_st:": { + "category": "flags", + "name": "s\u00e3o tom\u00e9 and pr\u00edncipe", + "unicode": "1f1f8-1f1f9" + }, + ":flag_sv:": { + "category": "flags", + "name": "el salvador", + "unicode": "1f1f8-1f1fb" + }, + ":flag_sx:": { + "category": "flags", + "name": "sint maarten", + "unicode": "1f1f8-1f1fd" + }, + ":flag_sy:": { + "category": "flags", + "name": "syria", + "unicode": "1f1f8-1f1fe" + }, + ":flag_sz:": { + "category": "flags", + "name": "swaziland", + "unicode": "1f1f8-1f1ff" + }, + ":flag_ta:": { + "category": "flags", + "name": "tristan da cunha", + "unicode": "1f1f9-1f1e6" + }, + ":flag_tc:": { + "category": "flags", + "name": "turks and caicos islands", + "unicode": "1f1f9-1f1e8" + }, + ":flag_td:": { + "category": "flags", + "name": "chad", + "unicode": "1f1f9-1f1e9" + }, + ":flag_tf:": { + "category": "flags", + "name": "french southern territories", + "unicode": "1f1f9-1f1eb" + }, + ":flag_tg:": { + "category": "flags", + "name": "togo", + "unicode": "1f1f9-1f1ec" + }, + ":flag_th:": { + "category": "flags", + "name": "thailand", + "unicode": "1f1f9-1f1ed" + }, + ":flag_tj:": { + "category": "flags", + "name": "tajikistan", + "unicode": "1f1f9-1f1ef" + }, + ":flag_tk:": { + "category": "flags", + "name": "tokelau", + "unicode": "1f1f9-1f1f0" + }, + ":flag_tl:": { + "category": "flags", + "name": "timor-leste", + "unicode": "1f1f9-1f1f1" + }, + ":flag_tm:": { + "category": "flags", + "name": "turkmenistan", + "unicode": "1f1f9-1f1f2" + }, + ":flag_tn:": { + "category": "flags", + "name": "tunisia", + "unicode": "1f1f9-1f1f3" + }, + ":flag_to:": { + "category": "flags", + "name": "tonga", + "unicode": "1f1f9-1f1f4" + }, + ":flag_tr:": { + "category": "flags", + "name": "turkey", + "unicode": "1f1f9-1f1f7" + }, + ":flag_tt:": { + "category": "flags", + "name": "trinidad and tobago", + "unicode": "1f1f9-1f1f9" + }, + ":flag_tv:": { + "category": "flags", + "name": "tuvalu", + "unicode": "1f1f9-1f1fb" + }, + ":flag_tw:": { + "category": "flags", + "name": "the republic of china", + "unicode": "1f1f9-1f1fc" + }, + ":flag_tz:": { + "category": "flags", + "name": "tanzania", + "unicode": "1f1f9-1f1ff" + }, + ":flag_ua:": { + "category": "flags", + "name": "ukraine", + "unicode": "1f1fa-1f1e6" + }, + ":flag_ug:": { + "category": "flags", + "name": "uganda", + "unicode": "1f1fa-1f1ec" + }, + ":flag_um:": { + "category": "flags", + "name": "united states minor outlying islands", + "unicode": "1f1fa-1f1f2" + }, + ":flag_us:": { + "category": "flags", + "name": "united states", + "unicode": "1f1fa-1f1f8" + }, + ":flag_uy:": { + "category": "flags", + "name": "uruguay", + "unicode": "1f1fa-1f1fe" + }, + ":flag_uz:": { + "category": "flags", + "name": "uzbekistan", + "unicode": "1f1fa-1f1ff" + }, + ":flag_va:": { + "category": "flags", + "name": "the vatican city", + "unicode": "1f1fb-1f1e6" + }, + ":flag_vc:": { + "category": "flags", + "name": "saint vincent and the grenadines", + "unicode": "1f1fb-1f1e8" + }, + ":flag_ve:": { + "category": "flags", + "name": "venezuela", + "unicode": "1f1fb-1f1ea" + }, + ":flag_vg:": { + "category": "flags", + "name": "british virgin islands", + "unicode": "1f1fb-1f1ec" + }, + ":flag_vi:": { + "category": "flags", + "name": "u.s. virgin islands", + "unicode": "1f1fb-1f1ee" + }, + ":flag_vn:": { + "category": "flags", + "name": "vietnam", + "unicode": "1f1fb-1f1f3" + }, + ":flag_vu:": { + "category": "flags", + "name": "vanuatu", + "unicode": "1f1fb-1f1fa" + }, + ":flag_wf:": { + "category": "flags", + "name": "wallis and futuna", + "unicode": "1f1fc-1f1eb" + }, + ":flag_white:": { + "category": "objects", + "name": "waving white flag", + "unicode": "1f3f3", + "unicode_alt": "1f3f3-fe0f" + }, + ":flag_ws:": { + "category": "flags", + "name": "samoa", + "unicode": "1f1fc-1f1f8" + }, + ":flag_xk:": { + "category": "flags", + "name": "kosovo", + "unicode": "1f1fd-1f1f0" + }, + ":flag_ye:": { + "category": "flags", + "name": "yemen", + "unicode": "1f1fe-1f1ea" + }, + ":flag_yt:": { + "category": "flags", + "name": "mayotte", + "unicode": "1f1fe-1f1f9" + }, + ":flag_za:": { + "category": "flags", + "name": "south africa", + "unicode": "1f1ff-1f1e6" + }, + ":flag_zm:": { + "category": "flags", + "name": "zambia", + "unicode": "1f1ff-1f1f2" + }, + ":flag_zw:": { + "category": "flags", + "name": "zimbabwe", + "unicode": "1f1ff-1f1fc" + }, + ":flags:": { + "category": "objects", + "name": "carp streamer", + "unicode": "1f38f" + }, + ":flashlight:": { + "category": "objects", + "name": "electric torch", + "unicode": "1f526" + }, + ":fleur-de-lis:": { + "category": "symbols", + "name": "fleur-de-lis", + "unicode": "269c", + "unicode_alt": "269c-fe0f" + }, + ":floppy_disk:": { + "category": "objects", + "name": "floppy disk", + "unicode": "1f4be" + }, + ":flower_playing_cards:": { + "category": "symbols", + "name": "flower playing cards", + "unicode": "1f3b4" + }, + ":flushed:": { + "category": "people", + "name": "flushed face", + "unicode": "1f633" + }, + ":fog:": { + "category": "nature", + "name": "fog", + "unicode": "1f32b", + "unicode_alt": "1f32b-fe0f" + }, + ":foggy:": { + "category": "travel", + "name": "foggy", + "unicode": "1f301" + }, + ":football:": { + "category": "activity", + "name": "american football", + "unicode": "1f3c8" + }, + ":footprints:": { + "category": "people", + "name": "footprints", + "unicode": "1f463" + }, + ":fork_and_knife:": { + "category": "food", + "name": "fork and knife", + "unicode": "1f374" + }, + ":fork_knife_plate:": { + "category": "food", + "name": "fork and knife with plate", + "unicode": "1f37d", + "unicode_alt": "1f37d-fe0f" + }, + ":fountain:": { + "category": "travel", + "name": "fountain", + "unicode": "26f2", + "unicode_alt": "26f2-fe0f" + }, + ":four:": { + "category": "symbols", + "name": "keycap digit four", + "unicode": "0034-20e3", + "unicode_alt": "0034-fe0f-20e3" + }, + ":four_leaf_clover:": { + "category": "nature", + "name": "four leaf clover", + "unicode": "1f340" + }, + ":fox:": { + "category": "nature", + "name": "fox face", + "unicode": "1f98a" + }, + ":frame_photo:": { + "category": "objects", + "name": "frame with picture", + "unicode": "1f5bc", + "unicode_alt": "1f5bc-fe0f" + }, + ":free:": { + "category": "symbols", + "name": "squared free", + "unicode": "1f193" + }, + ":french_bread:": { + "category": "food", + "name": "baguette bread", + "unicode": "1f956" + }, + ":fried_shrimp:": { + "category": "food", + "name": "fried shrimp", + "unicode": "1f364" + }, + ":fries:": { + "category": "food", + "name": "french fries", + "unicode": "1f35f" + }, + ":frog:": { + "category": "nature", + "name": "frog face", + "unicode": "1f438" + }, + ":frowning2:": { + "category": "people", + "name": "white frowning face", + "unicode": "2639", + "unicode_alt": "2639-fe0f" + }, + ":frowning:": { + "category": "people", + "name": "frowning face with open mouth", + "unicode": "1f626" + }, + ":fuelpump:": { + "category": "travel", + "name": "fuel pump", + "unicode": "26fd", + "unicode_alt": "26fd-fe0f" + }, + ":full_moon:": { + "category": "nature", + "name": "full moon symbol", + "unicode": "1f315" + }, + ":full_moon_with_face:": { + "category": "nature", + "name": "full moon with face", + "unicode": "1f31d" + }, + ":game_die:": { + "category": "activity", + "name": "game die", + "unicode": "1f3b2" + }, + ":gear:": { + "category": "objects", + "name": "gear", + "unicode": "2699", + "unicode_alt": "2699-fe0f" + }, + ":gem:": { + "category": "objects", + "name": "gem stone", + "unicode": "1f48e" + }, + ":gemini:": { + "category": "symbols", + "name": "gemini", + "unicode": "264a", + "unicode_alt": "264a-fe0f" + }, + ":ghost:": { + "category": "people", + "name": "ghost", + "unicode": "1f47b" + }, + ":gift:": { + "category": "objects", + "name": "wrapped present", + "unicode": "1f381" + }, + ":gift_heart:": { + "category": "symbols", + "name": "heart with ribbon", + "unicode": "1f49d" + }, + ":girl:": { + "category": "people", + "name": "girl", + "unicode": "1f467" + }, + ":girl_tone1:": { + "category": "people", + "name": "girl tone 1", + "unicode": "1f467-1f3fb" + }, + ":girl_tone2:": { + "category": "people", + "name": "girl tone 2", + "unicode": "1f467-1f3fc" + }, + ":girl_tone3:": { + "category": "people", + "name": "girl tone 3", + "unicode": "1f467-1f3fd" + }, + ":girl_tone4:": { + "category": "people", + "name": "girl tone 4", + "unicode": "1f467-1f3fe" + }, + ":girl_tone5:": { + "category": "people", + "name": "girl tone 5", + "unicode": "1f467-1f3ff" + }, + ":globe_with_meridians:": { + "category": "symbols", + "name": "globe with meridians", + "unicode": "1f310" + }, + ":goal:": { + "category": "activity", + "name": "goal net", + "unicode": "1f945" + }, + ":goat:": { + "category": "nature", + "name": "goat", + "unicode": "1f410" + }, + ":golf:": { + "category": "activity", + "name": "flag in hole", + "unicode": "26f3", + "unicode_alt": "26f3-fe0f" + }, + ":golfer:": { + "category": "activity", + "name": "golfer", + "unicode": "1f3cc", + "unicode_alt": "1f3cc-fe0f" + }, + ":gorilla:": { + "category": "nature", + "name": "gorilla", + "unicode": "1f98d" + }, + ":grapes:": { + "category": "food", + "name": "grapes", + "unicode": "1f347" + }, + ":green_apple:": { + "category": "food", + "name": "green apple", + "unicode": "1f34f" + }, + ":green_book:": { + "category": "objects", + "name": "green book", + "unicode": "1f4d7" + }, + ":green_heart:": { + "category": "symbols", + "name": "green heart", + "unicode": "1f49a" + }, + ":grey_exclamation:": { + "category": "symbols", + "name": "white exclamation mark ornament", + "unicode": "2755" + }, + ":grey_question:": { + "category": "symbols", + "name": "white question mark ornament", + "unicode": "2754" + }, + ":grimacing:": { + "category": "people", + "name": "grimacing face", + "unicode": "1f62c" + }, + ":grin:": { + "category": "people", + "name": "grinning face with smiling eyes", + "unicode": "1f601" + }, + ":grinning:": { + "category": "people", + "name": "grinning face", + "unicode": "1f600" + }, + ":guardsman:": { + "category": "people", + "name": "guardsman", + "unicode": "1f482" + }, + ":guardsman_tone1:": { + "category": "people", + "name": "guardsman tone 1", + "unicode": "1f482-1f3fb" + }, + ":guardsman_tone2:": { + "category": "people", + "name": "guardsman tone 2", + "unicode": "1f482-1f3fc" + }, + ":guardsman_tone3:": { + "category": "people", + "name": "guardsman tone 3", + "unicode": "1f482-1f3fd" + }, + ":guardsman_tone4:": { + "category": "people", + "name": "guardsman tone 4", + "unicode": "1f482-1f3fe" + }, + ":guardsman_tone5:": { + "category": "people", + "name": "guardsman tone 5", + "unicode": "1f482-1f3ff" + }, + ":guitar:": { + "category": "activity", + "name": "guitar", + "unicode": "1f3b8" + }, + ":gun:": { + "category": "objects", + "name": "pistol", + "unicode": "1f52b" + }, + ":haircut:": { + "category": "people", + "name": "haircut", + "unicode": "1f487" + }, + ":haircut_tone1:": { + "category": "people", + "name": "haircut tone 1", + "unicode": "1f487-1f3fb" + }, + ":haircut_tone2:": { + "category": "people", + "name": "haircut tone 2", + "unicode": "1f487-1f3fc" + }, + ":haircut_tone3:": { + "category": "people", + "name": "haircut tone 3", + "unicode": "1f487-1f3fd" + }, + ":haircut_tone4:": { + "category": "people", + "name": "haircut tone 4", + "unicode": "1f487-1f3fe" + }, + ":haircut_tone5:": { + "category": "people", + "name": "haircut tone 5", + "unicode": "1f487-1f3ff" + }, + ":hamburger:": { + "category": "food", + "name": "hamburger", + "unicode": "1f354" + }, + ":hammer:": { + "category": "objects", + "name": "hammer", + "unicode": "1f528" + }, + ":hammer_pick:": { + "category": "objects", + "name": "hammer and pick", + "unicode": "2692", + "unicode_alt": "2692-fe0f" + }, + ":hamster:": { + "category": "nature", + "name": "hamster face", + "unicode": "1f439" + }, + ":hand_splayed:": { + "category": "people", + "name": "raised hand with fingers splayed", + "unicode": "1f590", + "unicode_alt": "1f590-fe0f" + }, + ":hand_splayed_tone1:": { + "category": "people", + "name": "raised hand with fingers splayed tone 1", + "unicode": "1f590-1f3fb" + }, + ":hand_splayed_tone2:": { + "category": "people", + "name": "raised hand with fingers splayed tone 2", + "unicode": "1f590-1f3fc" + }, + ":hand_splayed_tone3:": { + "category": "people", + "name": "raised hand with fingers splayed tone 3", + "unicode": "1f590-1f3fd" + }, + ":hand_splayed_tone4:": { + "category": "people", + "name": "raised hand with fingers splayed tone 4", + "unicode": "1f590-1f3fe" + }, + ":hand_splayed_tone5:": { + "category": "people", + "name": "raised hand with fingers splayed tone 5", + "unicode": "1f590-1f3ff" + }, + ":handbag:": { + "category": "people", + "name": "handbag", + "unicode": "1f45c" + }, + ":handball:": { + "category": "activity", + "name": "handball", + "unicode": "1f93e" + }, + ":handball_tone1:": { + "category": "activity", + "name": "handball tone 1", + "unicode": "1f93e-1f3fb" + }, + ":handball_tone2:": { + "category": "activity", + "name": "handball tone 2", + "unicode": "1f93e-1f3fc" + }, + ":handball_tone3:": { + "category": "activity", + "name": "handball tone 3", + "unicode": "1f93e-1f3fd" + }, + ":handball_tone4:": { + "category": "activity", + "name": "handball tone 4", + "unicode": "1f93e-1f3fe" + }, + ":handball_tone5:": { + "category": "activity", + "name": "handball tone 5", + "unicode": "1f93e-1f3ff" + }, + ":handshake:": { + "category": "people", + "name": "handshake", + "unicode": "1f91d" + }, + ":handshake_tone1:": { + "category": "people", + "name": "handshake tone 1", + "unicode": "1f91d-1f3fb" + }, + ":handshake_tone2:": { + "category": "people", + "name": "handshake tone 2", + "unicode": "1f91d-1f3fc" + }, + ":handshake_tone3:": { + "category": "people", + "name": "handshake tone 3", + "unicode": "1f91d-1f3fd" + }, + ":handshake_tone4:": { + "category": "people", + "name": "handshake tone 4", + "unicode": "1f91d-1f3fe" + }, + ":handshake_tone5:": { + "category": "people", + "name": "handshake tone 5", + "unicode": "1f91d-1f3ff" + }, + ":hash:": { + "category": "symbols", + "name": "keycap number sign", + "unicode": "0023-20e3", + "unicode_alt": "0023-fe0f-20e3" + }, + ":hatched_chick:": { + "category": "nature", + "name": "front-facing baby chick", + "unicode": "1f425" + }, + ":hatching_chick:": { + "category": "nature", + "name": "hatching chick", + "unicode": "1f423" + }, + ":head_bandage:": { + "category": "people", + "name": "face with head-bandage", + "unicode": "1f915" + }, + ":headphones:": { + "category": "activity", + "name": "headphone", + "unicode": "1f3a7" + }, + ":hear_no_evil:": { + "category": "nature", + "name": "hear-no-evil monkey", + "unicode": "1f649" + }, + ":heart:": { + "category": "symbols", + "name": "heavy black heart", + "unicode": "2764", + "unicode_alt": "2764-fe0f" + }, + ":heart_decoration:": { + "category": "symbols", + "name": "heart decoration", + "unicode": "1f49f" + }, + ":heart_exclamation:": { + "category": "symbols", + "name": "heavy heart exclamation mark ornament", + "unicode": "2763", + "unicode_alt": "2763-fe0f" + }, + ":heart_eyes:": { + "category": "people", + "name": "smiling face with heart-shaped eyes", + "unicode": "1f60d" + }, + ":heart_eyes_cat:": { + "category": "people", + "name": "smiling cat face with heart-shaped eyes", + "unicode": "1f63b" + }, + ":heartbeat:": { + "category": "symbols", + "name": "beating heart", + "unicode": "1f493" + }, + ":heartpulse:": { + "category": "symbols", + "name": "growing heart", + "unicode": "1f497" + }, + ":hearts:": { + "category": "symbols", + "name": "black heart suit", + "unicode": "2665", + "unicode_alt": "2665-fe0f" + }, + ":heavy_check_mark:": { + "category": "symbols", + "name": "heavy check mark", + "unicode": "2714", + "unicode_alt": "2714-fe0f" + }, + ":heavy_division_sign:": { + "category": "symbols", + "name": "heavy division sign", + "unicode": "2797" + }, + ":heavy_dollar_sign:": { + "category": "symbols", + "name": "heavy dollar sign", + "unicode": "1f4b2" + }, + ":heavy_minus_sign:": { + "category": "symbols", + "name": "heavy minus sign", + "unicode": "2796" + }, + ":heavy_multiplication_x:": { + "category": "symbols", + "name": "heavy multiplication x", + "unicode": "2716", + "unicode_alt": "2716-fe0f" + }, + ":heavy_plus_sign:": { + "category": "symbols", + "name": "heavy plus sign", + "unicode": "2795" + }, + ":helicopter:": { + "category": "travel", + "name": "helicopter", + "unicode": "1f681" + }, + ":helmet_with_cross:": { + "category": "people", + "name": "helmet with white cross", + "unicode": "26d1", + "unicode_alt": "26d1-fe0f" + }, + ":herb:": { + "category": "nature", + "name": "herb", + "unicode": "1f33f" + }, + ":hibiscus:": { + "category": "nature", + "name": "hibiscus", + "unicode": "1f33a" + }, + ":high_brightness:": { + "category": "symbols", + "name": "high brightness symbol", + "unicode": "1f506" + }, + ":high_heel:": { + "category": "people", + "name": "high-heeled shoe", + "unicode": "1f460" + }, + ":hockey:": { + "category": "activity", + "name": "ice hockey stick and puck", + "unicode": "1f3d2" + }, + ":hole:": { + "category": "objects", + "name": "hole", + "unicode": "1f573", + "unicode_alt": "1f573-fe0f" + }, + ":homes:": { + "category": "travel", + "name": "house buildings", + "unicode": "1f3d8", + "unicode_alt": "1f3d8-fe0f" + }, + ":honey_pot:": { + "category": "food", + "name": "honey pot", + "unicode": "1f36f" + }, + ":horse:": { + "category": "nature", + "name": "horse face", + "unicode": "1f434" + }, + ":horse_racing:": { + "category": "activity", + "name": "horse racing", + "unicode": "1f3c7" + }, + ":horse_racing_tone1:": { + "category": "activity", + "name": "horse racing tone 1", + "unicode": "1f3c7-1f3fb" + }, + ":horse_racing_tone2:": { + "category": "activity", + "name": "horse racing tone 2", + "unicode": "1f3c7-1f3fc" + }, + ":horse_racing_tone3:": { + "category": "activity", + "name": "horse racing tone 3", + "unicode": "1f3c7-1f3fd" + }, + ":horse_racing_tone4:": { + "category": "activity", + "name": "horse racing tone 4", + "unicode": "1f3c7-1f3fe" + }, + ":horse_racing_tone5:": { + "category": "activity", + "name": "horse racing tone 5", + "unicode": "1f3c7-1f3ff" + }, + ":hospital:": { + "category": "travel", + "name": "hospital", + "unicode": "1f3e5" + }, + ":hot_pepper:": { + "category": "food", + "name": "hot pepper", + "unicode": "1f336", + "unicode_alt": "1f336-fe0f" + }, + ":hotdog:": { + "category": "food", + "name": "hot dog", + "unicode": "1f32d" + }, + ":hotel:": { + "category": "travel", + "name": "hotel", + "unicode": "1f3e8" + }, + ":hotsprings:": { + "category": "symbols", + "name": "hot springs", + "unicode": "2668", + "unicode_alt": "2668-fe0f" + }, + ":hourglass:": { + "category": "objects", + "name": "hourglass", + "unicode": "231b", + "unicode_alt": "231b-fe0f" + }, + ":hourglass_flowing_sand:": { + "category": "objects", + "name": "hourglass with flowing sand", + "unicode": "23f3" + }, + ":house:": { + "category": "travel", + "name": "house building", + "unicode": "1f3e0" + }, + ":house_abandoned:": { + "category": "travel", + "name": "derelict house building", + "unicode": "1f3da", + "unicode_alt": "1f3da-fe0f" + }, + ":house_with_garden:": { + "category": "travel", + "name": "house with garden", + "unicode": "1f3e1" + }, + ":hugging:": { + "category": "people", + "name": "hugging face", + "unicode": "1f917" + }, + ":hushed:": { + "category": "people", + "name": "hushed face", + "unicode": "1f62f" + }, + ":ice_cream:": { + "category": "food", + "name": "ice cream", + "unicode": "1f368" + }, + ":ice_skate:": { + "category": "activity", + "name": "ice skate", + "unicode": "26f8", + "unicode_alt": "26f8-fe0f" + }, + ":icecream:": { + "category": "food", + "name": "soft ice cream", + "unicode": "1f366" + }, + ":id:": { + "category": "symbols", + "name": "squared id", + "unicode": "1f194" + }, + ":ideograph_advantage:": { + "category": "symbols", + "name": "circled ideograph advantage", + "unicode": "1f250" + }, + ":imp:": { + "category": "people", + "name": "imp", + "unicode": "1f47f" + }, + ":inbox_tray:": { + "category": "objects", + "name": "inbox tray", + "unicode": "1f4e5" + }, + ":incoming_envelope:": { + "category": "objects", + "name": "incoming envelope", + "unicode": "1f4e8" + }, + ":information_desk_person:": { + "category": "people", + "name": "information desk person", + "unicode": "1f481" + }, + ":information_desk_person_tone1:": { + "category": "people", + "name": "information desk person tone 1", + "unicode": "1f481-1f3fb" + }, + ":information_desk_person_tone2:": { + "category": "people", + "name": "information desk person tone 2", + "unicode": "1f481-1f3fc" + }, + ":information_desk_person_tone3:": { + "category": "people", + "name": "information desk person tone 3", + "unicode": "1f481-1f3fd" + }, + ":information_desk_person_tone4:": { + "category": "people", + "name": "information desk person tone 4", + "unicode": "1f481-1f3fe" + }, + ":information_desk_person_tone5:": { + "category": "people", + "name": "information desk person tone 5", + "unicode": "1f481-1f3ff" + }, + ":information_source:": { + "category": "symbols", + "name": "information source", + "unicode": "2139", + "unicode_alt": "2139-fe0f" + }, + ":innocent:": { + "category": "people", + "name": "smiling face with halo", + "unicode": "1f607" + }, + ":interrobang:": { + "category": "symbols", + "name": "exclamation question mark", + "unicode": "2049", + "unicode_alt": "2049-fe0f" + }, + ":iphone:": { + "category": "objects", + "name": "mobile phone", + "unicode": "1f4f1" + }, + ":island:": { + "category": "travel", + "name": "desert island", + "unicode": "1f3dd", + "unicode_alt": "1f3dd-fe0f" + }, + ":izakaya_lantern:": { + "category": "objects", + "name": "izakaya lantern", + "unicode": "1f3ee" + }, + ":jack_o_lantern:": { + "category": "nature", + "name": "jack-o-lantern", + "unicode": "1f383" + }, + ":japan:": { + "category": "travel", + "name": "silhouette of japan", + "unicode": "1f5fe" + }, + ":japanese_castle:": { + "category": "travel", + "name": "japanese castle", + "unicode": "1f3ef" + }, + ":japanese_goblin:": { + "category": "people", + "name": "japanese goblin", + "unicode": "1f47a" + }, + ":japanese_ogre:": { + "category": "people", + "name": "japanese ogre", + "unicode": "1f479" + }, + ":jeans:": { + "category": "people", + "name": "jeans", + "unicode": "1f456" + }, + ":joy:": { + "category": "people", + "name": "face with tears of joy", + "unicode": "1f602" + }, + ":joy_cat:": { + "category": "people", + "name": "cat face with tears of joy", + "unicode": "1f639" + }, + ":joystick:": { + "category": "objects", + "name": "joystick", + "unicode": "1f579", + "unicode_alt": "1f579-fe0f" + }, + ":juggling:": { + "category": "activity", + "name": "juggling", + "unicode": "1f939" + }, + ":juggling_tone1:": { + "category": "activity", + "name": "juggling tone 1", + "unicode": "1f939-1f3fb" + }, + ":juggling_tone2:": { + "category": "activity", + "name": "juggling tone 2", + "unicode": "1f939-1f3fc" + }, + ":juggling_tone3:": { + "category": "activity", + "name": "juggling tone 3", + "unicode": "1f939-1f3fd" + }, + ":juggling_tone4:": { + "category": "activity", + "name": "juggling tone 4", + "unicode": "1f939-1f3fe" + }, + ":juggling_tone5:": { + "category": "activity", + "name": "juggling tone 5", + "unicode": "1f939-1f3ff" + }, + ":kaaba:": { + "category": "travel", + "name": "kaaba", + "unicode": "1f54b" + }, + ":key2:": { + "category": "objects", + "name": "old key", + "unicode": "1f5dd", + "unicode_alt": "1f5dd-fe0f" + }, + ":key:": { + "category": "objects", + "name": "key", + "unicode": "1f511" + }, + ":keyboard:": { + "category": "objects", + "name": "keyboard", + "unicode": "2328", + "unicode_alt": "2328-fe0f" + }, + ":keycap_ten:": { + "category": "symbols", + "name": "keycap ten", + "unicode": "1f51f" + }, + ":kimono:": { + "category": "people", + "name": "kimono", + "unicode": "1f458" + }, + ":kiss:": { + "category": "people", + "name": "kiss mark", + "unicode": "1f48b" + }, + ":kiss_mm:": { + "category": "people", + "name": "kiss (man,man)", + "unicode": "1f468-2764-1f48b-1f468", + "unicode_alt": "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468" + }, + ":kiss_ww:": { + "category": "people", + "name": "kiss (woman,woman)", + "unicode": "1f469-2764-1f48b-1f469", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469" + }, + ":kissing:": { + "category": "people", + "name": "kissing face", + "unicode": "1f617" + }, + ":kissing_cat:": { + "category": "people", + "name": "kissing cat face with closed eyes", + "unicode": "1f63d" + }, + ":kissing_closed_eyes:": { + "category": "people", + "name": "kissing face with closed eyes", + "unicode": "1f61a" + }, + ":kissing_heart:": { + "category": "people", + "name": "face throwing a kiss", + "unicode": "1f618" + }, + ":kissing_smiling_eyes:": { + "category": "people", + "name": "kissing face with smiling eyes", + "unicode": "1f619" + }, + ":kiwi:": { + "category": "food", + "name": "kiwifruit", + "unicode": "1f95d" + }, + ":knife:": { + "category": "objects", + "name": "hocho", + "unicode": "1f52a" + }, + ":koala:": { + "category": "nature", + "name": "koala", + "unicode": "1f428" + }, + ":koko:": { + "category": "symbols", + "name": "squared katakana koko", + "unicode": "1f201" + }, + ":label:": { + "category": "objects", + "name": "label", + "unicode": "1f3f7", + "unicode_alt": "1f3f7-fe0f" + }, + ":large_blue_diamond:": { + "category": "symbols", + "name": "large blue diamond", + "unicode": "1f537" + }, + ":large_orange_diamond:": { + "category": "symbols", + "name": "large orange diamond", + "unicode": "1f536" + }, + ":last_quarter_moon:": { + "category": "nature", + "name": "last quarter moon symbol", + "unicode": "1f317" + }, + ":last_quarter_moon_with_face:": { + "category": "nature", + "name": "last quarter moon with face", + "unicode": "1f31c" + }, + ":laughing:": { + "category": "people", + "name": "smiling face with open mouth and tightly-closed eyes", + "unicode": "1f606" + }, + ":leaves:": { + "category": "nature", + "name": "leaf fluttering in wind", + "unicode": "1f343" + }, + ":ledger:": { + "category": "objects", + "name": "ledger", + "unicode": "1f4d2" + }, + ":left_facing_fist:": { + "category": "people", + "name": "left-facing fist", + "unicode": "1f91b" + }, + ":left_facing_fist_tone1:": { + "category": "people", + "name": "left facing fist tone 1", + "unicode": "1f91b-1f3fb" + }, + ":left_facing_fist_tone2:": { + "category": "people", + "name": "left facing fist tone 2", + "unicode": "1f91b-1f3fc" + }, + ":left_facing_fist_tone3:": { + "category": "people", + "name": "left facing fist tone 3", + "unicode": "1f91b-1f3fd" + }, + ":left_facing_fist_tone4:": { + "category": "people", + "name": "left facing fist tone 4", + "unicode": "1f91b-1f3fe" + }, + ":left_facing_fist_tone5:": { + "category": "people", + "name": "left facing fist tone 5", + "unicode": "1f91b-1f3ff" + }, + ":left_luggage:": { + "category": "symbols", + "name": "left luggage", + "unicode": "1f6c5" + }, + ":left_right_arrow:": { + "category": "symbols", + "name": "left right arrow", + "unicode": "2194", + "unicode_alt": "2194-fe0f" + }, + ":leftwards_arrow_with_hook:": { + "category": "symbols", + "name": "leftwards arrow with hook", + "unicode": "21a9", + "unicode_alt": "21a9-fe0f" + }, + ":lemon:": { + "category": "food", + "name": "lemon", + "unicode": "1f34b" + }, + ":leo:": { + "category": "symbols", + "name": "leo", + "unicode": "264c", + "unicode_alt": "264c-fe0f" + }, + ":leopard:": { + "category": "nature", + "name": "leopard", + "unicode": "1f406" + }, + ":level_slider:": { + "category": "objects", + "name": "level slider", + "unicode": "1f39a", + "unicode_alt": "1f39a-fe0f" + }, + ":levitate:": { + "category": "activity", + "name": "man in business suit levitating", + "unicode": "1f574", + "unicode_alt": "1f574-fe0f" + }, + ":libra:": { + "category": "symbols", + "name": "libra", + "unicode": "264e", + "unicode_alt": "264e-fe0f" + }, + ":lifter:": { + "category": "activity", + "name": "weight lifter", + "unicode": "1f3cb", + "unicode_alt": "1f3cb-fe0f" + }, + ":lifter_tone1:": { + "category": "activity", + "name": "weight lifter tone 1", + "unicode": "1f3cb-1f3fb" + }, + ":lifter_tone2:": { + "category": "activity", + "name": "weight lifter tone 2", + "unicode": "1f3cb-1f3fc" + }, + ":lifter_tone3:": { + "category": "activity", + "name": "weight lifter tone 3", + "unicode": "1f3cb-1f3fd" + }, + ":lifter_tone4:": { + "category": "activity", + "name": "weight lifter tone 4", + "unicode": "1f3cb-1f3fe" + }, + ":lifter_tone5:": { + "category": "activity", + "name": "weight lifter tone 5", + "unicode": "1f3cb-1f3ff" + }, + ":light_rail:": { + "category": "travel", + "name": "light rail", + "unicode": "1f688" + }, + ":link:": { + "category": "objects", + "name": "link symbol", + "unicode": "1f517" + }, + ":lion_face:": { + "category": "nature", + "name": "lion face", + "unicode": "1f981" + }, + ":lips:": { + "category": "people", + "name": "mouth", + "unicode": "1f444" + }, + ":lipstick:": { + "category": "people", + "name": "lipstick", + "unicode": "1f484" + }, + ":lizard:": { + "category": "nature", + "name": "lizard", + "unicode": "1f98e" + }, + ":lock:": { + "category": "objects", + "name": "lock", + "unicode": "1f512" + }, + ":lock_with_ink_pen:": { + "category": "objects", + "name": "lock with ink pen", + "unicode": "1f50f" + }, + ":lollipop:": { + "category": "food", + "name": "lollipop", + "unicode": "1f36d" + }, + ":loop:": { + "category": "symbols", + "name": "double curly loop", + "unicode": "27bf" + }, + ":loud_sound:": { + "category": "symbols", + "name": "speaker with three sound waves", + "unicode": "1f50a" + }, + ":loudspeaker:": { + "category": "symbols", + "name": "public address loudspeaker", + "unicode": "1f4e2" + }, + ":love_hotel:": { + "category": "travel", + "name": "love hotel", + "unicode": "1f3e9" + }, + ":love_letter:": { + "category": "objects", + "name": "love letter", + "unicode": "1f48c" + }, + ":low_brightness:": { + "category": "symbols", + "name": "low brightness symbol", + "unicode": "1f505" + }, + ":lying_face:": { + "category": "people", + "name": "lying face", + "unicode": "1f925" + }, + ":m:": { + "category": "symbols", + "name": "circled latin capital letter m", + "unicode": "24c2", + "unicode_alt": "24c2-fe0f" + }, + ":mag:": { + "category": "objects", + "name": "left-pointing magnifying glass", + "unicode": "1f50d" + }, + ":mag_right:": { + "category": "objects", + "name": "right-pointing magnifying glass", + "unicode": "1f50e" + }, + ":mahjong:": { + "category": "symbols", + "name": "mahjong tile red dragon", + "unicode": "1f004", + "unicode_alt": "1f004-fe0f" + }, + ":mailbox:": { + "category": "objects", + "name": "closed mailbox with raised flag", + "unicode": "1f4eb" + }, + ":mailbox_closed:": { + "category": "objects", + "name": "closed mailbox with lowered flag", + "unicode": "1f4ea" + }, + ":mailbox_with_mail:": { + "category": "objects", + "name": "open mailbox with raised flag", + "unicode": "1f4ec" + }, + ":mailbox_with_no_mail:": { + "category": "objects", + "name": "open mailbox with lowered flag", + "unicode": "1f4ed" + }, + ":man:": { + "category": "people", + "name": "man", + "unicode": "1f468" + }, + ":man_dancing:": { + "category": "people", + "name": "man dancing", + "unicode": "1f57a" + }, + ":man_dancing_tone1:": { + "category": "people", + "name": "man dancing tone 1", + "unicode": "1f57a-1f3fb" + }, + ":man_dancing_tone2:": { + "category": "people", + "name": "man dancing tone 2", + "unicode": "1f57a-1f3fc" + }, + ":man_dancing_tone3:": { + "category": "people", + "name": "man dancing tone 3", + "unicode": "1f57a-1f3fd" + }, + ":man_dancing_tone4:": { + "category": "people", + "name": "man dancing tone 4", + "unicode": "1f57a-1f3fe" + }, + ":man_dancing_tone5:": { + "category": "people", + "name": "man dancing tone 5", + "unicode": "1f57a-1f3ff" + }, + ":man_in_tuxedo:": { + "category": "people", + "name": "man in tuxedo", + "unicode": "1f935" + }, + ":man_in_tuxedo_tone1:": { + "category": "people", + "name": "man in tuxedo tone 1", + "unicode": "1f935-1f3fb" + }, + ":man_in_tuxedo_tone2:": { + "category": "people", + "name": "man in tuxedo tone 2", + "unicode": "1f935-1f3fc" + }, + ":man_in_tuxedo_tone3:": { + "category": "people", + "name": "man in tuxedo tone 3", + "unicode": "1f935-1f3fd" + }, + ":man_in_tuxedo_tone4:": { + "category": "people", + "name": "man in tuxedo tone 4", + "unicode": "1f935-1f3fe" + }, + ":man_in_tuxedo_tone5:": { + "category": "people", + "name": "man in tuxedo tone 5", + "unicode": "1f935-1f3ff" + }, + ":man_tone1:": { + "category": "people", + "name": "man tone 1", + "unicode": "1f468-1f3fb" + }, + ":man_tone2:": { + "category": "people", + "name": "man tone 2", + "unicode": "1f468-1f3fc" + }, + ":man_tone3:": { + "category": "people", + "name": "man tone 3", + "unicode": "1f468-1f3fd" + }, + ":man_tone4:": { + "category": "people", + "name": "man tone 4", + "unicode": "1f468-1f3fe" + }, + ":man_tone5:": { + "category": "people", + "name": "man tone 5", + "unicode": "1f468-1f3ff" + }, + ":man_with_gua_pi_mao:": { + "category": "people", + "name": "man with gua pi mao", + "unicode": "1f472" + }, + ":man_with_gua_pi_mao_tone1:": { + "category": "people", + "name": "man with gua pi mao tone 1", + "unicode": "1f472-1f3fb" + }, + ":man_with_gua_pi_mao_tone2:": { + "category": "people", + "name": "man with gua pi mao tone 2", + "unicode": "1f472-1f3fc" + }, + ":man_with_gua_pi_mao_tone3:": { + "category": "people", + "name": "man with gua pi mao tone 3", + "unicode": "1f472-1f3fd" + }, + ":man_with_gua_pi_mao_tone4:": { + "category": "people", + "name": "man with gua pi mao tone 4", + "unicode": "1f472-1f3fe" + }, + ":man_with_gua_pi_mao_tone5:": { + "category": "people", + "name": "man with gua pi mao tone 5", + "unicode": "1f472-1f3ff" + }, + ":man_with_turban:": { + "category": "people", + "name": "man with turban", + "unicode": "1f473" + }, + ":man_with_turban_tone1:": { + "category": "people", + "name": "man with turban tone 1", + "unicode": "1f473-1f3fb" + }, + ":man_with_turban_tone2:": { + "category": "people", + "name": "man with turban tone 2", + "unicode": "1f473-1f3fc" + }, + ":man_with_turban_tone3:": { + "category": "people", + "name": "man with turban tone 3", + "unicode": "1f473-1f3fd" + }, + ":man_with_turban_tone4:": { + "category": "people", + "name": "man with turban tone 4", + "unicode": "1f473-1f3fe" + }, + ":man_with_turban_tone5:": { + "category": "people", + "name": "man with turban tone 5", + "unicode": "1f473-1f3ff" + }, + ":mans_shoe:": { + "category": "people", + "name": "mans shoe", + "unicode": "1f45e" + }, + ":map:": { + "category": "objects", + "name": "world map", + "unicode": "1f5fa", + "unicode_alt": "1f5fa-fe0f" + }, + ":maple_leaf:": { + "category": "nature", + "name": "maple leaf", + "unicode": "1f341" + }, + ":martial_arts_uniform:": { + "category": "activity", + "name": "martial arts uniform", + "unicode": "1f94b" + }, + ":mask:": { + "category": "people", + "name": "face with medical mask", + "unicode": "1f637" + }, + ":massage:": { + "category": "people", + "name": "face massage", + "unicode": "1f486" + }, + ":massage_tone1:": { + "category": "people", + "name": "face massage tone 1", + "unicode": "1f486-1f3fb" + }, + ":massage_tone2:": { + "category": "people", + "name": "face massage tone 2", + "unicode": "1f486-1f3fc" + }, + ":massage_tone3:": { + "category": "people", + "name": "face massage tone 3", + "unicode": "1f486-1f3fd" + }, + ":massage_tone4:": { + "category": "people", + "name": "face massage tone 4", + "unicode": "1f486-1f3fe" + }, + ":massage_tone5:": { + "category": "people", + "name": "face massage tone 5", + "unicode": "1f486-1f3ff" + }, + ":meat_on_bone:": { + "category": "food", + "name": "meat on bone", + "unicode": "1f356" + }, + ":medal:": { + "category": "activity", + "name": "sports medal", + "unicode": "1f3c5" + }, + ":mega:": { + "category": "symbols", + "name": "cheering megaphone", + "unicode": "1f4e3" + }, + ":melon:": { + "category": "food", + "name": "melon", + "unicode": "1f348" + }, + ":menorah:": { + "category": "symbols", + "name": "menorah with nine branches", + "unicode": "1f54e" + }, + ":mens:": { + "category": "symbols", + "name": "mens symbol", + "unicode": "1f6b9" + }, + ":metal:": { + "category": "people", + "name": "sign of the horns", + "unicode": "1f918" + }, + ":metal_tone1:": { + "category": "people", + "name": "sign of the horns tone 1", + "unicode": "1f918-1f3fb" + }, + ":metal_tone2:": { + "category": "people", + "name": "sign of the horns tone 2", + "unicode": "1f918-1f3fc" + }, + ":metal_tone3:": { + "category": "people", + "name": "sign of the horns tone 3", + "unicode": "1f918-1f3fd" + }, + ":metal_tone4:": { + "category": "people", + "name": "sign of the horns tone 4", + "unicode": "1f918-1f3fe" + }, + ":metal_tone5:": { + "category": "people", + "name": "sign of the horns tone 5", + "unicode": "1f918-1f3ff" + }, + ":metro:": { + "category": "travel", + "name": "metro", + "unicode": "1f687" + }, + ":microphone2:": { + "category": "objects", + "name": "studio microphone", + "unicode": "1f399", + "unicode_alt": "1f399-fe0f" + }, + ":microphone:": { + "category": "activity", + "name": "microphone", + "unicode": "1f3a4" + }, + ":microscope:": { + "category": "objects", + "name": "microscope", + "unicode": "1f52c" + }, + ":middle_finger:": { + "category": "people", + "name": "reversed hand with middle finger extended", + "unicode": "1f595" + }, + ":middle_finger_tone1:": { + "category": "people", + "name": "reversed hand with middle finger extended tone 1", + "unicode": "1f595-1f3fb" + }, + ":middle_finger_tone2:": { + "category": "people", + "name": "reversed hand with middle finger extended tone 2", + "unicode": "1f595-1f3fc" + }, + ":middle_finger_tone3:": { + "category": "people", + "name": "reversed hand with middle finger extended tone 3", + "unicode": "1f595-1f3fd" + }, + ":middle_finger_tone4:": { + "category": "people", + "name": "reversed hand with middle finger extended tone 4", + "unicode": "1f595-1f3fe" + }, + ":middle_finger_tone5:": { + "category": "people", + "name": "reversed hand with middle finger extended tone 5", + "unicode": "1f595-1f3ff" + }, + ":military_medal:": { + "category": "activity", + "name": "military medal", + "unicode": "1f396", + "unicode_alt": "1f396-fe0f" + }, + ":milk:": { + "category": "food", + "name": "glass of milk", + "unicode": "1f95b" + }, + ":milky_way:": { + "category": "travel", + "name": "milky way", + "unicode": "1f30c" + }, + ":minibus:": { + "category": "travel", + "name": "minibus", + "unicode": "1f690" + }, + ":minidisc:": { + "category": "objects", + "name": "minidisc", + "unicode": "1f4bd" + }, + ":mobile_phone_off:": { + "category": "symbols", + "name": "mobile phone off", + "unicode": "1f4f4" + }, + ":money_mouth:": { + "category": "people", + "name": "money-mouth face", + "unicode": "1f911" + }, + ":money_with_wings:": { + "category": "objects", + "name": "money with wings", + "unicode": "1f4b8" + }, + ":moneybag:": { + "category": "objects", + "name": "money bag", + "unicode": "1f4b0" + }, + ":monkey:": { + "category": "nature", + "name": "monkey", + "unicode": "1f412" + }, + ":monkey_face:": { + "category": "nature", + "name": "monkey face", + "unicode": "1f435" + }, + ":monorail:": { + "category": "travel", + "name": "monorail", + "unicode": "1f69d" + }, + ":mortar_board:": { + "category": "people", + "name": "graduation cap", + "unicode": "1f393" + }, + ":mosque:": { + "category": "travel", + "name": "mosque", + "unicode": "1f54c" + }, + ":motor_scooter:": { + "category": "travel", + "name": "motor scooter", + "unicode": "1f6f5" + }, + ":motorboat:": { + "category": "travel", + "name": "motorboat", + "unicode": "1f6e5", + "unicode_alt": "1f6e5-fe0f" + }, + ":motorcycle:": { + "category": "travel", + "name": "racing motorcycle", + "unicode": "1f3cd", + "unicode_alt": "1f3cd-fe0f" + }, + ":motorway:": { + "category": "travel", + "name": "motorway", + "unicode": "1f6e3", + "unicode_alt": "1f6e3-fe0f" + }, + ":mount_fuji:": { + "category": "travel", + "name": "mount fuji", + "unicode": "1f5fb" + }, + ":mountain:": { + "category": "travel", + "name": "mountain", + "unicode": "26f0", + "unicode_alt": "26f0-fe0f" + }, + ":mountain_bicyclist:": { + "category": "activity", + "name": "mountain bicyclist", + "unicode": "1f6b5" + }, + ":mountain_bicyclist_tone1:": { + "category": "activity", + "name": "mountain bicyclist tone 1", + "unicode": "1f6b5-1f3fb" + }, + ":mountain_bicyclist_tone2:": { + "category": "activity", + "name": "mountain bicyclist tone 2", + "unicode": "1f6b5-1f3fc" + }, + ":mountain_bicyclist_tone3:": { + "category": "activity", + "name": "mountain bicyclist tone 3", + "unicode": "1f6b5-1f3fd" + }, + ":mountain_bicyclist_tone4:": { + "category": "activity", + "name": "mountain bicyclist tone 4", + "unicode": "1f6b5-1f3fe" + }, + ":mountain_bicyclist_tone5:": { + "category": "activity", + "name": "mountain bicyclist tone 5", + "unicode": "1f6b5-1f3ff" + }, + ":mountain_cableway:": { + "category": "travel", + "name": "mountain cableway", + "unicode": "1f6a0" + }, + ":mountain_railway:": { + "category": "travel", + "name": "mountain railway", + "unicode": "1f69e" + }, + ":mountain_snow:": { + "category": "travel", + "name": "snow capped mountain", + "unicode": "1f3d4", + "unicode_alt": "1f3d4-fe0f" + }, + ":mouse2:": { + "category": "nature", + "name": "mouse", + "unicode": "1f401" + }, + ":mouse:": { + "category": "nature", + "name": "mouse face", + "unicode": "1f42d" + }, + ":mouse_three_button:": { + "category": "objects", + "name": "three button mouse", + "unicode": "1f5b1", + "unicode_alt": "1f5b1-fe0f" + }, + ":movie_camera:": { + "category": "objects", + "name": "movie camera", + "unicode": "1f3a5" + }, + ":moyai:": { + "category": "objects", + "name": "moyai", + "unicode": "1f5ff" + }, + ":mrs_claus:": { + "category": "people", + "name": "mother christmas", + "unicode": "1f936" + }, + ":mrs_claus_tone1:": { + "category": "people", + "name": "mother christmas tone 1", + "unicode": "1f936-1f3fb" + }, + ":mrs_claus_tone2:": { + "category": "people", + "name": "mother christmas tone 2", + "unicode": "1f936-1f3fc" + }, + ":mrs_claus_tone3:": { + "category": "people", + "name": "mother christmas tone 3", + "unicode": "1f936-1f3fd" + }, + ":mrs_claus_tone4:": { + "category": "people", + "name": "mother christmas tone 4", + "unicode": "1f936-1f3fe" + }, + ":mrs_claus_tone5:": { + "category": "people", + "name": "mother christmas tone 5", + "unicode": "1f936-1f3ff" + }, + ":muscle:": { + "category": "people", + "name": "flexed biceps", + "unicode": "1f4aa" + }, + ":muscle_tone1:": { + "category": "people", + "name": "flexed biceps tone 1", + "unicode": "1f4aa-1f3fb" + }, + ":muscle_tone2:": { + "category": "people", + "name": "flexed biceps tone 2", + "unicode": "1f4aa-1f3fc" + }, + ":muscle_tone3:": { + "category": "people", + "name": "flexed biceps tone 3", + "unicode": "1f4aa-1f3fd" + }, + ":muscle_tone4:": { + "category": "people", + "name": "flexed biceps tone 4", + "unicode": "1f4aa-1f3fe" + }, + ":muscle_tone5:": { + "category": "people", + "name": "flexed biceps tone 5", + "unicode": "1f4aa-1f3ff" + }, + ":mushroom:": { + "category": "nature", + "name": "mushroom", + "unicode": "1f344" + }, + ":musical_keyboard:": { + "category": "activity", + "name": "musical keyboard", + "unicode": "1f3b9" + }, + ":musical_note:": { + "category": "symbols", + "name": "musical note", + "unicode": "1f3b5" + }, + ":musical_score:": { + "category": "activity", + "name": "musical score", + "unicode": "1f3bc" + }, + ":mute:": { + "category": "symbols", + "name": "speaker with cancellation stroke", + "unicode": "1f507" + }, + ":nail_care:": { + "category": "people", + "name": "nail polish", + "unicode": "1f485" + }, + ":nail_care_tone1:": { + "category": "people", + "name": "nail polish tone 1", + "unicode": "1f485-1f3fb" + }, + ":nail_care_tone2:": { + "category": "people", + "name": "nail polish tone 2", + "unicode": "1f485-1f3fc" + }, + ":nail_care_tone3:": { + "category": "people", + "name": "nail polish tone 3", + "unicode": "1f485-1f3fd" + }, + ":nail_care_tone4:": { + "category": "people", + "name": "nail polish tone 4", + "unicode": "1f485-1f3fe" + }, + ":nail_care_tone5:": { + "category": "people", + "name": "nail polish tone 5", + "unicode": "1f485-1f3ff" + }, + ":name_badge:": { + "category": "symbols", + "name": "name badge", + "unicode": "1f4db" + }, + ":nauseated_face:": { + "category": "people", + "name": "nauseated face", + "unicode": "1f922" + }, + ":necktie:": { + "category": "people", + "name": "necktie", + "unicode": "1f454" + }, + ":negative_squared_cross_mark:": { + "category": "symbols", + "name": "negative squared cross mark", + "unicode": "274e" + }, + ":nerd:": { + "category": "people", + "name": "nerd face", + "unicode": "1f913" + }, + ":neutral_face:": { + "category": "people", + "name": "neutral face", + "unicode": "1f610" + }, + ":new:": { + "category": "symbols", + "name": "squared new", + "unicode": "1f195" + }, + ":new_moon:": { + "category": "nature", + "name": "new moon symbol", + "unicode": "1f311" + }, + ":new_moon_with_face:": { + "category": "nature", + "name": "new moon with face", + "unicode": "1f31a" + }, + ":newspaper2:": { + "category": "objects", + "name": "rolled-up newspaper", + "unicode": "1f5de", + "unicode_alt": "1f5de-fe0f" + }, + ":newspaper:": { + "category": "objects", + "name": "newspaper", + "unicode": "1f4f0" + }, + ":ng:": { + "category": "symbols", + "name": "squared ng", + "unicode": "1f196" + }, + ":night_with_stars:": { + "category": "travel", + "name": "night with stars", + "unicode": "1f303" + }, + ":nine:": { + "category": "symbols", + "name": "keycap digit nine", + "unicode": "0039-20e3", + "unicode_alt": "0039-fe0f-20e3" + }, + ":no_bell:": { + "category": "symbols", + "name": "bell with cancellation stroke", + "unicode": "1f515" + }, + ":no_bicycles:": { + "category": "symbols", + "name": "no bicycles", + "unicode": "1f6b3" + }, + ":no_entry:": { + "category": "symbols", + "name": "no entry", + "unicode": "26d4", + "unicode_alt": "26d4-fe0f" + }, + ":no_entry_sign:": { + "category": "symbols", + "name": "no entry sign", + "unicode": "1f6ab" + }, + ":no_good:": { + "category": "people", + "name": "face with no good gesture", + "unicode": "1f645" + }, + ":no_good_tone1:": { + "category": "people", + "name": "face with no good gesture tone 1", + "unicode": "1f645-1f3fb" + }, + ":no_good_tone2:": { + "category": "people", + "name": "face with no good gesture tone 2", + "unicode": "1f645-1f3fc" + }, + ":no_good_tone3:": { + "category": "people", + "name": "face with no good gesture tone 3", + "unicode": "1f645-1f3fd" + }, + ":no_good_tone4:": { + "category": "people", + "name": "face with no good gesture tone 4", + "unicode": "1f645-1f3fe" + }, + ":no_good_tone5:": { + "category": "people", + "name": "face with no good gesture tone 5", + "unicode": "1f645-1f3ff" + }, + ":no_mobile_phones:": { + "category": "symbols", + "name": "no mobile phones", + "unicode": "1f4f5" + }, + ":no_mouth:": { + "category": "people", + "name": "face without mouth", + "unicode": "1f636" + }, + ":no_pedestrians:": { + "category": "symbols", + "name": "no pedestrians", + "unicode": "1f6b7" + }, + ":no_smoking:": { + "category": "symbols", + "name": "no smoking symbol", + "unicode": "1f6ad" + }, + ":non-potable_water:": { + "category": "symbols", + "name": "non-potable water symbol", + "unicode": "1f6b1" + }, + ":nose:": { + "category": "people", + "name": "nose", + "unicode": "1f443" + }, + ":nose_tone1:": { + "category": "people", + "name": "nose tone 1", + "unicode": "1f443-1f3fb" + }, + ":nose_tone2:": { + "category": "people", + "name": "nose tone 2", + "unicode": "1f443-1f3fc" + }, + ":nose_tone3:": { + "category": "people", + "name": "nose tone 3", + "unicode": "1f443-1f3fd" + }, + ":nose_tone4:": { + "category": "people", + "name": "nose tone 4", + "unicode": "1f443-1f3fe" + }, + ":nose_tone5:": { + "category": "people", + "name": "nose tone 5", + "unicode": "1f443-1f3ff" + }, + ":notebook:": { + "category": "objects", + "name": "notebook", + "unicode": "1f4d3" + }, + ":notebook_with_decorative_cover:": { + "category": "objects", + "name": "notebook with decorative cover", + "unicode": "1f4d4" + }, + ":notepad_spiral:": { + "category": "objects", + "name": "spiral note pad", + "unicode": "1f5d2", + "unicode_alt": "1f5d2-fe0f" + }, + ":notes:": { + "category": "symbols", + "name": "multiple musical notes", + "unicode": "1f3b6" + }, + ":nut_and_bolt:": { + "category": "objects", + "name": "nut and bolt", + "unicode": "1f529" + }, + ":o2:": { + "category": "symbols", + "name": "negative squared latin capital letter o", + "unicode": "1f17e" + }, + ":o:": { + "category": "symbols", + "name": "heavy large circle", + "unicode": "2b55", + "unicode_alt": "2b55-fe0f" + }, + ":ocean:": { + "category": "nature", + "name": "water wave", + "unicode": "1f30a" + }, + ":octagonal_sign:": { + "category": "symbols", + "name": "octagonal sign", + "unicode": "1f6d1" + }, + ":octopus:": { + "category": "nature", + "name": "octopus", + "unicode": "1f419" + }, + ":oden:": { + "category": "food", + "name": "oden", + "unicode": "1f362" + }, + ":office:": { + "category": "travel", + "name": "office building", + "unicode": "1f3e2" + }, + ":oil:": { + "category": "objects", + "name": "oil drum", + "unicode": "1f6e2", + "unicode_alt": "1f6e2-fe0f" + }, + ":ok:": { + "category": "symbols", + "name": "squared ok", + "unicode": "1f197" + }, + ":ok_hand:": { + "category": "people", + "name": "ok hand sign", + "unicode": "1f44c" + }, + ":ok_hand_tone1:": { + "category": "people", + "name": "ok hand sign tone 1", + "unicode": "1f44c-1f3fb" + }, + ":ok_hand_tone2:": { + "category": "people", + "name": "ok hand sign tone 2", + "unicode": "1f44c-1f3fc" + }, + ":ok_hand_tone3:": { + "category": "people", + "name": "ok hand sign tone 3", + "unicode": "1f44c-1f3fd" + }, + ":ok_hand_tone4:": { + "category": "people", + "name": "ok hand sign tone 4", + "unicode": "1f44c-1f3fe" + }, + ":ok_hand_tone5:": { + "category": "people", + "name": "ok hand sign tone 5", + "unicode": "1f44c-1f3ff" + }, + ":ok_woman:": { + "category": "people", + "name": "face with ok gesture", + "unicode": "1f646" + }, + ":ok_woman_tone1:": { + "category": "people", + "name": "face with ok gesture tone1", + "unicode": "1f646-1f3fb" + }, + ":ok_woman_tone2:": { + "category": "people", + "name": "face with ok gesture tone2", + "unicode": "1f646-1f3fc" + }, + ":ok_woman_tone3:": { + "category": "people", + "name": "face with ok gesture tone3", + "unicode": "1f646-1f3fd" + }, + ":ok_woman_tone4:": { + "category": "people", + "name": "face with ok gesture tone4", + "unicode": "1f646-1f3fe" + }, + ":ok_woman_tone5:": { + "category": "people", + "name": "face with ok gesture tone5", + "unicode": "1f646-1f3ff" + }, + ":older_man:": { + "category": "people", + "name": "older man", + "unicode": "1f474" + }, + ":older_man_tone1:": { + "category": "people", + "name": "older man tone 1", + "unicode": "1f474-1f3fb" + }, + ":older_man_tone2:": { + "category": "people", + "name": "older man tone 2", + "unicode": "1f474-1f3fc" + }, + ":older_man_tone3:": { + "category": "people", + "name": "older man tone 3", + "unicode": "1f474-1f3fd" + }, + ":older_man_tone4:": { + "category": "people", + "name": "older man tone 4", + "unicode": "1f474-1f3fe" + }, + ":older_man_tone5:": { + "category": "people", + "name": "older man tone 5", + "unicode": "1f474-1f3ff" + }, + ":older_woman:": { + "category": "people", + "name": "older woman", + "unicode": "1f475" + }, + ":older_woman_tone1:": { + "category": "people", + "name": "older woman tone 1", + "unicode": "1f475-1f3fb" + }, + ":older_woman_tone2:": { + "category": "people", + "name": "older woman tone 2", + "unicode": "1f475-1f3fc" + }, + ":older_woman_tone3:": { + "category": "people", + "name": "older woman tone 3", + "unicode": "1f475-1f3fd" + }, + ":older_woman_tone4:": { + "category": "people", + "name": "older woman tone 4", + "unicode": "1f475-1f3fe" + }, + ":older_woman_tone5:": { + "category": "people", + "name": "older woman tone 5", + "unicode": "1f475-1f3ff" + }, + ":om_symbol:": { + "category": "symbols", + "name": "om symbol", + "unicode": "1f549", + "unicode_alt": "1f549-fe0f" + }, + ":on:": { + "category": "symbols", + "name": "on with exclamation mark with left right arrow abo", + "unicode": "1f51b" + }, + ":oncoming_automobile:": { + "category": "travel", + "name": "oncoming automobile", + "unicode": "1f698" + }, + ":oncoming_bus:": { + "category": "travel", + "name": "oncoming bus", + "unicode": "1f68d" + }, + ":oncoming_police_car:": { + "category": "travel", + "name": "oncoming police car", + "unicode": "1f694" + }, + ":oncoming_taxi:": { + "category": "travel", + "name": "oncoming taxi", + "unicode": "1f696" + }, + ":one:": { + "category": "symbols", + "name": "keycap digit one", + "unicode": "0031-20e3", + "unicode_alt": "0031-fe0f-20e3" + }, + ":open_file_folder:": { + "category": "objects", + "name": "open file folder", + "unicode": "1f4c2" + }, + ":open_hands:": { + "category": "people", + "name": "open hands sign", + "unicode": "1f450" + }, + ":open_hands_tone1:": { + "category": "people", + "name": "open hands sign tone 1", + "unicode": "1f450-1f3fb" + }, + ":open_hands_tone2:": { + "category": "people", + "name": "open hands sign tone 2", + "unicode": "1f450-1f3fc" + }, + ":open_hands_tone3:": { + "category": "people", + "name": "open hands sign tone 3", + "unicode": "1f450-1f3fd" + }, + ":open_hands_tone4:": { + "category": "people", + "name": "open hands sign tone 4", + "unicode": "1f450-1f3fe" + }, + ":open_hands_tone5:": { + "category": "people", + "name": "open hands sign tone 5", + "unicode": "1f450-1f3ff" + }, + ":open_mouth:": { + "category": "people", + "name": "face with open mouth", + "unicode": "1f62e" + }, + ":ophiuchus:": { + "category": "symbols", + "name": "ophiuchus", + "unicode": "26ce" + }, + ":orange_book:": { + "category": "objects", + "name": "orange book", + "unicode": "1f4d9" + }, + ":orthodox_cross:": { + "category": "symbols", + "name": "orthodox cross", + "unicode": "2626", + "unicode_alt": "2626-fe0f" + }, + ":outbox_tray:": { + "category": "objects", + "name": "outbox tray", + "unicode": "1f4e4" + }, + ":owl:": { + "category": "nature", + "name": "owl", + "unicode": "1f989" + }, + ":ox:": { + "category": "nature", + "name": "ox", + "unicode": "1f402" + }, + ":package:": { + "category": "objects", + "name": "package", + "unicode": "1f4e6" + }, + ":page_facing_up:": { + "category": "objects", + "name": "page facing up", + "unicode": "1f4c4" + }, + ":page_with_curl:": { + "category": "objects", + "name": "page with curl", + "unicode": "1f4c3" + }, + ":pager:": { + "category": "objects", + "name": "pager", + "unicode": "1f4df" + }, + ":paintbrush:": { + "category": "objects", + "name": "lower left paintbrush", + "unicode": "1f58c", + "unicode_alt": "1f58c-fe0f" + }, + ":palm_tree:": { + "category": "nature", + "name": "palm tree", + "unicode": "1f334" + }, + ":pancakes:": { + "category": "food", + "name": "pancakes", + "unicode": "1f95e" + }, + ":panda_face:": { + "category": "nature", + "name": "panda face", + "unicode": "1f43c" + }, + ":paperclip:": { + "category": "objects", + "name": "paperclip", + "unicode": "1f4ce" + }, + ":paperclips:": { + "category": "objects", + "name": "linked paperclips", + "unicode": "1f587", + "unicode_alt": "1f587-fe0f" + }, + ":park:": { + "category": "travel", + "name": "national park", + "unicode": "1f3de", + "unicode_alt": "1f3de-fe0f" + }, + ":parking:": { + "category": "symbols", + "name": "negative squared latin capital letter p", + "unicode": "1f17f", + "unicode_alt": "1f17f-fe0f" + }, + ":part_alternation_mark:": { + "category": "symbols", + "name": "part alternation mark", + "unicode": "303d", + "unicode_alt": "303d-fe0f" + }, + ":partly_sunny:": { + "category": "nature", + "name": "sun behind cloud", + "unicode": "26c5", + "unicode_alt": "26c5-fe0f" + }, + ":passport_control:": { + "category": "symbols", + "name": "passport control", + "unicode": "1f6c2" + }, + ":pause_button:": { + "category": "symbols", + "name": "double vertical bar", + "unicode": "23f8", + "unicode_alt": "23f8-fe0f" + }, + ":peace:": { + "category": "symbols", + "name": "peace symbol", + "unicode": "262e", + "unicode_alt": "262e-fe0f" + }, + ":peach:": { + "category": "food", + "name": "peach", + "unicode": "1f351" + }, + ":peanuts:": { + "category": "food", + "name": "peanuts", + "unicode": "1f95c" + }, + ":pear:": { + "category": "food", + "name": "pear", + "unicode": "1f350" + }, + ":pen_ballpoint:": { + "category": "objects", + "name": "lower left ballpoint pen", + "unicode": "1f58a", + "unicode_alt": "1f58a-fe0f" + }, + ":pen_fountain:": { + "category": "objects", + "name": "lower left fountain pen", + "unicode": "1f58b", + "unicode_alt": "1f58b-fe0f" + }, + ":pencil2:": { + "category": "objects", + "name": "pencil", + "unicode": "270f", + "unicode_alt": "270f-fe0f" + }, + ":pencil:": { + "category": "objects", + "name": "memo", + "unicode": "1f4dd" + }, + ":penguin:": { + "category": "nature", + "name": "penguin", + "unicode": "1f427" + }, + ":pensive:": { + "category": "people", + "name": "pensive face", + "unicode": "1f614" + }, + ":performing_arts:": { + "category": "activity", + "name": "performing arts", + "unicode": "1f3ad" + }, + ":persevere:": { + "category": "people", + "name": "persevering face", + "unicode": "1f623" + }, + ":person_frowning:": { + "category": "people", + "name": "person frowning", + "unicode": "1f64d" + }, + ":person_frowning_tone1:": { + "category": "people", + "name": "person frowning tone 1", + "unicode": "1f64d-1f3fb" + }, + ":person_frowning_tone2:": { + "category": "people", + "name": "person frowning tone 2", + "unicode": "1f64d-1f3fc" + }, + ":person_frowning_tone3:": { + "category": "people", + "name": "person frowning tone 3", + "unicode": "1f64d-1f3fd" + }, + ":person_frowning_tone4:": { + "category": "people", + "name": "person frowning tone 4", + "unicode": "1f64d-1f3fe" + }, + ":person_frowning_tone5:": { + "category": "people", + "name": "person frowning tone 5", + "unicode": "1f64d-1f3ff" + }, + ":person_with_blond_hair:": { + "category": "people", + "name": "person with blond hair", + "unicode": "1f471" + }, + ":person_with_blond_hair_tone1:": { + "category": "people", + "name": "person with blond hair tone 1", + "unicode": "1f471-1f3fb" + }, + ":person_with_blond_hair_tone2:": { + "category": "people", + "name": "person with blond hair tone 2", + "unicode": "1f471-1f3fc" + }, + ":person_with_blond_hair_tone3:": { + "category": "people", + "name": "person with blond hair tone 3", + "unicode": "1f471-1f3fd" + }, + ":person_with_blond_hair_tone4:": { + "category": "people", + "name": "person with blond hair tone 4", + "unicode": "1f471-1f3fe" + }, + ":person_with_blond_hair_tone5:": { + "category": "people", + "name": "person with blond hair tone 5", + "unicode": "1f471-1f3ff" + }, + ":person_with_pouting_face:": { + "category": "people", + "name": "person with pouting face", + "unicode": "1f64e" + }, + ":person_with_pouting_face_tone1:": { + "category": "people", + "name": "person with pouting face tone1", + "unicode": "1f64e-1f3fb" + }, + ":person_with_pouting_face_tone2:": { + "category": "people", + "name": "person with pouting face tone2", + "unicode": "1f64e-1f3fc" + }, + ":person_with_pouting_face_tone3:": { + "category": "people", + "name": "person with pouting face tone3", + "unicode": "1f64e-1f3fd" + }, + ":person_with_pouting_face_tone4:": { + "category": "people", + "name": "person with pouting face tone4", + "unicode": "1f64e-1f3fe" + }, + ":person_with_pouting_face_tone5:": { + "category": "people", + "name": "person with pouting face tone5", + "unicode": "1f64e-1f3ff" + }, + ":pick:": { + "category": "objects", + "name": "pick", + "unicode": "26cf", + "unicode_alt": "26cf-fe0f" + }, + ":pig2:": { + "category": "nature", + "name": "pig", + "unicode": "1f416" + }, + ":pig:": { + "category": "nature", + "name": "pig face", + "unicode": "1f437" + }, + ":pig_nose:": { + "category": "nature", + "name": "pig nose", + "unicode": "1f43d" + }, + ":pill:": { + "category": "objects", + "name": "pill", + "unicode": "1f48a" + }, + ":pineapple:": { + "category": "food", + "name": "pineapple", + "unicode": "1f34d" + }, + ":ping_pong:": { + "category": "activity", + "name": "table tennis paddle and ball", + "unicode": "1f3d3" + }, + ":pisces:": { + "category": "symbols", + "name": "pisces", + "unicode": "2653", + "unicode_alt": "2653-fe0f" + }, + ":pizza:": { + "category": "food", + "name": "slice of pizza", + "unicode": "1f355" + }, + ":place_of_worship:": { + "category": "symbols", + "name": "place of worship", + "unicode": "1f6d0" + }, + ":play_pause:": { + "category": "symbols", + "name": "black right-pointing double triangle with double vertical bar", + "unicode": "23ef", + "unicode_alt": "23ef-fe0f" + }, + ":point_down:": { + "category": "people", + "name": "white down pointing backhand index", + "unicode": "1f447" + }, + ":point_down_tone1:": { + "category": "people", + "name": "white down pointing backhand index tone 1", + "unicode": "1f447-1f3fb" + }, + ":point_down_tone2:": { + "category": "people", + "name": "white down pointing backhand index tone 2", + "unicode": "1f447-1f3fc" + }, + ":point_down_tone3:": { + "category": "people", + "name": "white down pointing backhand index tone 3", + "unicode": "1f447-1f3fd" + }, + ":point_down_tone4:": { + "category": "people", + "name": "white down pointing backhand index tone 4", + "unicode": "1f447-1f3fe" + }, + ":point_down_tone5:": { + "category": "people", + "name": "white down pointing backhand index tone 5", + "unicode": "1f447-1f3ff" + }, + ":point_left:": { + "category": "people", + "name": "white left pointing backhand index", + "unicode": "1f448" + }, + ":point_left_tone1:": { + "category": "people", + "name": "white left pointing backhand index tone 1", + "unicode": "1f448-1f3fb" + }, + ":point_left_tone2:": { + "category": "people", + "name": "white left pointing backhand index tone 2", + "unicode": "1f448-1f3fc" + }, + ":point_left_tone3:": { + "category": "people", + "name": "white left pointing backhand index tone 3", + "unicode": "1f448-1f3fd" + }, + ":point_left_tone4:": { + "category": "people", + "name": "white left pointing backhand index tone 4", + "unicode": "1f448-1f3fe" + }, + ":point_left_tone5:": { + "category": "people", + "name": "white left pointing backhand index tone 5", + "unicode": "1f448-1f3ff" + }, + ":point_right:": { + "category": "people", + "name": "white right pointing backhand index", + "unicode": "1f449" + }, + ":point_right_tone1:": { + "category": "people", + "name": "white right pointing backhand index tone 1", + "unicode": "1f449-1f3fb" + }, + ":point_right_tone2:": { + "category": "people", + "name": "white right pointing backhand index tone 2", + "unicode": "1f449-1f3fc" + }, + ":point_right_tone3:": { + "category": "people", + "name": "white right pointing backhand index tone 3", + "unicode": "1f449-1f3fd" + }, + ":point_right_tone4:": { + "category": "people", + "name": "white right pointing backhand index tone 4", + "unicode": "1f449-1f3fe" + }, + ":point_right_tone5:": { + "category": "people", + "name": "white right pointing backhand index tone 5", + "unicode": "1f449-1f3ff" + }, + ":point_up:": { + "category": "people", + "name": "white up pointing index", + "unicode": "261d", + "unicode_alt": "261d-fe0f" + }, + ":point_up_2:": { + "category": "people", + "name": "white up pointing backhand index", + "unicode": "1f446" + }, + ":point_up_2_tone1:": { + "category": "people", + "name": "white up pointing backhand index tone 1", + "unicode": "1f446-1f3fb" + }, + ":point_up_2_tone2:": { + "category": "people", + "name": "white up pointing backhand index tone 2", + "unicode": "1f446-1f3fc" + }, + ":point_up_2_tone3:": { + "category": "people", + "name": "white up pointing backhand index tone 3", + "unicode": "1f446-1f3fd" + }, + ":point_up_2_tone4:": { + "category": "people", + "name": "white up pointing backhand index tone 4", + "unicode": "1f446-1f3fe" + }, + ":point_up_2_tone5:": { + "category": "people", + "name": "white up pointing backhand index tone 5", + "unicode": "1f446-1f3ff" + }, + ":point_up_tone1:": { + "category": "people", + "name": "white up pointing index tone 1", + "unicode": "261d-1f3fb" + }, + ":point_up_tone2:": { + "category": "people", + "name": "white up pointing index tone 2", + "unicode": "261d-1f3fc" + }, + ":point_up_tone3:": { + "category": "people", + "name": "white up pointing index tone 3", + "unicode": "261d-1f3fd" + }, + ":point_up_tone4:": { + "category": "people", + "name": "white up pointing index tone 4", + "unicode": "261d-1f3fe" + }, + ":point_up_tone5:": { + "category": "people", + "name": "white up pointing index tone 5", + "unicode": "261d-1f3ff" + }, + ":police_car:": { + "category": "travel", + "name": "police car", + "unicode": "1f693" + }, + ":poodle:": { + "category": "nature", + "name": "poodle", + "unicode": "1f429" + }, + ":poop:": { + "category": "people", + "name": "pile of poo", + "unicode": "1f4a9" + }, + ":popcorn:": { + "category": "food", + "name": "popcorn", + "unicode": "1f37f" + }, + ":post_office:": { + "category": "travel", + "name": "japanese post office", + "unicode": "1f3e3" + }, + ":postal_horn:": { + "category": "objects", + "name": "postal horn", + "unicode": "1f4ef" + }, + ":postbox:": { + "category": "objects", + "name": "postbox", + "unicode": "1f4ee" + }, + ":potable_water:": { + "category": "symbols", + "name": "potable water symbol", + "unicode": "1f6b0" + }, + ":potato:": { + "category": "food", + "name": "potato", + "unicode": "1f954" + }, + ":pouch:": { + "category": "people", + "name": "pouch", + "unicode": "1f45d" + }, + ":poultry_leg:": { + "category": "food", + "name": "poultry leg", + "unicode": "1f357" + }, + ":pound:": { + "category": "objects", + "name": "banknote with pound sign", + "unicode": "1f4b7" + }, + ":pouting_cat:": { + "category": "people", + "name": "pouting cat face", + "unicode": "1f63e" + }, + ":pray:": { + "category": "people", + "name": "person with folded hands", + "unicode": "1f64f" + }, + ":pray_tone1:": { + "category": "people", + "name": "person with folded hands tone 1", + "unicode": "1f64f-1f3fb" + }, + ":pray_tone2:": { + "category": "people", + "name": "person with folded hands tone 2", + "unicode": "1f64f-1f3fc" + }, + ":pray_tone3:": { + "category": "people", + "name": "person with folded hands tone 3", + "unicode": "1f64f-1f3fd" + }, + ":pray_tone4:": { + "category": "people", + "name": "person with folded hands tone 4", + "unicode": "1f64f-1f3fe" + }, + ":pray_tone5:": { + "category": "people", + "name": "person with folded hands tone 5", + "unicode": "1f64f-1f3ff" + }, + ":prayer_beads:": { + "category": "objects", + "name": "prayer beads", + "unicode": "1f4ff" + }, + ":pregnant_woman:": { + "category": "people", + "name": "pregnant woman", + "unicode": "1f930" + }, + ":pregnant_woman_tone1:": { + "category": "people", + "name": "pregnant woman tone 1", + "unicode": "1f930-1f3fb" + }, + ":pregnant_woman_tone2:": { + "category": "people", + "name": "pregnant woman tone 2", + "unicode": "1f930-1f3fc" + }, + ":pregnant_woman_tone3:": { + "category": "people", + "name": "pregnant woman tone 3", + "unicode": "1f930-1f3fd" + }, + ":pregnant_woman_tone4:": { + "category": "people", + "name": "pregnant woman tone 4", + "unicode": "1f930-1f3fe" + }, + ":pregnant_woman_tone5:": { + "category": "people", + "name": "pregnant woman tone 5", + "unicode": "1f930-1f3ff" + }, + ":prince:": { + "category": "people", + "name": "prince", + "unicode": "1f934" + }, + ":prince_tone1:": { + "category": "people", + "name": "prince tone 1", + "unicode": "1f934-1f3fb" + }, + ":prince_tone2:": { + "category": "people", + "name": "prince tone 2", + "unicode": "1f934-1f3fc" + }, + ":prince_tone3:": { + "category": "people", + "name": "prince tone 3", + "unicode": "1f934-1f3fd" + }, + ":prince_tone4:": { + "category": "people", + "name": "prince tone 4", + "unicode": "1f934-1f3fe" + }, + ":prince_tone5:": { + "category": "people", + "name": "prince tone 5", + "unicode": "1f934-1f3ff" + }, + ":princess:": { + "category": "people", + "name": "princess", + "unicode": "1f478" + }, + ":princess_tone1:": { + "category": "people", + "name": "princess tone 1", + "unicode": "1f478-1f3fb" + }, + ":princess_tone2:": { + "category": "people", + "name": "princess tone 2", + "unicode": "1f478-1f3fc" + }, + ":princess_tone3:": { + "category": "people", + "name": "princess tone 3", + "unicode": "1f478-1f3fd" + }, + ":princess_tone4:": { + "category": "people", + "name": "princess tone 4", + "unicode": "1f478-1f3fe" + }, + ":princess_tone5:": { + "category": "people", + "name": "princess tone 5", + "unicode": "1f478-1f3ff" + }, + ":printer:": { + "category": "objects", + "name": "printer", + "unicode": "1f5a8", + "unicode_alt": "1f5a8-fe0f" + }, + ":projector:": { + "category": "objects", + "name": "film projector", + "unicode": "1f4fd", + "unicode_alt": "1f4fd-fe0f" + }, + ":punch:": { + "category": "people", + "name": "fisted hand sign", + "unicode": "1f44a" + }, + ":punch_tone1:": { + "category": "people", + "name": "fisted hand sign tone 1", + "unicode": "1f44a-1f3fb" + }, + ":punch_tone2:": { + "category": "people", + "name": "fisted hand sign tone 2", + "unicode": "1f44a-1f3fc" + }, + ":punch_tone3:": { + "category": "people", + "name": "fisted hand sign tone 3", + "unicode": "1f44a-1f3fd" + }, + ":punch_tone4:": { + "category": "people", + "name": "fisted hand sign tone 4", + "unicode": "1f44a-1f3fe" + }, + ":punch_tone5:": { + "category": "people", + "name": "fisted hand sign tone 5", + "unicode": "1f44a-1f3ff" + }, + ":purple_heart:": { + "category": "symbols", + "name": "purple heart", + "unicode": "1f49c" + }, + ":purse:": { + "category": "people", + "name": "purse", + "unicode": "1f45b" + }, + ":pushpin:": { + "category": "objects", + "name": "pushpin", + "unicode": "1f4cc" + }, + ":put_litter_in_its_place:": { + "category": "symbols", + "name": "put litter in its place symbol", + "unicode": "1f6ae" + }, + ":question:": { + "category": "symbols", + "name": "black question mark ornament", + "unicode": "2753" + }, + ":rabbit2:": { + "category": "nature", + "name": "rabbit", + "unicode": "1f407" + }, + ":rabbit:": { + "category": "nature", + "name": "rabbit face", + "unicode": "1f430" + }, + ":race_car:": { + "category": "travel", + "name": "racing car", + "unicode": "1f3ce", + "unicode_alt": "1f3ce-fe0f" + }, + ":racehorse:": { + "category": "nature", + "name": "horse", + "unicode": "1f40e" + }, + ":radio:": { + "category": "objects", + "name": "radio", + "unicode": "1f4fb" + }, + ":radio_button:": { + "category": "symbols", + "name": "radio button", + "unicode": "1f518" + }, + ":radioactive:": { + "category": "symbols", + "name": "radioactive sign", + "unicode": "2622", + "unicode_alt": "2622-fe0f" + }, + ":rage:": { + "category": "people", + "name": "pouting face", + "unicode": "1f621" + }, + ":railway_car:": { + "category": "travel", + "name": "railway car", + "unicode": "1f683" + }, + ":railway_track:": { + "category": "travel", + "name": "railway track", + "unicode": "1f6e4", + "unicode_alt": "1f6e4-fe0f" + }, + ":rainbow:": { + "category": "travel", + "name": "rainbow", + "unicode": "1f308" + }, + ":rainbow_flag:": { + "category": "objects", + "name": "rainbow_flag", + "unicode": "1f3f3-1f308" + }, + ":raised_back_of_hand:": { + "category": "people", + "name": "raised back of hand", + "unicode": "1f91a" + }, + ":raised_back_of_hand_tone1:": { + "category": "people", + "name": "raised back of hand tone 1", + "unicode": "1f91a-1f3fb" + }, + ":raised_back_of_hand_tone2:": { + "category": "people", + "name": "raised back of hand tone 2", + "unicode": "1f91a-1f3fc" + }, + ":raised_back_of_hand_tone3:": { + "category": "people", + "name": "raised back of hand tone 3", + "unicode": "1f91a-1f3fd" + }, + ":raised_back_of_hand_tone4:": { + "category": "people", + "name": "raised back of hand tone 4", + "unicode": "1f91a-1f3fe" + }, + ":raised_back_of_hand_tone5:": { + "category": "people", + "name": "raised back of hand tone 5", + "unicode": "1f91a-1f3ff" + }, + ":raised_hand:": { + "category": "people", + "name": "raised hand", + "unicode": "270b" + }, + ":raised_hand_tone1:": { + "category": "people", + "name": "raised hand tone 1", + "unicode": "270b-1f3fb" + }, + ":raised_hand_tone2:": { + "category": "people", + "name": "raised hand tone 2", + "unicode": "270b-1f3fc" + }, + ":raised_hand_tone3:": { + "category": "people", + "name": "raised hand tone 3", + "unicode": "270b-1f3fd" + }, + ":raised_hand_tone4:": { + "category": "people", + "name": "raised hand tone 4", + "unicode": "270b-1f3fe" + }, + ":raised_hand_tone5:": { + "category": "people", + "name": "raised hand tone 5", + "unicode": "270b-1f3ff" + }, + ":raised_hands:": { + "category": "people", + "name": "person raising both hands in celebration", + "unicode": "1f64c" + }, + ":raised_hands_tone1:": { + "category": "people", + "name": "person raising both hands in celebration tone 1", + "unicode": "1f64c-1f3fb" + }, + ":raised_hands_tone2:": { + "category": "people", + "name": "person raising both hands in celebration tone 2", + "unicode": "1f64c-1f3fc" + }, + ":raised_hands_tone3:": { + "category": "people", + "name": "person raising both hands in celebration tone 3", + "unicode": "1f64c-1f3fd" + }, + ":raised_hands_tone4:": { + "category": "people", + "name": "person raising both hands in celebration tone 4", + "unicode": "1f64c-1f3fe" + }, + ":raised_hands_tone5:": { + "category": "people", + "name": "person raising both hands in celebration tone 5", + "unicode": "1f64c-1f3ff" + }, + ":raising_hand:": { + "category": "people", + "name": "happy person raising one hand", + "unicode": "1f64b" + }, + ":raising_hand_tone1:": { + "category": "people", + "name": "happy person raising one hand tone1", + "unicode": "1f64b-1f3fb" + }, + ":raising_hand_tone2:": { + "category": "people", + "name": "happy person raising one hand tone2", + "unicode": "1f64b-1f3fc" + }, + ":raising_hand_tone3:": { + "category": "people", + "name": "happy person raising one hand tone3", + "unicode": "1f64b-1f3fd" + }, + ":raising_hand_tone4:": { + "category": "people", + "name": "happy person raising one hand tone4", + "unicode": "1f64b-1f3fe" + }, + ":raising_hand_tone5:": { + "category": "people", + "name": "happy person raising one hand tone5", + "unicode": "1f64b-1f3ff" + }, + ":ram:": { + "category": "nature", + "name": "ram", + "unicode": "1f40f" + }, + ":ramen:": { + "category": "food", + "name": "steaming bowl", + "unicode": "1f35c" + }, + ":rat:": { + "category": "nature", + "name": "rat", + "unicode": "1f400" + }, + ":record_button:": { + "category": "symbols", + "name": "black circle for record", + "unicode": "23fa", + "unicode_alt": "23fa-fe0f" + }, + ":recycle:": { + "category": "symbols", + "name": "black universal recycling symbol", + "unicode": "267b", + "unicode_alt": "267b-fe0f" + }, + ":red_car:": { + "category": "travel", + "name": "automobile", + "unicode": "1f697" + }, + ":red_circle:": { + "category": "symbols", + "name": "red circle", + "unicode": "1f534" + }, + ":regional_indicator_a:": { + "category": "regional", + "name": "regional indicator symbol letter a", + "unicode": "1f1e6" + }, + ":regional_indicator_b:": { + "category": "regional", + "name": "regional indicator symbol letter b", + "unicode": "1f1e7" + }, + ":regional_indicator_c:": { + "category": "regional", + "name": "regional indicator symbol letter c", + "unicode": "1f1e8" + }, + ":regional_indicator_d:": { + "category": "regional", + "name": "regional indicator symbol letter d", + "unicode": "1f1e9" + }, + ":regional_indicator_e:": { + "category": "regional", + "name": "regional indicator symbol letter e", + "unicode": "1f1ea" + }, + ":regional_indicator_f:": { + "category": "regional", + "name": "regional indicator symbol letter f", + "unicode": "1f1eb" + }, + ":regional_indicator_g:": { + "category": "regional", + "name": "regional indicator symbol letter g", + "unicode": "1f1ec" + }, + ":regional_indicator_h:": { + "category": "regional", + "name": "regional indicator symbol letter h", + "unicode": "1f1ed" + }, + ":regional_indicator_i:": { + "category": "regional", + "name": "regional indicator symbol letter i", + "unicode": "1f1ee" + }, + ":regional_indicator_j:": { + "category": "regional", + "name": "regional indicator symbol letter j", + "unicode": "1f1ef" + }, + ":regional_indicator_k:": { + "category": "regional", + "name": "regional indicator symbol letter k", + "unicode": "1f1f0" + }, + ":regional_indicator_l:": { + "category": "regional", + "name": "regional indicator symbol letter l", + "unicode": "1f1f1" + }, + ":regional_indicator_m:": { + "category": "regional", + "name": "regional indicator symbol letter m", + "unicode": "1f1f2" + }, + ":regional_indicator_n:": { + "category": "regional", + "name": "regional indicator symbol letter n", + "unicode": "1f1f3" + }, + ":regional_indicator_o:": { + "category": "regional", + "name": "regional indicator symbol letter o", + "unicode": "1f1f4" + }, + ":regional_indicator_p:": { + "category": "regional", + "name": "regional indicator symbol letter p", + "unicode": "1f1f5" + }, + ":regional_indicator_q:": { + "category": "regional", + "name": "regional indicator symbol letter q", + "unicode": "1f1f6" + }, + ":regional_indicator_r:": { + "category": "regional", + "name": "regional indicator symbol letter r", + "unicode": "1f1f7" + }, + ":regional_indicator_s:": { + "category": "regional", + "name": "regional indicator symbol letter s", + "unicode": "1f1f8" + }, + ":regional_indicator_t:": { + "category": "regional", + "name": "regional indicator symbol letter t", + "unicode": "1f1f9" + }, + ":regional_indicator_u:": { + "category": "regional", + "name": "regional indicator symbol letter u", + "unicode": "1f1fa" + }, + ":regional_indicator_v:": { + "category": "regional", + "name": "regional indicator symbol letter v", + "unicode": "1f1fb" + }, + ":regional_indicator_w:": { + "category": "regional", + "name": "regional indicator symbol letter w", + "unicode": "1f1fc" + }, + ":regional_indicator_x:": { + "category": "regional", + "name": "regional indicator symbol letter x", + "unicode": "1f1fd" + }, + ":regional_indicator_y:": { + "category": "regional", + "name": "regional indicator symbol letter y", + "unicode": "1f1fe" + }, + ":regional_indicator_z:": { + "category": "regional", + "name": "regional indicator symbol letter z", + "unicode": "1f1ff" + }, + ":registered:": { + "category": "symbols", + "name": "registered sign", + "unicode": "00ae", + "unicode_alt": "00ae-fe0f" + }, + ":relaxed:": { + "category": "people", + "name": "white smiling face", + "unicode": "263a", + "unicode_alt": "263a-fe0f" + }, + ":relieved:": { + "category": "people", + "name": "relieved face", + "unicode": "1f60c" + }, + ":reminder_ribbon:": { + "category": "activity", + "name": "reminder ribbon", + "unicode": "1f397", + "unicode_alt": "1f397-fe0f" + }, + ":repeat:": { + "category": "symbols", + "name": "clockwise rightwards and leftwards open circle arrows", + "unicode": "1f501" + }, + ":repeat_one:": { + "category": "symbols", + "name": "clockwise rightwards and leftwards open circle arrows with circled one overlay", + "unicode": "1f502" + }, + ":restroom:": { + "category": "symbols", + "name": "restroom", + "unicode": "1f6bb" + }, + ":revolving_hearts:": { + "category": "symbols", + "name": "revolving hearts", + "unicode": "1f49e" + }, + ":rewind:": { + "category": "symbols", + "name": "black left-pointing double triangle", + "unicode": "23ea" + }, + ":rhino:": { + "category": "nature", + "name": "rhinoceros", + "unicode": "1f98f" + }, + ":ribbon:": { + "category": "objects", + "name": "ribbon", + "unicode": "1f380" + }, + ":rice:": { + "category": "food", + "name": "cooked rice", + "unicode": "1f35a" + }, + ":rice_ball:": { + "category": "food", + "name": "rice ball", + "unicode": "1f359" + }, + ":rice_cracker:": { + "category": "food", + "name": "rice cracker", + "unicode": "1f358" + }, + ":rice_scene:": { + "category": "travel", + "name": "moon viewing ceremony", + "unicode": "1f391" + }, + ":right_facing_fist:": { + "category": "people", + "name": "right-facing fist", + "unicode": "1f91c" + }, + ":right_facing_fist_tone1:": { + "category": "people", + "name": "right facing fist tone 1", + "unicode": "1f91c-1f3fb" + }, + ":right_facing_fist_tone2:": { + "category": "people", + "name": "right facing fist tone 2", + "unicode": "1f91c-1f3fc" + }, + ":right_facing_fist_tone3:": { + "category": "people", + "name": "right facing fist tone 3", + "unicode": "1f91c-1f3fd" + }, + ":right_facing_fist_tone4:": { + "category": "people", + "name": "right facing fist tone 4", + "unicode": "1f91c-1f3fe" + }, + ":right_facing_fist_tone5:": { + "category": "people", + "name": "right facing fist tone 5", + "unicode": "1f91c-1f3ff" + }, + ":ring:": { + "category": "people", + "name": "ring", + "unicode": "1f48d" + }, + ":robot:": { + "category": "people", + "name": "robot face", + "unicode": "1f916" + }, + ":rocket:": { + "category": "travel", + "name": "rocket", + "unicode": "1f680" + }, + ":rofl:": { + "category": "people", + "name": "rolling on the floor laughing", + "unicode": "1f923" + }, + ":roller_coaster:": { + "category": "travel", + "name": "roller coaster", + "unicode": "1f3a2" + }, + ":rolling_eyes:": { + "category": "people", + "name": "face with rolling eyes", + "unicode": "1f644" + }, + ":rooster:": { + "category": "nature", + "name": "rooster", + "unicode": "1f413" + }, + ":rose:": { + "category": "nature", + "name": "rose", + "unicode": "1f339" + }, + ":rosette:": { + "category": "nature", + "name": "rosette", + "unicode": "1f3f5", + "unicode_alt": "1f3f5-fe0f" + }, + ":rotating_light:": { + "category": "travel", + "name": "police cars revolving light", + "unicode": "1f6a8" + }, + ":round_pushpin:": { + "category": "objects", + "name": "round pushpin", + "unicode": "1f4cd" + }, + ":rowboat:": { + "category": "activity", + "name": "rowboat", + "unicode": "1f6a3" + }, + ":rowboat_tone1:": { + "category": "activity", + "name": "rowboat tone 1", + "unicode": "1f6a3-1f3fb" + }, + ":rowboat_tone2:": { + "category": "activity", + "name": "rowboat tone 2", + "unicode": "1f6a3-1f3fc" + }, + ":rowboat_tone3:": { + "category": "activity", + "name": "rowboat tone 3", + "unicode": "1f6a3-1f3fd" + }, + ":rowboat_tone4:": { + "category": "activity", + "name": "rowboat tone 4", + "unicode": "1f6a3-1f3fe" + }, + ":rowboat_tone5:": { + "category": "activity", + "name": "rowboat tone 5", + "unicode": "1f6a3-1f3ff" + }, + ":rugby_football:": { + "category": "activity", + "name": "rugby football", + "unicode": "1f3c9" + }, + ":runner:": { + "category": "people", + "name": "runner", + "unicode": "1f3c3" + }, + ":runner_tone1:": { + "category": "people", + "name": "runner tone 1", + "unicode": "1f3c3-1f3fb" + }, + ":runner_tone2:": { + "category": "people", + "name": "runner tone 2", + "unicode": "1f3c3-1f3fc" + }, + ":runner_tone3:": { + "category": "people", + "name": "runner tone 3", + "unicode": "1f3c3-1f3fd" + }, + ":runner_tone4:": { + "category": "people", + "name": "runner tone 4", + "unicode": "1f3c3-1f3fe" + }, + ":runner_tone5:": { + "category": "people", + "name": "runner tone 5", + "unicode": "1f3c3-1f3ff" + }, + ":running_shirt_with_sash:": { + "category": "activity", + "name": "running shirt with sash", + "unicode": "1f3bd" + }, + ":sa:": { + "category": "symbols", + "name": "squared katakana sa", + "unicode": "1f202", + "unicode_alt": "1f202-fe0f" + }, + ":sagittarius:": { + "category": "symbols", + "name": "sagittarius", + "unicode": "2650", + "unicode_alt": "2650-fe0f" + }, + ":sailboat:": { + "category": "travel", + "name": "sailboat", + "unicode": "26f5", + "unicode_alt": "26f5-fe0f" + }, + ":sake:": { + "category": "food", + "name": "sake bottle and cup", + "unicode": "1f376" + }, + ":salad:": { + "category": "food", + "name": "green salad", + "unicode": "1f957" + }, + ":sandal:": { + "category": "people", + "name": "womans sandal", + "unicode": "1f461" + }, + ":santa:": { + "category": "people", + "name": "father christmas", + "unicode": "1f385" + }, + ":santa_tone1:": { + "category": "people", + "name": "father christmas tone 1", + "unicode": "1f385-1f3fb" + }, + ":santa_tone2:": { + "category": "people", + "name": "father christmas tone 2", + "unicode": "1f385-1f3fc" + }, + ":santa_tone3:": { + "category": "people", + "name": "father christmas tone 3", + "unicode": "1f385-1f3fd" + }, + ":santa_tone4:": { + "category": "people", + "name": "father christmas tone 4", + "unicode": "1f385-1f3fe" + }, + ":santa_tone5:": { + "category": "people", + "name": "father christmas tone 5", + "unicode": "1f385-1f3ff" + }, + ":satellite:": { + "category": "objects", + "name": "satellite antenna", + "unicode": "1f4e1" + }, + ":satellite_orbital:": { + "category": "travel", + "name": "satellite", + "unicode": "1f6f0", + "unicode_alt": "1f6f0-fe0f" + }, + ":saxophone:": { + "category": "activity", + "name": "saxophone", + "unicode": "1f3b7" + }, + ":scales:": { + "category": "objects", + "name": "scales", + "unicode": "2696", + "unicode_alt": "2696-fe0f" + }, + ":school:": { + "category": "travel", + "name": "school", + "unicode": "1f3eb" + }, + ":school_satchel:": { + "category": "people", + "name": "school satchel", + "unicode": "1f392" + }, + ":scissors:": { + "category": "objects", + "name": "black scissors", + "unicode": "2702", + "unicode_alt": "2702-fe0f" + }, + ":scooter:": { + "category": "travel", + "name": "scooter", + "unicode": "1f6f4" + }, + ":scorpion:": { + "category": "nature", + "name": "scorpion", + "unicode": "1f982" + }, + ":scorpius:": { + "category": "symbols", + "name": "scorpius", + "unicode": "264f", + "unicode_alt": "264f-fe0f" + }, + ":scream:": { + "category": "people", + "name": "face screaming in fear", + "unicode": "1f631" + }, + ":scream_cat:": { + "category": "people", + "name": "weary cat face", + "unicode": "1f640" + }, + ":scroll:": { + "category": "objects", + "name": "scroll", + "unicode": "1f4dc" + }, + ":seat:": { + "category": "travel", + "name": "seat", + "unicode": "1f4ba" + }, + ":second_place:": { + "category": "activity", + "name": "second place medal", + "unicode": "1f948" + }, + ":secret:": { + "category": "symbols", + "name": "circled ideograph secret", + "unicode": "3299", + "unicode_alt": "3299-fe0f" + }, + ":see_no_evil:": { + "category": "nature", + "name": "see-no-evil monkey", + "unicode": "1f648" + }, + ":seedling:": { + "category": "nature", + "name": "seedling", + "unicode": "1f331" + }, + ":selfie:": { + "category": "people", + "name": "selfie", + "unicode": "1f933" + }, + ":selfie_tone1:": { + "category": "people", + "name": "selfie tone 1", + "unicode": "1f933-1f3fb" + }, + ":selfie_tone2:": { + "category": "people", + "name": "selfie tone 2", + "unicode": "1f933-1f3fc" + }, + ":selfie_tone3:": { + "category": "people", + "name": "selfie tone 3", + "unicode": "1f933-1f3fd" + }, + ":selfie_tone4:": { + "category": "people", + "name": "selfie tone 4", + "unicode": "1f933-1f3fe" + }, + ":selfie_tone5:": { + "category": "people", + "name": "selfie tone 5", + "unicode": "1f933-1f3ff" + }, + ":seven:": { + "category": "symbols", + "name": "keycap digit seven", + "unicode": "0037-20e3", + "unicode_alt": "0037-fe0f-20e3" + }, + ":shallow_pan_of_food:": { + "category": "food", + "name": "shallow pan of food", + "unicode": "1f958" + }, + ":shamrock:": { + "category": "nature", + "name": "shamrock", + "unicode": "2618", + "unicode_alt": "2618-fe0f" + }, + ":shark:": { + "category": "nature", + "name": "shark", + "unicode": "1f988" + }, + ":shaved_ice:": { + "category": "food", + "name": "shaved ice", + "unicode": "1f367" + }, + ":sheep:": { + "category": "nature", + "name": "sheep", + "unicode": "1f411" + }, + ":shell:": { + "category": "nature", + "name": "spiral shell", + "unicode": "1f41a" + }, + ":shield:": { + "category": "objects", + "name": "shield", + "unicode": "1f6e1", + "unicode_alt": "1f6e1-fe0f" + }, + ":shinto_shrine:": { + "category": "travel", + "name": "shinto shrine", + "unicode": "26e9", + "unicode_alt": "26e9-fe0f" + }, + ":ship:": { + "category": "travel", + "name": "ship", + "unicode": "1f6a2" + }, + ":shirt:": { + "category": "people", + "name": "t-shirt", + "unicode": "1f455" + }, + ":shopping_bags:": { + "category": "objects", + "name": "shopping bags", + "unicode": "1f6cd", + "unicode_alt": "1f6cd-fe0f" + }, + ":shopping_cart:": { + "category": "objects", + "name": "shopping trolley", + "unicode": "1f6d2" + }, + ":shower:": { + "category": "objects", + "name": "shower", + "unicode": "1f6bf" + }, + ":shrimp:": { + "category": "nature", + "name": "shrimp", + "unicode": "1f990" + }, + ":shrug:": { + "category": "people", + "name": "shrug", + "unicode": "1f937" + }, + ":shrug_tone1:": { + "category": "people", + "name": "shrug tone 1", + "unicode": "1f937-1f3fb" + }, + ":shrug_tone2:": { + "category": "people", + "name": "shrug tone 2", + "unicode": "1f937-1f3fc" + }, + ":shrug_tone3:": { + "category": "people", + "name": "shrug tone 3", + "unicode": "1f937-1f3fd" + }, + ":shrug_tone4:": { + "category": "people", + "name": "shrug tone 4", + "unicode": "1f937-1f3fe" + }, + ":shrug_tone5:": { + "category": "people", + "name": "shrug tone 5", + "unicode": "1f937-1f3ff" + }, + ":signal_strength:": { + "category": "symbols", + "name": "antenna with bars", + "unicode": "1f4f6" + }, + ":six:": { + "category": "symbols", + "name": "keycap digit six", + "unicode": "0036-20e3", + "unicode_alt": "0036-fe0f-20e3" + }, + ":six_pointed_star:": { + "category": "symbols", + "name": "six pointed star with middle dot", + "unicode": "1f52f" + }, + ":ski:": { + "category": "activity", + "name": "ski and ski boot", + "unicode": "1f3bf" + }, + ":skier:": { + "category": "activity", + "name": "skier", + "unicode": "26f7", + "unicode_alt": "26f7-fe0f" + }, + ":skull:": { + "category": "people", + "name": "skull", + "unicode": "1f480" + }, + ":skull_crossbones:": { + "category": "objects", + "name": "skull and crossbones", + "unicode": "2620", + "unicode_alt": "2620-fe0f" + }, + ":sleeping:": { + "category": "people", + "name": "sleeping face", + "unicode": "1f634" + }, + ":sleeping_accommodation:": { + "category": "objects", + "name": "sleeping accommodation", + "unicode": "1f6cc" + }, + ":sleepy:": { + "category": "people", + "name": "sleepy face", + "unicode": "1f62a" + }, + ":slight_frown:": { + "category": "people", + "name": "slightly frowning face", + "unicode": "1f641" + }, + ":slight_smile:": { + "category": "people", + "name": "slightly smiling face", + "unicode": "1f642" + }, + ":slot_machine:": { + "category": "activity", + "name": "slot machine", + "unicode": "1f3b0" + }, + ":small_blue_diamond:": { + "category": "symbols", + "name": "small blue diamond", + "unicode": "1f539" + }, + ":small_orange_diamond:": { + "category": "symbols", + "name": "small orange diamond", + "unicode": "1f538" + }, + ":small_red_triangle:": { + "category": "symbols", + "name": "up-pointing red triangle", + "unicode": "1f53a" + }, + ":small_red_triangle_down:": { + "category": "symbols", + "name": "down-pointing red triangle", + "unicode": "1f53b" + }, + ":smile:": { + "category": "people", + "name": "smiling face with open mouth and smiling eyes", + "unicode": "1f604" + }, + ":smile_cat:": { + "category": "people", + "name": "grinning cat face with smiling eyes", + "unicode": "1f638" + }, + ":smiley:": { + "category": "people", + "name": "smiling face with open mouth", + "unicode": "1f603" + }, + ":smiley_cat:": { + "category": "people", + "name": "smiling cat face with open mouth", + "unicode": "1f63a" + }, + ":smiling_imp:": { + "category": "people", + "name": "smiling face with horns", + "unicode": "1f608" + }, + ":smirk:": { + "category": "people", + "name": "smirking face", + "unicode": "1f60f" + }, + ":smirk_cat:": { + "category": "people", + "name": "cat face with wry smile", + "unicode": "1f63c" + }, + ":smoking:": { + "category": "objects", + "name": "smoking symbol", + "unicode": "1f6ac" + }, + ":snail:": { + "category": "nature", + "name": "snail", + "unicode": "1f40c" + }, + ":snake:": { + "category": "nature", + "name": "snake", + "unicode": "1f40d" + }, + ":sneezing_face:": { + "category": "people", + "name": "sneezing face", + "unicode": "1f927" + }, + ":snowboarder:": { + "category": "activity", + "name": "snowboarder", + "unicode": "1f3c2" + }, + ":snowflake:": { + "category": "nature", + "name": "snowflake", + "unicode": "2744", + "unicode_alt": "2744-fe0f" + }, + ":snowman2:": { + "category": "nature", + "name": "snowman", + "unicode": "2603", + "unicode_alt": "2603-fe0f" + }, + ":snowman:": { + "category": "nature", + "name": "snowman without snow", + "unicode": "26c4", + "unicode_alt": "26c4-fe0f" + }, + ":sob:": { + "category": "people", + "name": "loudly crying face", + "unicode": "1f62d" + }, + ":soccer:": { + "category": "activity", + "name": "soccer ball", + "unicode": "26bd", + "unicode_alt": "26bd-fe0f" + }, + ":soon:": { + "category": "symbols", + "name": "soon with rightwards arrow above", + "unicode": "1f51c" + }, + ":sos:": { + "category": "symbols", + "name": "squared sos", + "unicode": "1f198" + }, + ":sound:": { + "category": "symbols", + "name": "speaker with one sound wave", + "unicode": "1f509" + }, + ":space_invader:": { + "category": "activity", + "name": "alien monster", + "unicode": "1f47e" + }, + ":spades:": { + "category": "symbols", + "name": "black spade suit", + "unicode": "2660", + "unicode_alt": "2660-fe0f" + }, + ":spaghetti:": { + "category": "food", + "name": "spaghetti", + "unicode": "1f35d" + }, + ":sparkle:": { + "category": "symbols", + "name": "sparkle", + "unicode": "2747", + "unicode_alt": "2747-fe0f" + }, + ":sparkler:": { + "category": "travel", + "name": "firework sparkler", + "unicode": "1f387" + }, + ":sparkles:": { + "category": "nature", + "name": "sparkles", + "unicode": "2728" + }, + ":sparkling_heart:": { + "category": "symbols", + "name": "sparkling heart", + "unicode": "1f496" + }, + ":speak_no_evil:": { + "category": "nature", + "name": "speak-no-evil monkey", + "unicode": "1f64a" + }, + ":speaker:": { + "category": "symbols", + "name": "speaker", + "unicode": "1f508" + }, + ":speaking_head:": { + "category": "people", + "name": "speaking head in silhouette", + "unicode": "1f5e3", + "unicode_alt": "1f5e3-fe0f" + }, + ":speech_balloon:": { + "category": "symbols", + "name": "speech balloon", + "unicode": "1f4ac" + }, + ":speech_left:": { + "category": "symbols", + "name": "left speech bubble", + "unicode": "1f5e8", + "unicode_alt": "1f5e8-fe0f" + }, + ":speedboat:": { + "category": "travel", + "name": "speedboat", + "unicode": "1f6a4" + }, + ":spider:": { + "category": "nature", + "name": "spider", + "unicode": "1f577", + "unicode_alt": "1f577-fe0f" + }, + ":spider_web:": { + "category": "nature", + "name": "spider web", + "unicode": "1f578", + "unicode_alt": "1f578-fe0f" + }, + ":spoon:": { + "category": "food", + "name": "spoon", + "unicode": "1f944" + }, + ":spy:": { + "category": "people", + "name": "sleuth or spy", + "unicode": "1f575", + "unicode_alt": "1f575-fe0f" + }, + ":spy_tone1:": { + "category": "people", + "name": "sleuth or spy tone 1", + "unicode": "1f575-1f3fb" + }, + ":spy_tone2:": { + "category": "people", + "name": "sleuth or spy tone 2", + "unicode": "1f575-1f3fc" + }, + ":spy_tone3:": { + "category": "people", + "name": "sleuth or spy tone 3", + "unicode": "1f575-1f3fd" + }, + ":spy_tone4:": { + "category": "people", + "name": "sleuth or spy tone 4", + "unicode": "1f575-1f3fe" + }, + ":spy_tone5:": { + "category": "people", + "name": "sleuth or spy tone 5", + "unicode": "1f575-1f3ff" + }, + ":squid:": { + "category": "nature", + "name": "squid", + "unicode": "1f991" + }, + ":stadium:": { + "category": "travel", + "name": "stadium", + "unicode": "1f3df", + "unicode_alt": "1f3df-fe0f" + }, + ":star2:": { + "category": "nature", + "name": "glowing star", + "unicode": "1f31f" + }, + ":star:": { + "category": "nature", + "name": "white medium star", + "unicode": "2b50", + "unicode_alt": "2b50-fe0f" + }, + ":star_and_crescent:": { + "category": "symbols", + "name": "star and crescent", + "unicode": "262a", + "unicode_alt": "262a-fe0f" + }, + ":star_of_david:": { + "category": "symbols", + "name": "star of david", + "unicode": "2721", + "unicode_alt": "2721-fe0f" + }, + ":stars:": { + "category": "travel", + "name": "shooting star", + "unicode": "1f320" + }, + ":station:": { + "category": "travel", + "name": "station", + "unicode": "1f689" + }, + ":statue_of_liberty:": { + "category": "travel", + "name": "statue of liberty", + "unicode": "1f5fd" + }, + ":steam_locomotive:": { + "category": "travel", + "name": "steam locomotive", + "unicode": "1f682" + }, + ":stew:": { + "category": "food", + "name": "pot of food", + "unicode": "1f372" + }, + ":stop_button:": { + "category": "symbols", + "name": "black square for stop", + "unicode": "23f9", + "unicode_alt": "23f9-fe0f" + }, + ":stopwatch:": { + "category": "objects", + "name": "stopwatch", + "unicode": "23f1", + "unicode_alt": "23f1-fe0f" + }, + ":straight_ruler:": { + "category": "objects", + "name": "straight ruler", + "unicode": "1f4cf" + }, + ":strawberry:": { + "category": "food", + "name": "strawberry", + "unicode": "1f353" + }, + ":stuck_out_tongue:": { + "category": "people", + "name": "face with stuck-out tongue", + "unicode": "1f61b" + }, + ":stuck_out_tongue_closed_eyes:": { + "category": "people", + "name": "face with stuck-out tongue and tightly-closed eyes", + "unicode": "1f61d" + }, + ":stuck_out_tongue_winking_eye:": { + "category": "people", + "name": "face with stuck-out tongue and winking eye", + "unicode": "1f61c" + }, + ":stuffed_flatbread:": { + "category": "food", + "name": "stuffed flatbread", + "unicode": "1f959" + }, + ":sun_with_face:": { + "category": "nature", + "name": "sun with face", + "unicode": "1f31e" + }, + ":sunflower:": { + "category": "nature", + "name": "sunflower", + "unicode": "1f33b" + }, + ":sunglasses:": { + "category": "people", + "name": "smiling face with sunglasses", + "unicode": "1f60e" + }, + ":sunny:": { + "category": "nature", + "name": "black sun with rays", + "unicode": "2600", + "unicode_alt": "2600-fe0f" + }, + ":sunrise:": { + "category": "travel", + "name": "sunrise", + "unicode": "1f305" + }, + ":sunrise_over_mountains:": { + "category": "travel", + "name": "sunrise over mountains", + "unicode": "1f304" + }, + ":surfer:": { + "category": "activity", + "name": "surfer", + "unicode": "1f3c4" + }, + ":surfer_tone1:": { + "category": "activity", + "name": "surfer tone 1", + "unicode": "1f3c4-1f3fb" + }, + ":surfer_tone2:": { + "category": "activity", + "name": "surfer tone 2", + "unicode": "1f3c4-1f3fc" + }, + ":surfer_tone3:": { + "category": "activity", + "name": "surfer tone 3", + "unicode": "1f3c4-1f3fd" + }, + ":surfer_tone4:": { + "category": "activity", + "name": "surfer tone 4", + "unicode": "1f3c4-1f3fe" + }, + ":surfer_tone5:": { + "category": "activity", + "name": "surfer tone 5", + "unicode": "1f3c4-1f3ff" + }, + ":sushi:": { + "category": "food", + "name": "sushi", + "unicode": "1f363" + }, + ":suspension_railway:": { + "category": "travel", + "name": "suspension railway", + "unicode": "1f69f" + }, + ":sweat:": { + "category": "people", + "name": "face with cold sweat", + "unicode": "1f613" + }, + ":sweat_drops:": { + "category": "nature", + "name": "splashing sweat symbol", + "unicode": "1f4a6" + }, + ":sweat_smile:": { + "category": "people", + "name": "smiling face with open mouth and cold sweat", + "unicode": "1f605" + }, + ":sweet_potato:": { + "category": "food", + "name": "roasted sweet potato", + "unicode": "1f360" + }, + ":swimmer:": { + "category": "activity", + "name": "swimmer", + "unicode": "1f3ca" + }, + ":swimmer_tone1:": { + "category": "activity", + "name": "swimmer tone 1", + "unicode": "1f3ca-1f3fb" + }, + ":swimmer_tone2:": { + "category": "activity", + "name": "swimmer tone 2", + "unicode": "1f3ca-1f3fc" + }, + ":swimmer_tone3:": { + "category": "activity", + "name": "swimmer tone 3", + "unicode": "1f3ca-1f3fd" + }, + ":swimmer_tone4:": { + "category": "activity", + "name": "swimmer tone 4", + "unicode": "1f3ca-1f3fe" + }, + ":swimmer_tone5:": { + "category": "activity", + "name": "swimmer tone 5", + "unicode": "1f3ca-1f3ff" + }, + ":symbols:": { + "category": "symbols", + "name": "input symbol for symbols", + "unicode": "1f523" + }, + ":synagogue:": { + "category": "travel", + "name": "synagogue", + "unicode": "1f54d" + }, + ":syringe:": { + "category": "objects", + "name": "syringe", + "unicode": "1f489" + }, + ":taco:": { + "category": "food", + "name": "taco", + "unicode": "1f32e" + }, + ":tada:": { + "category": "objects", + "name": "party popper", + "unicode": "1f389" + }, + ":tanabata_tree:": { + "category": "nature", + "name": "tanabata tree", + "unicode": "1f38b" + }, + ":tangerine:": { + "category": "food", + "name": "tangerine", + "unicode": "1f34a" + }, + ":taurus:": { + "category": "symbols", + "name": "taurus", + "unicode": "2649", + "unicode_alt": "2649-fe0f" + }, + ":taxi:": { + "category": "travel", + "name": "taxi", + "unicode": "1f695" + }, + ":tea:": { + "category": "food", + "name": "teacup without handle", + "unicode": "1f375" + }, + ":telephone:": { + "category": "objects", + "name": "black telephone", + "unicode": "260e", + "unicode_alt": "260e-fe0f" + }, + ":telephone_receiver:": { + "category": "objects", + "name": "telephone receiver", + "unicode": "1f4de" + }, + ":telescope:": { + "category": "objects", + "name": "telescope", + "unicode": "1f52d" + }, + ":tennis:": { + "category": "activity", + "name": "tennis racquet and ball", + "unicode": "1f3be" + }, + ":tent:": { + "category": "travel", + "name": "tent", + "unicode": "26fa", + "unicode_alt": "26fa-fe0f" + }, + ":thermometer:": { + "category": "objects", + "name": "thermometer", + "unicode": "1f321", + "unicode_alt": "1f321-fe0f" + }, + ":thermometer_face:": { + "category": "people", + "name": "face with thermometer", + "unicode": "1f912" + }, + ":thinking:": { + "category": "people", + "name": "thinking face", + "unicode": "1f914" + }, + ":third_place:": { + "category": "activity", + "name": "third place medal", + "unicode": "1f949" + }, + ":thought_balloon:": { + "category": "symbols", + "name": "thought balloon", + "unicode": "1f4ad" + }, + ":three:": { + "category": "symbols", + "name": "keycap digit three", + "unicode": "0033-20e3", + "unicode_alt": "0033-fe0f-20e3" + }, + ":thumbsdown:": { + "category": "people", + "name": "thumbs down sign", + "unicode": "1f44e" + }, + ":thumbsdown_tone1:": { + "category": "people", + "name": "thumbs down sign tone 1", + "unicode": "1f44e-1f3fb" + }, + ":thumbsdown_tone2:": { + "category": "people", + "name": "thumbs down sign tone 2", + "unicode": "1f44e-1f3fc" + }, + ":thumbsdown_tone3:": { + "category": "people", + "name": "thumbs down sign tone 3", + "unicode": "1f44e-1f3fd" + }, + ":thumbsdown_tone4:": { + "category": "people", + "name": "thumbs down sign tone 4", + "unicode": "1f44e-1f3fe" + }, + ":thumbsdown_tone5:": { + "category": "people", + "name": "thumbs down sign tone 5", + "unicode": "1f44e-1f3ff" + }, + ":thumbsup:": { + "category": "people", + "name": "thumbs up sign", + "unicode": "1f44d" + }, + ":thumbsup_tone1:": { + "category": "people", + "name": "thumbs up sign tone 1", + "unicode": "1f44d-1f3fb" + }, + ":thumbsup_tone2:": { + "category": "people", + "name": "thumbs up sign tone 2", + "unicode": "1f44d-1f3fc" + }, + ":thumbsup_tone3:": { + "category": "people", + "name": "thumbs up sign tone 3", + "unicode": "1f44d-1f3fd" + }, + ":thumbsup_tone4:": { + "category": "people", + "name": "thumbs up sign tone 4", + "unicode": "1f44d-1f3fe" + }, + ":thumbsup_tone5:": { + "category": "people", + "name": "thumbs up sign tone 5", + "unicode": "1f44d-1f3ff" + }, + ":thunder_cloud_rain:": { + "category": "nature", + "name": "thunder cloud and rain", + "unicode": "26c8", + "unicode_alt": "26c8-fe0f" + }, + ":ticket:": { + "category": "activity", + "name": "ticket", + "unicode": "1f3ab" + }, + ":tickets:": { + "category": "activity", + "name": "admission tickets", + "unicode": "1f39f", + "unicode_alt": "1f39f-fe0f" + }, + ":tiger2:": { + "category": "nature", + "name": "tiger", + "unicode": "1f405" + }, + ":tiger:": { + "category": "nature", + "name": "tiger face", + "unicode": "1f42f" + }, + ":timer:": { + "category": "objects", + "name": "timer clock", + "unicode": "23f2", + "unicode_alt": "23f2-fe0f" + }, + ":tired_face:": { + "category": "people", + "name": "tired face", + "unicode": "1f62b" + }, + ":tm:": { + "category": "symbols", + "name": "trade mark sign", + "unicode": "2122", + "unicode_alt": "2122-fe0f" + }, + ":toilet:": { + "category": "objects", + "name": "toilet", + "unicode": "1f6bd" + }, + ":tokyo_tower:": { + "category": "travel", + "name": "tokyo tower", + "unicode": "1f5fc" + }, + ":tomato:": { + "category": "food", + "name": "tomato", + "unicode": "1f345" + }, + ":tone1:": { + "category": "modifier", + "name": "emoji modifier Fitzpatrick type-1-2", + "unicode": "1f3fb" + }, + ":tone2:": { + "category": "modifier", + "name": "emoji modifier Fitzpatrick type-3", + "unicode": "1f3fc" + }, + ":tone3:": { + "category": "modifier", + "name": "emoji modifier Fitzpatrick type-4", + "unicode": "1f3fd" + }, + ":tone4:": { + "category": "modifier", + "name": "emoji modifier Fitzpatrick type-5", + "unicode": "1f3fe" + }, + ":tone5:": { + "category": "modifier", + "name": "emoji modifier Fitzpatrick type-6", + "unicode": "1f3ff" + }, + ":tongue:": { + "category": "people", + "name": "tongue", + "unicode": "1f445" + }, + ":tools:": { + "category": "objects", + "name": "hammer and wrench", + "unicode": "1f6e0", + "unicode_alt": "1f6e0-fe0f" + }, + ":top:": { + "category": "symbols", + "name": "top with upwards arrow above", + "unicode": "1f51d" + }, + ":tophat:": { + "category": "people", + "name": "top hat", + "unicode": "1f3a9" + }, + ":track_next:": { + "category": "symbols", + "name": "black right-pointing double triangle with vertical bar", + "unicode": "23ed", + "unicode_alt": "23ed-fe0f" + }, + ":track_previous:": { + "category": "symbols", + "name": "black left-pointing double triangle with vertical bar", + "unicode": "23ee", + "unicode_alt": "23ee-fe0f" + }, + ":trackball:": { + "category": "objects", + "name": "trackball", + "unicode": "1f5b2", + "unicode_alt": "1f5b2-fe0f" + }, + ":tractor:": { + "category": "travel", + "name": "tractor", + "unicode": "1f69c" + }, + ":traffic_light:": { + "category": "travel", + "name": "horizontal traffic light", + "unicode": "1f6a5" + }, + ":train2:": { + "category": "travel", + "name": "train", + "unicode": "1f686" + }, + ":train:": { + "category": "travel", + "name": "tram car", + "unicode": "1f68b" + }, + ":tram:": { + "category": "travel", + "name": "tram", + "unicode": "1f68a" + }, + ":triangular_flag_on_post:": { + "category": "objects", + "name": "triangular flag on post", + "unicode": "1f6a9" + }, + ":triangular_ruler:": { + "category": "objects", + "name": "triangular ruler", + "unicode": "1f4d0" + }, + ":trident:": { + "category": "symbols", + "name": "trident emblem", + "unicode": "1f531" + }, + ":triumph:": { + "category": "people", + "name": "face with look of triumph", + "unicode": "1f624" + }, + ":trolleybus:": { + "category": "travel", + "name": "trolleybus", + "unicode": "1f68e" + }, + ":trophy:": { + "category": "activity", + "name": "trophy", + "unicode": "1f3c6" + }, + ":tropical_drink:": { + "category": "food", + "name": "tropical drink", + "unicode": "1f379" + }, + ":tropical_fish:": { + "category": "nature", + "name": "tropical fish", + "unicode": "1f420" + }, + ":truck:": { + "category": "travel", + "name": "delivery truck", + "unicode": "1f69a" + }, + ":trumpet:": { + "category": "activity", + "name": "trumpet", + "unicode": "1f3ba" + }, + ":tulip:": { + "category": "nature", + "name": "tulip", + "unicode": "1f337" + }, + ":tumbler_glass:": { + "category": "food", + "name": "tumbler glass", + "unicode": "1f943" + }, + ":turkey:": { + "category": "nature", + "name": "turkey", + "unicode": "1f983" + }, + ":turtle:": { + "category": "nature", + "name": "turtle", + "unicode": "1f422" + }, + ":tv:": { + "category": "objects", + "name": "television", + "unicode": "1f4fa" + }, + ":twisted_rightwards_arrows:": { + "category": "symbols", + "name": "twisted rightwards arrows", + "unicode": "1f500" + }, + ":two:": { + "category": "symbols", + "name": "keycap digit two", + "unicode": "0032-20e3", + "unicode_alt": "0032-fe0f-20e3" + }, + ":two_hearts:": { + "category": "symbols", + "name": "two hearts", + "unicode": "1f495" + }, + ":two_men_holding_hands:": { + "category": "people", + "name": "two men holding hands", + "unicode": "1f46c" + }, + ":two_women_holding_hands:": { + "category": "people", + "name": "two women holding hands", + "unicode": "1f46d" + }, + ":u5272:": { + "category": "symbols", + "name": "squared cjk unified ideograph-5272", + "unicode": "1f239" + }, + ":u5408:": { + "category": "symbols", + "name": "squared cjk unified ideograph-5408", + "unicode": "1f234" + }, + ":u55b6:": { + "category": "symbols", + "name": "squared cjk unified ideograph-55b6", + "unicode": "1f23a" + }, + ":u6307:": { + "category": "symbols", + "name": "squared cjk unified ideograph-6307", + "unicode": "1f22f", + "unicode_alt": "1f22f-fe0f" + }, + ":u6708:": { + "category": "symbols", + "name": "squared cjk unified ideograph-6708", + "unicode": "1f237", + "unicode_alt": "1f237-fe0f" + }, + ":u6709:": { + "category": "symbols", + "name": "squared cjk unified ideograph-6709", + "unicode": "1f236" + }, + ":u6e80:": { + "category": "symbols", + "name": "squared cjk unified ideograph-6e80", + "unicode": "1f235" + }, + ":u7121:": { + "category": "symbols", + "name": "squared cjk unified ideograph-7121", + "unicode": "1f21a", + "unicode_alt": "1f21a-fe0f" + }, + ":u7533:": { + "category": "symbols", + "name": "squared cjk unified ideograph-7533", + "unicode": "1f238" + }, + ":u7981:": { + "category": "symbols", + "name": "squared cjk unified ideograph-7981", + "unicode": "1f232" + }, + ":u7a7a:": { + "category": "symbols", + "name": "squared cjk unified ideograph-7a7a", + "unicode": "1f233" + }, + ":umbrella2:": { + "category": "nature", + "name": "umbrella", + "unicode": "2602", + "unicode_alt": "2602-fe0f" + }, + ":umbrella:": { + "category": "nature", + "name": "umbrella with rain drops", + "unicode": "2614", + "unicode_alt": "2614-fe0f" + }, + ":unamused:": { + "category": "people", + "name": "unamused face", + "unicode": "1f612" + }, + ":underage:": { + "category": "symbols", + "name": "no one under eighteen symbol", + "unicode": "1f51e" + }, + ":unicorn:": { + "category": "nature", + "name": "unicorn face", + "unicode": "1f984" + }, + ":unlock:": { + "category": "objects", + "name": "open lock", + "unicode": "1f513" + }, + ":up:": { + "category": "symbols", + "name": "squared up with exclamation mark", + "unicode": "1f199" + }, + ":upside_down:": { + "category": "people", + "name": "upside-down face", + "unicode": "1f643" + }, + ":urn:": { + "category": "objects", + "name": "funeral urn", + "unicode": "26b1", + "unicode_alt": "26b1-fe0f" + }, + ":v:": { + "category": "people", + "name": "victory hand", + "unicode": "270c", + "unicode_alt": "270c-fe0f" + }, + ":v_tone1:": { + "category": "people", + "name": "victory hand tone 1", + "unicode": "270c-1f3fb" + }, + ":v_tone2:": { + "category": "people", + "name": "victory hand tone 2", + "unicode": "270c-1f3fc" + }, + ":v_tone3:": { + "category": "people", + "name": "victory hand tone 3", + "unicode": "270c-1f3fd" + }, + ":v_tone4:": { + "category": "people", + "name": "victory hand tone 4", + "unicode": "270c-1f3fe" + }, + ":v_tone5:": { + "category": "people", + "name": "victory hand tone 5", + "unicode": "270c-1f3ff" + }, + ":vertical_traffic_light:": { + "category": "travel", + "name": "vertical traffic light", + "unicode": "1f6a6" + }, + ":vhs:": { + "category": "objects", + "name": "videocassette", + "unicode": "1f4fc" + }, + ":vibration_mode:": { + "category": "symbols", + "name": "vibration mode", + "unicode": "1f4f3" + }, + ":video_camera:": { + "category": "objects", + "name": "video camera", + "unicode": "1f4f9" + }, + ":video_game:": { + "category": "activity", + "name": "video game", + "unicode": "1f3ae" + }, + ":violin:": { + "category": "activity", + "name": "violin", + "unicode": "1f3bb" + }, + ":virgo:": { + "category": "symbols", + "name": "virgo", + "unicode": "264d", + "unicode_alt": "264d-fe0f" + }, + ":volcano:": { + "category": "travel", + "name": "volcano", + "unicode": "1f30b" + }, + ":volleyball:": { + "category": "activity", + "name": "volleyball", + "unicode": "1f3d0" + }, + ":vs:": { + "category": "symbols", + "name": "squared vs", + "unicode": "1f19a" + }, + ":vulcan:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers", + "unicode": "1f596" + }, + ":vulcan_tone1:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers tone 1", + "unicode": "1f596-1f3fb" + }, + ":vulcan_tone2:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers tone 2", + "unicode": "1f596-1f3fc" + }, + ":vulcan_tone3:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers tone 3", + "unicode": "1f596-1f3fd" + }, + ":vulcan_tone4:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers tone 4", + "unicode": "1f596-1f3fe" + }, + ":vulcan_tone5:": { + "category": "people", + "name": "raised hand with part between middle and ring fingers tone 5", + "unicode": "1f596-1f3ff" + }, + ":walking:": { + "category": "people", + "name": "pedestrian", + "unicode": "1f6b6" + }, + ":walking_tone1:": { + "category": "people", + "name": "pedestrian tone 1", + "unicode": "1f6b6-1f3fb" + }, + ":walking_tone2:": { + "category": "people", + "name": "pedestrian tone 2", + "unicode": "1f6b6-1f3fc" + }, + ":walking_tone3:": { + "category": "people", + "name": "pedestrian tone 3", + "unicode": "1f6b6-1f3fd" + }, + ":walking_tone4:": { + "category": "people", + "name": "pedestrian tone 4", + "unicode": "1f6b6-1f3fe" + }, + ":walking_tone5:": { + "category": "people", + "name": "pedestrian tone 5", + "unicode": "1f6b6-1f3ff" + }, + ":waning_crescent_moon:": { + "category": "nature", + "name": "waning crescent moon symbol", + "unicode": "1f318" + }, + ":waning_gibbous_moon:": { + "category": "nature", + "name": "waning gibbous moon symbol", + "unicode": "1f316" + }, + ":warning:": { + "category": "symbols", + "name": "warning sign", + "unicode": "26a0", + "unicode_alt": "26a0-fe0f" + }, + ":wastebasket:": { + "category": "objects", + "name": "wastebasket", + "unicode": "1f5d1", + "unicode_alt": "1f5d1-fe0f" + }, + ":watch:": { + "category": "objects", + "name": "watch", + "unicode": "231a", + "unicode_alt": "231a-fe0f" + }, + ":water_buffalo:": { + "category": "nature", + "name": "water buffalo", + "unicode": "1f403" + }, + ":water_polo:": { + "category": "activity", + "name": "water polo", + "unicode": "1f93d" + }, + ":water_polo_tone1:": { + "category": "activity", + "name": "water polo tone 1", + "unicode": "1f93d-1f3fb" + }, + ":water_polo_tone2:": { + "category": "activity", + "name": "water polo tone 2", + "unicode": "1f93d-1f3fc" + }, + ":water_polo_tone3:": { + "category": "activity", + "name": "water polo tone 3", + "unicode": "1f93d-1f3fd" + }, + ":water_polo_tone4:": { + "category": "activity", + "name": "water polo tone 4", + "unicode": "1f93d-1f3fe" + }, + ":water_polo_tone5:": { + "category": "activity", + "name": "water polo tone 5", + "unicode": "1f93d-1f3ff" + }, + ":watermelon:": { + "category": "food", + "name": "watermelon", + "unicode": "1f349" + }, + ":wave:": { + "category": "people", + "name": "waving hand sign", + "unicode": "1f44b" + }, + ":wave_tone1:": { + "category": "people", + "name": "waving hand sign tone 1", + "unicode": "1f44b-1f3fb" + }, + ":wave_tone2:": { + "category": "people", + "name": "waving hand sign tone 2", + "unicode": "1f44b-1f3fc" + }, + ":wave_tone3:": { + "category": "people", + "name": "waving hand sign tone 3", + "unicode": "1f44b-1f3fd" + }, + ":wave_tone4:": { + "category": "people", + "name": "waving hand sign tone 4", + "unicode": "1f44b-1f3fe" + }, + ":wave_tone5:": { + "category": "people", + "name": "waving hand sign tone 5", + "unicode": "1f44b-1f3ff" + }, + ":wavy_dash:": { + "category": "symbols", + "name": "wavy dash", + "unicode": "3030", + "unicode_alt": "3030-fe0f" + }, + ":waxing_crescent_moon:": { + "category": "nature", + "name": "waxing crescent moon symbol", + "unicode": "1f312" + }, + ":waxing_gibbous_moon:": { + "category": "nature", + "name": "waxing gibbous moon symbol", + "unicode": "1f314" + }, + ":wc:": { + "category": "symbols", + "name": "water closet", + "unicode": "1f6be" + }, + ":weary:": { + "category": "people", + "name": "weary face", + "unicode": "1f629" + }, + ":wedding:": { + "category": "travel", + "name": "wedding", + "unicode": "1f492" + }, + ":whale2:": { + "category": "nature", + "name": "whale", + "unicode": "1f40b" + }, + ":whale:": { + "category": "nature", + "name": "spouting whale", + "unicode": "1f433" + }, + ":wheel_of_dharma:": { + "category": "symbols", + "name": "wheel of dharma", + "unicode": "2638", + "unicode_alt": "2638-fe0f" + }, + ":wheelchair:": { + "category": "symbols", + "name": "wheelchair symbol", + "unicode": "267f", + "unicode_alt": "267f-fe0f" + }, + ":white_check_mark:": { + "category": "symbols", + "name": "white heavy check mark", + "unicode": "2705" + }, + ":white_circle:": { + "category": "symbols", + "name": "white circle", + "unicode": "26aa", + "unicode_alt": "26aa-fe0f" + }, + ":white_flower:": { + "category": "symbols", + "name": "white flower", + "unicode": "1f4ae" + }, + ":white_large_square:": { + "category": "symbols", + "name": "white large square", + "unicode": "2b1c", + "unicode_alt": "2b1c-fe0f" + }, + ":white_medium_small_square:": { + "category": "symbols", + "name": "white medium small square", + "unicode": "25fd", + "unicode_alt": "25fd-fe0f" + }, + ":white_medium_square:": { + "category": "symbols", + "name": "white medium square", + "unicode": "25fb", + "unicode_alt": "25fb-fe0f" + }, + ":white_small_square:": { + "category": "symbols", + "name": "white small square", + "unicode": "25ab", + "unicode_alt": "25ab-fe0f" + }, + ":white_square_button:": { + "category": "symbols", + "name": "white square button", + "unicode": "1f533" + }, + ":white_sun_cloud:": { + "category": "nature", + "name": "white sun behind cloud", + "unicode": "1f325", + "unicode_alt": "1f325-fe0f" + }, + ":white_sun_rain_cloud:": { + "category": "nature", + "name": "white sun behind cloud with rain", + "unicode": "1f326", + "unicode_alt": "1f326-fe0f" + }, + ":white_sun_small_cloud:": { + "category": "nature", + "name": "white sun with small cloud", + "unicode": "1f324", + "unicode_alt": "1f324-fe0f" + }, + ":wilted_rose:": { + "category": "nature", + "name": "wilted flower", + "unicode": "1f940" + }, + ":wind_blowing_face:": { + "category": "nature", + "name": "wind blowing face", + "unicode": "1f32c", + "unicode_alt": "1f32c-fe0f" + }, + ":wind_chime:": { + "category": "objects", + "name": "wind chime", + "unicode": "1f390" + }, + ":wine_glass:": { + "category": "food", + "name": "wine glass", + "unicode": "1f377" + }, + ":wink:": { + "category": "people", + "name": "winking face", + "unicode": "1f609" + }, + ":wolf:": { + "category": "nature", + "name": "wolf face", + "unicode": "1f43a" + }, + ":woman:": { + "category": "people", + "name": "woman", + "unicode": "1f469" + }, + ":woman_tone1:": { + "category": "people", + "name": "woman tone 1", + "unicode": "1f469-1f3fb" + }, + ":woman_tone2:": { + "category": "people", + "name": "woman tone 2", + "unicode": "1f469-1f3fc" + }, + ":woman_tone3:": { + "category": "people", + "name": "woman tone 3", + "unicode": "1f469-1f3fd" + }, + ":woman_tone4:": { + "category": "people", + "name": "woman tone 4", + "unicode": "1f469-1f3fe" + }, + ":woman_tone5:": { + "category": "people", + "name": "woman tone 5", + "unicode": "1f469-1f3ff" + }, + ":womans_clothes:": { + "category": "people", + "name": "womans clothes", + "unicode": "1f45a" + }, + ":womans_hat:": { + "category": "people", + "name": "womans hat", + "unicode": "1f452" + }, + ":womens:": { + "category": "symbols", + "name": "womens symbol", + "unicode": "1f6ba" + }, + ":worried:": { + "category": "people", + "name": "worried face", + "unicode": "1f61f" + }, + ":wrench:": { + "category": "objects", + "name": "wrench", + "unicode": "1f527" + }, + ":wrestlers:": { + "category": "activity", + "name": "wrestlers", + "unicode": "1f93c" + }, + ":wrestlers_tone1:": { + "category": "activity", + "name": "wrestlers tone 1", + "unicode": "1f93c-1f3fb" + }, + ":wrestlers_tone2:": { + "category": "activity", + "name": "wrestlers tone 2", + "unicode": "1f93c-1f3fc" + }, + ":wrestlers_tone3:": { + "category": "activity", + "name": "wrestlers tone 3", + "unicode": "1f93c-1f3fd" + }, + ":wrestlers_tone4:": { + "category": "activity", + "name": "wrestlers tone 4", + "unicode": "1f93c-1f3fe" + }, + ":wrestlers_tone5:": { + "category": "activity", + "name": "wrestlers tone 5", + "unicode": "1f93c-1f3ff" + }, + ":writing_hand:": { + "category": "people", + "name": "writing hand", + "unicode": "270d", + "unicode_alt": "270d-fe0f" + }, + ":writing_hand_tone1:": { + "category": "people", + "name": "writing hand tone 1", + "unicode": "270d-1f3fb" + }, + ":writing_hand_tone2:": { + "category": "people", + "name": "writing hand tone 2", + "unicode": "270d-1f3fc" + }, + ":writing_hand_tone3:": { + "category": "people", + "name": "writing hand tone 3", + "unicode": "270d-1f3fd" + }, + ":writing_hand_tone4:": { + "category": "people", + "name": "writing hand tone 4", + "unicode": "270d-1f3fe" + }, + ":writing_hand_tone5:": { + "category": "people", + "name": "writing hand tone 5", + "unicode": "270d-1f3ff" + }, + ":x:": { + "category": "symbols", + "name": "cross mark", + "unicode": "274c" + }, + ":yellow_heart:": { + "category": "symbols", + "name": "yellow heart", + "unicode": "1f49b" + }, + ":yen:": { + "category": "objects", + "name": "banknote with yen sign", + "unicode": "1f4b4" + }, + ":yin_yang:": { + "category": "symbols", + "name": "yin yang", + "unicode": "262f", + "unicode_alt": "262f-fe0f" + }, + ":yum:": { + "category": "people", + "name": "face savouring delicious food", + "unicode": "1f60b" + }, + ":zap:": { + "category": "nature", + "name": "high voltage sign", + "unicode": "26a1", + "unicode_alt": "26a1-fe0f" + }, + ":zero:": { + "category": "symbols", + "name": "keycap digit zero", + "unicode": "0030-20e3", + "unicode_alt": "0030-fe0f-20e3" + }, + ":zipper_mouth:": { + "category": "people", + "name": "zipper-mouth face", + "unicode": "1f910" + }, + ":zzz:": { + "category": "people", + "name": "sleeping symbol", + "unicode": "1f4a4" + } +} +aliases = { + ":+1:": ":thumbsup:", + ":+1_tone1:": ":thumbsup_tone1:", + ":+1_tone2:": ":thumbsup_tone2:", + ":+1_tone3:": ":thumbsup_tone3:", + ":+1_tone4:": ":thumbsup_tone4:", + ":+1_tone5:": ":thumbsup_tone5:", + ":-1:": ":thumbsdown:", + ":-1_tone1:": ":thumbsdown_tone1:", + ":-1_tone2:": ":thumbsdown_tone2:", + ":-1_tone3:": ":thumbsdown_tone3:", + ":-1_tone4:": ":thumbsdown_tone4:", + ":-1_tone5:": ":thumbsdown_tone5:", + ":ac:": ":flag_ac:", + ":ad:": ":flag_ad:", + ":admission_tickets:": ":tickets:", + ":ae:": ":flag_ae:", + ":af:": ":flag_af:", + ":ag:": ":flag_ag:", + ":ai:": ":flag_ai:", + ":al:": ":flag_al:", + ":am:": ":flag_am:", + ":ao:": ":flag_ao:", + ":aq:": ":flag_aq:", + ":ar:": ":flag_ar:", + ":archery:": ":bow_and_arrow:", + ":as:": ":flag_as:", + ":at:": ":flag_at:", + ":atom_symbol:": ":atom:", + ":au:": ":flag_au:", + ":aw:": ":flag_aw:", + ":ax:": ":flag_ax:", + ":az:": ":flag_az:", + ":ba:": ":flag_ba:", + ":back_of_hand:": ":raised_back_of_hand:", + ":back_of_hand_tone1:": ":raised_back_of_hand_tone1:", + ":back_of_hand_tone2:": ":raised_back_of_hand_tone2:", + ":back_of_hand_tone3:": ":raised_back_of_hand_tone3:", + ":back_of_hand_tone4:": ":raised_back_of_hand_tone4:", + ":back_of_hand_tone5:": ":raised_back_of_hand_tone5:", + ":baguette_bread:": ":french_bread:", + ":ballot_box_with_ballot:": ":ballot_box:", + ":bb:": ":flag_bb:", + ":bd:": ":flag_bd:", + ":be:": ":flag_be:", + ":beach_with_umbrella:": ":beach:", + ":bellhop_bell:": ":bellhop:", + ":bf:": ":flag_bf:", + ":bg:": ":flag_bg:", + ":bh:": ":flag_bh:", + ":bi:": ":flag_bi:", + ":biohazard_sign:": ":biohazard:", + ":bj:": ":flag_bj:", + ":bl:": ":flag_bl:", + ":bm:": ":flag_bm:", + ":bn:": ":flag_bn:", + ":bo:": ":flag_bo:", + ":bottle_with_popping_cork:": ":champagne:", + ":boxing_gloves:": ":boxing_glove:", + ":bq:": ":flag_bq:", + ":br:": ":flag_br:", + ":bs:": ":flag_bs:", + ":bt:": ":flag_bt:", + ":building_construction:": ":construction_site:", + ":bv:": ":flag_bv:", + ":bw:": ":flag_bw:", + ":by:": ":flag_by:", + ":bz:": ":flag_bz:", + ":ca:": ":flag_ca:", + ":call_me_hand:": ":call_me:", + ":call_me_hand_tone1:": ":call_me_tone1:", + ":call_me_hand_tone2:": ":call_me_tone2:", + ":call_me_hand_tone3:": ":call_me_tone3:", + ":call_me_hand_tone4:": ":call_me_tone4:", + ":call_me_hand_tone5:": ":call_me_tone5:", + ":card_file_box:": ":card_box:", + ":card_index_dividers:": ":dividers:", + ":cc:": ":flag_cc:", + ":cf:": ":flag_cf:", + ":cg:": ":flag_cg:", + ":ch:": ":flag_ch:", + ":cheese_wedge:": ":cheese:", + ":chile:": ":flag_cl:", + ":ci:": ":flag_ci:", + ":city_sunrise:": ":city_sunset:", + ":ck:": ":flag_ck:", + ":clinking_glass:": ":champagne_glass:", + ":cloud_with_lightning:": ":cloud_lightning:", + ":cloud_with_rain:": ":cloud_rain:", + ":cloud_with_snow:": ":cloud_snow:", + ":cloud_with_tornado:": ":cloud_tornado:", + ":clown_face:": ":clown:", + ":cm:": ":flag_cm:", + ":cn:": ":flag_cn:", + ":co:": ":flag_co:", + ":congo:": ":flag_cd:", + ":couch_and_lamp:": ":couch:", + ":couple_with_heart_mm:": ":couple_mm:", + ":couple_with_heart_ww:": ":couple_ww:", + ":couplekiss_mm:": ":kiss_mm:", + ":couplekiss_ww:": ":kiss_ww:", + ":cp:": ":flag_cp:", + ":cr:": ":flag_cr:", + ":cricket_bat_ball:": ":cricket:", + ":cu:": ":flag_cu:", + ":cv:": ":flag_cv:", + ":cw:": ":flag_cw:", + ":cx:": ":flag_cx:", + ":cy:": ":flag_cy:", + ":cz:": ":flag_cz:", + ":dagger_knife:": ":dagger:", + ":de:": ":flag_de:", + ":derelict_house_building:": ":house_abandoned:", + ":desert_island:": ":island:", + ":desktop_computer:": ":desktop:", + ":dg:": ":flag_dg:", + ":dj:": ":flag_dj:", + ":dk:": ":flag_dk:", + ":dm:": ":flag_dm:", + ":do:": ":flag_do:", + ":double_vertical_bar:": ":pause_button:", + ":dove_of_peace:": ":dove:", + ":drool:": ":drooling_face:", + ":drum_with_drumsticks:": ":drum:", + ":dz:": ":flag_dz:", + ":ea:": ":flag_ea:", + ":ec:": ":flag_ec:", + ":ee:": ":flag_ee:", + ":eg:": ":flag_eg:", + ":eh:": ":flag_eh:", + ":eject_symbol:": ":eject:", + ":email:": ":e-mail:", + ":er:": ":flag_er:", + ":es:": ":flag_es:", + ":et:": ":flag_et:", + ":eu:": ":flag_eu:", + ":expecting_woman:": ":pregnant_woman:", + ":expecting_woman_tone1:": ":pregnant_woman_tone1:", + ":expecting_woman_tone2:": ":pregnant_woman_tone2:", + ":expecting_woman_tone3:": ":pregnant_woman_tone3:", + ":expecting_woman_tone4:": ":pregnant_woman_tone4:", + ":expecting_woman_tone5:": ":pregnant_woman_tone5:", + ":face_with_cowboy_hat:": ":cowboy:", + ":face_with_head_bandage:": ":head_bandage:", + ":face_with_rolling_eyes:": ":rolling_eyes:", + ":face_with_thermometer:": ":thermometer_face:", + ":facepalm:": ":face_palm:", + ":facepalm_tone1:": ":face_palm_tone1:", + ":facepalm_tone2:": ":face_palm_tone2:", + ":facepalm_tone3:": ":face_palm_tone3:", + ":facepalm_tone4:": ":face_palm_tone4:", + ":facepalm_tone5:": ":face_palm_tone5:", + ":fencing:": ":fencer:", + ":fi:": ":flag_fi:", + ":film_projector:": ":projector:", + ":first_place_medal:": ":first_place:", + ":fj:": ":flag_fj:", + ":fk:": ":flag_fk:", + ":flame:": ":fire:", + ":flan:": ":custard:", + ":fm:": ":flag_fm:", + ":fo:": ":flag_fo:", + ":fork_and_knife_with_plate:": ":fork_knife_plate:", + ":fox_face:": ":fox:", + ":fr:": ":flag_fr:", + ":frame_with_picture:": ":frame_photo:", + ":funeral_urn:": ":urn:", + ":ga:": ":flag_ga:", + ":gay_pride_flag:": ":rainbow_flag:", + ":gb:": ":flag_gb:", + ":gd:": ":flag_gd:", + ":ge:": ":flag_ge:", + ":gf:": ":flag_gf:", + ":gg:": ":flag_gg:", + ":gh:": ":flag_gh:", + ":gi:": ":flag_gi:", + ":gl:": ":flag_gl:", + ":glass_of_milk:": ":milk:", + ":gm:": ":flag_gm:", + ":gn:": ":flag_gn:", + ":goal_net:": ":goal:", + ":gp:": ":flag_gp:", + ":gq:": ":flag_gq:", + ":gr:": ":flag_gr:", + ":grandma:": ":older_woman:", + ":grandma_tone1:": ":older_woman_tone1:", + ":grandma_tone2:": ":older_woman_tone2:", + ":grandma_tone3:": ":older_woman_tone3:", + ":grandma_tone4:": ":older_woman_tone4:", + ":grandma_tone5:": ":older_woman_tone5:", + ":green_salad:": ":salad:", + ":gs:": ":flag_gs:", + ":gt:": ":flag_gt:", + ":gu:": ":flag_gu:", + ":gw:": ":flag_gw:", + ":gy:": ":flag_gy:", + ":hammer_and_pick:": ":hammer_pick:", + ":hammer_and_wrench:": ":tools:", + ":hand_with_index_and_middle_finger_crossed:": ":fingers_crossed:", + ":hand_with_index_and_middle_fingers_crossed_tone1:": ":fingers_crossed_tone1:", + ":hand_with_index_and_middle_fingers_crossed_tone2:": ":fingers_crossed_tone2:", + ":hand_with_index_and_middle_fingers_crossed_tone3:": ":fingers_crossed_tone3:", + ":hand_with_index_and_middle_fingers_crossed_tone4:": ":fingers_crossed_tone4:", + ":hand_with_index_and_middle_fingers_crossed_tone5:": ":fingers_crossed_tone5:", + ":hankey:": ":poop:", + ":heavy_heart_exclamation_mark_ornament:": ":heart_exclamation:", + ":helmet_with_white_cross:": ":helmet_with_cross:", + ":hk:": ":flag_hk:", + ":hm:": ":flag_hm:", + ":hn:": ":flag_hn:", + ":hot_dog:": ":hotdog:", + ":house_buildings:": ":homes:", + ":hr:": ":flag_hr:", + ":ht:": ":flag_ht:", + ":hu:": ":flag_hu:", + ":hugging_face:": ":hugging:", + ":ic:": ":flag_ic:", + ":ie:": ":flag_ie:", + ":il:": ":flag_il:", + ":im:": ":flag_im:", + ":in:": ":flag_in:", + ":indonesia:": ":flag_id:", + ":io:": ":flag_io:", + ":iq:": ":flag_iq:", + ":ir:": ":flag_ir:", + ":is:": ":flag_is:", + ":it:": ":flag_it:", + ":je:": ":flag_je:", + ":jm:": ":flag_jm:", + ":jo:": ":flag_jo:", + ":jp:": ":flag_jp:", + ":juggler:": ":juggling:", + ":juggler_tone1:": ":juggling_tone1:", + ":juggler_tone2:": ":juggling_tone2:", + ":juggler_tone3:": ":juggling_tone3:", + ":juggler_tone4:": ":juggling_tone4:", + ":juggler_tone5:": ":juggling_tone5:", + ":karate_uniform:": ":martial_arts_uniform:", + ":kayak:": ":canoe:", + ":ke:": ":flag_ke:", + ":keycap_asterisk:": ":asterisk:", + ":kg:": ":flag_kg:", + ":kh:": ":flag_kh:", + ":ki:": ":flag_ki:", + ":kiwifruit:": ":kiwi:", + ":km:": ":flag_km:", + ":kn:": ":flag_kn:", + ":kp:": ":flag_kp:", + ":kr:": ":flag_kr:", + ":kw:": ":flag_kw:", + ":ky:": ":flag_ky:", + ":kz:": ":flag_kz:", + ":la:": ":flag_la:", + ":latin_cross:": ":cross:", + ":lb:": ":flag_lb:", + ":lc:": ":flag_lc:", + ":left_fist:": ":left_facing_fist:", + ":left_fist_tone1:": ":left_facing_fist_tone1:", + ":left_fist_tone2:": ":left_facing_fist_tone2:", + ":left_fist_tone3:": ":left_facing_fist_tone3:", + ":left_fist_tone4:": ":left_facing_fist_tone4:", + ":left_fist_tone5:": ":left_facing_fist_tone5:", + ":left_speech_bubble:": ":speech_left:", + ":li:": ":flag_li:", + ":liar:": ":lying_face:", + ":linked_paperclips:": ":paperclips:", + ":lion:": ":lion_face:", + ":lk:": ":flag_lk:", + ":lower_left_ballpoint_pen:": ":pen_ballpoint:", + ":lower_left_crayon:": ":crayon:", + ":lower_left_fountain_pen:": ":pen_fountain:", + ":lower_left_paintbrush:": ":paintbrush:", + ":lr:": ":flag_lr:", + ":ls:": ":flag_ls:", + ":lt:": ":flag_lt:", + ":lu:": ":flag_lu:", + ":lv:": ":flag_lv:", + ":ly:": ":flag_ly:", + ":ma:": ":flag_ma:", + ":male_dancer:": ":man_dancing:", + ":male_dancer_tone1:": ":man_dancing_tone1:", + ":male_dancer_tone2:": ":man_dancing_tone2:", + ":male_dancer_tone3:": ":man_dancing_tone3:", + ":male_dancer_tone4:": ":man_dancing_tone4:", + ":male_dancer_tone5:": ":man_dancing_tone5:", + ":man_in_business_suit_levitating:": ":levitate:", + ":mantlepiece_clock:": ":clock:", + ":mc:": ":flag_mc:", + ":md:": ":flag_md:", + ":me:": ":flag_me:", + ":mf:": ":flag_mf:", + ":mg:": ":flag_mg:", + ":mh:": ":flag_mh:", + ":mk:": ":flag_mk:", + ":ml:": ":flag_ml:", + ":mm:": ":flag_mm:", + ":mn:": ":flag_mn:", + ":mo:": ":flag_mo:", + ":money_mouth_face:": ":money_mouth:", + ":mother_christmas:": ":mrs_claus:", + ":mother_christmas_tone1:": ":mrs_claus_tone1:", + ":mother_christmas_tone2:": ":mrs_claus_tone2:", + ":mother_christmas_tone3:": ":mrs_claus_tone3:", + ":mother_christmas_tone4:": ":mrs_claus_tone4:", + ":mother_christmas_tone5:": ":mrs_claus_tone5:", + ":motorbike:": ":motor_scooter:", + ":mp:": ":flag_mp:", + ":mq:": ":flag_mq:", + ":mr:": ":flag_mr:", + ":ms:": ":flag_ms:", + ":mt:": ":flag_mt:", + ":mu:": ":flag_mu:", + ":mv:": ":flag_mv:", + ":mw:": ":flag_mw:", + ":mx:": ":flag_mx:", + ":my:": ":flag_my:", + ":mz:": ":flag_mz:", + ":na:": ":flag_na:", + ":national_park:": ":park:", + ":nc:": ":flag_nc:", + ":ne:": ":flag_ne:", + ":nerd_face:": ":nerd:", + ":next_track:": ":track_next:", + ":nf:": ":flag_nf:", + ":ni:": ":flag_ni:", + ":nigeria:": ":flag_ng:", + ":nl:": ":flag_nl:", + ":no:": ":flag_no:", + ":np:": ":flag_np:", + ":nr:": ":flag_nr:", + ":nu:": ":flag_nu:", + ":nz:": ":flag_nz:", + ":oil_drum:": ":oil:", + ":old_key:": ":key2:", + ":om:": ":flag_om:", + ":pa:": ":flag_pa:", + ":paella:": ":shallow_pan_of_food:", + ":passenger_ship:": ":cruise_ship:", + ":paw_prints:": ":feet:", + ":pe:": ":flag_pe:", + ":peace_symbol:": ":peace:", + ":person_doing_cartwheel:": ":cartwheel:", + ":person_doing_cartwheel_tone1:": ":cartwheel_tone1:", + ":person_doing_cartwheel_tone2:": ":cartwheel_tone2:", + ":person_doing_cartwheel_tone3:": ":cartwheel_tone3:", + ":person_doing_cartwheel_tone4:": ":cartwheel_tone4:", + ":person_doing_cartwheel_tone5:": ":cartwheel_tone5:", + ":person_with_ball:": ":basketball_player:", + ":person_with_ball_tone1:": ":basketball_player_tone1:", + ":person_with_ball_tone2:": ":basketball_player_tone2:", + ":person_with_ball_tone3:": ":basketball_player_tone3:", + ":person_with_ball_tone4:": ":basketball_player_tone4:", + ":person_with_ball_tone5:": ":basketball_player_tone5:", + ":pf:": ":flag_pf:", + ":pg:": ":flag_pg:", + ":ph:": ":flag_ph:", + ":pk:": ":flag_pk:", + ":pl:": ":flag_pl:", + ":pm:": ":flag_pm:", + ":pn:": ":flag_pn:", + ":poo:": ":poop:", + ":pr:": ":flag_pr:", + ":previous_track:": ":track_previous:", + ":ps:": ":flag_ps:", + ":pt:": ":flag_pt:", + ":pudding:": ":custard:", + ":pw:": ":flag_pw:", + ":py:": ":flag_py:", + ":qa:": ":flag_qa:", + ":racing_car:": ":race_car:", + ":racing_motorcycle:": ":motorcycle:", + ":radioactive_sign:": ":radioactive:", + ":railroad_track:": ":railway_track:", + ":raised_hand_with_fingers_splayed:": ":hand_splayed:", + ":raised_hand_with_fingers_splayed_tone1:": ":hand_splayed_tone1:", + ":raised_hand_with_fingers_splayed_tone2:": ":hand_splayed_tone2:", + ":raised_hand_with_fingers_splayed_tone3:": ":hand_splayed_tone3:", + ":raised_hand_with_fingers_splayed_tone4:": ":hand_splayed_tone4:", + ":raised_hand_with_fingers_splayed_tone5:": ":hand_splayed_tone5:", + ":raised_hand_with_part_between_middle_and_ring_fingers:": ":vulcan:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone1:": ":vulcan_tone1:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone2:": ":vulcan_tone2:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone3:": ":vulcan_tone3:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone4:": ":vulcan_tone4:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone5:": ":vulcan_tone5:", + ":re:": ":flag_re:", + ":reversed_hand_with_middle_finger_extended:": ":middle_finger:", + ":reversed_hand_with_middle_finger_extended_tone1:": ":middle_finger_tone1:", + ":reversed_hand_with_middle_finger_extended_tone2:": ":middle_finger_tone2:", + ":reversed_hand_with_middle_finger_extended_tone3:": ":middle_finger_tone3:", + ":reversed_hand_with_middle_finger_extended_tone4:": ":middle_finger_tone4:", + ":reversed_hand_with_middle_finger_extended_tone5:": ":middle_finger_tone5:", + ":rhinoceros:": ":rhino:", + ":right_anger_bubble:": ":anger_right:", + ":right_fist:": ":right_facing_fist:", + ":right_fist_tone1:": ":right_facing_fist_tone1:", + ":right_fist_tone2:": ":right_facing_fist_tone2:", + ":right_fist_tone3:": ":right_facing_fist_tone3:", + ":right_fist_tone4:": ":right_facing_fist_tone4:", + ":right_fist_tone5:": ":right_facing_fist_tone5:", + ":ro:": ":flag_ro:", + ":robot_face:": ":robot:", + ":rolled_up_newspaper:": ":newspaper2:", + ":rolling_on_the_floor_laughing:": ":rofl:", + ":rs:": ":flag_rs:", + ":ru:": ":flag_ru:", + ":rw:": ":flag_rw:", + ":satisfied:": ":laughing:", + ":saudi:": ":flag_sa:", + ":saudiarabia:": ":flag_sa:", + ":sb:": ":flag_sb:", + ":sc:": ":flag_sc:", + ":sd:": ":flag_sd:", + ":se:": ":flag_se:", + ":second_place_medal:": ":second_place:", + ":sg:": ":flag_sg:", + ":sh:": ":flag_sh:", + ":shaking_hands:": ":handshake:", + ":shaking_hands_tone1:": ":handshake_tone1:", + ":shaking_hands_tone2:": ":handshake_tone2:", + ":shaking_hands_tone3:": ":handshake_tone3:", + ":shaking_hands_tone4:": ":handshake_tone4:", + ":shaking_hands_tone5:": ":handshake_tone5:", + ":shelled_peanut:": ":peanuts:", + ":shit:": ":poop:", + ":shopping_trolley:": ":shopping_cart:", + ":si:": ":flag_si:", + ":sick:": ":nauseated_face:", + ":sign_of_the_horns:": ":metal:", + ":sign_of_the_horns_tone1:": ":metal_tone1:", + ":sign_of_the_horns_tone2:": ":metal_tone2:", + ":sign_of_the_horns_tone3:": ":metal_tone3:", + ":sign_of_the_horns_tone4:": ":metal_tone4:", + ":sign_of_the_horns_tone5:": ":metal_tone5:", + ":sj:": ":flag_sj:", + ":sk:": ":flag_sk:", + ":skeleton:": ":skull:", + ":skull_and_crossbones:": ":skull_crossbones:", + ":sl:": ":flag_sl:", + ":sleuth_or_spy:": ":spy:", + ":sleuth_or_spy_tone1:": ":spy_tone1:", + ":sleuth_or_spy_tone2:": ":spy_tone2:", + ":sleuth_or_spy_tone3:": ":spy_tone3:", + ":sleuth_or_spy_tone4:": ":spy_tone4:", + ":sleuth_or_spy_tone5:": ":spy_tone5:", + ":slightly_frowning_face:": ":slight_frown:", + ":slightly_smiling_face:": ":slight_smile:", + ":sm:": ":flag_sm:", + ":small_airplane:": ":airplane_small:", + ":sn:": ":flag_sn:", + ":sneeze:": ":sneezing_face:", + ":snow_capped_mountain:": ":mountain_snow:", + ":so:": ":flag_so:", + ":speaking_head_in_silhouette:": ":speaking_head:", + ":spiral_calendar_pad:": ":calendar_spiral:", + ":spiral_note_pad:": ":notepad_spiral:", + ":sports_medal:": ":medal:", + ":sr:": ":flag_sr:", + ":ss:": ":flag_ss:", + ":st:": ":flag_st:", + ":stop_sign:": ":octagonal_sign:", + ":studio_microphone:": ":microphone2:", + ":stuffed_pita:": ":stuffed_flatbread:", + ":sv:": ":flag_sv:", + ":sx:": ":flag_sx:", + ":sy:": ":flag_sy:", + ":sz:": ":flag_sz:", + ":ta:": ":flag_ta:", + ":table_tennis:": ":ping_pong:", + ":tc:": ":flag_tc:", + ":td:": ":flag_td:", + ":tf:": ":flag_tf:", + ":tg:": ":flag_tg:", + ":th:": ":flag_th:", + ":thinking_face:": ":thinking:", + ":third_place_medal:": ":third_place:", + ":three_button_mouse:": ":mouse_three_button:", + ":thumbdown:": ":thumbsdown:", + ":thumbdown_tone1:": ":thumbsdown_tone1:", + ":thumbdown_tone2:": ":thumbsdown_tone2:", + ":thumbdown_tone3:": ":thumbsdown_tone3:", + ":thumbdown_tone4:": ":thumbsdown_tone4:", + ":thumbdown_tone5:": ":thumbsdown_tone5:", + ":thumbup:": ":thumbsup:", + ":thumbup_tone1:": ":thumbsup_tone1:", + ":thumbup_tone2:": ":thumbsup_tone2:", + ":thumbup_tone3:": ":thumbsup_tone3:", + ":thumbup_tone4:": ":thumbsup_tone4:", + ":thumbup_tone5:": ":thumbsup_tone5:", + ":thunder_cloud_and_rain:": ":thunder_cloud_rain:", + ":timer_clock:": ":timer:", + ":tj:": ":flag_tj:", + ":tk:": ":flag_tk:", + ":tl:": ":flag_tl:", + ":tn:": ":flag_tn:", + ":to:": ":flag_to:", + ":tr:": ":flag_tr:", + ":tt:": ":flag_tt:", + ":turkmenistan:": ":flag_tm:", + ":tuvalu:": ":flag_tv:", + ":tuxedo_tone1:": ":man_in_tuxedo_tone1:", + ":tuxedo_tone2:": ":man_in_tuxedo_tone2:", + ":tuxedo_tone3:": ":man_in_tuxedo_tone3:", + ":tuxedo_tone4:": ":man_in_tuxedo_tone4:", + ":tuxedo_tone5:": ":man_in_tuxedo_tone5:", + ":tw:": ":flag_tw:", + ":tz:": ":flag_tz:", + ":ua:": ":flag_ua:", + ":ug:": ":flag_ug:", + ":um:": ":flag_um:", + ":umbrella_on_ground:": ":beach_umbrella:", + ":unicorn_face:": ":unicorn:", + ":upside_down_face:": ":upside_down:", + ":us:": ":flag_us:", + ":uy:": ":flag_uy:", + ":uz:": ":flag_uz:", + ":va:": ":flag_va:", + ":vc:": ":flag_vc:", + ":ve:": ":flag_ve:", + ":vg:": ":flag_vg:", + ":vi:": ":flag_vi:", + ":vn:": ":flag_vn:", + ":vu:": ":flag_vu:", + ":waving_black_flag:": ":flag_black:", + ":waving_white_flag:": ":flag_white:", + ":weight_lifter:": ":lifter:", + ":weight_lifter_tone1:": ":lifter_tone1:", + ":weight_lifter_tone2:": ":lifter_tone2:", + ":weight_lifter_tone3:": ":lifter_tone3:", + ":weight_lifter_tone4:": ":lifter_tone4:", + ":weight_lifter_tone5:": ":lifter_tone5:", + ":wf:": ":flag_wf:", + ":whisky:": ":tumbler_glass:", + ":white_frowning_face:": ":frowning2:", + ":white_sun_behind_cloud:": ":white_sun_cloud:", + ":white_sun_behind_cloud_with_rain:": ":white_sun_rain_cloud:", + ":white_sun_with_small_cloud:": ":white_sun_small_cloud:", + ":wilted_flower:": ":wilted_rose:", + ":world_map:": ":map:", + ":worship_symbol:": ":place_of_worship:", + ":wrestling:": ":wrestlers:", + ":wrestling_tone1:": ":wrestlers_tone1:", + ":wrestling_tone2:": ":wrestlers_tone2:", + ":wrestling_tone3:": ":wrestlers_tone3:", + ":wrestling_tone4:": ":wrestlers_tone4:", + ":wrestling_tone5:": ":wrestlers_tone5:", + ":ws:": ":flag_ws:", + ":xk:": ":flag_xk:", + ":ye:": ":flag_ye:", + ":yt:": ":flag_yt:", + ":za:": ":flag_za:", + ":zipper_mouth_face:": ":zipper_mouth:", + ":zm:": ":flag_zm:", + ":zw:": ":flag_zw:" +} diff --git a/micromamba_root/Lib/site-packages/pymdownx/escapeall.py b/micromamba_root/Lib/site-packages/pymdownx/escapeall.py new file mode 100644 index 0000000000000000000000000000000000000000..19bb5a7f60cd9536db8356eede204033c397f186 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/escapeall.py @@ -0,0 +1,104 @@ +""" +EscapeAll. + +pymdownx.escapeall +Escape everything. + +MIT license. + +Copyright (c) 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.inlinepatterns import InlineProcessor, SubstituteTagInlineProcessor +from markdown import util as md_util +from . import util + +# We need to ignore these as they are used in Markdown processing +STX = '\u0002' +ETX = '\u0003' +ESCAPE_RE = r'\\(.)' +ESCAPE_NO_NL_RE = r'\\([^\n])' +HARDBREAK_RE = r'\\\n' + + +class EscapeAllPattern(InlineProcessor): + """Return an escaped character.""" + + def __init__(self, pattern, nbsp, md): + """Initialize.""" + + self.nbsp = nbsp + InlineProcessor.__init__(self, pattern, md) + + def handleMatch(self, m, data): + """Convert the char to an escaped character.""" + + char = m.group(1) + if char in ('<', '>', '&'): + if char == '<': + char = '<' + elif char == '>': + char = '>' + elif char == '&': + char = '&' + escape = self.md.htmlStash.store(char) + elif self.nbsp and char == ' ': + escape = self.md.htmlStash.store(' ') + elif char in (STX, ETX): + escape = char + else: + escape = '{}{}{}'.format(md_util.STX, util.get_ord(char), md_util.ETX) + return escape, m.start(0), m.end(0) + + +class EscapeAllExtension(Extension): + """Extension that allows you to escape everything.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'hardbreak': [ + False, + "Turn escaped newlines to hardbreaks - Default: False" + ], + 'nbsp': [ + False, + "Turn escaped spaces to non-breaking spaces - Default: False" + ] + } + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Escape all.""" + + config = self.getConfigs() + hardbreak = config['hardbreak'] + md.inlinePatterns.register( + EscapeAllPattern(ESCAPE_NO_NL_RE if hardbreak else ESCAPE_RE, config['nbsp'], md), + "escape", + 180 + ) + + if config['hardbreak']: + md.inlinePatterns.register(SubstituteTagInlineProcessor(HARDBREAK_RE, 'br'), "hardbreak", 5.1) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return EscapeAllExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/extra.py b/micromamba_root/Lib/site-packages/pymdownx/extra.py new file mode 100644 index 0000000000000000000000000000000000000000..2fdabe5784fb85fb5af3ac441f079c7fa57a592c --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/extra.py @@ -0,0 +1,65 @@ +""" +Extra. + +pymdown.extra +A wrapper that emulate PHP Markdown Extra. +Re-packages Python Markdowns 'extra' extensions, +but substitutes a few extensions with PyMdown extensions: + +- fenced_code --> superfences +- smartstrong --> betterem + +MIT license. + +Copyright (c) 2015 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension + +extra_extensions = [ + 'pymdownx.betterem', + 'pymdownx.superfences', + 'markdown.extensions.footnotes', + 'markdown.extensions.attr_list', + 'markdown.extensions.def_list', + 'markdown.extensions.tables', + 'markdown.extensions.abbr', + 'markdown.extensions.md_in_html' +] + +extra_extension_configs = {} + + +class ExtraExtension(Extension): + """Add various extensions to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = kwargs.pop('configs', {}) + self.config.update(extra_extension_configs) + self.config.update(kwargs) + + def extendMarkdown(self, md): + """Register extension instances.""" + + md.registerExtensions(extra_extensions, self.config) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return ExtraExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/fancylists.py b/micromamba_root/Lib/site-packages/pymdownx/fancylists.py new file mode 100644 index 0000000000000000000000000000000000000000..88cafe15086ebb88c7e704fbf46e2e105a7715bd --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/fancylists.py @@ -0,0 +1,535 @@ +""" +Fancy lists in the style of Pandoc. + +--- +# A Python implementation of John Gruber's Markdown. + +# Started by Manfred Stienstra (http://www.dwerg.net/). +# Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). +# Currently maintained by Waylan Limberg (https://github.com/waylan), +# Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). + +# Copyright 2007-2023 The Python Markdown Project (v. 1.7 and later) +# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) +# Copyright 2004 Manfred Stienstra (the original version) + +# License: BSD (see LICENSE.md for details). +--- + +Adapted to support "fancy" behavior by Copyright 2024 Isaac Muse. + +Work in progress, not fully tested. +""" +from markdown.blockprocessors import BlockProcessor +from markdown.treeprocessors import Treeprocessor +from .blocks.block import Block +from .blocks import BlocksExtension +import xml.etree.ElementTree as etree +import re + +ROMAN_MAP = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} + +OL_STYLE = { + '1': 'decimal', + 'a': 'lower-alpha', + 'A': 'upper-alpha', + 'i': 'lower-roman', + 'I': 'upper-roman' +} + + +def roman2int(s): + """ + Convert Roman numeral to integer. + + Values should be validated before as no validation during conversion. + """ + + s = s.upper() + + # Initialize result + total = 0 + i = 0 + while i < len(s): + # Current index is less than the next, subtract current from next and sum value + if i + 1 < len(s) and ROMAN_MAP[s[i]] < ROMAN_MAP[s[i + 1]]: + total += ROMAN_MAP[s[i + 1]] - ROMAN_MAP[s[i]] + i += 2 + # Sum the value + else: + total += ROMAN_MAP[s[i]] + i += 1 + + return total + + +class FancyOListProcessor(BlockProcessor): + """Process fancy ordered list blocks.""" + + TAG = 'ol' + SIBLING_TAGS = ['ol'] + OL_TYPES = { + 'dot-decimal': '1', + 'paren-decimal': '1', + 'dot-roman': 'i', + 'paren-roman': 'i', + 'dot-ROMAN': 'I', + 'paren-ROMAN': 'I', + 'dot-alpha': 'a', + 'paren-alpha': 'a', + 'dot-ALPHA': 'A', + 'paren-ALPHA': 'A' + } + + def __init__(self, parser, config): + """Initialize.""" + + super().__init__(parser) + + list_types = config['additional_ordered_styles'] + self.alpha_enabled = 'alpha' in list_types + self.roman_enabled = 'roman' in list_types + self.inject_style = config['inject_style'] + self.inject_class = config['inject_class'] + + formats = '' + + if 'generic' in list_types: + formats += r'| \#' + + if 'roman' in list_types: + # Rules are similar to https://projecteuler.net/about=roman_numerals + # We do not follow the "rule of 3": repeated values should not occur more than 3 times. + # The above link suggests that repeats should be restricted such that lower denominations + # do not equal or exceed X, C or M. We alter this to allow equaling to help mitigate + # conflicts with alphabetical lists. + formats += r''' + | (?=[IVXLCDM]{2}) + M* + (?:C[MD]|D(?:C{0,4}|C{5}\b)|(?:C{0,9}|C{10}\b)) + (?:X[CL]|L(?:X{0,4}|X{5}\b)|(?:X{0,9}|X{10}\b)) + (?:I[XV]|V(?:I{0,4}|I{5}\b)|(?:I{0,9}|I{10}\b)) + | (?=[ivxlcdm]) + m* + (?:c[md]|d(?:c{0,4}|c{5}\b)|(?:c{0,9}|c{10}\b)) + (?:x[cl]|l(?:x{0,4}|x{5}\b)|(?:x{0,9}|x{10}\b)) + (?:i[xv]|v(?:i{0,4}|i{5}\b)|(?:i{0,9}|i{10}\b)) + ''' + + if 'alpha' not in list_types: + formats += r''' + | [IVXLCDM](?=\)|\.[ ]{2}) + ''' + + if 'alpha' in list_types: + formats += r''' + | [a-z] + | [A-Z](?=\)|\.[ ]{2}) + ''' + + # Detect an item list item. + self.list_re = re.compile( + r'^[ ]{0,%d}(?:(?:\d+%s)[).])[ ]+(.*)' % (self.tab_length - 1, formats), + re.VERBOSE + ) + + # Detect items on secondary lines which can be of any list type. + self.child_re = re.compile( + r'^[ ]{0,%d}((?:(?:\d+%s)[).]|[-*+]))[ ]+(.*)' % (self.tab_length - 1, formats), + re.VERBOSE + ) + + # Detect indented (nested) list items of any type. + self.indent_re = re.compile( + r'^[ ]{%d,%d}(?:(?:\d+%s)[).]|[-*+])[ ]+.*' % (self.tab_length, self.tab_length * 2 - 1, formats), + re.VERBOSE + ) + + self.startswith = "1" + + def test(self, parent, block): + """Test to see if block starts with a list.""" + + return bool(self.list_re.match(block)) + + def run(self, parent, blocks): + """Process list items.""" + + sibling = self.lastChild(parent) + + # Check for multiple items in one block and get the ordered list fancy type. + items, fancy_type = self.get_items(sibling, blocks.pop(0), blocks) + + # Append list items that are under the sibling list if the list type matches + if ( + sibling is not None and sibling.tag in self.SIBLING_TAGS and + sibling.attrib.get('__fancylist', '') == fancy_type + ): + # Previous block was a list item, so set that as parent + lst = sibling + + # Make sure previous item is in a `p` - if the item has text, + # then it isn't in a `p`. + if lst[-1].text: + # Since it's possible there are other children for this + # sibling, we can't just `SubElement` the `p`, we need to + # insert it as the first item. + p = etree.Element('p') + p.text = lst[-1].text + lst[-1].text = '' + lst[-1].insert(0, p) + + # If the last item has a tail, then the tail needs to be put in a `p` + # likely only when a header is not followed by a blank line. + lch = self.lastChild(lst[-1]) + if lch is not None and lch.tail: + p = etree.SubElement(lst[-1], 'p') + p.text = lch.tail.lstrip() + lch.tail = '' + + # Parse first block differently as it gets wrapped in a `p`. + li = etree.SubElement(lst, 'li') + self.parser.state.set('looselist') + firstitem = items.pop(0) + self.parser.parseBlocks(li, [firstitem]) + self.parser.state.reset() + + # This catches the edge case of a multi-item indented list whose + # first item is in a blank parent-list item: + # ``` + # * * subitem1 + # * subitem2 + # ``` + # see also `ListIndentProcessor` + elif parent.tag in ['ol', 'ul']: + lst = parent + + # This is a new, unique list so create parent with appropriate tag. + else: + if self.TAG == 'ol': + # Correct the metadata of a forced list to now represent the actual content + if sibling is not None and sibling.attrib.get('__fancylist', '').startswith('force'): + sibling.attrib['__fancylist'] = fancy_type + lst = sibling + else: + attrib = {'type': self.OL_TYPES[fancy_type], '__fancylist': fancy_type} + if self.inject_style: + attrib['style'] = f"list-style-type: {OL_STYLE[attrib['type']]};" + if self.inject_class: + attrib['class'] = f"fancylists-{OL_STYLE[attrib['type']]}" + lst = etree.SubElement( + parent, + self.TAG, + attrib + ) + else: + lst = etree.SubElement(parent, self.TAG) + + # Check if a custom start integer is set + if self.startswith != '1' and not lst.attrib.get('start', ''): + lst.attrib['start'] = self.startswith + + # Set the parse set to list + self.parser.state.set('list') + + # Loop through items in block, recursively parsing each with the appropriate parent. + for item in items: + # Item is indented. Parse with last item as parent + if item.startswith(' '*self.tab_length): + self.parser.parseBlocks(lst[-1], [item]) + # New item. Create `li` and parse with it as parent + else: + li = etree.SubElement(lst, 'li') + self.parser.parseBlocks(li, [item]) + + # Reset the parse state + self.parser.state.reset() + + def get_start(self, fancy_type, m): + """Translate list convention into a logical start.""" + + # Generic marker + if m.group(1).startswith('#'): + return '1' + + t = fancy_type.split('-')[1].lower() + if t == 'decimal': + return m.group(1)[:-1].lstrip('(') + elif t == 'roman': + return str(roman2int(m.group(1)[:-1])) + elif t == 'alpha': + return str(ord(m.group(1)[:-1].upper()) - 64) + + def get_fancy_type(self, m, first, fancy_type): + """Get the fancy type for a given list item.""" + + value = m.group(1)[:-1] + sep = m.group(1)[-1] + list_type = '' + + # Determine list type convention: _., _), (_) + if sep == '.': + list_type += 'dot-' + elif sep == ')': + list_type += 'paren-' + else: + return list_type, fancy_type + + # The first item will be forced to assume the sibling list's type + if fancy_type.startswith('force'): + ltype = fancy_type.split('-', 1)[1] + # Make sure we aren't forcing an impossible scenario. + # If everything looks sound, return the types + if value == '#' or ( + (ltype.lower() == 'decimal' and value.isdigit()) or + ( + ltype.lower() == 'roman' and + self.roman_enabled and + value.isalpha() and + (len(value) > 2 or value.lower() in 'ivxlcdm') + ) or + (ltype.lower() == 'alpha' and self.alpha_enabled and len(value) == 1 and value.isalpha()) + ): + fancy_type = list_type + fancy_type.split('-', 1)[1] if list_type else list_type + return fancy_type, fancy_type + + # Ignore the force as it cannot be done + fancy_type = '' + + # Determine numbering: numerical, roman numerical, alphabetic, or `#` numerical placeholder. + if value == '#': + list_type += fancy_type.split('-', 1)[1] if fancy_type else 'decimal' + elif value.isdigit(): + list_type += 'decimal' + elif len(value) == 1 and value.isalpha(): + if value.islower(): + in_roman = value in 'ivxlcdm' + if ( + self.alpha_enabled and ( + not self.roman_enabled or ( + first and (not in_roman or ((list_type + 'roman') != fancy_type and value != 'i')) + ) + ) + ): + list_type += 'alpha' + elif self.alpha_enabled and not first and ((list_type + 'alpha') == fancy_type or not in_roman): + list_type += 'alpha' + else: + list_type += 'roman' + elif value.isupper(): + in_roman = value in 'IVXLCDM' + if ( + self.alpha_enabled and ( + not self.roman_enabled or ( + first and (not in_roman or ((list_type + 'ROMAN') != fancy_type and value != 'I')) + ) + ) + ): + list_type += 'ALPHA' + elif self.alpha_enabled and not first and ((list_type + 'ALPHA') == fancy_type or not in_roman): + list_type += 'ALPHA' + else: + list_type += 'ROMAN' + elif value.isupper(): + list_type += 'ROMAN' + elif value.islower(): + list_type += 'roman' + + return list_type, fancy_type + + def get_items(self, sibling, block, blocks): + """Break a block into list items.""" + + # Get ordered list fancy type + fancy_type = '' + if self.TAG == 'ol': + if sibling is not None and sibling.tag in self.SIBLING_TAGS: + fancy_type = sibling.attrib.get('__fancylist', '') + fancy = fancy_type + + items = [] + rest = [] + for line in block.split('\n'): + + # We've found a list type that differs form the our current, + # so gather the rest to be processed separately. + if rest: + rest.append(line) + continue + + # Child list items + m = self.child_re.match(line) + if m: + # This is a new list item check first item for the start index. + # Also check for list items that differ from the first. + fancy, fancy_type = self.get_fancy_type(m, not items, fancy) + + # We found a different fancy type, so handle these separately + if items and fancy != fancy_type: + rest.append(line) + continue + + # Detect the integer value of first list item. + # If we are already in a list, just grab that. + if not items and self.TAG == 'ol': + self.startswith = self.get_start(fancy, m) + fancy_type = fancy + + # Append to the list + items.append(m.group(2)) + + # Indented, possibly nested content + elif self.indent_re.match(line): + # Previous item was indented. Append to that item. + if items[-1].startswith(' ' * self.tab_length): + items[-1] = '{}\n{}'.format(items[-1], line) + # Other indented content + else: + items.append(line) + + # Append non list items to previous list item. + else: + items[-1] = '{}\n{}'.format(items[-1], line) + + # Insert non-list items back into the blocks to be parsed later + if rest: + blocks.insert(0, '\n'.join(rest)) + + return items, fancy_type + + +class FancyListBlock(Block): + """Collapse code.""" + + NAME = 'fancylists' + ARGUMENT = True + OL_TYPE = { + '1': 'decimal', + 'a': 'alpha', + 'A': 'ALPHA', + 'i': 'roman', + 'I': 'ROMAN' + } + + def on_init(self): + """Handle initialization.""" + + ordered_styles = self.config['additional_ordered_styles'] + self.inject_style = self.config['inject_style'] + self.inject_class = self.config['inject_class'] + self.roman_enabled = 'roman' in ordered_styles + self.alpha_enabled = 'alpha' in ordered_styles + + def on_validate(self, parent): + """Handle on validate event.""" + + self.type = '1' + self.start = None + self.count = 0 + + try: + for a in self.argument.split(): + name, value = [x.strip() for x in a.split('=')] + if name == 'type' and value in ['a', 'A', 'i', 'I', '1']: + if value.lower() == 'a' and not self.alpha_enabled: + raise ValueError('Alphabetical lists not enabled') + if value.lower() == 'i' and not self.roman_enabled: + raise ValueError('Alphabetical lists not enabled') + self.type = value + elif name == 'start': + self.start = max(0, int(value)) + else: + raise ValueError('Not a valid option') + except Exception: + return False + + return True + + def on_create(self, parent): + """Create the element.""" + + # Create an ordered list that will guide the first list item's type + attrib = {'type': self.type, '__fancylist': 'force-' + self.OL_TYPE[self.type]} + if self.start is not None: + attrib['start'] = str(self.start) + if self.inject_style: + attrib['style'] = f"list-style-type: {OL_STYLE[self.type]};" + if self.inject_class: + attrib['class'] = f"fancylists-{OL_STYLE[self.type]}" + + self.parent = parent + self.ol = etree.SubElement(parent, 'ol', attrib) + return parent + + def on_end(self, block): + """On end.""" + + # Remove the ordered list if empty. + if not list(self.ol): + self.parent.remove(self.ol) + + +class FancyUListProcessor(FancyOListProcessor): + """Process unordered list blocks.""" + + SIBLING_TAGS = ['ul'] + TAG = 'ul' + + def __init__(self, parser, config): + """Initialize.""" + + super().__init__(parser, config) + self.list_re = re.compile(r'^[ ]{0,%d}[-+*][ ]+(.*)' % (self.tab_length - 1)) + + +class FancyListTreeprocessor(Treeprocessor): + """Clean up fancy list metadata.""" + + def run(self, root): + """Remove intermediate fancy list type metadata.""" + + for ol in root.iter('ol'): + if '__fancylist' in ol.attrib: + del ol.attrib['__fancylist'] + return root + + +class FancyListExtension(BlocksExtension): + """HTML Blocks Extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'additional_ordered_styles': [ + ['roman', 'alpha', 'generic'], + "Specify the ordered list formats to add in addition to decimal.", + ], + 'inject_style': [ + False, + "Inject style attribute with the appropriate 'list-style-type'" + ], + 'inject_class': [ + False, + "Inject a class indicating the 'list-style-type'" + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdownBlocks(self, md, blocks): + """Add Details to Markdown instance.""" + + config = self.getConfigs() + blocks.register(FancyListBlock, config) + ol = FancyOListProcessor(md.parser, config) + ul = FancyUListProcessor(md.parser, config) + md.parser.blockprocessors.register(ol, 'olist', 40) + md.parser.blockprocessors.register(ul, 'ulist', 30) + md.treeprocessors.register(FancyListTreeprocessor(md), "olist-cleanup", 10) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return FancyListExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/gemoji_db.py b/micromamba_root/Lib/site-packages/pymdownx/gemoji_db.py new file mode 100644 index 0000000000000000000000000000000000000000..3140bc640eb83437842a11f3faddec48dd904676 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/gemoji_db.py @@ -0,0 +1,9865 @@ +"""Gemoji autogen. + +Generated from gemoji source. Do not edit by hand. + +Copyright (c) 2019 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +""" +version = "v4.1.0" +name = "gemoji" +emoji = { + ":+1:": { + "category": "People & Body", + "name": "thumbs up", + "unicode": "1f44d" + }, + ":-1:": { + "category": "People & Body", + "name": "thumbs down", + "unicode": "1f44e" + }, + ":100:": { + "category": "Smileys & Emotion", + "name": "hundred points", + "unicode": "1f4af" + }, + ":1234:": { + "category": "Symbols", + "name": "input numbers", + "unicode": "1f522" + }, + ":1st_place_medal:": { + "category": "Activities", + "name": "1st place medal", + "unicode": "1f947" + }, + ":2nd_place_medal:": { + "category": "Activities", + "name": "2nd place medal", + "unicode": "1f948" + }, + ":3rd_place_medal:": { + "category": "Activities", + "name": "3rd place medal", + "unicode": "1f949" + }, + ":8ball:": { + "category": "Activities", + "name": "pool 8 ball", + "unicode": "1f3b1" + }, + ":a:": { + "category": "Symbols", + "name": "A button (blood type)", + "unicode": "1f170", + "unicode_alt": "1f170-fe0f" + }, + ":ab:": { + "category": "Symbols", + "name": "AB button (blood type)", + "unicode": "1f18e" + }, + ":abacus:": { + "category": "Objects", + "name": "abacus", + "unicode": "1f9ee" + }, + ":abc:": { + "category": "Symbols", + "name": "input latin letters", + "unicode": "1f524" + }, + ":abcd:": { + "category": "Symbols", + "name": "input latin lowercase", + "unicode": "1f521" + }, + ":accept:": { + "category": "Symbols", + "name": "Japanese \u201cacceptable\u201d button", + "unicode": "1f251" + }, + ":accordion:": { + "category": "Objects", + "name": "accordion", + "unicode": "1fa97" + }, + ":adhesive_bandage:": { + "category": "Objects", + "name": "adhesive bandage", + "unicode": "1fa79" + }, + ":adult:": { + "category": "People & Body", + "name": "person", + "unicode": "1f9d1" + }, + ":aerial_tramway:": { + "category": "Travel & Places", + "name": "aerial tramway", + "unicode": "1f6a1" + }, + ":afghanistan:": { + "category": "Flags", + "name": "flag: Afghanistan", + "unicode": "1f1e6-1f1eb" + }, + ":airplane:": { + "category": "Travel & Places", + "name": "airplane", + "unicode": "2708", + "unicode_alt": "2708-fe0f" + }, + ":aland_islands:": { + "category": "Flags", + "name": "flag: \u00c5land Islands", + "unicode": "1f1e6-1f1fd" + }, + ":alarm_clock:": { + "category": "Travel & Places", + "name": "alarm clock", + "unicode": "23f0" + }, + ":albania:": { + "category": "Flags", + "name": "flag: Albania", + "unicode": "1f1e6-1f1f1" + }, + ":alembic:": { + "category": "Objects", + "name": "alembic", + "unicode": "2697", + "unicode_alt": "2697-fe0f" + }, + ":algeria:": { + "category": "Flags", + "name": "flag: Algeria", + "unicode": "1f1e9-1f1ff" + }, + ":alien:": { + "category": "Smileys & Emotion", + "name": "alien", + "unicode": "1f47d" + }, + ":ambulance:": { + "category": "Travel & Places", + "name": "ambulance", + "unicode": "1f691" + }, + ":american_samoa:": { + "category": "Flags", + "name": "flag: American Samoa", + "unicode": "1f1e6-1f1f8" + }, + ":amphora:": { + "category": "Food & Drink", + "name": "amphora", + "unicode": "1f3fa" + }, + ":anatomical_heart:": { + "category": "People & Body", + "name": "anatomical heart", + "unicode": "1fac0" + }, + ":anchor:": { + "category": "Travel & Places", + "name": "anchor", + "unicode": "2693" + }, + ":andorra:": { + "category": "Flags", + "name": "flag: Andorra", + "unicode": "1f1e6-1f1e9" + }, + ":angel:": { + "category": "People & Body", + "name": "baby angel", + "unicode": "1f47c" + }, + ":anger:": { + "category": "Smileys & Emotion", + "name": "anger symbol", + "unicode": "1f4a2" + }, + ":angola:": { + "category": "Flags", + "name": "flag: Angola", + "unicode": "1f1e6-1f1f4" + }, + ":angry:": { + "category": "Smileys & Emotion", + "name": "angry face", + "unicode": "1f620" + }, + ":anguilla:": { + "category": "Flags", + "name": "flag: Anguilla", + "unicode": "1f1e6-1f1ee" + }, + ":anguished:": { + "category": "Smileys & Emotion", + "name": "anguished face", + "unicode": "1f627" + }, + ":ant:": { + "category": "Animals & Nature", + "name": "ant", + "unicode": "1f41c" + }, + ":antarctica:": { + "category": "Flags", + "name": "flag: Antarctica", + "unicode": "1f1e6-1f1f6" + }, + ":antigua_barbuda:": { + "category": "Flags", + "name": "flag: Antigua & Barbuda", + "unicode": "1f1e6-1f1ec" + }, + ":apple:": { + "category": "Food & Drink", + "name": "red apple", + "unicode": "1f34e" + }, + ":aquarius:": { + "category": "Symbols", + "name": "Aquarius", + "unicode": "2652" + }, + ":argentina:": { + "category": "Flags", + "name": "flag: Argentina", + "unicode": "1f1e6-1f1f7" + }, + ":aries:": { + "category": "Symbols", + "name": "Aries", + "unicode": "2648" + }, + ":armenia:": { + "category": "Flags", + "name": "flag: Armenia", + "unicode": "1f1e6-1f1f2" + }, + ":arrow_backward:": { + "category": "Symbols", + "name": "reverse button", + "unicode": "25c0", + "unicode_alt": "25c0-fe0f" + }, + ":arrow_double_down:": { + "category": "Symbols", + "name": "fast down button", + "unicode": "23ec" + }, + ":arrow_double_up:": { + "category": "Symbols", + "name": "fast up button", + "unicode": "23eb" + }, + ":arrow_down:": { + "category": "Symbols", + "name": "down arrow", + "unicode": "2b07", + "unicode_alt": "2b07-fe0f" + }, + ":arrow_down_small:": { + "category": "Symbols", + "name": "downwards button", + "unicode": "1f53d" + }, + ":arrow_forward:": { + "category": "Symbols", + "name": "play button", + "unicode": "25b6", + "unicode_alt": "25b6-fe0f" + }, + ":arrow_heading_down:": { + "category": "Symbols", + "name": "right arrow curving down", + "unicode": "2935", + "unicode_alt": "2935-fe0f" + }, + ":arrow_heading_up:": { + "category": "Symbols", + "name": "right arrow curving up", + "unicode": "2934", + "unicode_alt": "2934-fe0f" + }, + ":arrow_left:": { + "category": "Symbols", + "name": "left arrow", + "unicode": "2b05", + "unicode_alt": "2b05-fe0f" + }, + ":arrow_lower_left:": { + "category": "Symbols", + "name": "down-left arrow", + "unicode": "2199", + "unicode_alt": "2199-fe0f" + }, + ":arrow_lower_right:": { + "category": "Symbols", + "name": "down-right arrow", + "unicode": "2198", + "unicode_alt": "2198-fe0f" + }, + ":arrow_right:": { + "category": "Symbols", + "name": "right arrow", + "unicode": "27a1", + "unicode_alt": "27a1-fe0f" + }, + ":arrow_right_hook:": { + "category": "Symbols", + "name": "left arrow curving right", + "unicode": "21aa", + "unicode_alt": "21aa-fe0f" + }, + ":arrow_up:": { + "category": "Symbols", + "name": "up arrow", + "unicode": "2b06", + "unicode_alt": "2b06-fe0f" + }, + ":arrow_up_down:": { + "category": "Symbols", + "name": "up-down arrow", + "unicode": "2195", + "unicode_alt": "2195-fe0f" + }, + ":arrow_up_small:": { + "category": "Symbols", + "name": "upwards button", + "unicode": "1f53c" + }, + ":arrow_upper_left:": { + "category": "Symbols", + "name": "up-left arrow", + "unicode": "2196", + "unicode_alt": "2196-fe0f" + }, + ":arrow_upper_right:": { + "category": "Symbols", + "name": "up-right arrow", + "unicode": "2197", + "unicode_alt": "2197-fe0f" + }, + ":arrows_clockwise:": { + "category": "Symbols", + "name": "clockwise vertical arrows", + "unicode": "1f503" + }, + ":arrows_counterclockwise:": { + "category": "Symbols", + "name": "counterclockwise arrows button", + "unicode": "1f504" + }, + ":art:": { + "category": "Activities", + "name": "artist palette", + "unicode": "1f3a8" + }, + ":articulated_lorry:": { + "category": "Travel & Places", + "name": "articulated lorry", + "unicode": "1f69b" + }, + ":artificial_satellite:": { + "category": "Travel & Places", + "name": "satellite", + "unicode": "1f6f0", + "unicode_alt": "1f6f0-fe0f" + }, + ":artist:": { + "category": "People & Body", + "name": "artist", + "unicode": "1f9d1-1f3a8", + "unicode_alt": "1f9d1-200d-1f3a8" + }, + ":aruba:": { + "category": "Flags", + "name": "flag: Aruba", + "unicode": "1f1e6-1f1fc" + }, + ":ascension_island:": { + "category": "Flags", + "name": "flag: Ascension Island", + "unicode": "1f1e6-1f1e8" + }, + ":asterisk:": { + "category": "Symbols", + "name": "keycap: *", + "unicode": "002a-20e3", + "unicode_alt": "002a-fe0f-20e3" + }, + ":astonished:": { + "category": "Smileys & Emotion", + "name": "astonished face", + "unicode": "1f632" + }, + ":astronaut:": { + "category": "People & Body", + "name": "astronaut", + "unicode": "1f9d1-1f680", + "unicode_alt": "1f9d1-200d-1f680" + }, + ":athletic_shoe:": { + "category": "Objects", + "name": "running shoe", + "unicode": "1f45f" + }, + ":atm:": { + "category": "Symbols", + "name": "ATM sign", + "unicode": "1f3e7" + }, + ":atom_symbol:": { + "category": "Symbols", + "name": "atom symbol", + "unicode": "269b", + "unicode_alt": "269b-fe0f" + }, + ":australia:": { + "category": "Flags", + "name": "flag: Australia", + "unicode": "1f1e6-1f1fa" + }, + ":austria:": { + "category": "Flags", + "name": "flag: Austria", + "unicode": "1f1e6-1f1f9" + }, + ":auto_rickshaw:": { + "category": "Travel & Places", + "name": "auto rickshaw", + "unicode": "1f6fa" + }, + ":avocado:": { + "category": "Food & Drink", + "name": "avocado", + "unicode": "1f951" + }, + ":axe:": { + "category": "Objects", + "name": "axe", + "unicode": "1fa93" + }, + ":azerbaijan:": { + "category": "Flags", + "name": "flag: Azerbaijan", + "unicode": "1f1e6-1f1ff" + }, + ":b:": { + "category": "Symbols", + "name": "B button (blood type)", + "unicode": "1f171", + "unicode_alt": "1f171-fe0f" + }, + ":baby:": { + "category": "People & Body", + "name": "baby", + "unicode": "1f476" + }, + ":baby_bottle:": { + "category": "Food & Drink", + "name": "baby bottle", + "unicode": "1f37c" + }, + ":baby_chick:": { + "category": "Animals & Nature", + "name": "baby chick", + "unicode": "1f424" + }, + ":baby_symbol:": { + "category": "Symbols", + "name": "baby symbol", + "unicode": "1f6bc" + }, + ":back:": { + "category": "Symbols", + "name": "BACK arrow", + "unicode": "1f519" + }, + ":bacon:": { + "category": "Food & Drink", + "name": "bacon", + "unicode": "1f953" + }, + ":badger:": { + "category": "Animals & Nature", + "name": "badger", + "unicode": "1f9a1" + }, + ":badminton:": { + "category": "Activities", + "name": "badminton", + "unicode": "1f3f8" + }, + ":bagel:": { + "category": "Food & Drink", + "name": "bagel", + "unicode": "1f96f" + }, + ":baggage_claim:": { + "category": "Symbols", + "name": "baggage claim", + "unicode": "1f6c4" + }, + ":baguette_bread:": { + "category": "Food & Drink", + "name": "baguette bread", + "unicode": "1f956" + }, + ":bahamas:": { + "category": "Flags", + "name": "flag: Bahamas", + "unicode": "1f1e7-1f1f8" + }, + ":bahrain:": { + "category": "Flags", + "name": "flag: Bahrain", + "unicode": "1f1e7-1f1ed" + }, + ":balance_scale:": { + "category": "Objects", + "name": "balance scale", + "unicode": "2696", + "unicode_alt": "2696-fe0f" + }, + ":bald_man:": { + "category": "People & Body", + "name": "man: bald", + "unicode": "1f468-1f9b2", + "unicode_alt": "1f468-200d-1f9b2" + }, + ":bald_woman:": { + "category": "People & Body", + "name": "woman: bald", + "unicode": "1f469-1f9b2", + "unicode_alt": "1f469-200d-1f9b2" + }, + ":ballet_shoes:": { + "category": "Objects", + "name": "ballet shoes", + "unicode": "1fa70" + }, + ":balloon:": { + "category": "Activities", + "name": "balloon", + "unicode": "1f388" + }, + ":ballot_box:": { + "category": "Objects", + "name": "ballot box with ballot", + "unicode": "1f5f3", + "unicode_alt": "1f5f3-fe0f" + }, + ":ballot_box_with_check:": { + "category": "Symbols", + "name": "check box with check", + "unicode": "2611", + "unicode_alt": "2611-fe0f" + }, + ":bamboo:": { + "category": "Activities", + "name": "pine decoration", + "unicode": "1f38d" + }, + ":banana:": { + "category": "Food & Drink", + "name": "banana", + "unicode": "1f34c" + }, + ":bangbang:": { + "category": "Symbols", + "name": "double exclamation mark", + "unicode": "203c", + "unicode_alt": "203c-fe0f" + }, + ":bangladesh:": { + "category": "Flags", + "name": "flag: Bangladesh", + "unicode": "1f1e7-1f1e9" + }, + ":banjo:": { + "category": "Objects", + "name": "banjo", + "unicode": "1fa95" + }, + ":bank:": { + "category": "Travel & Places", + "name": "bank", + "unicode": "1f3e6" + }, + ":bar_chart:": { + "category": "Objects", + "name": "bar chart", + "unicode": "1f4ca" + }, + ":barbados:": { + "category": "Flags", + "name": "flag: Barbados", + "unicode": "1f1e7-1f1e7" + }, + ":barber:": { + "category": "Travel & Places", + "name": "barber pole", + "unicode": "1f488" + }, + ":baseball:": { + "category": "Activities", + "name": "baseball", + "unicode": "26be" + }, + ":basket:": { + "category": "Objects", + "name": "basket", + "unicode": "1f9fa" + }, + ":basketball:": { + "category": "Activities", + "name": "basketball", + "unicode": "1f3c0" + }, + ":bat:": { + "category": "Animals & Nature", + "name": "bat", + "unicode": "1f987" + }, + ":bath:": { + "category": "People & Body", + "name": "person taking bath", + "unicode": "1f6c0" + }, + ":bathtub:": { + "category": "Objects", + "name": "bathtub", + "unicode": "1f6c1" + }, + ":battery:": { + "category": "Objects", + "name": "battery", + "unicode": "1f50b" + }, + ":beach_umbrella:": { + "category": "Travel & Places", + "name": "beach with umbrella", + "unicode": "1f3d6", + "unicode_alt": "1f3d6-fe0f" + }, + ":beans:": { + "category": "Food & Drink", + "name": "beans", + "unicode": "1fad8" + }, + ":bear:": { + "category": "Animals & Nature", + "name": "bear", + "unicode": "1f43b" + }, + ":bearded_person:": { + "category": "People & Body", + "name": "person: beard", + "unicode": "1f9d4" + }, + ":beaver:": { + "category": "Animals & Nature", + "name": "beaver", + "unicode": "1f9ab" + }, + ":bed:": { + "category": "Objects", + "name": "bed", + "unicode": "1f6cf", + "unicode_alt": "1f6cf-fe0f" + }, + ":bee:": { + "category": "Animals & Nature", + "name": "honeybee", + "unicode": "1f41d" + }, + ":beer:": { + "category": "Food & Drink", + "name": "beer mug", + "unicode": "1f37a" + }, + ":beers:": { + "category": "Food & Drink", + "name": "clinking beer mugs", + "unicode": "1f37b" + }, + ":beetle:": { + "category": "Animals & Nature", + "name": "beetle", + "unicode": "1fab2" + }, + ":beginner:": { + "category": "Symbols", + "name": "Japanese symbol for beginner", + "unicode": "1f530" + }, + ":belarus:": { + "category": "Flags", + "name": "flag: Belarus", + "unicode": "1f1e7-1f1fe" + }, + ":belgium:": { + "category": "Flags", + "name": "flag: Belgium", + "unicode": "1f1e7-1f1ea" + }, + ":belize:": { + "category": "Flags", + "name": "flag: Belize", + "unicode": "1f1e7-1f1ff" + }, + ":bell:": { + "category": "Objects", + "name": "bell", + "unicode": "1f514" + }, + ":bell_pepper:": { + "category": "Food & Drink", + "name": "bell pepper", + "unicode": "1fad1" + }, + ":bellhop_bell:": { + "category": "Travel & Places", + "name": "bellhop bell", + "unicode": "1f6ce", + "unicode_alt": "1f6ce-fe0f" + }, + ":benin:": { + "category": "Flags", + "name": "flag: Benin", + "unicode": "1f1e7-1f1ef" + }, + ":bento:": { + "category": "Food & Drink", + "name": "bento box", + "unicode": "1f371" + }, + ":bermuda:": { + "category": "Flags", + "name": "flag: Bermuda", + "unicode": "1f1e7-1f1f2" + }, + ":beverage_box:": { + "category": "Food & Drink", + "name": "beverage box", + "unicode": "1f9c3" + }, + ":bhutan:": { + "category": "Flags", + "name": "flag: Bhutan", + "unicode": "1f1e7-1f1f9" + }, + ":bicyclist:": { + "category": "People & Body", + "name": "person biking", + "unicode": "1f6b4" + }, + ":bike:": { + "category": "Travel & Places", + "name": "bicycle", + "unicode": "1f6b2" + }, + ":biking_man:": { + "category": "People & Body", + "name": "man biking", + "unicode": "1f6b4-2642", + "unicode_alt": "1f6b4-200d-2642-fe0f" + }, + ":biking_woman:": { + "category": "People & Body", + "name": "woman biking", + "unicode": "1f6b4-2640", + "unicode_alt": "1f6b4-200d-2640-fe0f" + }, + ":bikini:": { + "category": "Objects", + "name": "bikini", + "unicode": "1f459" + }, + ":billed_cap:": { + "category": "Objects", + "name": "billed cap", + "unicode": "1f9e2" + }, + ":biohazard:": { + "category": "Symbols", + "name": "biohazard", + "unicode": "2623", + "unicode_alt": "2623-fe0f" + }, + ":bird:": { + "category": "Animals & Nature", + "name": "bird", + "unicode": "1f426" + }, + ":birthday:": { + "category": "Food & Drink", + "name": "birthday cake", + "unicode": "1f382" + }, + ":bison:": { + "category": "Animals & Nature", + "name": "bison", + "unicode": "1f9ac" + }, + ":biting_lip:": { + "category": "People & Body", + "name": "biting lip", + "unicode": "1fae6" + }, + ":black_bird:": { + "category": "Animals & Nature", + "name": "black bird", + "unicode": "1f426-2b1b", + "unicode_alt": "1f426-200d-2b1b" + }, + ":black_cat:": { + "category": "Animals & Nature", + "name": "black cat", + "unicode": "1f408-2b1b", + "unicode_alt": "1f408-200d-2b1b" + }, + ":black_circle:": { + "category": "Symbols", + "name": "black circle", + "unicode": "26ab" + }, + ":black_flag:": { + "category": "Flags", + "name": "black flag", + "unicode": "1f3f4" + }, + ":black_heart:": { + "category": "Smileys & Emotion", + "name": "black heart", + "unicode": "1f5a4" + }, + ":black_joker:": { + "category": "Activities", + "name": "joker", + "unicode": "1f0cf" + }, + ":black_large_square:": { + "category": "Symbols", + "name": "black large square", + "unicode": "2b1b" + }, + ":black_medium_small_square:": { + "category": "Symbols", + "name": "black medium-small square", + "unicode": "25fe" + }, + ":black_medium_square:": { + "category": "Symbols", + "name": "black medium square", + "unicode": "25fc", + "unicode_alt": "25fc-fe0f" + }, + ":black_nib:": { + "category": "Objects", + "name": "black nib", + "unicode": "2712", + "unicode_alt": "2712-fe0f" + }, + ":black_small_square:": { + "category": "Symbols", + "name": "black small square", + "unicode": "25aa", + "unicode_alt": "25aa-fe0f" + }, + ":black_square_button:": { + "category": "Symbols", + "name": "black square button", + "unicode": "1f532" + }, + ":blond_haired_man:": { + "category": "People & Body", + "name": "man: blond hair", + "unicode": "1f471-2642", + "unicode_alt": "1f471-200d-2642-fe0f" + }, + ":blond_haired_person:": { + "category": "People & Body", + "name": "person: blond hair", + "unicode": "1f471" + }, + ":blond_haired_woman:": { + "category": "People & Body", + "name": "woman: blond hair", + "unicode": "1f471-2640", + "unicode_alt": "1f471-200d-2640-fe0f" + }, + ":blossom:": { + "category": "Animals & Nature", + "name": "blossom", + "unicode": "1f33c" + }, + ":blowfish:": { + "category": "Animals & Nature", + "name": "blowfish", + "unicode": "1f421" + }, + ":blue_book:": { + "category": "Objects", + "name": "blue book", + "unicode": "1f4d8" + }, + ":blue_car:": { + "category": "Travel & Places", + "name": "sport utility vehicle", + "unicode": "1f699" + }, + ":blue_heart:": { + "category": "Smileys & Emotion", + "name": "blue heart", + "unicode": "1f499" + }, + ":blue_square:": { + "category": "Symbols", + "name": "blue square", + "unicode": "1f7e6" + }, + ":blueberries:": { + "category": "Food & Drink", + "name": "blueberries", + "unicode": "1fad0" + }, + ":blush:": { + "category": "Smileys & Emotion", + "name": "smiling face with smiling eyes", + "unicode": "1f60a" + }, + ":boar:": { + "category": "Animals & Nature", + "name": "boar", + "unicode": "1f417" + }, + ":boat:": { + "category": "Travel & Places", + "name": "sailboat", + "unicode": "26f5" + }, + ":bolivia:": { + "category": "Flags", + "name": "flag: Bolivia", + "unicode": "1f1e7-1f1f4" + }, + ":bomb:": { + "category": "Objects", + "name": "bomb", + "unicode": "1f4a3" + }, + ":bone:": { + "category": "People & Body", + "name": "bone", + "unicode": "1f9b4" + }, + ":book:": { + "category": "Objects", + "name": "open book", + "unicode": "1f4d6" + }, + ":bookmark:": { + "category": "Objects", + "name": "bookmark", + "unicode": "1f516" + }, + ":bookmark_tabs:": { + "category": "Objects", + "name": "bookmark tabs", + "unicode": "1f4d1" + }, + ":books:": { + "category": "Objects", + "name": "books", + "unicode": "1f4da" + }, + ":boom:": { + "category": "Smileys & Emotion", + "name": "collision", + "unicode": "1f4a5" + }, + ":boomerang:": { + "category": "Objects", + "name": "boomerang", + "unicode": "1fa83" + }, + ":boot:": { + "category": "Objects", + "name": "woman\u2019s boot", + "unicode": "1f462" + }, + ":bosnia_herzegovina:": { + "category": "Flags", + "name": "flag: Bosnia & Herzegovina", + "unicode": "1f1e7-1f1e6" + }, + ":botswana:": { + "category": "Flags", + "name": "flag: Botswana", + "unicode": "1f1e7-1f1fc" + }, + ":bouncing_ball_man:": { + "category": "People & Body", + "name": "man bouncing ball", + "unicode": "26f9-2642", + "unicode_alt": "26f9-fe0f-200d-2642-fe0f" + }, + ":bouncing_ball_person:": { + "category": "People & Body", + "name": "person bouncing ball", + "unicode": "26f9", + "unicode_alt": "26f9-fe0f" + }, + ":bouncing_ball_woman:": { + "category": "People & Body", + "name": "woman bouncing ball", + "unicode": "26f9-2640", + "unicode_alt": "26f9-fe0f-200d-2640-fe0f" + }, + ":bouquet:": { + "category": "Animals & Nature", + "name": "bouquet", + "unicode": "1f490" + }, + ":bouvet_island:": { + "category": "Flags", + "name": "flag: Bouvet Island", + "unicode": "1f1e7-1f1fb" + }, + ":bow:": { + "category": "People & Body", + "name": "person bowing", + "unicode": "1f647" + }, + ":bow_and_arrow:": { + "category": "Objects", + "name": "bow and arrow", + "unicode": "1f3f9" + }, + ":bowing_man:": { + "category": "People & Body", + "name": "man bowing", + "unicode": "1f647-2642", + "unicode_alt": "1f647-200d-2642-fe0f" + }, + ":bowing_woman:": { + "category": "People & Body", + "name": "woman bowing", + "unicode": "1f647-2640", + "unicode_alt": "1f647-200d-2640-fe0f" + }, + ":bowl_with_spoon:": { + "category": "Food & Drink", + "name": "bowl with spoon", + "unicode": "1f963" + }, + ":bowling:": { + "category": "Activities", + "name": "bowling", + "unicode": "1f3b3" + }, + ":boxing_glove:": { + "category": "Activities", + "name": "boxing glove", + "unicode": "1f94a" + }, + ":boy:": { + "category": "People & Body", + "name": "boy", + "unicode": "1f466" + }, + ":brain:": { + "category": "People & Body", + "name": "brain", + "unicode": "1f9e0" + }, + ":brazil:": { + "category": "Flags", + "name": "flag: Brazil", + "unicode": "1f1e7-1f1f7" + }, + ":bread:": { + "category": "Food & Drink", + "name": "bread", + "unicode": "1f35e" + }, + ":breast_feeding:": { + "category": "People & Body", + "name": "breast-feeding", + "unicode": "1f931" + }, + ":bricks:": { + "category": "Travel & Places", + "name": "brick", + "unicode": "1f9f1" + }, + ":bridge_at_night:": { + "category": "Travel & Places", + "name": "bridge at night", + "unicode": "1f309" + }, + ":briefcase:": { + "category": "Objects", + "name": "briefcase", + "unicode": "1f4bc" + }, + ":british_indian_ocean_territory:": { + "category": "Flags", + "name": "flag: British Indian Ocean Territory", + "unicode": "1f1ee-1f1f4" + }, + ":british_virgin_islands:": { + "category": "Flags", + "name": "flag: British Virgin Islands", + "unicode": "1f1fb-1f1ec" + }, + ":broccoli:": { + "category": "Food & Drink", + "name": "broccoli", + "unicode": "1f966" + }, + ":broken_heart:": { + "category": "Smileys & Emotion", + "name": "broken heart", + "unicode": "1f494" + }, + ":broom:": { + "category": "Objects", + "name": "broom", + "unicode": "1f9f9" + }, + ":brown_circle:": { + "category": "Symbols", + "name": "brown circle", + "unicode": "1f7e4" + }, + ":brown_heart:": { + "category": "Smileys & Emotion", + "name": "brown heart", + "unicode": "1f90e" + }, + ":brown_square:": { + "category": "Symbols", + "name": "brown square", + "unicode": "1f7eb" + }, + ":brunei:": { + "category": "Flags", + "name": "flag: Brunei", + "unicode": "1f1e7-1f1f3" + }, + ":bubble_tea:": { + "category": "Food & Drink", + "name": "bubble tea", + "unicode": "1f9cb" + }, + ":bubbles:": { + "category": "Objects", + "name": "bubbles", + "unicode": "1fae7" + }, + ":bucket:": { + "category": "Objects", + "name": "bucket", + "unicode": "1faa3" + }, + ":bug:": { + "category": "Animals & Nature", + "name": "bug", + "unicode": "1f41b" + }, + ":building_construction:": { + "category": "Travel & Places", + "name": "building construction", + "unicode": "1f3d7", + "unicode_alt": "1f3d7-fe0f" + }, + ":bulb:": { + "category": "Objects", + "name": "light bulb", + "unicode": "1f4a1" + }, + ":bulgaria:": { + "category": "Flags", + "name": "flag: Bulgaria", + "unicode": "1f1e7-1f1ec" + }, + ":bullettrain_front:": { + "category": "Travel & Places", + "name": "bullet train", + "unicode": "1f685" + }, + ":bullettrain_side:": { + "category": "Travel & Places", + "name": "high-speed train", + "unicode": "1f684" + }, + ":burkina_faso:": { + "category": "Flags", + "name": "flag: Burkina Faso", + "unicode": "1f1e7-1f1eb" + }, + ":burrito:": { + "category": "Food & Drink", + "name": "burrito", + "unicode": "1f32f" + }, + ":burundi:": { + "category": "Flags", + "name": "flag: Burundi", + "unicode": "1f1e7-1f1ee" + }, + ":bus:": { + "category": "Travel & Places", + "name": "bus", + "unicode": "1f68c" + }, + ":business_suit_levitating:": { + "category": "People & Body", + "name": "person in suit levitating", + "unicode": "1f574", + "unicode_alt": "1f574-fe0f" + }, + ":busstop:": { + "category": "Travel & Places", + "name": "bus stop", + "unicode": "1f68f" + }, + ":bust_in_silhouette:": { + "category": "People & Body", + "name": "bust in silhouette", + "unicode": "1f464" + }, + ":busts_in_silhouette:": { + "category": "People & Body", + "name": "busts in silhouette", + "unicode": "1f465" + }, + ":butter:": { + "category": "Food & Drink", + "name": "butter", + "unicode": "1f9c8" + }, + ":butterfly:": { + "category": "Animals & Nature", + "name": "butterfly", + "unicode": "1f98b" + }, + ":cactus:": { + "category": "Animals & Nature", + "name": "cactus", + "unicode": "1f335" + }, + ":cake:": { + "category": "Food & Drink", + "name": "shortcake", + "unicode": "1f370" + }, + ":calendar:": { + "category": "Objects", + "name": "tear-off calendar", + "unicode": "1f4c6" + }, + ":call_me_hand:": { + "category": "People & Body", + "name": "call me hand", + "unicode": "1f919" + }, + ":calling:": { + "category": "Objects", + "name": "mobile phone with arrow", + "unicode": "1f4f2" + }, + ":cambodia:": { + "category": "Flags", + "name": "flag: Cambodia", + "unicode": "1f1f0-1f1ed" + }, + ":camel:": { + "category": "Animals & Nature", + "name": "two-hump camel", + "unicode": "1f42b" + }, + ":camera:": { + "category": "Objects", + "name": "camera", + "unicode": "1f4f7" + }, + ":camera_flash:": { + "category": "Objects", + "name": "camera with flash", + "unicode": "1f4f8" + }, + ":cameroon:": { + "category": "Flags", + "name": "flag: Cameroon", + "unicode": "1f1e8-1f1f2" + }, + ":camping:": { + "category": "Travel & Places", + "name": "camping", + "unicode": "1f3d5", + "unicode_alt": "1f3d5-fe0f" + }, + ":canada:": { + "category": "Flags", + "name": "flag: Canada", + "unicode": "1f1e8-1f1e6" + }, + ":canary_islands:": { + "category": "Flags", + "name": "flag: Canary Islands", + "unicode": "1f1ee-1f1e8" + }, + ":cancer:": { + "category": "Symbols", + "name": "Cancer", + "unicode": "264b" + }, + ":candle:": { + "category": "Objects", + "name": "candle", + "unicode": "1f56f", + "unicode_alt": "1f56f-fe0f" + }, + ":candy:": { + "category": "Food & Drink", + "name": "candy", + "unicode": "1f36c" + }, + ":canned_food:": { + "category": "Food & Drink", + "name": "canned food", + "unicode": "1f96b" + }, + ":canoe:": { + "category": "Travel & Places", + "name": "canoe", + "unicode": "1f6f6" + }, + ":cape_verde:": { + "category": "Flags", + "name": "flag: Cape Verde", + "unicode": "1f1e8-1f1fb" + }, + ":capital_abcd:": { + "category": "Symbols", + "name": "input latin uppercase", + "unicode": "1f520" + }, + ":capricorn:": { + "category": "Symbols", + "name": "Capricorn", + "unicode": "2651" + }, + ":car:": { + "category": "Travel & Places", + "name": "automobile", + "unicode": "1f697" + }, + ":card_file_box:": { + "category": "Objects", + "name": "card file box", + "unicode": "1f5c3", + "unicode_alt": "1f5c3-fe0f" + }, + ":card_index:": { + "category": "Objects", + "name": "card index", + "unicode": "1f4c7" + }, + ":card_index_dividers:": { + "category": "Objects", + "name": "card index dividers", + "unicode": "1f5c2", + "unicode_alt": "1f5c2-fe0f" + }, + ":caribbean_netherlands:": { + "category": "Flags", + "name": "flag: Caribbean Netherlands", + "unicode": "1f1e7-1f1f6" + }, + ":carousel_horse:": { + "category": "Travel & Places", + "name": "carousel horse", + "unicode": "1f3a0" + }, + ":carpentry_saw:": { + "category": "Objects", + "name": "carpentry saw", + "unicode": "1fa9a" + }, + ":carrot:": { + "category": "Food & Drink", + "name": "carrot", + "unicode": "1f955" + }, + ":cartwheeling:": { + "category": "People & Body", + "name": "person cartwheeling", + "unicode": "1f938" + }, + ":cat2:": { + "category": "Animals & Nature", + "name": "cat", + "unicode": "1f408" + }, + ":cat:": { + "category": "Animals & Nature", + "name": "cat face", + "unicode": "1f431" + }, + ":cayman_islands:": { + "category": "Flags", + "name": "flag: Cayman Islands", + "unicode": "1f1f0-1f1fe" + }, + ":cd:": { + "category": "Objects", + "name": "optical disk", + "unicode": "1f4bf" + }, + ":central_african_republic:": { + "category": "Flags", + "name": "flag: Central African Republic", + "unicode": "1f1e8-1f1eb" + }, + ":ceuta_melilla:": { + "category": "Flags", + "name": "flag: Ceuta & Melilla", + "unicode": "1f1ea-1f1e6" + }, + ":chad:": { + "category": "Flags", + "name": "flag: Chad", + "unicode": "1f1f9-1f1e9" + }, + ":chains:": { + "category": "Objects", + "name": "chains", + "unicode": "26d3", + "unicode_alt": "26d3-fe0f" + }, + ":chair:": { + "category": "Objects", + "name": "chair", + "unicode": "1fa91" + }, + ":champagne:": { + "category": "Food & Drink", + "name": "bottle with popping cork", + "unicode": "1f37e" + }, + ":chart:": { + "category": "Objects", + "name": "chart increasing with yen", + "unicode": "1f4b9" + }, + ":chart_with_downwards_trend:": { + "category": "Objects", + "name": "chart decreasing", + "unicode": "1f4c9" + }, + ":chart_with_upwards_trend:": { + "category": "Objects", + "name": "chart increasing", + "unicode": "1f4c8" + }, + ":checkered_flag:": { + "category": "Flags", + "name": "chequered flag", + "unicode": "1f3c1" + }, + ":cheese:": { + "category": "Food & Drink", + "name": "cheese wedge", + "unicode": "1f9c0" + }, + ":cherries:": { + "category": "Food & Drink", + "name": "cherries", + "unicode": "1f352" + }, + ":cherry_blossom:": { + "category": "Animals & Nature", + "name": "cherry blossom", + "unicode": "1f338" + }, + ":chess_pawn:": { + "category": "Activities", + "name": "chess pawn", + "unicode": "265f", + "unicode_alt": "265f-fe0f" + }, + ":chestnut:": { + "category": "Food & Drink", + "name": "chestnut", + "unicode": "1f330" + }, + ":chicken:": { + "category": "Animals & Nature", + "name": "chicken", + "unicode": "1f414" + }, + ":child:": { + "category": "People & Body", + "name": "child", + "unicode": "1f9d2" + }, + ":children_crossing:": { + "category": "Symbols", + "name": "children crossing", + "unicode": "1f6b8" + }, + ":chile:": { + "category": "Flags", + "name": "flag: Chile", + "unicode": "1f1e8-1f1f1" + }, + ":chipmunk:": { + "category": "Animals & Nature", + "name": "chipmunk", + "unicode": "1f43f", + "unicode_alt": "1f43f-fe0f" + }, + ":chocolate_bar:": { + "category": "Food & Drink", + "name": "chocolate bar", + "unicode": "1f36b" + }, + ":chopsticks:": { + "category": "Food & Drink", + "name": "chopsticks", + "unicode": "1f962" + }, + ":christmas_island:": { + "category": "Flags", + "name": "flag: Christmas Island", + "unicode": "1f1e8-1f1fd" + }, + ":christmas_tree:": { + "category": "Activities", + "name": "Christmas tree", + "unicode": "1f384" + }, + ":church:": { + "category": "Travel & Places", + "name": "church", + "unicode": "26ea" + }, + ":cinema:": { + "category": "Symbols", + "name": "cinema", + "unicode": "1f3a6" + }, + ":circus_tent:": { + "category": "Travel & Places", + "name": "circus tent", + "unicode": "1f3aa" + }, + ":city_sunrise:": { + "category": "Travel & Places", + "name": "sunset", + "unicode": "1f307" + }, + ":city_sunset:": { + "category": "Travel & Places", + "name": "cityscape at dusk", + "unicode": "1f306" + }, + ":cityscape:": { + "category": "Travel & Places", + "name": "cityscape", + "unicode": "1f3d9", + "unicode_alt": "1f3d9-fe0f" + }, + ":cl:": { + "category": "Symbols", + "name": "CL button", + "unicode": "1f191" + }, + ":clamp:": { + "category": "Objects", + "name": "clamp", + "unicode": "1f5dc", + "unicode_alt": "1f5dc-fe0f" + }, + ":clap:": { + "category": "People & Body", + "name": "clapping hands", + "unicode": "1f44f" + }, + ":clapper:": { + "category": "Objects", + "name": "clapper board", + "unicode": "1f3ac" + }, + ":classical_building:": { + "category": "Travel & Places", + "name": "classical building", + "unicode": "1f3db", + "unicode_alt": "1f3db-fe0f" + }, + ":climbing:": { + "category": "People & Body", + "name": "person climbing", + "unicode": "1f9d7" + }, + ":climbing_man:": { + "category": "People & Body", + "name": "man climbing", + "unicode": "1f9d7-2642", + "unicode_alt": "1f9d7-200d-2642-fe0f" + }, + ":climbing_woman:": { + "category": "People & Body", + "name": "woman climbing", + "unicode": "1f9d7-2640", + "unicode_alt": "1f9d7-200d-2640-fe0f" + }, + ":clinking_glasses:": { + "category": "Food & Drink", + "name": "clinking glasses", + "unicode": "1f942" + }, + ":clipboard:": { + "category": "Objects", + "name": "clipboard", + "unicode": "1f4cb" + }, + ":clipperton_island:": { + "category": "Flags", + "name": "flag: Clipperton Island", + "unicode": "1f1e8-1f1f5" + }, + ":clock1030:": { + "category": "Travel & Places", + "name": "ten-thirty", + "unicode": "1f565" + }, + ":clock10:": { + "category": "Travel & Places", + "name": "ten o\u2019clock", + "unicode": "1f559" + }, + ":clock1130:": { + "category": "Travel & Places", + "name": "eleven-thirty", + "unicode": "1f566" + }, + ":clock11:": { + "category": "Travel & Places", + "name": "eleven o\u2019clock", + "unicode": "1f55a" + }, + ":clock1230:": { + "category": "Travel & Places", + "name": "twelve-thirty", + "unicode": "1f567" + }, + ":clock12:": { + "category": "Travel & Places", + "name": "twelve o\u2019clock", + "unicode": "1f55b" + }, + ":clock130:": { + "category": "Travel & Places", + "name": "one-thirty", + "unicode": "1f55c" + }, + ":clock1:": { + "category": "Travel & Places", + "name": "one o\u2019clock", + "unicode": "1f550" + }, + ":clock230:": { + "category": "Travel & Places", + "name": "two-thirty", + "unicode": "1f55d" + }, + ":clock2:": { + "category": "Travel & Places", + "name": "two o\u2019clock", + "unicode": "1f551" + }, + ":clock330:": { + "category": "Travel & Places", + "name": "three-thirty", + "unicode": "1f55e" + }, + ":clock3:": { + "category": "Travel & Places", + "name": "three o\u2019clock", + "unicode": "1f552" + }, + ":clock430:": { + "category": "Travel & Places", + "name": "four-thirty", + "unicode": "1f55f" + }, + ":clock4:": { + "category": "Travel & Places", + "name": "four o\u2019clock", + "unicode": "1f553" + }, + ":clock530:": { + "category": "Travel & Places", + "name": "five-thirty", + "unicode": "1f560" + }, + ":clock5:": { + "category": "Travel & Places", + "name": "five o\u2019clock", + "unicode": "1f554" + }, + ":clock630:": { + "category": "Travel & Places", + "name": "six-thirty", + "unicode": "1f561" + }, + ":clock6:": { + "category": "Travel & Places", + "name": "six o\u2019clock", + "unicode": "1f555" + }, + ":clock730:": { + "category": "Travel & Places", + "name": "seven-thirty", + "unicode": "1f562" + }, + ":clock7:": { + "category": "Travel & Places", + "name": "seven o\u2019clock", + "unicode": "1f556" + }, + ":clock830:": { + "category": "Travel & Places", + "name": "eight-thirty", + "unicode": "1f563" + }, + ":clock8:": { + "category": "Travel & Places", + "name": "eight o\u2019clock", + "unicode": "1f557" + }, + ":clock930:": { + "category": "Travel & Places", + "name": "nine-thirty", + "unicode": "1f564" + }, + ":clock9:": { + "category": "Travel & Places", + "name": "nine o\u2019clock", + "unicode": "1f558" + }, + ":closed_book:": { + "category": "Objects", + "name": "closed book", + "unicode": "1f4d5" + }, + ":closed_lock_with_key:": { + "category": "Objects", + "name": "locked with key", + "unicode": "1f510" + }, + ":closed_umbrella:": { + "category": "Travel & Places", + "name": "closed umbrella", + "unicode": "1f302" + }, + ":cloud:": { + "category": "Travel & Places", + "name": "cloud", + "unicode": "2601", + "unicode_alt": "2601-fe0f" + }, + ":cloud_with_lightning:": { + "category": "Travel & Places", + "name": "cloud with lightning", + "unicode": "1f329", + "unicode_alt": "1f329-fe0f" + }, + ":cloud_with_lightning_and_rain:": { + "category": "Travel & Places", + "name": "cloud with lightning and rain", + "unicode": "26c8", + "unicode_alt": "26c8-fe0f" + }, + ":cloud_with_rain:": { + "category": "Travel & Places", + "name": "cloud with rain", + "unicode": "1f327", + "unicode_alt": "1f327-fe0f" + }, + ":cloud_with_snow:": { + "category": "Travel & Places", + "name": "cloud with snow", + "unicode": "1f328", + "unicode_alt": "1f328-fe0f" + }, + ":clown_face:": { + "category": "Smileys & Emotion", + "name": "clown face", + "unicode": "1f921" + }, + ":clubs:": { + "category": "Activities", + "name": "club suit", + "unicode": "2663", + "unicode_alt": "2663-fe0f" + }, + ":cn:": { + "category": "Flags", + "name": "flag: China", + "unicode": "1f1e8-1f1f3" + }, + ":coat:": { + "category": "Objects", + "name": "coat", + "unicode": "1f9e5" + }, + ":cockroach:": { + "category": "Animals & Nature", + "name": "cockroach", + "unicode": "1fab3" + }, + ":cocktail:": { + "category": "Food & Drink", + "name": "cocktail glass", + "unicode": "1f378" + }, + ":coconut:": { + "category": "Food & Drink", + "name": "coconut", + "unicode": "1f965" + }, + ":cocos_islands:": { + "category": "Flags", + "name": "flag: Cocos (Keeling) Islands", + "unicode": "1f1e8-1f1e8" + }, + ":coffee:": { + "category": "Food & Drink", + "name": "hot beverage", + "unicode": "2615" + }, + ":coffin:": { + "category": "Objects", + "name": "coffin", + "unicode": "26b0", + "unicode_alt": "26b0-fe0f" + }, + ":coin:": { + "category": "Objects", + "name": "coin", + "unicode": "1fa99" + }, + ":cold_face:": { + "category": "Smileys & Emotion", + "name": "cold face", + "unicode": "1f976" + }, + ":cold_sweat:": { + "category": "Smileys & Emotion", + "name": "anxious face with sweat", + "unicode": "1f630" + }, + ":colombia:": { + "category": "Flags", + "name": "flag: Colombia", + "unicode": "1f1e8-1f1f4" + }, + ":comet:": { + "category": "Travel & Places", + "name": "comet", + "unicode": "2604", + "unicode_alt": "2604-fe0f" + }, + ":comoros:": { + "category": "Flags", + "name": "flag: Comoros", + "unicode": "1f1f0-1f1f2" + }, + ":compass:": { + "category": "Travel & Places", + "name": "compass", + "unicode": "1f9ed" + }, + ":computer:": { + "category": "Objects", + "name": "laptop", + "unicode": "1f4bb" + }, + ":computer_mouse:": { + "category": "Objects", + "name": "computer mouse", + "unicode": "1f5b1", + "unicode_alt": "1f5b1-fe0f" + }, + ":confetti_ball:": { + "category": "Activities", + "name": "confetti ball", + "unicode": "1f38a" + }, + ":confounded:": { + "category": "Smileys & Emotion", + "name": "confounded face", + "unicode": "1f616" + }, + ":confused:": { + "category": "Smileys & Emotion", + "name": "confused face", + "unicode": "1f615" + }, + ":congo_brazzaville:": { + "category": "Flags", + "name": "flag: Congo - Brazzaville", + "unicode": "1f1e8-1f1ec" + }, + ":congo_kinshasa:": { + "category": "Flags", + "name": "flag: Congo - Kinshasa", + "unicode": "1f1e8-1f1e9" + }, + ":congratulations:": { + "category": "Symbols", + "name": "Japanese \u201ccongratulations\u201d button", + "unicode": "3297", + "unicode_alt": "3297-fe0f" + }, + ":construction:": { + "category": "Travel & Places", + "name": "construction", + "unicode": "1f6a7" + }, + ":construction_worker:": { + "category": "People & Body", + "name": "construction worker", + "unicode": "1f477" + }, + ":construction_worker_man:": { + "category": "People & Body", + "name": "man construction worker", + "unicode": "1f477-2642", + "unicode_alt": "1f477-200d-2642-fe0f" + }, + ":construction_worker_woman:": { + "category": "People & Body", + "name": "woman construction worker", + "unicode": "1f477-2640", + "unicode_alt": "1f477-200d-2640-fe0f" + }, + ":control_knobs:": { + "category": "Objects", + "name": "control knobs", + "unicode": "1f39b", + "unicode_alt": "1f39b-fe0f" + }, + ":convenience_store:": { + "category": "Travel & Places", + "name": "convenience store", + "unicode": "1f3ea" + }, + ":cook:": { + "category": "People & Body", + "name": "cook", + "unicode": "1f9d1-1f373", + "unicode_alt": "1f9d1-200d-1f373" + }, + ":cook_islands:": { + "category": "Flags", + "name": "flag: Cook Islands", + "unicode": "1f1e8-1f1f0" + }, + ":cookie:": { + "category": "Food & Drink", + "name": "cookie", + "unicode": "1f36a" + }, + ":cool:": { + "category": "Symbols", + "name": "COOL button", + "unicode": "1f192" + }, + ":copyright:": { + "category": "Symbols", + "name": "copyright", + "unicode": "00a9", + "unicode_alt": "00a9-fe0f" + }, + ":coral:": { + "category": "Animals & Nature", + "name": "coral", + "unicode": "1fab8" + }, + ":corn:": { + "category": "Food & Drink", + "name": "ear of corn", + "unicode": "1f33d" + }, + ":costa_rica:": { + "category": "Flags", + "name": "flag: Costa Rica", + "unicode": "1f1e8-1f1f7" + }, + ":cote_divoire:": { + "category": "Flags", + "name": "flag: C\u00f4te d\u2019Ivoire", + "unicode": "1f1e8-1f1ee" + }, + ":couch_and_lamp:": { + "category": "Objects", + "name": "couch and lamp", + "unicode": "1f6cb", + "unicode_alt": "1f6cb-fe0f" + }, + ":couple:": { + "category": "People & Body", + "name": "woman and man holding hands", + "unicode": "1f46b" + }, + ":couple_with_heart:": { + "category": "People & Body", + "name": "couple with heart", + "unicode": "1f491" + }, + ":couple_with_heart_man_man:": { + "category": "People & Body", + "name": "couple with heart: man, man", + "unicode": "1f468-2764-1f468", + "unicode_alt": "1f468-200d-2764-fe0f-200d-1f468" + }, + ":couple_with_heart_woman_man:": { + "category": "People & Body", + "name": "couple with heart: woman, man", + "unicode": "1f469-2764-1f468", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f468" + }, + ":couple_with_heart_woman_woman:": { + "category": "People & Body", + "name": "couple with heart: woman, woman", + "unicode": "1f469-2764-1f469", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f469" + }, + ":couplekiss:": { + "category": "People & Body", + "name": "kiss", + "unicode": "1f48f" + }, + ":couplekiss_man_man:": { + "category": "People & Body", + "name": "kiss: man, man", + "unicode": "1f468-2764-1f48b-1f468", + "unicode_alt": "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468" + }, + ":couplekiss_man_woman:": { + "category": "People & Body", + "name": "kiss: woman, man", + "unicode": "1f469-2764-1f48b-1f468", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f468" + }, + ":couplekiss_woman_woman:": { + "category": "People & Body", + "name": "kiss: woman, woman", + "unicode": "1f469-2764-1f48b-1f469", + "unicode_alt": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469" + }, + ":cow2:": { + "category": "Animals & Nature", + "name": "cow", + "unicode": "1f404" + }, + ":cow:": { + "category": "Animals & Nature", + "name": "cow face", + "unicode": "1f42e" + }, + ":cowboy_hat_face:": { + "category": "Smileys & Emotion", + "name": "cowboy hat face", + "unicode": "1f920" + }, + ":crab:": { + "category": "Food & Drink", + "name": "crab", + "unicode": "1f980" + }, + ":crayon:": { + "category": "Objects", + "name": "crayon", + "unicode": "1f58d", + "unicode_alt": "1f58d-fe0f" + }, + ":credit_card:": { + "category": "Objects", + "name": "credit card", + "unicode": "1f4b3" + }, + ":crescent_moon:": { + "category": "Travel & Places", + "name": "crescent moon", + "unicode": "1f319" + }, + ":cricket:": { + "category": "Animals & Nature", + "name": "cricket", + "unicode": "1f997" + }, + ":cricket_game:": { + "category": "Activities", + "name": "cricket game", + "unicode": "1f3cf" + }, + ":croatia:": { + "category": "Flags", + "name": "flag: Croatia", + "unicode": "1f1ed-1f1f7" + }, + ":crocodile:": { + "category": "Animals & Nature", + "name": "crocodile", + "unicode": "1f40a" + }, + ":croissant:": { + "category": "Food & Drink", + "name": "croissant", + "unicode": "1f950" + }, + ":crossed_fingers:": { + "category": "People & Body", + "name": "crossed fingers", + "unicode": "1f91e" + }, + ":crossed_flags:": { + "category": "Flags", + "name": "crossed flags", + "unicode": "1f38c" + }, + ":crossed_swords:": { + "category": "Objects", + "name": "crossed swords", + "unicode": "2694", + "unicode_alt": "2694-fe0f" + }, + ":crown:": { + "category": "Objects", + "name": "crown", + "unicode": "1f451" + }, + ":crutch:": { + "category": "Objects", + "name": "crutch", + "unicode": "1fa7c" + }, + ":cry:": { + "category": "Smileys & Emotion", + "name": "crying face", + "unicode": "1f622" + }, + ":crying_cat_face:": { + "category": "Smileys & Emotion", + "name": "crying cat", + "unicode": "1f63f" + }, + ":crystal_ball:": { + "category": "Activities", + "name": "crystal ball", + "unicode": "1f52e" + }, + ":cuba:": { + "category": "Flags", + "name": "flag: Cuba", + "unicode": "1f1e8-1f1fa" + }, + ":cucumber:": { + "category": "Food & Drink", + "name": "cucumber", + "unicode": "1f952" + }, + ":cup_with_straw:": { + "category": "Food & Drink", + "name": "cup with straw", + "unicode": "1f964" + }, + ":cupcake:": { + "category": "Food & Drink", + "name": "cupcake", + "unicode": "1f9c1" + }, + ":cupid:": { + "category": "Smileys & Emotion", + "name": "heart with arrow", + "unicode": "1f498" + }, + ":curacao:": { + "category": "Flags", + "name": "flag: Cura\u00e7ao", + "unicode": "1f1e8-1f1fc" + }, + ":curling_stone:": { + "category": "Activities", + "name": "curling stone", + "unicode": "1f94c" + }, + ":curly_haired_man:": { + "category": "People & Body", + "name": "man: curly hair", + "unicode": "1f468-1f9b1", + "unicode_alt": "1f468-200d-1f9b1" + }, + ":curly_haired_woman:": { + "category": "People & Body", + "name": "woman: curly hair", + "unicode": "1f469-1f9b1", + "unicode_alt": "1f469-200d-1f9b1" + }, + ":curly_loop:": { + "category": "Symbols", + "name": "curly loop", + "unicode": "27b0" + }, + ":currency_exchange:": { + "category": "Symbols", + "name": "currency exchange", + "unicode": "1f4b1" + }, + ":curry:": { + "category": "Food & Drink", + "name": "curry rice", + "unicode": "1f35b" + }, + ":cursing_face:": { + "category": "Smileys & Emotion", + "name": "face with symbols on mouth", + "unicode": "1f92c" + }, + ":custard:": { + "category": "Food & Drink", + "name": "custard", + "unicode": "1f36e" + }, + ":customs:": { + "category": "Symbols", + "name": "customs", + "unicode": "1f6c3" + }, + ":cut_of_meat:": { + "category": "Food & Drink", + "name": "cut of meat", + "unicode": "1f969" + }, + ":cyclone:": { + "category": "Travel & Places", + "name": "cyclone", + "unicode": "1f300" + }, + ":cyprus:": { + "category": "Flags", + "name": "flag: Cyprus", + "unicode": "1f1e8-1f1fe" + }, + ":czech_republic:": { + "category": "Flags", + "name": "flag: Czechia", + "unicode": "1f1e8-1f1ff" + }, + ":dagger:": { + "category": "Objects", + "name": "dagger", + "unicode": "1f5e1", + "unicode_alt": "1f5e1-fe0f" + }, + ":dancers:": { + "category": "People & Body", + "name": "people with bunny ears", + "unicode": "1f46f" + }, + ":dancing_men:": { + "category": "People & Body", + "name": "men with bunny ears", + "unicode": "1f46f-2642", + "unicode_alt": "1f46f-200d-2642-fe0f" + }, + ":dancing_women:": { + "category": "People & Body", + "name": "women with bunny ears", + "unicode": "1f46f-2640", + "unicode_alt": "1f46f-200d-2640-fe0f" + }, + ":dango:": { + "category": "Food & Drink", + "name": "dango", + "unicode": "1f361" + }, + ":dark_sunglasses:": { + "category": "Objects", + "name": "sunglasses", + "unicode": "1f576", + "unicode_alt": "1f576-fe0f" + }, + ":dart:": { + "category": "Activities", + "name": "bullseye", + "unicode": "1f3af" + }, + ":dash:": { + "category": "Smileys & Emotion", + "name": "dashing away", + "unicode": "1f4a8" + }, + ":date:": { + "category": "Objects", + "name": "calendar", + "unicode": "1f4c5" + }, + ":de:": { + "category": "Flags", + "name": "flag: Germany", + "unicode": "1f1e9-1f1ea" + }, + ":deaf_man:": { + "category": "People & Body", + "name": "deaf man", + "unicode": "1f9cf-2642", + "unicode_alt": "1f9cf-200d-2642-fe0f" + }, + ":deaf_person:": { + "category": "People & Body", + "name": "deaf person", + "unicode": "1f9cf" + }, + ":deaf_woman:": { + "category": "People & Body", + "name": "deaf woman", + "unicode": "1f9cf-2640", + "unicode_alt": "1f9cf-200d-2640-fe0f" + }, + ":deciduous_tree:": { + "category": "Animals & Nature", + "name": "deciduous tree", + "unicode": "1f333" + }, + ":deer:": { + "category": "Animals & Nature", + "name": "deer", + "unicode": "1f98c" + }, + ":denmark:": { + "category": "Flags", + "name": "flag: Denmark", + "unicode": "1f1e9-1f1f0" + }, + ":department_store:": { + "category": "Travel & Places", + "name": "department store", + "unicode": "1f3ec" + }, + ":derelict_house:": { + "category": "Travel & Places", + "name": "derelict house", + "unicode": "1f3da", + "unicode_alt": "1f3da-fe0f" + }, + ":desert:": { + "category": "Travel & Places", + "name": "desert", + "unicode": "1f3dc", + "unicode_alt": "1f3dc-fe0f" + }, + ":desert_island:": { + "category": "Travel & Places", + "name": "desert island", + "unicode": "1f3dd", + "unicode_alt": "1f3dd-fe0f" + }, + ":desktop_computer:": { + "category": "Objects", + "name": "desktop computer", + "unicode": "1f5a5", + "unicode_alt": "1f5a5-fe0f" + }, + ":detective:": { + "category": "People & Body", + "name": "detective", + "unicode": "1f575", + "unicode_alt": "1f575-fe0f" + }, + ":diamond_shape_with_a_dot_inside:": { + "category": "Symbols", + "name": "diamond with a dot", + "unicode": "1f4a0" + }, + ":diamonds:": { + "category": "Activities", + "name": "diamond suit", + "unicode": "2666", + "unicode_alt": "2666-fe0f" + }, + ":diego_garcia:": { + "category": "Flags", + "name": "flag: Diego Garcia", + "unicode": "1f1e9-1f1ec" + }, + ":disappointed:": { + "category": "Smileys & Emotion", + "name": "disappointed face", + "unicode": "1f61e" + }, + ":disappointed_relieved:": { + "category": "Smileys & Emotion", + "name": "sad but relieved face", + "unicode": "1f625" + }, + ":disguised_face:": { + "category": "Smileys & Emotion", + "name": "disguised face", + "unicode": "1f978" + }, + ":diving_mask:": { + "category": "Activities", + "name": "diving mask", + "unicode": "1f93f" + }, + ":diya_lamp:": { + "category": "Objects", + "name": "diya lamp", + "unicode": "1fa94" + }, + ":dizzy:": { + "category": "Smileys & Emotion", + "name": "dizzy", + "unicode": "1f4ab" + }, + ":dizzy_face:": { + "category": "Smileys & Emotion", + "name": "face with crossed-out eyes", + "unicode": "1f635" + }, + ":djibouti:": { + "category": "Flags", + "name": "flag: Djibouti", + "unicode": "1f1e9-1f1ef" + }, + ":dna:": { + "category": "Objects", + "name": "dna", + "unicode": "1f9ec" + }, + ":do_not_litter:": { + "category": "Symbols", + "name": "no littering", + "unicode": "1f6af" + }, + ":dodo:": { + "category": "Animals & Nature", + "name": "dodo", + "unicode": "1f9a4" + }, + ":dog2:": { + "category": "Animals & Nature", + "name": "dog", + "unicode": "1f415" + }, + ":dog:": { + "category": "Animals & Nature", + "name": "dog face", + "unicode": "1f436" + }, + ":dollar:": { + "category": "Objects", + "name": "dollar banknote", + "unicode": "1f4b5" + }, + ":dolls:": { + "category": "Activities", + "name": "Japanese dolls", + "unicode": "1f38e" + }, + ":dolphin:": { + "category": "Animals & Nature", + "name": "dolphin", + "unicode": "1f42c" + }, + ":dominica:": { + "category": "Flags", + "name": "flag: Dominica", + "unicode": "1f1e9-1f1f2" + }, + ":dominican_republic:": { + "category": "Flags", + "name": "flag: Dominican Republic", + "unicode": "1f1e9-1f1f4" + }, + ":donkey:": { + "category": "Animals & Nature", + "name": "donkey", + "unicode": "1facf" + }, + ":door:": { + "category": "Objects", + "name": "door", + "unicode": "1f6aa" + }, + ":dotted_line_face:": { + "category": "Smileys & Emotion", + "name": "dotted line face", + "unicode": "1fae5" + }, + ":doughnut:": { + "category": "Food & Drink", + "name": "doughnut", + "unicode": "1f369" + }, + ":dove:": { + "category": "Animals & Nature", + "name": "dove", + "unicode": "1f54a", + "unicode_alt": "1f54a-fe0f" + }, + ":dragon:": { + "category": "Animals & Nature", + "name": "dragon", + "unicode": "1f409" + }, + ":dragon_face:": { + "category": "Animals & Nature", + "name": "dragon face", + "unicode": "1f432" + }, + ":dress:": { + "category": "Objects", + "name": "dress", + "unicode": "1f457" + }, + ":dromedary_camel:": { + "category": "Animals & Nature", + "name": "camel", + "unicode": "1f42a" + }, + ":drooling_face:": { + "category": "Smileys & Emotion", + "name": "drooling face", + "unicode": "1f924" + }, + ":drop_of_blood:": { + "category": "Objects", + "name": "drop of blood", + "unicode": "1fa78" + }, + ":droplet:": { + "category": "Travel & Places", + "name": "droplet", + "unicode": "1f4a7" + }, + ":drum:": { + "category": "Objects", + "name": "drum", + "unicode": "1f941" + }, + ":duck:": { + "category": "Animals & Nature", + "name": "duck", + "unicode": "1f986" + }, + ":dumpling:": { + "category": "Food & Drink", + "name": "dumpling", + "unicode": "1f95f" + }, + ":dvd:": { + "category": "Objects", + "name": "dvd", + "unicode": "1f4c0" + }, + ":eagle:": { + "category": "Animals & Nature", + "name": "eagle", + "unicode": "1f985" + }, + ":ear:": { + "category": "People & Body", + "name": "ear", + "unicode": "1f442" + }, + ":ear_of_rice:": { + "category": "Animals & Nature", + "name": "sheaf of rice", + "unicode": "1f33e" + }, + ":ear_with_hearing_aid:": { + "category": "People & Body", + "name": "ear with hearing aid", + "unicode": "1f9bb" + }, + ":earth_africa:": { + "category": "Travel & Places", + "name": "globe showing Europe-Africa", + "unicode": "1f30d" + }, + ":earth_americas:": { + "category": "Travel & Places", + "name": "globe showing Americas", + "unicode": "1f30e" + }, + ":earth_asia:": { + "category": "Travel & Places", + "name": "globe showing Asia-Australia", + "unicode": "1f30f" + }, + ":ecuador:": { + "category": "Flags", + "name": "flag: Ecuador", + "unicode": "1f1ea-1f1e8" + }, + ":egg:": { + "category": "Food & Drink", + "name": "egg", + "unicode": "1f95a" + }, + ":eggplant:": { + "category": "Food & Drink", + "name": "eggplant", + "unicode": "1f346" + }, + ":egypt:": { + "category": "Flags", + "name": "flag: Egypt", + "unicode": "1f1ea-1f1ec" + }, + ":eight:": { + "category": "Symbols", + "name": "keycap: 8", + "unicode": "0038-20e3", + "unicode_alt": "0038-fe0f-20e3" + }, + ":eight_pointed_black_star:": { + "category": "Symbols", + "name": "eight-pointed star", + "unicode": "2734", + "unicode_alt": "2734-fe0f" + }, + ":eight_spoked_asterisk:": { + "category": "Symbols", + "name": "eight-spoked asterisk", + "unicode": "2733", + "unicode_alt": "2733-fe0f" + }, + ":eject_button:": { + "category": "Symbols", + "name": "eject button", + "unicode": "23cf", + "unicode_alt": "23cf-fe0f" + }, + ":el_salvador:": { + "category": "Flags", + "name": "flag: El Salvador", + "unicode": "1f1f8-1f1fb" + }, + ":electric_plug:": { + "category": "Objects", + "name": "electric plug", + "unicode": "1f50c" + }, + ":elephant:": { + "category": "Animals & Nature", + "name": "elephant", + "unicode": "1f418" + }, + ":elevator:": { + "category": "Objects", + "name": "elevator", + "unicode": "1f6d7" + }, + ":elf:": { + "category": "People & Body", + "name": "elf", + "unicode": "1f9dd" + }, + ":elf_man:": { + "category": "People & Body", + "name": "man elf", + "unicode": "1f9dd-2642", + "unicode_alt": "1f9dd-200d-2642-fe0f" + }, + ":elf_woman:": { + "category": "People & Body", + "name": "woman elf", + "unicode": "1f9dd-2640", + "unicode_alt": "1f9dd-200d-2640-fe0f" + }, + ":email:": { + "category": "Objects", + "name": "e-mail", + "unicode": "1f4e7" + }, + ":empty_nest:": { + "category": "Animals & Nature", + "name": "empty nest", + "unicode": "1fab9" + }, + ":end:": { + "category": "Symbols", + "name": "END arrow", + "unicode": "1f51a" + }, + ":england:": { + "category": "Flags", + "name": "flag: England", + "unicode": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f" + }, + ":envelope:": { + "category": "Objects", + "name": "envelope", + "unicode": "2709", + "unicode_alt": "2709-fe0f" + }, + ":envelope_with_arrow:": { + "category": "Objects", + "name": "envelope with arrow", + "unicode": "1f4e9" + }, + ":equatorial_guinea:": { + "category": "Flags", + "name": "flag: Equatorial Guinea", + "unicode": "1f1ec-1f1f6" + }, + ":eritrea:": { + "category": "Flags", + "name": "flag: Eritrea", + "unicode": "1f1ea-1f1f7" + }, + ":es:": { + "category": "Flags", + "name": "flag: Spain", + "unicode": "1f1ea-1f1f8" + }, + ":estonia:": { + "category": "Flags", + "name": "flag: Estonia", + "unicode": "1f1ea-1f1ea" + }, + ":ethiopia:": { + "category": "Flags", + "name": "flag: Ethiopia", + "unicode": "1f1ea-1f1f9" + }, + ":eu:": { + "category": "Flags", + "name": "flag: European Union", + "unicode": "1f1ea-1f1fa" + }, + ":euro:": { + "category": "Objects", + "name": "euro banknote", + "unicode": "1f4b6" + }, + ":european_castle:": { + "category": "Travel & Places", + "name": "castle", + "unicode": "1f3f0" + }, + ":european_post_office:": { + "category": "Travel & Places", + "name": "post office", + "unicode": "1f3e4" + }, + ":evergreen_tree:": { + "category": "Animals & Nature", + "name": "evergreen tree", + "unicode": "1f332" + }, + ":exclamation:": { + "category": "Symbols", + "name": "red exclamation mark", + "unicode": "2757" + }, + ":exploding_head:": { + "category": "Smileys & Emotion", + "name": "exploding head", + "unicode": "1f92f" + }, + ":expressionless:": { + "category": "Smileys & Emotion", + "name": "expressionless face", + "unicode": "1f611" + }, + ":eye:": { + "category": "People & Body", + "name": "eye", + "unicode": "1f441", + "unicode_alt": "1f441-fe0f" + }, + ":eye_speech_bubble:": { + "category": "Smileys & Emotion", + "name": "eye in speech bubble", + "unicode": "1f441-1f5e8", + "unicode_alt": "1f441-fe0f-200d-1f5e8-fe0f" + }, + ":eyeglasses:": { + "category": "Objects", + "name": "glasses", + "unicode": "1f453" + }, + ":eyes:": { + "category": "People & Body", + "name": "eyes", + "unicode": "1f440" + }, + ":face_exhaling:": { + "category": "Smileys & Emotion", + "name": "face exhaling", + "unicode": "1f62e-1f4a8", + "unicode_alt": "1f62e-200d-1f4a8" + }, + ":face_holding_back_tears:": { + "category": "Smileys & Emotion", + "name": "face holding back tears", + "unicode": "1f979" + }, + ":face_in_clouds:": { + "category": "Smileys & Emotion", + "name": "face in clouds", + "unicode": "1f636-1f32b", + "unicode_alt": "1f636-200d-1f32b-fe0f" + }, + ":face_with_diagonal_mouth:": { + "category": "Smileys & Emotion", + "name": "face with diagonal mouth", + "unicode": "1fae4" + }, + ":face_with_head_bandage:": { + "category": "Smileys & Emotion", + "name": "face with head-bandage", + "unicode": "1f915" + }, + ":face_with_open_eyes_and_hand_over_mouth:": { + "category": "Smileys & Emotion", + "name": "face with open eyes and hand over mouth", + "unicode": "1fae2" + }, + ":face_with_peeking_eye:": { + "category": "Smileys & Emotion", + "name": "face with peeking eye", + "unicode": "1fae3" + }, + ":face_with_spiral_eyes:": { + "category": "Smileys & Emotion", + "name": "face with spiral eyes", + "unicode": "1f635-1f4ab", + "unicode_alt": "1f635-200d-1f4ab" + }, + ":face_with_thermometer:": { + "category": "Smileys & Emotion", + "name": "face with thermometer", + "unicode": "1f912" + }, + ":facepalm:": { + "category": "People & Body", + "name": "person facepalming", + "unicode": "1f926" + }, + ":factory:": { + "category": "Travel & Places", + "name": "factory", + "unicode": "1f3ed" + }, + ":factory_worker:": { + "category": "People & Body", + "name": "factory worker", + "unicode": "1f9d1-1f3ed", + "unicode_alt": "1f9d1-200d-1f3ed" + }, + ":fairy:": { + "category": "People & Body", + "name": "fairy", + "unicode": "1f9da" + }, + ":fairy_man:": { + "category": "People & Body", + "name": "man fairy", + "unicode": "1f9da-2642", + "unicode_alt": "1f9da-200d-2642-fe0f" + }, + ":fairy_woman:": { + "category": "People & Body", + "name": "woman fairy", + "unicode": "1f9da-2640", + "unicode_alt": "1f9da-200d-2640-fe0f" + }, + ":falafel:": { + "category": "Food & Drink", + "name": "falafel", + "unicode": "1f9c6" + }, + ":falkland_islands:": { + "category": "Flags", + "name": "flag: Falkland Islands", + "unicode": "1f1eb-1f1f0" + }, + ":fallen_leaf:": { + "category": "Animals & Nature", + "name": "fallen leaf", + "unicode": "1f342" + }, + ":family:": { + "category": "People & Body", + "name": "family", + "unicode": "1f46a" + }, + ":family_man_boy:": { + "category": "People & Body", + "name": "family: man, boy", + "unicode": "1f468-1f466", + "unicode_alt": "1f468-200d-1f466" + }, + ":family_man_boy_boy:": { + "category": "People & Body", + "name": "family: man, boy, boy", + "unicode": "1f468-1f466-1f466", + "unicode_alt": "1f468-200d-1f466-200d-1f466" + }, + ":family_man_girl:": { + "category": "People & Body", + "name": "family: man, girl", + "unicode": "1f468-1f467", + "unicode_alt": "1f468-200d-1f467" + }, + ":family_man_girl_boy:": { + "category": "People & Body", + "name": "family: man, girl, boy", + "unicode": "1f468-1f467-1f466", + "unicode_alt": "1f468-200d-1f467-200d-1f466" + }, + ":family_man_girl_girl:": { + "category": "People & Body", + "name": "family: man, girl, girl", + "unicode": "1f468-1f467-1f467", + "unicode_alt": "1f468-200d-1f467-200d-1f467" + }, + ":family_man_man_boy:": { + "category": "People & Body", + "name": "family: man, man, boy", + "unicode": "1f468-1f468-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f466" + }, + ":family_man_man_boy_boy:": { + "category": "People & Body", + "name": "family: man, man, boy, boy", + "unicode": "1f468-1f468-1f466-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f466-200d-1f466" + }, + ":family_man_man_girl:": { + "category": "People & Body", + "name": "family: man, man, girl", + "unicode": "1f468-1f468-1f467", + "unicode_alt": "1f468-200d-1f468-200d-1f467" + }, + ":family_man_man_girl_boy:": { + "category": "People & Body", + "name": "family: man, man, girl, boy", + "unicode": "1f468-1f468-1f467-1f466", + "unicode_alt": "1f468-200d-1f468-200d-1f467-200d-1f466" + }, + ":family_man_man_girl_girl:": { + "category": "People & Body", + "name": "family: man, man, girl, girl", + "unicode": "1f468-1f468-1f467-1f467", + "unicode_alt": "1f468-200d-1f468-200d-1f467-200d-1f467" + }, + ":family_man_woman_boy:": { + "category": "People & Body", + "name": "family: man, woman, boy", + "unicode": "1f468-1f469-1f466", + "unicode_alt": "1f468-200d-1f469-200d-1f466" + }, + ":family_man_woman_boy_boy:": { + "category": "People & Body", + "name": "family: man, woman, boy, boy", + "unicode": "1f468-1f469-1f466-1f466", + "unicode_alt": "1f468-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_man_woman_girl:": { + "category": "People & Body", + "name": "family: man, woman, girl", + "unicode": "1f468-1f469-1f467", + "unicode_alt": "1f468-200d-1f469-200d-1f467" + }, + ":family_man_woman_girl_boy:": { + "category": "People & Body", + "name": "family: man, woman, girl, boy", + "unicode": "1f468-1f469-1f467-1f466", + "unicode_alt": "1f468-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_man_woman_girl_girl:": { + "category": "People & Body", + "name": "family: man, woman, girl, girl", + "unicode": "1f468-1f469-1f467-1f467", + "unicode_alt": "1f468-200d-1f469-200d-1f467-200d-1f467" + }, + ":family_woman_boy:": { + "category": "People & Body", + "name": "family: woman, boy", + "unicode": "1f469-1f466", + "unicode_alt": "1f469-200d-1f466" + }, + ":family_woman_boy_boy:": { + "category": "People & Body", + "name": "family: woman, boy, boy", + "unicode": "1f469-1f466-1f466", + "unicode_alt": "1f469-200d-1f466-200d-1f466" + }, + ":family_woman_girl:": { + "category": "People & Body", + "name": "family: woman, girl", + "unicode": "1f469-1f467", + "unicode_alt": "1f469-200d-1f467" + }, + ":family_woman_girl_boy:": { + "category": "People & Body", + "name": "family: woman, girl, boy", + "unicode": "1f469-1f467-1f466", + "unicode_alt": "1f469-200d-1f467-200d-1f466" + }, + ":family_woman_girl_girl:": { + "category": "People & Body", + "name": "family: woman, girl, girl", + "unicode": "1f469-1f467-1f467", + "unicode_alt": "1f469-200d-1f467-200d-1f467" + }, + ":family_woman_woman_boy:": { + "category": "People & Body", + "name": "family: woman, woman, boy", + "unicode": "1f469-1f469-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f466" + }, + ":family_woman_woman_boy_boy:": { + "category": "People & Body", + "name": "family: woman, woman, boy, boy", + "unicode": "1f469-1f469-1f466-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_woman_woman_girl:": { + "category": "People & Body", + "name": "family: woman, woman, girl", + "unicode": "1f469-1f469-1f467", + "unicode_alt": "1f469-200d-1f469-200d-1f467" + }, + ":family_woman_woman_girl_boy:": { + "category": "People & Body", + "name": "family: woman, woman, girl, boy", + "unicode": "1f469-1f469-1f467-1f466", + "unicode_alt": "1f469-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_woman_woman_girl_girl:": { + "category": "People & Body", + "name": "family: woman, woman, girl, girl", + "unicode": "1f469-1f469-1f467-1f467", + "unicode_alt": "1f469-200d-1f469-200d-1f467-200d-1f467" + }, + ":farmer:": { + "category": "People & Body", + "name": "farmer", + "unicode": "1f9d1-1f33e", + "unicode_alt": "1f9d1-200d-1f33e" + }, + ":faroe_islands:": { + "category": "Flags", + "name": "flag: Faroe Islands", + "unicode": "1f1eb-1f1f4" + }, + ":fast_forward:": { + "category": "Symbols", + "name": "fast-forward button", + "unicode": "23e9" + }, + ":fax:": { + "category": "Objects", + "name": "fax machine", + "unicode": "1f4e0" + }, + ":fearful:": { + "category": "Smileys & Emotion", + "name": "fearful face", + "unicode": "1f628" + }, + ":feather:": { + "category": "Animals & Nature", + "name": "feather", + "unicode": "1fab6" + }, + ":feet:": { + "category": "Animals & Nature", + "name": "paw prints", + "unicode": "1f43e" + }, + ":female_detective:": { + "category": "People & Body", + "name": "woman detective", + "unicode": "1f575-2640", + "unicode_alt": "1f575-fe0f-200d-2640-fe0f" + }, + ":female_sign:": { + "category": "Symbols", + "name": "female sign", + "unicode": "2640", + "unicode_alt": "2640-fe0f" + }, + ":ferris_wheel:": { + "category": "Travel & Places", + "name": "ferris wheel", + "unicode": "1f3a1" + }, + ":ferry:": { + "category": "Travel & Places", + "name": "ferry", + "unicode": "26f4", + "unicode_alt": "26f4-fe0f" + }, + ":field_hockey:": { + "category": "Activities", + "name": "field hockey", + "unicode": "1f3d1" + }, + ":fiji:": { + "category": "Flags", + "name": "flag: Fiji", + "unicode": "1f1eb-1f1ef" + }, + ":file_cabinet:": { + "category": "Objects", + "name": "file cabinet", + "unicode": "1f5c4", + "unicode_alt": "1f5c4-fe0f" + }, + ":file_folder:": { + "category": "Objects", + "name": "file folder", + "unicode": "1f4c1" + }, + ":film_projector:": { + "category": "Objects", + "name": "film projector", + "unicode": "1f4fd", + "unicode_alt": "1f4fd-fe0f" + }, + ":film_strip:": { + "category": "Objects", + "name": "film frames", + "unicode": "1f39e", + "unicode_alt": "1f39e-fe0f" + }, + ":finland:": { + "category": "Flags", + "name": "flag: Finland", + "unicode": "1f1eb-1f1ee" + }, + ":fire:": { + "category": "Travel & Places", + "name": "fire", + "unicode": "1f525" + }, + ":fire_engine:": { + "category": "Travel & Places", + "name": "fire engine", + "unicode": "1f692" + }, + ":fire_extinguisher:": { + "category": "Objects", + "name": "fire extinguisher", + "unicode": "1f9ef" + }, + ":firecracker:": { + "category": "Activities", + "name": "firecracker", + "unicode": "1f9e8" + }, + ":firefighter:": { + "category": "People & Body", + "name": "firefighter", + "unicode": "1f9d1-1f692", + "unicode_alt": "1f9d1-200d-1f692" + }, + ":fireworks:": { + "category": "Activities", + "name": "fireworks", + "unicode": "1f386" + }, + ":first_quarter_moon:": { + "category": "Travel & Places", + "name": "first quarter moon", + "unicode": "1f313" + }, + ":first_quarter_moon_with_face:": { + "category": "Travel & Places", + "name": "first quarter moon face", + "unicode": "1f31b" + }, + ":fish:": { + "category": "Animals & Nature", + "name": "fish", + "unicode": "1f41f" + }, + ":fish_cake:": { + "category": "Food & Drink", + "name": "fish cake with swirl", + "unicode": "1f365" + }, + ":fishing_pole_and_fish:": { + "category": "Activities", + "name": "fishing pole", + "unicode": "1f3a3" + }, + ":fist_left:": { + "category": "People & Body", + "name": "left-facing fist", + "unicode": "1f91b" + }, + ":fist_oncoming:": { + "category": "People & Body", + "name": "oncoming fist", + "unicode": "1f44a" + }, + ":fist_raised:": { + "category": "People & Body", + "name": "raised fist", + "unicode": "270a" + }, + ":fist_right:": { + "category": "People & Body", + "name": "right-facing fist", + "unicode": "1f91c" + }, + ":five:": { + "category": "Symbols", + "name": "keycap: 5", + "unicode": "0035-20e3", + "unicode_alt": "0035-fe0f-20e3" + }, + ":flags:": { + "category": "Activities", + "name": "carp streamer", + "unicode": "1f38f" + }, + ":flamingo:": { + "category": "Animals & Nature", + "name": "flamingo", + "unicode": "1f9a9" + }, + ":flashlight:": { + "category": "Objects", + "name": "flashlight", + "unicode": "1f526" + }, + ":flat_shoe:": { + "category": "Objects", + "name": "flat shoe", + "unicode": "1f97f" + }, + ":flatbread:": { + "category": "Food & Drink", + "name": "flatbread", + "unicode": "1fad3" + }, + ":fleur_de_lis:": { + "category": "Symbols", + "name": "fleur-de-lis", + "unicode": "269c", + "unicode_alt": "269c-fe0f" + }, + ":flight_arrival:": { + "category": "Travel & Places", + "name": "airplane arrival", + "unicode": "1f6ec" + }, + ":flight_departure:": { + "category": "Travel & Places", + "name": "airplane departure", + "unicode": "1f6eb" + }, + ":floppy_disk:": { + "category": "Objects", + "name": "floppy disk", + "unicode": "1f4be" + }, + ":flower_playing_cards:": { + "category": "Activities", + "name": "flower playing cards", + "unicode": "1f3b4" + }, + ":flushed:": { + "category": "Smileys & Emotion", + "name": "flushed face", + "unicode": "1f633" + }, + ":flute:": { + "category": "Objects", + "name": "flute", + "unicode": "1fa88" + }, + ":fly:": { + "category": "Animals & Nature", + "name": "fly", + "unicode": "1fab0" + }, + ":flying_disc:": { + "category": "Activities", + "name": "flying disc", + "unicode": "1f94f" + }, + ":flying_saucer:": { + "category": "Travel & Places", + "name": "flying saucer", + "unicode": "1f6f8" + }, + ":fog:": { + "category": "Travel & Places", + "name": "fog", + "unicode": "1f32b", + "unicode_alt": "1f32b-fe0f" + }, + ":foggy:": { + "category": "Travel & Places", + "name": "foggy", + "unicode": "1f301" + }, + ":folding_hand_fan:": { + "category": "Objects", + "name": "folding hand fan", + "unicode": "1faad" + }, + ":fondue:": { + "category": "Food & Drink", + "name": "fondue", + "unicode": "1fad5" + }, + ":foot:": { + "category": "People & Body", + "name": "foot", + "unicode": "1f9b6" + }, + ":football:": { + "category": "Activities", + "name": "american football", + "unicode": "1f3c8" + }, + ":footprints:": { + "category": "People & Body", + "name": "footprints", + "unicode": "1f463" + }, + ":fork_and_knife:": { + "category": "Food & Drink", + "name": "fork and knife", + "unicode": "1f374" + }, + ":fortune_cookie:": { + "category": "Food & Drink", + "name": "fortune cookie", + "unicode": "1f960" + }, + ":fountain:": { + "category": "Travel & Places", + "name": "fountain", + "unicode": "26f2" + }, + ":fountain_pen:": { + "category": "Objects", + "name": "fountain pen", + "unicode": "1f58b", + "unicode_alt": "1f58b-fe0f" + }, + ":four:": { + "category": "Symbols", + "name": "keycap: 4", + "unicode": "0034-20e3", + "unicode_alt": "0034-fe0f-20e3" + }, + ":four_leaf_clover:": { + "category": "Animals & Nature", + "name": "four leaf clover", + "unicode": "1f340" + }, + ":fox_face:": { + "category": "Animals & Nature", + "name": "fox", + "unicode": "1f98a" + }, + ":fr:": { + "category": "Flags", + "name": "flag: France", + "unicode": "1f1eb-1f1f7" + }, + ":framed_picture:": { + "category": "Activities", + "name": "framed picture", + "unicode": "1f5bc", + "unicode_alt": "1f5bc-fe0f" + }, + ":free:": { + "category": "Symbols", + "name": "FREE button", + "unicode": "1f193" + }, + ":french_guiana:": { + "category": "Flags", + "name": "flag: French Guiana", + "unicode": "1f1ec-1f1eb" + }, + ":french_polynesia:": { + "category": "Flags", + "name": "flag: French Polynesia", + "unicode": "1f1f5-1f1eb" + }, + ":french_southern_territories:": { + "category": "Flags", + "name": "flag: French Southern Territories", + "unicode": "1f1f9-1f1eb" + }, + ":fried_egg:": { + "category": "Food & Drink", + "name": "cooking", + "unicode": "1f373" + }, + ":fried_shrimp:": { + "category": "Food & Drink", + "name": "fried shrimp", + "unicode": "1f364" + }, + ":fries:": { + "category": "Food & Drink", + "name": "french fries", + "unicode": "1f35f" + }, + ":frog:": { + "category": "Animals & Nature", + "name": "frog", + "unicode": "1f438" + }, + ":frowning:": { + "category": "Smileys & Emotion", + "name": "frowning face with open mouth", + "unicode": "1f626" + }, + ":frowning_face:": { + "category": "Smileys & Emotion", + "name": "frowning face", + "unicode": "2639", + "unicode_alt": "2639-fe0f" + }, + ":frowning_man:": { + "category": "People & Body", + "name": "man frowning", + "unicode": "1f64d-2642", + "unicode_alt": "1f64d-200d-2642-fe0f" + }, + ":frowning_person:": { + "category": "People & Body", + "name": "person frowning", + "unicode": "1f64d" + }, + ":frowning_woman:": { + "category": "People & Body", + "name": "woman frowning", + "unicode": "1f64d-2640", + "unicode_alt": "1f64d-200d-2640-fe0f" + }, + ":fuelpump:": { + "category": "Travel & Places", + "name": "fuel pump", + "unicode": "26fd" + }, + ":full_moon:": { + "category": "Travel & Places", + "name": "full moon", + "unicode": "1f315" + }, + ":full_moon_with_face:": { + "category": "Travel & Places", + "name": "full moon face", + "unicode": "1f31d" + }, + ":funeral_urn:": { + "category": "Objects", + "name": "funeral urn", + "unicode": "26b1", + "unicode_alt": "26b1-fe0f" + }, + ":gabon:": { + "category": "Flags", + "name": "flag: Gabon", + "unicode": "1f1ec-1f1e6" + }, + ":gambia:": { + "category": "Flags", + "name": "flag: Gambia", + "unicode": "1f1ec-1f1f2" + }, + ":game_die:": { + "category": "Activities", + "name": "game die", + "unicode": "1f3b2" + }, + ":garlic:": { + "category": "Food & Drink", + "name": "garlic", + "unicode": "1f9c4" + }, + ":gb:": { + "category": "Flags", + "name": "flag: United Kingdom", + "unicode": "1f1ec-1f1e7" + }, + ":gear:": { + "category": "Objects", + "name": "gear", + "unicode": "2699", + "unicode_alt": "2699-fe0f" + }, + ":gem:": { + "category": "Objects", + "name": "gem stone", + "unicode": "1f48e" + }, + ":gemini:": { + "category": "Symbols", + "name": "Gemini", + "unicode": "264a" + }, + ":genie:": { + "category": "People & Body", + "name": "genie", + "unicode": "1f9de" + }, + ":genie_man:": { + "category": "People & Body", + "name": "man genie", + "unicode": "1f9de-2642", + "unicode_alt": "1f9de-200d-2642-fe0f" + }, + ":genie_woman:": { + "category": "People & Body", + "name": "woman genie", + "unicode": "1f9de-2640", + "unicode_alt": "1f9de-200d-2640-fe0f" + }, + ":georgia:": { + "category": "Flags", + "name": "flag: Georgia", + "unicode": "1f1ec-1f1ea" + }, + ":ghana:": { + "category": "Flags", + "name": "flag: Ghana", + "unicode": "1f1ec-1f1ed" + }, + ":ghost:": { + "category": "Smileys & Emotion", + "name": "ghost", + "unicode": "1f47b" + }, + ":gibraltar:": { + "category": "Flags", + "name": "flag: Gibraltar", + "unicode": "1f1ec-1f1ee" + }, + ":gift:": { + "category": "Activities", + "name": "wrapped gift", + "unicode": "1f381" + }, + ":gift_heart:": { + "category": "Smileys & Emotion", + "name": "heart with ribbon", + "unicode": "1f49d" + }, + ":ginger_root:": { + "category": "Food & Drink", + "name": "ginger root", + "unicode": "1fada" + }, + ":giraffe:": { + "category": "Animals & Nature", + "name": "giraffe", + "unicode": "1f992" + }, + ":girl:": { + "category": "People & Body", + "name": "girl", + "unicode": "1f467" + }, + ":globe_with_meridians:": { + "category": "Travel & Places", + "name": "globe with meridians", + "unicode": "1f310" + }, + ":gloves:": { + "category": "Objects", + "name": "gloves", + "unicode": "1f9e4" + }, + ":goal_net:": { + "category": "Activities", + "name": "goal net", + "unicode": "1f945" + }, + ":goat:": { + "category": "Animals & Nature", + "name": "goat", + "unicode": "1f410" + }, + ":goggles:": { + "category": "Objects", + "name": "goggles", + "unicode": "1f97d" + }, + ":golf:": { + "category": "Activities", + "name": "flag in hole", + "unicode": "26f3" + }, + ":golfing:": { + "category": "People & Body", + "name": "person golfing", + "unicode": "1f3cc", + "unicode_alt": "1f3cc-fe0f" + }, + ":golfing_man:": { + "category": "People & Body", + "name": "man golfing", + "unicode": "1f3cc-2642", + "unicode_alt": "1f3cc-fe0f-200d-2642-fe0f" + }, + ":golfing_woman:": { + "category": "People & Body", + "name": "woman golfing", + "unicode": "1f3cc-2640", + "unicode_alt": "1f3cc-fe0f-200d-2640-fe0f" + }, + ":goose:": { + "category": "Animals & Nature", + "name": "goose", + "unicode": "1fabf" + }, + ":gorilla:": { + "category": "Animals & Nature", + "name": "gorilla", + "unicode": "1f98d" + }, + ":grapes:": { + "category": "Food & Drink", + "name": "grapes", + "unicode": "1f347" + }, + ":greece:": { + "category": "Flags", + "name": "flag: Greece", + "unicode": "1f1ec-1f1f7" + }, + ":green_apple:": { + "category": "Food & Drink", + "name": "green apple", + "unicode": "1f34f" + }, + ":green_book:": { + "category": "Objects", + "name": "green book", + "unicode": "1f4d7" + }, + ":green_circle:": { + "category": "Symbols", + "name": "green circle", + "unicode": "1f7e2" + }, + ":green_heart:": { + "category": "Smileys & Emotion", + "name": "green heart", + "unicode": "1f49a" + }, + ":green_salad:": { + "category": "Food & Drink", + "name": "green salad", + "unicode": "1f957" + }, + ":green_square:": { + "category": "Symbols", + "name": "green square", + "unicode": "1f7e9" + }, + ":greenland:": { + "category": "Flags", + "name": "flag: Greenland", + "unicode": "1f1ec-1f1f1" + }, + ":grenada:": { + "category": "Flags", + "name": "flag: Grenada", + "unicode": "1f1ec-1f1e9" + }, + ":grey_exclamation:": { + "category": "Symbols", + "name": "white exclamation mark", + "unicode": "2755" + }, + ":grey_heart:": { + "category": "Smileys & Emotion", + "name": "grey heart", + "unicode": "1fa76" + }, + ":grey_question:": { + "category": "Symbols", + "name": "white question mark", + "unicode": "2754" + }, + ":grimacing:": { + "category": "Smileys & Emotion", + "name": "grimacing face", + "unicode": "1f62c" + }, + ":grin:": { + "category": "Smileys & Emotion", + "name": "beaming face with smiling eyes", + "unicode": "1f601" + }, + ":grinning:": { + "category": "Smileys & Emotion", + "name": "grinning face", + "unicode": "1f600" + }, + ":guadeloupe:": { + "category": "Flags", + "name": "flag: Guadeloupe", + "unicode": "1f1ec-1f1f5" + }, + ":guam:": { + "category": "Flags", + "name": "flag: Guam", + "unicode": "1f1ec-1f1fa" + }, + ":guard:": { + "category": "People & Body", + "name": "guard", + "unicode": "1f482" + }, + ":guardsman:": { + "category": "People & Body", + "name": "man guard", + "unicode": "1f482-2642", + "unicode_alt": "1f482-200d-2642-fe0f" + }, + ":guardswoman:": { + "category": "People & Body", + "name": "woman guard", + "unicode": "1f482-2640", + "unicode_alt": "1f482-200d-2640-fe0f" + }, + ":guatemala:": { + "category": "Flags", + "name": "flag: Guatemala", + "unicode": "1f1ec-1f1f9" + }, + ":guernsey:": { + "category": "Flags", + "name": "flag: Guernsey", + "unicode": "1f1ec-1f1ec" + }, + ":guide_dog:": { + "category": "Animals & Nature", + "name": "guide dog", + "unicode": "1f9ae" + }, + ":guinea:": { + "category": "Flags", + "name": "flag: Guinea", + "unicode": "1f1ec-1f1f3" + }, + ":guinea_bissau:": { + "category": "Flags", + "name": "flag: Guinea-Bissau", + "unicode": "1f1ec-1f1fc" + }, + ":guitar:": { + "category": "Objects", + "name": "guitar", + "unicode": "1f3b8" + }, + ":gun:": { + "category": "Activities", + "name": "water pistol", + "unicode": "1f52b" + }, + ":guyana:": { + "category": "Flags", + "name": "flag: Guyana", + "unicode": "1f1ec-1f1fe" + }, + ":hair_pick:": { + "category": "Objects", + "name": "hair pick", + "unicode": "1faae" + }, + ":haircut:": { + "category": "People & Body", + "name": "person getting haircut", + "unicode": "1f487" + }, + ":haircut_man:": { + "category": "People & Body", + "name": "man getting haircut", + "unicode": "1f487-2642", + "unicode_alt": "1f487-200d-2642-fe0f" + }, + ":haircut_woman:": { + "category": "People & Body", + "name": "woman getting haircut", + "unicode": "1f487-2640", + "unicode_alt": "1f487-200d-2640-fe0f" + }, + ":haiti:": { + "category": "Flags", + "name": "flag: Haiti", + "unicode": "1f1ed-1f1f9" + }, + ":hamburger:": { + "category": "Food & Drink", + "name": "hamburger", + "unicode": "1f354" + }, + ":hammer:": { + "category": "Objects", + "name": "hammer", + "unicode": "1f528" + }, + ":hammer_and_pick:": { + "category": "Objects", + "name": "hammer and pick", + "unicode": "2692", + "unicode_alt": "2692-fe0f" + }, + ":hammer_and_wrench:": { + "category": "Objects", + "name": "hammer and wrench", + "unicode": "1f6e0", + "unicode_alt": "1f6e0-fe0f" + }, + ":hamsa:": { + "category": "Objects", + "name": "hamsa", + "unicode": "1faac" + }, + ":hamster:": { + "category": "Animals & Nature", + "name": "hamster", + "unicode": "1f439" + }, + ":hand:": { + "category": "People & Body", + "name": "raised hand", + "unicode": "270b" + }, + ":hand_over_mouth:": { + "category": "Smileys & Emotion", + "name": "face with hand over mouth", + "unicode": "1f92d" + }, + ":hand_with_index_finger_and_thumb_crossed:": { + "category": "People & Body", + "name": "hand with index finger and thumb crossed", + "unicode": "1faf0" + }, + ":handbag:": { + "category": "Objects", + "name": "handbag", + "unicode": "1f45c" + }, + ":handball_person:": { + "category": "People & Body", + "name": "person playing handball", + "unicode": "1f93e" + }, + ":handshake:": { + "category": "People & Body", + "name": "handshake", + "unicode": "1f91d" + }, + ":hankey:": { + "category": "Smileys & Emotion", + "name": "pile of poo", + "unicode": "1f4a9" + }, + ":hash:": { + "category": "Symbols", + "name": "keycap: #", + "unicode": "0023-20e3", + "unicode_alt": "0023-fe0f-20e3" + }, + ":hatched_chick:": { + "category": "Animals & Nature", + "name": "front-facing baby chick", + "unicode": "1f425" + }, + ":hatching_chick:": { + "category": "Animals & Nature", + "name": "hatching chick", + "unicode": "1f423" + }, + ":headphones:": { + "category": "Objects", + "name": "headphone", + "unicode": "1f3a7" + }, + ":headstone:": { + "category": "Objects", + "name": "headstone", + "unicode": "1faa6" + }, + ":health_worker:": { + "category": "People & Body", + "name": "health worker", + "unicode": "1f9d1-2695", + "unicode_alt": "1f9d1-200d-2695-fe0f" + }, + ":hear_no_evil:": { + "category": "Smileys & Emotion", + "name": "hear-no-evil monkey", + "unicode": "1f649" + }, + ":heard_mcdonald_islands:": { + "category": "Flags", + "name": "flag: Heard & McDonald Islands", + "unicode": "1f1ed-1f1f2" + }, + ":heart:": { + "category": "Smileys & Emotion", + "name": "red heart", + "unicode": "2764", + "unicode_alt": "2764-fe0f" + }, + ":heart_decoration:": { + "category": "Smileys & Emotion", + "name": "heart decoration", + "unicode": "1f49f" + }, + ":heart_eyes:": { + "category": "Smileys & Emotion", + "name": "smiling face with heart-eyes", + "unicode": "1f60d" + }, + ":heart_eyes_cat:": { + "category": "Smileys & Emotion", + "name": "smiling cat with heart-eyes", + "unicode": "1f63b" + }, + ":heart_hands:": { + "category": "People & Body", + "name": "heart hands", + "unicode": "1faf6" + }, + ":heart_on_fire:": { + "category": "Smileys & Emotion", + "name": "heart on fire", + "unicode": "2764-1f525", + "unicode_alt": "2764-fe0f-200d-1f525" + }, + ":heartbeat:": { + "category": "Smileys & Emotion", + "name": "beating heart", + "unicode": "1f493" + }, + ":heartpulse:": { + "category": "Smileys & Emotion", + "name": "growing heart", + "unicode": "1f497" + }, + ":hearts:": { + "category": "Activities", + "name": "heart suit", + "unicode": "2665", + "unicode_alt": "2665-fe0f" + }, + ":heavy_check_mark:": { + "category": "Symbols", + "name": "check mark", + "unicode": "2714", + "unicode_alt": "2714-fe0f" + }, + ":heavy_division_sign:": { + "category": "Symbols", + "name": "divide", + "unicode": "2797" + }, + ":heavy_dollar_sign:": { + "category": "Symbols", + "name": "heavy dollar sign", + "unicode": "1f4b2" + }, + ":heavy_equals_sign:": { + "category": "Symbols", + "name": "heavy equals sign", + "unicode": "1f7f0" + }, + ":heavy_heart_exclamation:": { + "category": "Smileys & Emotion", + "name": "heart exclamation", + "unicode": "2763", + "unicode_alt": "2763-fe0f" + }, + ":heavy_minus_sign:": { + "category": "Symbols", + "name": "minus", + "unicode": "2796" + }, + ":heavy_multiplication_x:": { + "category": "Symbols", + "name": "multiply", + "unicode": "2716", + "unicode_alt": "2716-fe0f" + }, + ":heavy_plus_sign:": { + "category": "Symbols", + "name": "plus", + "unicode": "2795" + }, + ":hedgehog:": { + "category": "Animals & Nature", + "name": "hedgehog", + "unicode": "1f994" + }, + ":helicopter:": { + "category": "Travel & Places", + "name": "helicopter", + "unicode": "1f681" + }, + ":herb:": { + "category": "Animals & Nature", + "name": "herb", + "unicode": "1f33f" + }, + ":hibiscus:": { + "category": "Animals & Nature", + "name": "hibiscus", + "unicode": "1f33a" + }, + ":high_brightness:": { + "category": "Symbols", + "name": "bright button", + "unicode": "1f506" + }, + ":high_heel:": { + "category": "Objects", + "name": "high-heeled shoe", + "unicode": "1f460" + }, + ":hiking_boot:": { + "category": "Objects", + "name": "hiking boot", + "unicode": "1f97e" + }, + ":hindu_temple:": { + "category": "Travel & Places", + "name": "hindu temple", + "unicode": "1f6d5" + }, + ":hippopotamus:": { + "category": "Animals & Nature", + "name": "hippopotamus", + "unicode": "1f99b" + }, + ":hocho:": { + "category": "Food & Drink", + "name": "kitchen knife", + "unicode": "1f52a" + }, + ":hole:": { + "category": "Smileys & Emotion", + "name": "hole", + "unicode": "1f573", + "unicode_alt": "1f573-fe0f" + }, + ":honduras:": { + "category": "Flags", + "name": "flag: Honduras", + "unicode": "1f1ed-1f1f3" + }, + ":honey_pot:": { + "category": "Food & Drink", + "name": "honey pot", + "unicode": "1f36f" + }, + ":hong_kong:": { + "category": "Flags", + "name": "flag: Hong Kong SAR China", + "unicode": "1f1ed-1f1f0" + }, + ":hook:": { + "category": "Objects", + "name": "hook", + "unicode": "1fa9d" + }, + ":horse:": { + "category": "Animals & Nature", + "name": "horse face", + "unicode": "1f434" + }, + ":horse_racing:": { + "category": "People & Body", + "name": "horse racing", + "unicode": "1f3c7" + }, + ":hospital:": { + "category": "Travel & Places", + "name": "hospital", + "unicode": "1f3e5" + }, + ":hot_face:": { + "category": "Smileys & Emotion", + "name": "hot face", + "unicode": "1f975" + }, + ":hot_pepper:": { + "category": "Food & Drink", + "name": "hot pepper", + "unicode": "1f336", + "unicode_alt": "1f336-fe0f" + }, + ":hotdog:": { + "category": "Food & Drink", + "name": "hot dog", + "unicode": "1f32d" + }, + ":hotel:": { + "category": "Travel & Places", + "name": "hotel", + "unicode": "1f3e8" + }, + ":hotsprings:": { + "category": "Travel & Places", + "name": "hot springs", + "unicode": "2668", + "unicode_alt": "2668-fe0f" + }, + ":hourglass:": { + "category": "Travel & Places", + "name": "hourglass done", + "unicode": "231b" + }, + ":hourglass_flowing_sand:": { + "category": "Travel & Places", + "name": "hourglass not done", + "unicode": "23f3" + }, + ":house:": { + "category": "Travel & Places", + "name": "house", + "unicode": "1f3e0" + }, + ":house_with_garden:": { + "category": "Travel & Places", + "name": "house with garden", + "unicode": "1f3e1" + }, + ":houses:": { + "category": "Travel & Places", + "name": "houses", + "unicode": "1f3d8", + "unicode_alt": "1f3d8-fe0f" + }, + ":hugs:": { + "category": "Smileys & Emotion", + "name": "smiling face with open hands", + "unicode": "1f917" + }, + ":hungary:": { + "category": "Flags", + "name": "flag: Hungary", + "unicode": "1f1ed-1f1fa" + }, + ":hushed:": { + "category": "Smileys & Emotion", + "name": "hushed face", + "unicode": "1f62f" + }, + ":hut:": { + "category": "Travel & Places", + "name": "hut", + "unicode": "1f6d6" + }, + ":hyacinth:": { + "category": "Animals & Nature", + "name": "hyacinth", + "unicode": "1fabb" + }, + ":ice_cream:": { + "category": "Food & Drink", + "name": "ice cream", + "unicode": "1f368" + }, + ":ice_cube:": { + "category": "Food & Drink", + "name": "ice", + "unicode": "1f9ca" + }, + ":ice_hockey:": { + "category": "Activities", + "name": "ice hockey", + "unicode": "1f3d2" + }, + ":ice_skate:": { + "category": "Activities", + "name": "ice skate", + "unicode": "26f8", + "unicode_alt": "26f8-fe0f" + }, + ":icecream:": { + "category": "Food & Drink", + "name": "soft ice cream", + "unicode": "1f366" + }, + ":iceland:": { + "category": "Flags", + "name": "flag: Iceland", + "unicode": "1f1ee-1f1f8" + }, + ":id:": { + "category": "Symbols", + "name": "ID button", + "unicode": "1f194" + }, + ":identification_card:": { + "category": "Objects", + "name": "identification card", + "unicode": "1faaa" + }, + ":ideograph_advantage:": { + "category": "Symbols", + "name": "Japanese \u201cbargain\u201d button", + "unicode": "1f250" + }, + ":imp:": { + "category": "Smileys & Emotion", + "name": "angry face with horns", + "unicode": "1f47f" + }, + ":inbox_tray:": { + "category": "Objects", + "name": "inbox tray", + "unicode": "1f4e5" + }, + ":incoming_envelope:": { + "category": "Objects", + "name": "incoming envelope", + "unicode": "1f4e8" + }, + ":index_pointing_at_the_viewer:": { + "category": "People & Body", + "name": "index pointing at the viewer", + "unicode": "1faf5" + }, + ":india:": { + "category": "Flags", + "name": "flag: India", + "unicode": "1f1ee-1f1f3" + }, + ":indonesia:": { + "category": "Flags", + "name": "flag: Indonesia", + "unicode": "1f1ee-1f1e9" + }, + ":infinity:": { + "category": "Symbols", + "name": "infinity", + "unicode": "267e", + "unicode_alt": "267e-fe0f" + }, + ":information_source:": { + "category": "Symbols", + "name": "information", + "unicode": "2139", + "unicode_alt": "2139-fe0f" + }, + ":innocent:": { + "category": "Smileys & Emotion", + "name": "smiling face with halo", + "unicode": "1f607" + }, + ":interrobang:": { + "category": "Symbols", + "name": "exclamation question mark", + "unicode": "2049", + "unicode_alt": "2049-fe0f" + }, + ":iphone:": { + "category": "Objects", + "name": "mobile phone", + "unicode": "1f4f1" + }, + ":iran:": { + "category": "Flags", + "name": "flag: Iran", + "unicode": "1f1ee-1f1f7" + }, + ":iraq:": { + "category": "Flags", + "name": "flag: Iraq", + "unicode": "1f1ee-1f1f6" + }, + ":ireland:": { + "category": "Flags", + "name": "flag: Ireland", + "unicode": "1f1ee-1f1ea" + }, + ":isle_of_man:": { + "category": "Flags", + "name": "flag: Isle of Man", + "unicode": "1f1ee-1f1f2" + }, + ":israel:": { + "category": "Flags", + "name": "flag: Israel", + "unicode": "1f1ee-1f1f1" + }, + ":it:": { + "category": "Flags", + "name": "flag: Italy", + "unicode": "1f1ee-1f1f9" + }, + ":izakaya_lantern:": { + "category": "Objects", + "name": "red paper lantern", + "unicode": "1f3ee" + }, + ":jack_o_lantern:": { + "category": "Activities", + "name": "jack-o-lantern", + "unicode": "1f383" + }, + ":jamaica:": { + "category": "Flags", + "name": "flag: Jamaica", + "unicode": "1f1ef-1f1f2" + }, + ":japan:": { + "category": "Travel & Places", + "name": "map of Japan", + "unicode": "1f5fe" + }, + ":japanese_castle:": { + "category": "Travel & Places", + "name": "Japanese castle", + "unicode": "1f3ef" + }, + ":japanese_goblin:": { + "category": "Smileys & Emotion", + "name": "goblin", + "unicode": "1f47a" + }, + ":japanese_ogre:": { + "category": "Smileys & Emotion", + "name": "ogre", + "unicode": "1f479" + }, + ":jar:": { + "category": "Food & Drink", + "name": "jar", + "unicode": "1fad9" + }, + ":jeans:": { + "category": "Objects", + "name": "jeans", + "unicode": "1f456" + }, + ":jellyfish:": { + "category": "Animals & Nature", + "name": "jellyfish", + "unicode": "1fabc" + }, + ":jersey:": { + "category": "Flags", + "name": "flag: Jersey", + "unicode": "1f1ef-1f1ea" + }, + ":jigsaw:": { + "category": "Activities", + "name": "puzzle piece", + "unicode": "1f9e9" + }, + ":jordan:": { + "category": "Flags", + "name": "flag: Jordan", + "unicode": "1f1ef-1f1f4" + }, + ":joy:": { + "category": "Smileys & Emotion", + "name": "face with tears of joy", + "unicode": "1f602" + }, + ":joy_cat:": { + "category": "Smileys & Emotion", + "name": "cat with tears of joy", + "unicode": "1f639" + }, + ":joystick:": { + "category": "Activities", + "name": "joystick", + "unicode": "1f579", + "unicode_alt": "1f579-fe0f" + }, + ":jp:": { + "category": "Flags", + "name": "flag: Japan", + "unicode": "1f1ef-1f1f5" + }, + ":judge:": { + "category": "People & Body", + "name": "judge", + "unicode": "1f9d1-2696", + "unicode_alt": "1f9d1-200d-2696-fe0f" + }, + ":juggling_person:": { + "category": "People & Body", + "name": "person juggling", + "unicode": "1f939" + }, + ":kaaba:": { + "category": "Travel & Places", + "name": "kaaba", + "unicode": "1f54b" + }, + ":kangaroo:": { + "category": "Animals & Nature", + "name": "kangaroo", + "unicode": "1f998" + }, + ":kazakhstan:": { + "category": "Flags", + "name": "flag: Kazakhstan", + "unicode": "1f1f0-1f1ff" + }, + ":kenya:": { + "category": "Flags", + "name": "flag: Kenya", + "unicode": "1f1f0-1f1ea" + }, + ":key:": { + "category": "Objects", + "name": "key", + "unicode": "1f511" + }, + ":keyboard:": { + "category": "Objects", + "name": "keyboard", + "unicode": "2328", + "unicode_alt": "2328-fe0f" + }, + ":keycap_ten:": { + "category": "Symbols", + "name": "keycap: 10", + "unicode": "1f51f" + }, + ":khanda:": { + "category": "Symbols", + "name": "khanda", + "unicode": "1faaf" + }, + ":kick_scooter:": { + "category": "Travel & Places", + "name": "kick scooter", + "unicode": "1f6f4" + }, + ":kimono:": { + "category": "Objects", + "name": "kimono", + "unicode": "1f458" + }, + ":kiribati:": { + "category": "Flags", + "name": "flag: Kiribati", + "unicode": "1f1f0-1f1ee" + }, + ":kiss:": { + "category": "Smileys & Emotion", + "name": "kiss mark", + "unicode": "1f48b" + }, + ":kissing:": { + "category": "Smileys & Emotion", + "name": "kissing face", + "unicode": "1f617" + }, + ":kissing_cat:": { + "category": "Smileys & Emotion", + "name": "kissing cat", + "unicode": "1f63d" + }, + ":kissing_closed_eyes:": { + "category": "Smileys & Emotion", + "name": "kissing face with closed eyes", + "unicode": "1f61a" + }, + ":kissing_heart:": { + "category": "Smileys & Emotion", + "name": "face blowing a kiss", + "unicode": "1f618" + }, + ":kissing_smiling_eyes:": { + "category": "Smileys & Emotion", + "name": "kissing face with smiling eyes", + "unicode": "1f619" + }, + ":kite:": { + "category": "Activities", + "name": "kite", + "unicode": "1fa81" + }, + ":kiwi_fruit:": { + "category": "Food & Drink", + "name": "kiwi fruit", + "unicode": "1f95d" + }, + ":kneeling_man:": { + "category": "People & Body", + "name": "man kneeling", + "unicode": "1f9ce-2642", + "unicode_alt": "1f9ce-200d-2642-fe0f" + }, + ":kneeling_person:": { + "category": "People & Body", + "name": "person kneeling", + "unicode": "1f9ce" + }, + ":kneeling_woman:": { + "category": "People & Body", + "name": "woman kneeling", + "unicode": "1f9ce-2640", + "unicode_alt": "1f9ce-200d-2640-fe0f" + }, + ":knot:": { + "category": "Activities", + "name": "knot", + "unicode": "1faa2" + }, + ":koala:": { + "category": "Animals & Nature", + "name": "koala", + "unicode": "1f428" + }, + ":koko:": { + "category": "Symbols", + "name": "Japanese \u201chere\u201d button", + "unicode": "1f201" + }, + ":kosovo:": { + "category": "Flags", + "name": "flag: Kosovo", + "unicode": "1f1fd-1f1f0" + }, + ":kr:": { + "category": "Flags", + "name": "flag: South Korea", + "unicode": "1f1f0-1f1f7" + }, + ":kuwait:": { + "category": "Flags", + "name": "flag: Kuwait", + "unicode": "1f1f0-1f1fc" + }, + ":kyrgyzstan:": { + "category": "Flags", + "name": "flag: Kyrgyzstan", + "unicode": "1f1f0-1f1ec" + }, + ":lab_coat:": { + "category": "Objects", + "name": "lab coat", + "unicode": "1f97c" + }, + ":label:": { + "category": "Objects", + "name": "label", + "unicode": "1f3f7", + "unicode_alt": "1f3f7-fe0f" + }, + ":lacrosse:": { + "category": "Activities", + "name": "lacrosse", + "unicode": "1f94d" + }, + ":ladder:": { + "category": "Objects", + "name": "ladder", + "unicode": "1fa9c" + }, + ":lady_beetle:": { + "category": "Animals & Nature", + "name": "lady beetle", + "unicode": "1f41e" + }, + ":laos:": { + "category": "Flags", + "name": "flag: Laos", + "unicode": "1f1f1-1f1e6" + }, + ":large_blue_circle:": { + "category": "Symbols", + "name": "blue circle", + "unicode": "1f535" + }, + ":large_blue_diamond:": { + "category": "Symbols", + "name": "large blue diamond", + "unicode": "1f537" + }, + ":large_orange_diamond:": { + "category": "Symbols", + "name": "large orange diamond", + "unicode": "1f536" + }, + ":last_quarter_moon:": { + "category": "Travel & Places", + "name": "last quarter moon", + "unicode": "1f317" + }, + ":last_quarter_moon_with_face:": { + "category": "Travel & Places", + "name": "last quarter moon face", + "unicode": "1f31c" + }, + ":latin_cross:": { + "category": "Symbols", + "name": "latin cross", + "unicode": "271d", + "unicode_alt": "271d-fe0f" + }, + ":latvia:": { + "category": "Flags", + "name": "flag: Latvia", + "unicode": "1f1f1-1f1fb" + }, + ":laughing:": { + "category": "Smileys & Emotion", + "name": "grinning squinting face", + "unicode": "1f606" + }, + ":leafy_green:": { + "category": "Food & Drink", + "name": "leafy green", + "unicode": "1f96c" + }, + ":leaves:": { + "category": "Animals & Nature", + "name": "leaf fluttering in wind", + "unicode": "1f343" + }, + ":lebanon:": { + "category": "Flags", + "name": "flag: Lebanon", + "unicode": "1f1f1-1f1e7" + }, + ":ledger:": { + "category": "Objects", + "name": "ledger", + "unicode": "1f4d2" + }, + ":left_luggage:": { + "category": "Symbols", + "name": "left luggage", + "unicode": "1f6c5" + }, + ":left_right_arrow:": { + "category": "Symbols", + "name": "left-right arrow", + "unicode": "2194", + "unicode_alt": "2194-fe0f" + }, + ":left_speech_bubble:": { + "category": "Smileys & Emotion", + "name": "left speech bubble", + "unicode": "1f5e8", + "unicode_alt": "1f5e8-fe0f" + }, + ":leftwards_arrow_with_hook:": { + "category": "Symbols", + "name": "right arrow curving left", + "unicode": "21a9", + "unicode_alt": "21a9-fe0f" + }, + ":leftwards_hand:": { + "category": "People & Body", + "name": "leftwards hand", + "unicode": "1faf2" + }, + ":leftwards_pushing_hand:": { + "category": "People & Body", + "name": "leftwards pushing hand", + "unicode": "1faf7" + }, + ":leg:": { + "category": "People & Body", + "name": "leg", + "unicode": "1f9b5" + }, + ":lemon:": { + "category": "Food & Drink", + "name": "lemon", + "unicode": "1f34b" + }, + ":leo:": { + "category": "Symbols", + "name": "Leo", + "unicode": "264c" + }, + ":leopard:": { + "category": "Animals & Nature", + "name": "leopard", + "unicode": "1f406" + }, + ":lesotho:": { + "category": "Flags", + "name": "flag: Lesotho", + "unicode": "1f1f1-1f1f8" + }, + ":level_slider:": { + "category": "Objects", + "name": "level slider", + "unicode": "1f39a", + "unicode_alt": "1f39a-fe0f" + }, + ":liberia:": { + "category": "Flags", + "name": "flag: Liberia", + "unicode": "1f1f1-1f1f7" + }, + ":libra:": { + "category": "Symbols", + "name": "Libra", + "unicode": "264e" + }, + ":libya:": { + "category": "Flags", + "name": "flag: Libya", + "unicode": "1f1f1-1f1fe" + }, + ":liechtenstein:": { + "category": "Flags", + "name": "flag: Liechtenstein", + "unicode": "1f1f1-1f1ee" + }, + ":light_blue_heart:": { + "category": "Smileys & Emotion", + "name": "light blue heart", + "unicode": "1fa75" + }, + ":light_rail:": { + "category": "Travel & Places", + "name": "light rail", + "unicode": "1f688" + }, + ":link:": { + "category": "Objects", + "name": "link", + "unicode": "1f517" + }, + ":lion:": { + "category": "Animals & Nature", + "name": "lion", + "unicode": "1f981" + }, + ":lips:": { + "category": "People & Body", + "name": "mouth", + "unicode": "1f444" + }, + ":lipstick:": { + "category": "Objects", + "name": "lipstick", + "unicode": "1f484" + }, + ":lithuania:": { + "category": "Flags", + "name": "flag: Lithuania", + "unicode": "1f1f1-1f1f9" + }, + ":lizard:": { + "category": "Animals & Nature", + "name": "lizard", + "unicode": "1f98e" + }, + ":llama:": { + "category": "Animals & Nature", + "name": "llama", + "unicode": "1f999" + }, + ":lobster:": { + "category": "Food & Drink", + "name": "lobster", + "unicode": "1f99e" + }, + ":lock:": { + "category": "Objects", + "name": "locked", + "unicode": "1f512" + }, + ":lock_with_ink_pen:": { + "category": "Objects", + "name": "locked with pen", + "unicode": "1f50f" + }, + ":lollipop:": { + "category": "Food & Drink", + "name": "lollipop", + "unicode": "1f36d" + }, + ":long_drum:": { + "category": "Objects", + "name": "long drum", + "unicode": "1fa98" + }, + ":loop:": { + "category": "Symbols", + "name": "double curly loop", + "unicode": "27bf" + }, + ":lotion_bottle:": { + "category": "Objects", + "name": "lotion bottle", + "unicode": "1f9f4" + }, + ":lotus:": { + "category": "Animals & Nature", + "name": "lotus", + "unicode": "1fab7" + }, + ":lotus_position:": { + "category": "People & Body", + "name": "person in lotus position", + "unicode": "1f9d8" + }, + ":lotus_position_man:": { + "category": "People & Body", + "name": "man in lotus position", + "unicode": "1f9d8-2642", + "unicode_alt": "1f9d8-200d-2642-fe0f" + }, + ":lotus_position_woman:": { + "category": "People & Body", + "name": "woman in lotus position", + "unicode": "1f9d8-2640", + "unicode_alt": "1f9d8-200d-2640-fe0f" + }, + ":loud_sound:": { + "category": "Objects", + "name": "speaker high volume", + "unicode": "1f50a" + }, + ":loudspeaker:": { + "category": "Objects", + "name": "loudspeaker", + "unicode": "1f4e2" + }, + ":love_hotel:": { + "category": "Travel & Places", + "name": "love hotel", + "unicode": "1f3e9" + }, + ":love_letter:": { + "category": "Smileys & Emotion", + "name": "love letter", + "unicode": "1f48c" + }, + ":love_you_gesture:": { + "category": "People & Body", + "name": "love-you gesture", + "unicode": "1f91f" + }, + ":low_battery:": { + "category": "Objects", + "name": "low battery", + "unicode": "1faab" + }, + ":low_brightness:": { + "category": "Symbols", + "name": "dim button", + "unicode": "1f505" + }, + ":luggage:": { + "category": "Travel & Places", + "name": "luggage", + "unicode": "1f9f3" + }, + ":lungs:": { + "category": "People & Body", + "name": "lungs", + "unicode": "1fac1" + }, + ":luxembourg:": { + "category": "Flags", + "name": "flag: Luxembourg", + "unicode": "1f1f1-1f1fa" + }, + ":lying_face:": { + "category": "Smileys & Emotion", + "name": "lying face", + "unicode": "1f925" + }, + ":m:": { + "category": "Symbols", + "name": "circled M", + "unicode": "24c2", + "unicode_alt": "24c2-fe0f" + }, + ":macau:": { + "category": "Flags", + "name": "flag: Macao SAR China", + "unicode": "1f1f2-1f1f4" + }, + ":macedonia:": { + "category": "Flags", + "name": "flag: North Macedonia", + "unicode": "1f1f2-1f1f0" + }, + ":madagascar:": { + "category": "Flags", + "name": "flag: Madagascar", + "unicode": "1f1f2-1f1ec" + }, + ":mag:": { + "category": "Objects", + "name": "magnifying glass tilted left", + "unicode": "1f50d" + }, + ":mag_right:": { + "category": "Objects", + "name": "magnifying glass tilted right", + "unicode": "1f50e" + }, + ":mage:": { + "category": "People & Body", + "name": "mage", + "unicode": "1f9d9" + }, + ":mage_man:": { + "category": "People & Body", + "name": "man mage", + "unicode": "1f9d9-2642", + "unicode_alt": "1f9d9-200d-2642-fe0f" + }, + ":mage_woman:": { + "category": "People & Body", + "name": "woman mage", + "unicode": "1f9d9-2640", + "unicode_alt": "1f9d9-200d-2640-fe0f" + }, + ":magic_wand:": { + "category": "Activities", + "name": "magic wand", + "unicode": "1fa84" + }, + ":magnet:": { + "category": "Objects", + "name": "magnet", + "unicode": "1f9f2" + }, + ":mahjong:": { + "category": "Activities", + "name": "mahjong red dragon", + "unicode": "1f004" + }, + ":mailbox:": { + "category": "Objects", + "name": "closed mailbox with raised flag", + "unicode": "1f4eb" + }, + ":mailbox_closed:": { + "category": "Objects", + "name": "closed mailbox with lowered flag", + "unicode": "1f4ea" + }, + ":mailbox_with_mail:": { + "category": "Objects", + "name": "open mailbox with raised flag", + "unicode": "1f4ec" + }, + ":mailbox_with_no_mail:": { + "category": "Objects", + "name": "open mailbox with lowered flag", + "unicode": "1f4ed" + }, + ":malawi:": { + "category": "Flags", + "name": "flag: Malawi", + "unicode": "1f1f2-1f1fc" + }, + ":malaysia:": { + "category": "Flags", + "name": "flag: Malaysia", + "unicode": "1f1f2-1f1fe" + }, + ":maldives:": { + "category": "Flags", + "name": "flag: Maldives", + "unicode": "1f1f2-1f1fb" + }, + ":male_detective:": { + "category": "People & Body", + "name": "man detective", + "unicode": "1f575-2642", + "unicode_alt": "1f575-fe0f-200d-2642-fe0f" + }, + ":male_sign:": { + "category": "Symbols", + "name": "male sign", + "unicode": "2642", + "unicode_alt": "2642-fe0f" + }, + ":mali:": { + "category": "Flags", + "name": "flag: Mali", + "unicode": "1f1f2-1f1f1" + }, + ":malta:": { + "category": "Flags", + "name": "flag: Malta", + "unicode": "1f1f2-1f1f9" + }, + ":mammoth:": { + "category": "Animals & Nature", + "name": "mammoth", + "unicode": "1f9a3" + }, + ":man:": { + "category": "People & Body", + "name": "man", + "unicode": "1f468" + }, + ":man_artist:": { + "category": "People & Body", + "name": "man artist", + "unicode": "1f468-1f3a8", + "unicode_alt": "1f468-200d-1f3a8" + }, + ":man_astronaut:": { + "category": "People & Body", + "name": "man astronaut", + "unicode": "1f468-1f680", + "unicode_alt": "1f468-200d-1f680" + }, + ":man_beard:": { + "category": "People & Body", + "name": "man: beard", + "unicode": "1f9d4-2642", + "unicode_alt": "1f9d4-200d-2642-fe0f" + }, + ":man_cartwheeling:": { + "category": "People & Body", + "name": "man cartwheeling", + "unicode": "1f938-2642", + "unicode_alt": "1f938-200d-2642-fe0f" + }, + ":man_cook:": { + "category": "People & Body", + "name": "man cook", + "unicode": "1f468-1f373", + "unicode_alt": "1f468-200d-1f373" + }, + ":man_dancing:": { + "category": "People & Body", + "name": "man dancing", + "unicode": "1f57a" + }, + ":man_facepalming:": { + "category": "People & Body", + "name": "man facepalming", + "unicode": "1f926-2642", + "unicode_alt": "1f926-200d-2642-fe0f" + }, + ":man_factory_worker:": { + "category": "People & Body", + "name": "man factory worker", + "unicode": "1f468-1f3ed", + "unicode_alt": "1f468-200d-1f3ed" + }, + ":man_farmer:": { + "category": "People & Body", + "name": "man farmer", + "unicode": "1f468-1f33e", + "unicode_alt": "1f468-200d-1f33e" + }, + ":man_feeding_baby:": { + "category": "People & Body", + "name": "man feeding baby", + "unicode": "1f468-1f37c", + "unicode_alt": "1f468-200d-1f37c" + }, + ":man_firefighter:": { + "category": "People & Body", + "name": "man firefighter", + "unicode": "1f468-1f692", + "unicode_alt": "1f468-200d-1f692" + }, + ":man_health_worker:": { + "category": "People & Body", + "name": "man health worker", + "unicode": "1f468-2695", + "unicode_alt": "1f468-200d-2695-fe0f" + }, + ":man_in_manual_wheelchair:": { + "category": "People & Body", + "name": "man in manual wheelchair", + "unicode": "1f468-1f9bd", + "unicode_alt": "1f468-200d-1f9bd" + }, + ":man_in_motorized_wheelchair:": { + "category": "People & Body", + "name": "man in motorized wheelchair", + "unicode": "1f468-1f9bc", + "unicode_alt": "1f468-200d-1f9bc" + }, + ":man_in_tuxedo:": { + "category": "People & Body", + "name": "man in tuxedo", + "unicode": "1f935-2642", + "unicode_alt": "1f935-200d-2642-fe0f" + }, + ":man_judge:": { + "category": "People & Body", + "name": "man judge", + "unicode": "1f468-2696", + "unicode_alt": "1f468-200d-2696-fe0f" + }, + ":man_juggling:": { + "category": "People & Body", + "name": "man juggling", + "unicode": "1f939-2642", + "unicode_alt": "1f939-200d-2642-fe0f" + }, + ":man_mechanic:": { + "category": "People & Body", + "name": "man mechanic", + "unicode": "1f468-1f527", + "unicode_alt": "1f468-200d-1f527" + }, + ":man_office_worker:": { + "category": "People & Body", + "name": "man office worker", + "unicode": "1f468-1f4bc", + "unicode_alt": "1f468-200d-1f4bc" + }, + ":man_pilot:": { + "category": "People & Body", + "name": "man pilot", + "unicode": "1f468-2708", + "unicode_alt": "1f468-200d-2708-fe0f" + }, + ":man_playing_handball:": { + "category": "People & Body", + "name": "man playing handball", + "unicode": "1f93e-2642", + "unicode_alt": "1f93e-200d-2642-fe0f" + }, + ":man_playing_water_polo:": { + "category": "People & Body", + "name": "man playing water polo", + "unicode": "1f93d-2642", + "unicode_alt": "1f93d-200d-2642-fe0f" + }, + ":man_scientist:": { + "category": "People & Body", + "name": "man scientist", + "unicode": "1f468-1f52c", + "unicode_alt": "1f468-200d-1f52c" + }, + ":man_shrugging:": { + "category": "People & Body", + "name": "man shrugging", + "unicode": "1f937-2642", + "unicode_alt": "1f937-200d-2642-fe0f" + }, + ":man_singer:": { + "category": "People & Body", + "name": "man singer", + "unicode": "1f468-1f3a4", + "unicode_alt": "1f468-200d-1f3a4" + }, + ":man_student:": { + "category": "People & Body", + "name": "man student", + "unicode": "1f468-1f393", + "unicode_alt": "1f468-200d-1f393" + }, + ":man_teacher:": { + "category": "People & Body", + "name": "man teacher", + "unicode": "1f468-1f3eb", + "unicode_alt": "1f468-200d-1f3eb" + }, + ":man_technologist:": { + "category": "People & Body", + "name": "man technologist", + "unicode": "1f468-1f4bb", + "unicode_alt": "1f468-200d-1f4bb" + }, + ":man_with_gua_pi_mao:": { + "category": "People & Body", + "name": "person with skullcap", + "unicode": "1f472" + }, + ":man_with_probing_cane:": { + "category": "People & Body", + "name": "man with white cane", + "unicode": "1f468-1f9af", + "unicode_alt": "1f468-200d-1f9af" + }, + ":man_with_turban:": { + "category": "People & Body", + "name": "man wearing turban", + "unicode": "1f473-2642", + "unicode_alt": "1f473-200d-2642-fe0f" + }, + ":man_with_veil:": { + "category": "People & Body", + "name": "man with veil", + "unicode": "1f470-2642", + "unicode_alt": "1f470-200d-2642-fe0f" + }, + ":mango:": { + "category": "Food & Drink", + "name": "mango", + "unicode": "1f96d" + }, + ":mans_shoe:": { + "category": "Objects", + "name": "man\u2019s shoe", + "unicode": "1f45e" + }, + ":mantelpiece_clock:": { + "category": "Travel & Places", + "name": "mantelpiece clock", + "unicode": "1f570", + "unicode_alt": "1f570-fe0f" + }, + ":manual_wheelchair:": { + "category": "Travel & Places", + "name": "manual wheelchair", + "unicode": "1f9bd" + }, + ":maple_leaf:": { + "category": "Animals & Nature", + "name": "maple leaf", + "unicode": "1f341" + }, + ":maracas:": { + "category": "Objects", + "name": "maracas", + "unicode": "1fa87" + }, + ":marshall_islands:": { + "category": "Flags", + "name": "flag: Marshall Islands", + "unicode": "1f1f2-1f1ed" + }, + ":martial_arts_uniform:": { + "category": "Activities", + "name": "martial arts uniform", + "unicode": "1f94b" + }, + ":martinique:": { + "category": "Flags", + "name": "flag: Martinique", + "unicode": "1f1f2-1f1f6" + }, + ":mask:": { + "category": "Smileys & Emotion", + "name": "face with medical mask", + "unicode": "1f637" + }, + ":massage:": { + "category": "People & Body", + "name": "person getting massage", + "unicode": "1f486" + }, + ":massage_man:": { + "category": "People & Body", + "name": "man getting massage", + "unicode": "1f486-2642", + "unicode_alt": "1f486-200d-2642-fe0f" + }, + ":massage_woman:": { + "category": "People & Body", + "name": "woman getting massage", + "unicode": "1f486-2640", + "unicode_alt": "1f486-200d-2640-fe0f" + }, + ":mate:": { + "category": "Food & Drink", + "name": "mate", + "unicode": "1f9c9" + }, + ":mauritania:": { + "category": "Flags", + "name": "flag: Mauritania", + "unicode": "1f1f2-1f1f7" + }, + ":mauritius:": { + "category": "Flags", + "name": "flag: Mauritius", + "unicode": "1f1f2-1f1fa" + }, + ":mayotte:": { + "category": "Flags", + "name": "flag: Mayotte", + "unicode": "1f1fe-1f1f9" + }, + ":meat_on_bone:": { + "category": "Food & Drink", + "name": "meat on bone", + "unicode": "1f356" + }, + ":mechanic:": { + "category": "People & Body", + "name": "mechanic", + "unicode": "1f9d1-1f527", + "unicode_alt": "1f9d1-200d-1f527" + }, + ":mechanical_arm:": { + "category": "People & Body", + "name": "mechanical arm", + "unicode": "1f9be" + }, + ":mechanical_leg:": { + "category": "People & Body", + "name": "mechanical leg", + "unicode": "1f9bf" + }, + ":medal_military:": { + "category": "Activities", + "name": "military medal", + "unicode": "1f396", + "unicode_alt": "1f396-fe0f" + }, + ":medal_sports:": { + "category": "Activities", + "name": "sports medal", + "unicode": "1f3c5" + }, + ":medical_symbol:": { + "category": "Symbols", + "name": "medical symbol", + "unicode": "2695", + "unicode_alt": "2695-fe0f" + }, + ":mega:": { + "category": "Objects", + "name": "megaphone", + "unicode": "1f4e3" + }, + ":melon:": { + "category": "Food & Drink", + "name": "melon", + "unicode": "1f348" + }, + ":melting_face:": { + "category": "Smileys & Emotion", + "name": "melting face", + "unicode": "1fae0" + }, + ":memo:": { + "category": "Objects", + "name": "memo", + "unicode": "1f4dd" + }, + ":men_wrestling:": { + "category": "People & Body", + "name": "men wrestling", + "unicode": "1f93c-2642", + "unicode_alt": "1f93c-200d-2642-fe0f" + }, + ":mending_heart:": { + "category": "Smileys & Emotion", + "name": "mending heart", + "unicode": "2764-1fa79", + "unicode_alt": "2764-fe0f-200d-1fa79" + }, + ":menorah:": { + "category": "Symbols", + "name": "menorah", + "unicode": "1f54e" + }, + ":mens:": { + "category": "Symbols", + "name": "men\u2019s room", + "unicode": "1f6b9" + }, + ":mermaid:": { + "category": "People & Body", + "name": "mermaid", + "unicode": "1f9dc-2640", + "unicode_alt": "1f9dc-200d-2640-fe0f" + }, + ":merman:": { + "category": "People & Body", + "name": "merman", + "unicode": "1f9dc-2642", + "unicode_alt": "1f9dc-200d-2642-fe0f" + }, + ":merperson:": { + "category": "People & Body", + "name": "merperson", + "unicode": "1f9dc" + }, + ":metal:": { + "category": "People & Body", + "name": "sign of the horns", + "unicode": "1f918" + }, + ":metro:": { + "category": "Travel & Places", + "name": "metro", + "unicode": "1f687" + }, + ":mexico:": { + "category": "Flags", + "name": "flag: Mexico", + "unicode": "1f1f2-1f1fd" + }, + ":microbe:": { + "category": "Animals & Nature", + "name": "microbe", + "unicode": "1f9a0" + }, + ":micronesia:": { + "category": "Flags", + "name": "flag: Micronesia", + "unicode": "1f1eb-1f1f2" + }, + ":microphone:": { + "category": "Objects", + "name": "microphone", + "unicode": "1f3a4" + }, + ":microscope:": { + "category": "Objects", + "name": "microscope", + "unicode": "1f52c" + }, + ":middle_finger:": { + "category": "People & Body", + "name": "middle finger", + "unicode": "1f595" + }, + ":military_helmet:": { + "category": "Objects", + "name": "military helmet", + "unicode": "1fa96" + }, + ":milk_glass:": { + "category": "Food & Drink", + "name": "glass of milk", + "unicode": "1f95b" + }, + ":milky_way:": { + "category": "Travel & Places", + "name": "milky way", + "unicode": "1f30c" + }, + ":minibus:": { + "category": "Travel & Places", + "name": "minibus", + "unicode": "1f690" + }, + ":minidisc:": { + "category": "Objects", + "name": "computer disk", + "unicode": "1f4bd" + }, + ":mirror:": { + "category": "Objects", + "name": "mirror", + "unicode": "1fa9e" + }, + ":mirror_ball:": { + "category": "Activities", + "name": "mirror ball", + "unicode": "1faa9" + }, + ":mobile_phone_off:": { + "category": "Symbols", + "name": "mobile phone off", + "unicode": "1f4f4" + }, + ":moldova:": { + "category": "Flags", + "name": "flag: Moldova", + "unicode": "1f1f2-1f1e9" + }, + ":monaco:": { + "category": "Flags", + "name": "flag: Monaco", + "unicode": "1f1f2-1f1e8" + }, + ":money_mouth_face:": { + "category": "Smileys & Emotion", + "name": "money-mouth face", + "unicode": "1f911" + }, + ":money_with_wings:": { + "category": "Objects", + "name": "money with wings", + "unicode": "1f4b8" + }, + ":moneybag:": { + "category": "Objects", + "name": "money bag", + "unicode": "1f4b0" + }, + ":mongolia:": { + "category": "Flags", + "name": "flag: Mongolia", + "unicode": "1f1f2-1f1f3" + }, + ":monkey:": { + "category": "Animals & Nature", + "name": "monkey", + "unicode": "1f412" + }, + ":monkey_face:": { + "category": "Animals & Nature", + "name": "monkey face", + "unicode": "1f435" + }, + ":monocle_face:": { + "category": "Smileys & Emotion", + "name": "face with monocle", + "unicode": "1f9d0" + }, + ":monorail:": { + "category": "Travel & Places", + "name": "monorail", + "unicode": "1f69d" + }, + ":montenegro:": { + "category": "Flags", + "name": "flag: Montenegro", + "unicode": "1f1f2-1f1ea" + }, + ":montserrat:": { + "category": "Flags", + "name": "flag: Montserrat", + "unicode": "1f1f2-1f1f8" + }, + ":moon:": { + "category": "Travel & Places", + "name": "waxing gibbous moon", + "unicode": "1f314" + }, + ":moon_cake:": { + "category": "Food & Drink", + "name": "moon cake", + "unicode": "1f96e" + }, + ":moose:": { + "category": "Animals & Nature", + "name": "moose", + "unicode": "1face" + }, + ":morocco:": { + "category": "Flags", + "name": "flag: Morocco", + "unicode": "1f1f2-1f1e6" + }, + ":mortar_board:": { + "category": "Objects", + "name": "graduation cap", + "unicode": "1f393" + }, + ":mosque:": { + "category": "Travel & Places", + "name": "mosque", + "unicode": "1f54c" + }, + ":mosquito:": { + "category": "Animals & Nature", + "name": "mosquito", + "unicode": "1f99f" + }, + ":motor_boat:": { + "category": "Travel & Places", + "name": "motor boat", + "unicode": "1f6e5", + "unicode_alt": "1f6e5-fe0f" + }, + ":motor_scooter:": { + "category": "Travel & Places", + "name": "motor scooter", + "unicode": "1f6f5" + }, + ":motorcycle:": { + "category": "Travel & Places", + "name": "motorcycle", + "unicode": "1f3cd", + "unicode_alt": "1f3cd-fe0f" + }, + ":motorized_wheelchair:": { + "category": "Travel & Places", + "name": "motorized wheelchair", + "unicode": "1f9bc" + }, + ":motorway:": { + "category": "Travel & Places", + "name": "motorway", + "unicode": "1f6e3", + "unicode_alt": "1f6e3-fe0f" + }, + ":mount_fuji:": { + "category": "Travel & Places", + "name": "mount fuji", + "unicode": "1f5fb" + }, + ":mountain:": { + "category": "Travel & Places", + "name": "mountain", + "unicode": "26f0", + "unicode_alt": "26f0-fe0f" + }, + ":mountain_bicyclist:": { + "category": "People & Body", + "name": "person mountain biking", + "unicode": "1f6b5" + }, + ":mountain_biking_man:": { + "category": "People & Body", + "name": "man mountain biking", + "unicode": "1f6b5-2642", + "unicode_alt": "1f6b5-200d-2642-fe0f" + }, + ":mountain_biking_woman:": { + "category": "People & Body", + "name": "woman mountain biking", + "unicode": "1f6b5-2640", + "unicode_alt": "1f6b5-200d-2640-fe0f" + }, + ":mountain_cableway:": { + "category": "Travel & Places", + "name": "mountain cableway", + "unicode": "1f6a0" + }, + ":mountain_railway:": { + "category": "Travel & Places", + "name": "mountain railway", + "unicode": "1f69e" + }, + ":mountain_snow:": { + "category": "Travel & Places", + "name": "snow-capped mountain", + "unicode": "1f3d4", + "unicode_alt": "1f3d4-fe0f" + }, + ":mouse2:": { + "category": "Animals & Nature", + "name": "mouse", + "unicode": "1f401" + }, + ":mouse:": { + "category": "Animals & Nature", + "name": "mouse face", + "unicode": "1f42d" + }, + ":mouse_trap:": { + "category": "Objects", + "name": "mouse trap", + "unicode": "1faa4" + }, + ":movie_camera:": { + "category": "Objects", + "name": "movie camera", + "unicode": "1f3a5" + }, + ":moyai:": { + "category": "Objects", + "name": "moai", + "unicode": "1f5ff" + }, + ":mozambique:": { + "category": "Flags", + "name": "flag: Mozambique", + "unicode": "1f1f2-1f1ff" + }, + ":mrs_claus:": { + "category": "People & Body", + "name": "Mrs. Claus", + "unicode": "1f936" + }, + ":muscle:": { + "category": "People & Body", + "name": "flexed biceps", + "unicode": "1f4aa" + }, + ":mushroom:": { + "category": "Animals & Nature", + "name": "mushroom", + "unicode": "1f344" + }, + ":musical_keyboard:": { + "category": "Objects", + "name": "musical keyboard", + "unicode": "1f3b9" + }, + ":musical_note:": { + "category": "Objects", + "name": "musical note", + "unicode": "1f3b5" + }, + ":musical_score:": { + "category": "Objects", + "name": "musical score", + "unicode": "1f3bc" + }, + ":mute:": { + "category": "Objects", + "name": "muted speaker", + "unicode": "1f507" + }, + ":mx_claus:": { + "category": "People & Body", + "name": "mx claus", + "unicode": "1f9d1-1f384", + "unicode_alt": "1f9d1-200d-1f384" + }, + ":myanmar:": { + "category": "Flags", + "name": "flag: Myanmar (Burma)", + "unicode": "1f1f2-1f1f2" + }, + ":nail_care:": { + "category": "People & Body", + "name": "nail polish", + "unicode": "1f485" + }, + ":name_badge:": { + "category": "Symbols", + "name": "name badge", + "unicode": "1f4db" + }, + ":namibia:": { + "category": "Flags", + "name": "flag: Namibia", + "unicode": "1f1f3-1f1e6" + }, + ":national_park:": { + "category": "Travel & Places", + "name": "national park", + "unicode": "1f3de", + "unicode_alt": "1f3de-fe0f" + }, + ":nauru:": { + "category": "Flags", + "name": "flag: Nauru", + "unicode": "1f1f3-1f1f7" + }, + ":nauseated_face:": { + "category": "Smileys & Emotion", + "name": "nauseated face", + "unicode": "1f922" + }, + ":nazar_amulet:": { + "category": "Objects", + "name": "nazar amulet", + "unicode": "1f9ff" + }, + ":necktie:": { + "category": "Objects", + "name": "necktie", + "unicode": "1f454" + }, + ":negative_squared_cross_mark:": { + "category": "Symbols", + "name": "cross mark button", + "unicode": "274e" + }, + ":nepal:": { + "category": "Flags", + "name": "flag: Nepal", + "unicode": "1f1f3-1f1f5" + }, + ":nerd_face:": { + "category": "Smileys & Emotion", + "name": "nerd face", + "unicode": "1f913" + }, + ":nest_with_eggs:": { + "category": "Animals & Nature", + "name": "nest with eggs", + "unicode": "1faba" + }, + ":nesting_dolls:": { + "category": "Activities", + "name": "nesting dolls", + "unicode": "1fa86" + }, + ":netherlands:": { + "category": "Flags", + "name": "flag: Netherlands", + "unicode": "1f1f3-1f1f1" + }, + ":neutral_face:": { + "category": "Smileys & Emotion", + "name": "neutral face", + "unicode": "1f610" + }, + ":new:": { + "category": "Symbols", + "name": "NEW button", + "unicode": "1f195" + }, + ":new_caledonia:": { + "category": "Flags", + "name": "flag: New Caledonia", + "unicode": "1f1f3-1f1e8" + }, + ":new_moon:": { + "category": "Travel & Places", + "name": "new moon", + "unicode": "1f311" + }, + ":new_moon_with_face:": { + "category": "Travel & Places", + "name": "new moon face", + "unicode": "1f31a" + }, + ":new_zealand:": { + "category": "Flags", + "name": "flag: New Zealand", + "unicode": "1f1f3-1f1ff" + }, + ":newspaper:": { + "category": "Objects", + "name": "newspaper", + "unicode": "1f4f0" + }, + ":newspaper_roll:": { + "category": "Objects", + "name": "rolled-up newspaper", + "unicode": "1f5de", + "unicode_alt": "1f5de-fe0f" + }, + ":next_track_button:": { + "category": "Symbols", + "name": "next track button", + "unicode": "23ed", + "unicode_alt": "23ed-fe0f" + }, + ":ng:": { + "category": "Symbols", + "name": "NG button", + "unicode": "1f196" + }, + ":nicaragua:": { + "category": "Flags", + "name": "flag: Nicaragua", + "unicode": "1f1f3-1f1ee" + }, + ":niger:": { + "category": "Flags", + "name": "flag: Niger", + "unicode": "1f1f3-1f1ea" + }, + ":nigeria:": { + "category": "Flags", + "name": "flag: Nigeria", + "unicode": "1f1f3-1f1ec" + }, + ":night_with_stars:": { + "category": "Travel & Places", + "name": "night with stars", + "unicode": "1f303" + }, + ":nine:": { + "category": "Symbols", + "name": "keycap: 9", + "unicode": "0039-20e3", + "unicode_alt": "0039-fe0f-20e3" + }, + ":ninja:": { + "category": "People & Body", + "name": "ninja", + "unicode": "1f977" + }, + ":niue:": { + "category": "Flags", + "name": "flag: Niue", + "unicode": "1f1f3-1f1fa" + }, + ":no_bell:": { + "category": "Objects", + "name": "bell with slash", + "unicode": "1f515" + }, + ":no_bicycles:": { + "category": "Symbols", + "name": "no bicycles", + "unicode": "1f6b3" + }, + ":no_entry:": { + "category": "Symbols", + "name": "no entry", + "unicode": "26d4" + }, + ":no_entry_sign:": { + "category": "Symbols", + "name": "prohibited", + "unicode": "1f6ab" + }, + ":no_good:": { + "category": "People & Body", + "name": "person gesturing NO", + "unicode": "1f645" + }, + ":no_good_man:": { + "category": "People & Body", + "name": "man gesturing NO", + "unicode": "1f645-2642", + "unicode_alt": "1f645-200d-2642-fe0f" + }, + ":no_good_woman:": { + "category": "People & Body", + "name": "woman gesturing NO", + "unicode": "1f645-2640", + "unicode_alt": "1f645-200d-2640-fe0f" + }, + ":no_mobile_phones:": { + "category": "Symbols", + "name": "no mobile phones", + "unicode": "1f4f5" + }, + ":no_mouth:": { + "category": "Smileys & Emotion", + "name": "face without mouth", + "unicode": "1f636" + }, + ":no_pedestrians:": { + "category": "Symbols", + "name": "no pedestrians", + "unicode": "1f6b7" + }, + ":no_smoking:": { + "category": "Symbols", + "name": "no smoking", + "unicode": "1f6ad" + }, + ":non-potable_water:": { + "category": "Symbols", + "name": "non-potable water", + "unicode": "1f6b1" + }, + ":norfolk_island:": { + "category": "Flags", + "name": "flag: Norfolk Island", + "unicode": "1f1f3-1f1eb" + }, + ":north_korea:": { + "category": "Flags", + "name": "flag: North Korea", + "unicode": "1f1f0-1f1f5" + }, + ":northern_mariana_islands:": { + "category": "Flags", + "name": "flag: Northern Mariana Islands", + "unicode": "1f1f2-1f1f5" + }, + ":norway:": { + "category": "Flags", + "name": "flag: Norway", + "unicode": "1f1f3-1f1f4" + }, + ":nose:": { + "category": "People & Body", + "name": "nose", + "unicode": "1f443" + }, + ":notebook:": { + "category": "Objects", + "name": "notebook", + "unicode": "1f4d3" + }, + ":notebook_with_decorative_cover:": { + "category": "Objects", + "name": "notebook with decorative cover", + "unicode": "1f4d4" + }, + ":notes:": { + "category": "Objects", + "name": "musical notes", + "unicode": "1f3b6" + }, + ":nut_and_bolt:": { + "category": "Objects", + "name": "nut and bolt", + "unicode": "1f529" + }, + ":o2:": { + "category": "Symbols", + "name": "O button (blood type)", + "unicode": "1f17e", + "unicode_alt": "1f17e-fe0f" + }, + ":o:": { + "category": "Symbols", + "name": "hollow red circle", + "unicode": "2b55" + }, + ":ocean:": { + "category": "Travel & Places", + "name": "water wave", + "unicode": "1f30a" + }, + ":octopus:": { + "category": "Animals & Nature", + "name": "octopus", + "unicode": "1f419" + }, + ":oden:": { + "category": "Food & Drink", + "name": "oden", + "unicode": "1f362" + }, + ":office:": { + "category": "Travel & Places", + "name": "office building", + "unicode": "1f3e2" + }, + ":office_worker:": { + "category": "People & Body", + "name": "office worker", + "unicode": "1f9d1-1f4bc", + "unicode_alt": "1f9d1-200d-1f4bc" + }, + ":oil_drum:": { + "category": "Travel & Places", + "name": "oil drum", + "unicode": "1f6e2", + "unicode_alt": "1f6e2-fe0f" + }, + ":ok:": { + "category": "Symbols", + "name": "OK button", + "unicode": "1f197" + }, + ":ok_hand:": { + "category": "People & Body", + "name": "OK hand", + "unicode": "1f44c" + }, + ":ok_man:": { + "category": "People & Body", + "name": "man gesturing OK", + "unicode": "1f646-2642", + "unicode_alt": "1f646-200d-2642-fe0f" + }, + ":ok_person:": { + "category": "People & Body", + "name": "person gesturing OK", + "unicode": "1f646" + }, + ":ok_woman:": { + "category": "People & Body", + "name": "woman gesturing OK", + "unicode": "1f646-2640", + "unicode_alt": "1f646-200d-2640-fe0f" + }, + ":old_key:": { + "category": "Objects", + "name": "old key", + "unicode": "1f5dd", + "unicode_alt": "1f5dd-fe0f" + }, + ":older_adult:": { + "category": "People & Body", + "name": "older person", + "unicode": "1f9d3" + }, + ":older_man:": { + "category": "People & Body", + "name": "old man", + "unicode": "1f474" + }, + ":older_woman:": { + "category": "People & Body", + "name": "old woman", + "unicode": "1f475" + }, + ":olive:": { + "category": "Food & Drink", + "name": "olive", + "unicode": "1fad2" + }, + ":om:": { + "category": "Symbols", + "name": "om", + "unicode": "1f549", + "unicode_alt": "1f549-fe0f" + }, + ":oman:": { + "category": "Flags", + "name": "flag: Oman", + "unicode": "1f1f4-1f1f2" + }, + ":on:": { + "category": "Symbols", + "name": "ON! arrow", + "unicode": "1f51b" + }, + ":oncoming_automobile:": { + "category": "Travel & Places", + "name": "oncoming automobile", + "unicode": "1f698" + }, + ":oncoming_bus:": { + "category": "Travel & Places", + "name": "oncoming bus", + "unicode": "1f68d" + }, + ":oncoming_police_car:": { + "category": "Travel & Places", + "name": "oncoming police car", + "unicode": "1f694" + }, + ":oncoming_taxi:": { + "category": "Travel & Places", + "name": "oncoming taxi", + "unicode": "1f696" + }, + ":one:": { + "category": "Symbols", + "name": "keycap: 1", + "unicode": "0031-20e3", + "unicode_alt": "0031-fe0f-20e3" + }, + ":one_piece_swimsuit:": { + "category": "Objects", + "name": "one-piece swimsuit", + "unicode": "1fa71" + }, + ":onion:": { + "category": "Food & Drink", + "name": "onion", + "unicode": "1f9c5" + }, + ":open_file_folder:": { + "category": "Objects", + "name": "open file folder", + "unicode": "1f4c2" + }, + ":open_hands:": { + "category": "People & Body", + "name": "open hands", + "unicode": "1f450" + }, + ":open_mouth:": { + "category": "Smileys & Emotion", + "name": "face with open mouth", + "unicode": "1f62e" + }, + ":open_umbrella:": { + "category": "Travel & Places", + "name": "umbrella", + "unicode": "2602", + "unicode_alt": "2602-fe0f" + }, + ":ophiuchus:": { + "category": "Symbols", + "name": "Ophiuchus", + "unicode": "26ce" + }, + ":orange_book:": { + "category": "Objects", + "name": "orange book", + "unicode": "1f4d9" + }, + ":orange_circle:": { + "category": "Symbols", + "name": "orange circle", + "unicode": "1f7e0" + }, + ":orange_heart:": { + "category": "Smileys & Emotion", + "name": "orange heart", + "unicode": "1f9e1" + }, + ":orange_square:": { + "category": "Symbols", + "name": "orange square", + "unicode": "1f7e7" + }, + ":orangutan:": { + "category": "Animals & Nature", + "name": "orangutan", + "unicode": "1f9a7" + }, + ":orthodox_cross:": { + "category": "Symbols", + "name": "orthodox cross", + "unicode": "2626", + "unicode_alt": "2626-fe0f" + }, + ":otter:": { + "category": "Animals & Nature", + "name": "otter", + "unicode": "1f9a6" + }, + ":outbox_tray:": { + "category": "Objects", + "name": "outbox tray", + "unicode": "1f4e4" + }, + ":owl:": { + "category": "Animals & Nature", + "name": "owl", + "unicode": "1f989" + }, + ":ox:": { + "category": "Animals & Nature", + "name": "ox", + "unicode": "1f402" + }, + ":oyster:": { + "category": "Food & Drink", + "name": "oyster", + "unicode": "1f9aa" + }, + ":package:": { + "category": "Objects", + "name": "package", + "unicode": "1f4e6" + }, + ":page_facing_up:": { + "category": "Objects", + "name": "page facing up", + "unicode": "1f4c4" + }, + ":page_with_curl:": { + "category": "Objects", + "name": "page with curl", + "unicode": "1f4c3" + }, + ":pager:": { + "category": "Objects", + "name": "pager", + "unicode": "1f4df" + }, + ":paintbrush:": { + "category": "Objects", + "name": "paintbrush", + "unicode": "1f58c", + "unicode_alt": "1f58c-fe0f" + }, + ":pakistan:": { + "category": "Flags", + "name": "flag: Pakistan", + "unicode": "1f1f5-1f1f0" + }, + ":palau:": { + "category": "Flags", + "name": "flag: Palau", + "unicode": "1f1f5-1f1fc" + }, + ":palestinian_territories:": { + "category": "Flags", + "name": "flag: Palestinian Territories", + "unicode": "1f1f5-1f1f8" + }, + ":palm_down_hand:": { + "category": "People & Body", + "name": "palm down hand", + "unicode": "1faf3" + }, + ":palm_tree:": { + "category": "Animals & Nature", + "name": "palm tree", + "unicode": "1f334" + }, + ":palm_up_hand:": { + "category": "People & Body", + "name": "palm up hand", + "unicode": "1faf4" + }, + ":palms_up_together:": { + "category": "People & Body", + "name": "palms up together", + "unicode": "1f932" + }, + ":panama:": { + "category": "Flags", + "name": "flag: Panama", + "unicode": "1f1f5-1f1e6" + }, + ":pancakes:": { + "category": "Food & Drink", + "name": "pancakes", + "unicode": "1f95e" + }, + ":panda_face:": { + "category": "Animals & Nature", + "name": "panda", + "unicode": "1f43c" + }, + ":paperclip:": { + "category": "Objects", + "name": "paperclip", + "unicode": "1f4ce" + }, + ":paperclips:": { + "category": "Objects", + "name": "linked paperclips", + "unicode": "1f587", + "unicode_alt": "1f587-fe0f" + }, + ":papua_new_guinea:": { + "category": "Flags", + "name": "flag: Papua New Guinea", + "unicode": "1f1f5-1f1ec" + }, + ":parachute:": { + "category": "Travel & Places", + "name": "parachute", + "unicode": "1fa82" + }, + ":paraguay:": { + "category": "Flags", + "name": "flag: Paraguay", + "unicode": "1f1f5-1f1fe" + }, + ":parasol_on_ground:": { + "category": "Travel & Places", + "name": "umbrella on ground", + "unicode": "26f1", + "unicode_alt": "26f1-fe0f" + }, + ":parking:": { + "category": "Symbols", + "name": "P button", + "unicode": "1f17f", + "unicode_alt": "1f17f-fe0f" + }, + ":parrot:": { + "category": "Animals & Nature", + "name": "parrot", + "unicode": "1f99c" + }, + ":part_alternation_mark:": { + "category": "Symbols", + "name": "part alternation mark", + "unicode": "303d", + "unicode_alt": "303d-fe0f" + }, + ":partly_sunny:": { + "category": "Travel & Places", + "name": "sun behind cloud", + "unicode": "26c5" + }, + ":partying_face:": { + "category": "Smileys & Emotion", + "name": "partying face", + "unicode": "1f973" + }, + ":passenger_ship:": { + "category": "Travel & Places", + "name": "passenger ship", + "unicode": "1f6f3", + "unicode_alt": "1f6f3-fe0f" + }, + ":passport_control:": { + "category": "Symbols", + "name": "passport control", + "unicode": "1f6c2" + }, + ":pause_button:": { + "category": "Symbols", + "name": "pause button", + "unicode": "23f8", + "unicode_alt": "23f8-fe0f" + }, + ":pea_pod:": { + "category": "Food & Drink", + "name": "pea pod", + "unicode": "1fadb" + }, + ":peace_symbol:": { + "category": "Symbols", + "name": "peace symbol", + "unicode": "262e", + "unicode_alt": "262e-fe0f" + }, + ":peach:": { + "category": "Food & Drink", + "name": "peach", + "unicode": "1f351" + }, + ":peacock:": { + "category": "Animals & Nature", + "name": "peacock", + "unicode": "1f99a" + }, + ":peanuts:": { + "category": "Food & Drink", + "name": "peanuts", + "unicode": "1f95c" + }, + ":pear:": { + "category": "Food & Drink", + "name": "pear", + "unicode": "1f350" + }, + ":pen:": { + "category": "Objects", + "name": "pen", + "unicode": "1f58a", + "unicode_alt": "1f58a-fe0f" + }, + ":pencil2:": { + "category": "Objects", + "name": "pencil", + "unicode": "270f", + "unicode_alt": "270f-fe0f" + }, + ":penguin:": { + "category": "Animals & Nature", + "name": "penguin", + "unicode": "1f427" + }, + ":pensive:": { + "category": "Smileys & Emotion", + "name": "pensive face", + "unicode": "1f614" + }, + ":people_holding_hands:": { + "category": "People & Body", + "name": "people holding hands", + "unicode": "1f9d1-1f91d-1f9d1", + "unicode_alt": "1f9d1-200d-1f91d-200d-1f9d1" + }, + ":people_hugging:": { + "category": "People & Body", + "name": "people hugging", + "unicode": "1fac2" + }, + ":performing_arts:": { + "category": "Activities", + "name": "performing arts", + "unicode": "1f3ad" + }, + ":persevere:": { + "category": "Smileys & Emotion", + "name": "persevering face", + "unicode": "1f623" + }, + ":person_bald:": { + "category": "People & Body", + "name": "person: bald", + "unicode": "1f9d1-1f9b2", + "unicode_alt": "1f9d1-200d-1f9b2" + }, + ":person_curly_hair:": { + "category": "People & Body", + "name": "person: curly hair", + "unicode": "1f9d1-1f9b1", + "unicode_alt": "1f9d1-200d-1f9b1" + }, + ":person_feeding_baby:": { + "category": "People & Body", + "name": "person feeding baby", + "unicode": "1f9d1-1f37c", + "unicode_alt": "1f9d1-200d-1f37c" + }, + ":person_fencing:": { + "category": "People & Body", + "name": "person fencing", + "unicode": "1f93a" + }, + ":person_in_manual_wheelchair:": { + "category": "People & Body", + "name": "person in manual wheelchair", + "unicode": "1f9d1-1f9bd", + "unicode_alt": "1f9d1-200d-1f9bd" + }, + ":person_in_motorized_wheelchair:": { + "category": "People & Body", + "name": "person in motorized wheelchair", + "unicode": "1f9d1-1f9bc", + "unicode_alt": "1f9d1-200d-1f9bc" + }, + ":person_in_tuxedo:": { + "category": "People & Body", + "name": "person in tuxedo", + "unicode": "1f935" + }, + ":person_red_hair:": { + "category": "People & Body", + "name": "person: red hair", + "unicode": "1f9d1-1f9b0", + "unicode_alt": "1f9d1-200d-1f9b0" + }, + ":person_white_hair:": { + "category": "People & Body", + "name": "person: white hair", + "unicode": "1f9d1-1f9b3", + "unicode_alt": "1f9d1-200d-1f9b3" + }, + ":person_with_crown:": { + "category": "People & Body", + "name": "person with crown", + "unicode": "1fac5" + }, + ":person_with_probing_cane:": { + "category": "People & Body", + "name": "person with white cane", + "unicode": "1f9d1-1f9af", + "unicode_alt": "1f9d1-200d-1f9af" + }, + ":person_with_turban:": { + "category": "People & Body", + "name": "person wearing turban", + "unicode": "1f473" + }, + ":person_with_veil:": { + "category": "People & Body", + "name": "person with veil", + "unicode": "1f470" + }, + ":peru:": { + "category": "Flags", + "name": "flag: Peru", + "unicode": "1f1f5-1f1ea" + }, + ":petri_dish:": { + "category": "Objects", + "name": "petri dish", + "unicode": "1f9eb" + }, + ":philippines:": { + "category": "Flags", + "name": "flag: Philippines", + "unicode": "1f1f5-1f1ed" + }, + ":phone:": { + "category": "Objects", + "name": "telephone", + "unicode": "260e", + "unicode_alt": "260e-fe0f" + }, + ":pick:": { + "category": "Objects", + "name": "pick", + "unicode": "26cf", + "unicode_alt": "26cf-fe0f" + }, + ":pickup_truck:": { + "category": "Travel & Places", + "name": "pickup truck", + "unicode": "1f6fb" + }, + ":pie:": { + "category": "Food & Drink", + "name": "pie", + "unicode": "1f967" + }, + ":pig2:": { + "category": "Animals & Nature", + "name": "pig", + "unicode": "1f416" + }, + ":pig:": { + "category": "Animals & Nature", + "name": "pig face", + "unicode": "1f437" + }, + ":pig_nose:": { + "category": "Animals & Nature", + "name": "pig nose", + "unicode": "1f43d" + }, + ":pill:": { + "category": "Objects", + "name": "pill", + "unicode": "1f48a" + }, + ":pilot:": { + "category": "People & Body", + "name": "pilot", + "unicode": "1f9d1-2708", + "unicode_alt": "1f9d1-200d-2708-fe0f" + }, + ":pinata:": { + "category": "Activities", + "name": "pi\u00f1ata", + "unicode": "1fa85" + }, + ":pinched_fingers:": { + "category": "People & Body", + "name": "pinched fingers", + "unicode": "1f90c" + }, + ":pinching_hand:": { + "category": "People & Body", + "name": "pinching hand", + "unicode": "1f90f" + }, + ":pineapple:": { + "category": "Food & Drink", + "name": "pineapple", + "unicode": "1f34d" + }, + ":ping_pong:": { + "category": "Activities", + "name": "ping pong", + "unicode": "1f3d3" + }, + ":pink_heart:": { + "category": "Smileys & Emotion", + "name": "pink heart", + "unicode": "1fa77" + }, + ":pirate_flag:": { + "category": "Flags", + "name": "pirate flag", + "unicode": "1f3f4-2620", + "unicode_alt": "1f3f4-200d-2620-fe0f" + }, + ":pisces:": { + "category": "Symbols", + "name": "Pisces", + "unicode": "2653" + }, + ":pitcairn_islands:": { + "category": "Flags", + "name": "flag: Pitcairn Islands", + "unicode": "1f1f5-1f1f3" + }, + ":pizza:": { + "category": "Food & Drink", + "name": "pizza", + "unicode": "1f355" + }, + ":placard:": { + "category": "Objects", + "name": "placard", + "unicode": "1faa7" + }, + ":place_of_worship:": { + "category": "Symbols", + "name": "place of worship", + "unicode": "1f6d0" + }, + ":plate_with_cutlery:": { + "category": "Food & Drink", + "name": "fork and knife with plate", + "unicode": "1f37d", + "unicode_alt": "1f37d-fe0f" + }, + ":play_or_pause_button:": { + "category": "Symbols", + "name": "play or pause button", + "unicode": "23ef", + "unicode_alt": "23ef-fe0f" + }, + ":playground_slide:": { + "category": "Travel & Places", + "name": "playground slide", + "unicode": "1f6dd" + }, + ":pleading_face:": { + "category": "Smileys & Emotion", + "name": "pleading face", + "unicode": "1f97a" + }, + ":plunger:": { + "category": "Objects", + "name": "plunger", + "unicode": "1faa0" + }, + ":point_down:": { + "category": "People & Body", + "name": "backhand index pointing down", + "unicode": "1f447" + }, + ":point_left:": { + "category": "People & Body", + "name": "backhand index pointing left", + "unicode": "1f448" + }, + ":point_right:": { + "category": "People & Body", + "name": "backhand index pointing right", + "unicode": "1f449" + }, + ":point_up:": { + "category": "People & Body", + "name": "index pointing up", + "unicode": "261d", + "unicode_alt": "261d-fe0f" + }, + ":point_up_2:": { + "category": "People & Body", + "name": "backhand index pointing up", + "unicode": "1f446" + }, + ":poland:": { + "category": "Flags", + "name": "flag: Poland", + "unicode": "1f1f5-1f1f1" + }, + ":polar_bear:": { + "category": "Animals & Nature", + "name": "polar bear", + "unicode": "1f43b-2744", + "unicode_alt": "1f43b-200d-2744-fe0f" + }, + ":police_car:": { + "category": "Travel & Places", + "name": "police car", + "unicode": "1f693" + }, + ":police_officer:": { + "category": "People & Body", + "name": "police officer", + "unicode": "1f46e" + }, + ":policeman:": { + "category": "People & Body", + "name": "man police officer", + "unicode": "1f46e-2642", + "unicode_alt": "1f46e-200d-2642-fe0f" + }, + ":policewoman:": { + "category": "People & Body", + "name": "woman police officer", + "unicode": "1f46e-2640", + "unicode_alt": "1f46e-200d-2640-fe0f" + }, + ":poodle:": { + "category": "Animals & Nature", + "name": "poodle", + "unicode": "1f429" + }, + ":popcorn:": { + "category": "Food & Drink", + "name": "popcorn", + "unicode": "1f37f" + }, + ":portugal:": { + "category": "Flags", + "name": "flag: Portugal", + "unicode": "1f1f5-1f1f9" + }, + ":post_office:": { + "category": "Travel & Places", + "name": "Japanese post office", + "unicode": "1f3e3" + }, + ":postal_horn:": { + "category": "Objects", + "name": "postal horn", + "unicode": "1f4ef" + }, + ":postbox:": { + "category": "Objects", + "name": "postbox", + "unicode": "1f4ee" + }, + ":potable_water:": { + "category": "Symbols", + "name": "potable water", + "unicode": "1f6b0" + }, + ":potato:": { + "category": "Food & Drink", + "name": "potato", + "unicode": "1f954" + }, + ":potted_plant:": { + "category": "Animals & Nature", + "name": "potted plant", + "unicode": "1fab4" + }, + ":pouch:": { + "category": "Objects", + "name": "clutch bag", + "unicode": "1f45d" + }, + ":poultry_leg:": { + "category": "Food & Drink", + "name": "poultry leg", + "unicode": "1f357" + }, + ":pound:": { + "category": "Objects", + "name": "pound banknote", + "unicode": "1f4b7" + }, + ":pouring_liquid:": { + "category": "Food & Drink", + "name": "pouring liquid", + "unicode": "1fad7" + }, + ":pouting_cat:": { + "category": "Smileys & Emotion", + "name": "pouting cat", + "unicode": "1f63e" + }, + ":pouting_face:": { + "category": "People & Body", + "name": "person pouting", + "unicode": "1f64e" + }, + ":pouting_man:": { + "category": "People & Body", + "name": "man pouting", + "unicode": "1f64e-2642", + "unicode_alt": "1f64e-200d-2642-fe0f" + }, + ":pouting_woman:": { + "category": "People & Body", + "name": "woman pouting", + "unicode": "1f64e-2640", + "unicode_alt": "1f64e-200d-2640-fe0f" + }, + ":pray:": { + "category": "People & Body", + "name": "folded hands", + "unicode": "1f64f" + }, + ":prayer_beads:": { + "category": "Objects", + "name": "prayer beads", + "unicode": "1f4ff" + }, + ":pregnant_man:": { + "category": "People & Body", + "name": "pregnant man", + "unicode": "1fac3" + }, + ":pregnant_person:": { + "category": "People & Body", + "name": "pregnant person", + "unicode": "1fac4" + }, + ":pregnant_woman:": { + "category": "People & Body", + "name": "pregnant woman", + "unicode": "1f930" + }, + ":pretzel:": { + "category": "Food & Drink", + "name": "pretzel", + "unicode": "1f968" + }, + ":previous_track_button:": { + "category": "Symbols", + "name": "last track button", + "unicode": "23ee", + "unicode_alt": "23ee-fe0f" + }, + ":prince:": { + "category": "People & Body", + "name": "prince", + "unicode": "1f934" + }, + ":princess:": { + "category": "People & Body", + "name": "princess", + "unicode": "1f478" + }, + ":printer:": { + "category": "Objects", + "name": "printer", + "unicode": "1f5a8", + "unicode_alt": "1f5a8-fe0f" + }, + ":probing_cane:": { + "category": "Objects", + "name": "white cane", + "unicode": "1f9af" + }, + ":puerto_rico:": { + "category": "Flags", + "name": "flag: Puerto Rico", + "unicode": "1f1f5-1f1f7" + }, + ":purple_circle:": { + "category": "Symbols", + "name": "purple circle", + "unicode": "1f7e3" + }, + ":purple_heart:": { + "category": "Smileys & Emotion", + "name": "purple heart", + "unicode": "1f49c" + }, + ":purple_square:": { + "category": "Symbols", + "name": "purple square", + "unicode": "1f7ea" + }, + ":purse:": { + "category": "Objects", + "name": "purse", + "unicode": "1f45b" + }, + ":pushpin:": { + "category": "Objects", + "name": "pushpin", + "unicode": "1f4cc" + }, + ":put_litter_in_its_place:": { + "category": "Symbols", + "name": "litter in bin sign", + "unicode": "1f6ae" + }, + ":qatar:": { + "category": "Flags", + "name": "flag: Qatar", + "unicode": "1f1f6-1f1e6" + }, + ":question:": { + "category": "Symbols", + "name": "red question mark", + "unicode": "2753" + }, + ":rabbit2:": { + "category": "Animals & Nature", + "name": "rabbit", + "unicode": "1f407" + }, + ":rabbit:": { + "category": "Animals & Nature", + "name": "rabbit face", + "unicode": "1f430" + }, + ":raccoon:": { + "category": "Animals & Nature", + "name": "raccoon", + "unicode": "1f99d" + }, + ":racehorse:": { + "category": "Animals & Nature", + "name": "horse", + "unicode": "1f40e" + }, + ":racing_car:": { + "category": "Travel & Places", + "name": "racing car", + "unicode": "1f3ce", + "unicode_alt": "1f3ce-fe0f" + }, + ":radio:": { + "category": "Objects", + "name": "radio", + "unicode": "1f4fb" + }, + ":radio_button:": { + "category": "Symbols", + "name": "radio button", + "unicode": "1f518" + }, + ":radioactive:": { + "category": "Symbols", + "name": "radioactive", + "unicode": "2622", + "unicode_alt": "2622-fe0f" + }, + ":rage:": { + "category": "Smileys & Emotion", + "name": "enraged face", + "unicode": "1f621" + }, + ":railway_car:": { + "category": "Travel & Places", + "name": "railway car", + "unicode": "1f683" + }, + ":railway_track:": { + "category": "Travel & Places", + "name": "railway track", + "unicode": "1f6e4", + "unicode_alt": "1f6e4-fe0f" + }, + ":rainbow:": { + "category": "Travel & Places", + "name": "rainbow", + "unicode": "1f308" + }, + ":rainbow_flag:": { + "category": "Flags", + "name": "rainbow flag", + "unicode": "1f3f3-1f308", + "unicode_alt": "1f3f3-fe0f-200d-1f308" + }, + ":raised_back_of_hand:": { + "category": "People & Body", + "name": "raised back of hand", + "unicode": "1f91a" + }, + ":raised_eyebrow:": { + "category": "Smileys & Emotion", + "name": "face with raised eyebrow", + "unicode": "1f928" + }, + ":raised_hand_with_fingers_splayed:": { + "category": "People & Body", + "name": "hand with fingers splayed", + "unicode": "1f590", + "unicode_alt": "1f590-fe0f" + }, + ":raised_hands:": { + "category": "People & Body", + "name": "raising hands", + "unicode": "1f64c" + }, + ":raising_hand:": { + "category": "People & Body", + "name": "person raising hand", + "unicode": "1f64b" + }, + ":raising_hand_man:": { + "category": "People & Body", + "name": "man raising hand", + "unicode": "1f64b-2642", + "unicode_alt": "1f64b-200d-2642-fe0f" + }, + ":raising_hand_woman:": { + "category": "People & Body", + "name": "woman raising hand", + "unicode": "1f64b-2640", + "unicode_alt": "1f64b-200d-2640-fe0f" + }, + ":ram:": { + "category": "Animals & Nature", + "name": "ram", + "unicode": "1f40f" + }, + ":ramen:": { + "category": "Food & Drink", + "name": "steaming bowl", + "unicode": "1f35c" + }, + ":rat:": { + "category": "Animals & Nature", + "name": "rat", + "unicode": "1f400" + }, + ":razor:": { + "category": "Objects", + "name": "razor", + "unicode": "1fa92" + }, + ":receipt:": { + "category": "Objects", + "name": "receipt", + "unicode": "1f9fe" + }, + ":record_button:": { + "category": "Symbols", + "name": "record button", + "unicode": "23fa", + "unicode_alt": "23fa-fe0f" + }, + ":recycle:": { + "category": "Symbols", + "name": "recycling symbol", + "unicode": "267b", + "unicode_alt": "267b-fe0f" + }, + ":red_circle:": { + "category": "Symbols", + "name": "red circle", + "unicode": "1f534" + }, + ":red_envelope:": { + "category": "Activities", + "name": "red envelope", + "unicode": "1f9e7" + }, + ":red_haired_man:": { + "category": "People & Body", + "name": "man: red hair", + "unicode": "1f468-1f9b0", + "unicode_alt": "1f468-200d-1f9b0" + }, + ":red_haired_woman:": { + "category": "People & Body", + "name": "woman: red hair", + "unicode": "1f469-1f9b0", + "unicode_alt": "1f469-200d-1f9b0" + }, + ":red_square:": { + "category": "Symbols", + "name": "red square", + "unicode": "1f7e5" + }, + ":registered:": { + "category": "Symbols", + "name": "registered", + "unicode": "00ae", + "unicode_alt": "00ae-fe0f" + }, + ":relaxed:": { + "category": "Smileys & Emotion", + "name": "smiling face", + "unicode": "263a", + "unicode_alt": "263a-fe0f" + }, + ":relieved:": { + "category": "Smileys & Emotion", + "name": "relieved face", + "unicode": "1f60c" + }, + ":reminder_ribbon:": { + "category": "Activities", + "name": "reminder ribbon", + "unicode": "1f397", + "unicode_alt": "1f397-fe0f" + }, + ":repeat:": { + "category": "Symbols", + "name": "repeat button", + "unicode": "1f501" + }, + ":repeat_one:": { + "category": "Symbols", + "name": "repeat single button", + "unicode": "1f502" + }, + ":rescue_worker_helmet:": { + "category": "Objects", + "name": "rescue worker\u2019s helmet", + "unicode": "26d1", + "unicode_alt": "26d1-fe0f" + }, + ":restroom:": { + "category": "Symbols", + "name": "restroom", + "unicode": "1f6bb" + }, + ":reunion:": { + "category": "Flags", + "name": "flag: R\u00e9union", + "unicode": "1f1f7-1f1ea" + }, + ":revolving_hearts:": { + "category": "Smileys & Emotion", + "name": "revolving hearts", + "unicode": "1f49e" + }, + ":rewind:": { + "category": "Symbols", + "name": "fast reverse button", + "unicode": "23ea" + }, + ":rhinoceros:": { + "category": "Animals & Nature", + "name": "rhinoceros", + "unicode": "1f98f" + }, + ":ribbon:": { + "category": "Activities", + "name": "ribbon", + "unicode": "1f380" + }, + ":rice:": { + "category": "Food & Drink", + "name": "cooked rice", + "unicode": "1f35a" + }, + ":rice_ball:": { + "category": "Food & Drink", + "name": "rice ball", + "unicode": "1f359" + }, + ":rice_cracker:": { + "category": "Food & Drink", + "name": "rice cracker", + "unicode": "1f358" + }, + ":rice_scene:": { + "category": "Activities", + "name": "moon viewing ceremony", + "unicode": "1f391" + }, + ":right_anger_bubble:": { + "category": "Smileys & Emotion", + "name": "right anger bubble", + "unicode": "1f5ef", + "unicode_alt": "1f5ef-fe0f" + }, + ":rightwards_hand:": { + "category": "People & Body", + "name": "rightwards hand", + "unicode": "1faf1" + }, + ":rightwards_pushing_hand:": { + "category": "People & Body", + "name": "rightwards pushing hand", + "unicode": "1faf8" + }, + ":ring:": { + "category": "Objects", + "name": "ring", + "unicode": "1f48d" + }, + ":ring_buoy:": { + "category": "Travel & Places", + "name": "ring buoy", + "unicode": "1f6df" + }, + ":ringed_planet:": { + "category": "Travel & Places", + "name": "ringed planet", + "unicode": "1fa90" + }, + ":robot:": { + "category": "Smileys & Emotion", + "name": "robot", + "unicode": "1f916" + }, + ":rock:": { + "category": "Travel & Places", + "name": "rock", + "unicode": "1faa8" + }, + ":rocket:": { + "category": "Travel & Places", + "name": "rocket", + "unicode": "1f680" + }, + ":rofl:": { + "category": "Smileys & Emotion", + "name": "rolling on the floor laughing", + "unicode": "1f923" + }, + ":roll_eyes:": { + "category": "Smileys & Emotion", + "name": "face with rolling eyes", + "unicode": "1f644" + }, + ":roll_of_paper:": { + "category": "Objects", + "name": "roll of paper", + "unicode": "1f9fb" + }, + ":roller_coaster:": { + "category": "Travel & Places", + "name": "roller coaster", + "unicode": "1f3a2" + }, + ":roller_skate:": { + "category": "Travel & Places", + "name": "roller skate", + "unicode": "1f6fc" + }, + ":romania:": { + "category": "Flags", + "name": "flag: Romania", + "unicode": "1f1f7-1f1f4" + }, + ":rooster:": { + "category": "Animals & Nature", + "name": "rooster", + "unicode": "1f413" + }, + ":rose:": { + "category": "Animals & Nature", + "name": "rose", + "unicode": "1f339" + }, + ":rosette:": { + "category": "Animals & Nature", + "name": "rosette", + "unicode": "1f3f5", + "unicode_alt": "1f3f5-fe0f" + }, + ":rotating_light:": { + "category": "Travel & Places", + "name": "police car light", + "unicode": "1f6a8" + }, + ":round_pushpin:": { + "category": "Objects", + "name": "round pushpin", + "unicode": "1f4cd" + }, + ":rowboat:": { + "category": "People & Body", + "name": "person rowing boat", + "unicode": "1f6a3" + }, + ":rowing_man:": { + "category": "People & Body", + "name": "man rowing boat", + "unicode": "1f6a3-2642", + "unicode_alt": "1f6a3-200d-2642-fe0f" + }, + ":rowing_woman:": { + "category": "People & Body", + "name": "woman rowing boat", + "unicode": "1f6a3-2640", + "unicode_alt": "1f6a3-200d-2640-fe0f" + }, + ":ru:": { + "category": "Flags", + "name": "flag: Russia", + "unicode": "1f1f7-1f1fa" + }, + ":rugby_football:": { + "category": "Activities", + "name": "rugby football", + "unicode": "1f3c9" + }, + ":runner:": { + "category": "People & Body", + "name": "person running", + "unicode": "1f3c3" + }, + ":running_man:": { + "category": "People & Body", + "name": "man running", + "unicode": "1f3c3-2642", + "unicode_alt": "1f3c3-200d-2642-fe0f" + }, + ":running_shirt_with_sash:": { + "category": "Activities", + "name": "running shirt", + "unicode": "1f3bd" + }, + ":running_woman:": { + "category": "People & Body", + "name": "woman running", + "unicode": "1f3c3-2640", + "unicode_alt": "1f3c3-200d-2640-fe0f" + }, + ":rwanda:": { + "category": "Flags", + "name": "flag: Rwanda", + "unicode": "1f1f7-1f1fc" + }, + ":sa:": { + "category": "Symbols", + "name": "Japanese \u201cservice charge\u201d button", + "unicode": "1f202", + "unicode_alt": "1f202-fe0f" + }, + ":safety_pin:": { + "category": "Objects", + "name": "safety pin", + "unicode": "1f9f7" + }, + ":safety_vest:": { + "category": "Objects", + "name": "safety vest", + "unicode": "1f9ba" + }, + ":sagittarius:": { + "category": "Symbols", + "name": "Sagittarius", + "unicode": "2650" + }, + ":sake:": { + "category": "Food & Drink", + "name": "sake", + "unicode": "1f376" + }, + ":salt:": { + "category": "Food & Drink", + "name": "salt", + "unicode": "1f9c2" + }, + ":saluting_face:": { + "category": "Smileys & Emotion", + "name": "saluting face", + "unicode": "1fae1" + }, + ":samoa:": { + "category": "Flags", + "name": "flag: Samoa", + "unicode": "1f1fc-1f1f8" + }, + ":san_marino:": { + "category": "Flags", + "name": "flag: San Marino", + "unicode": "1f1f8-1f1f2" + }, + ":sandal:": { + "category": "Objects", + "name": "woman\u2019s sandal", + "unicode": "1f461" + }, + ":sandwich:": { + "category": "Food & Drink", + "name": "sandwich", + "unicode": "1f96a" + }, + ":santa:": { + "category": "People & Body", + "name": "Santa Claus", + "unicode": "1f385" + }, + ":sao_tome_principe:": { + "category": "Flags", + "name": "flag: S\u00e3o Tom\u00e9 & Pr\u00edncipe", + "unicode": "1f1f8-1f1f9" + }, + ":sari:": { + "category": "Objects", + "name": "sari", + "unicode": "1f97b" + }, + ":satellite:": { + "category": "Objects", + "name": "satellite antenna", + "unicode": "1f4e1" + }, + ":saudi_arabia:": { + "category": "Flags", + "name": "flag: Saudi Arabia", + "unicode": "1f1f8-1f1e6" + }, + ":sauna_man:": { + "category": "People & Body", + "name": "man in steamy room", + "unicode": "1f9d6-2642", + "unicode_alt": "1f9d6-200d-2642-fe0f" + }, + ":sauna_person:": { + "category": "People & Body", + "name": "person in steamy room", + "unicode": "1f9d6" + }, + ":sauna_woman:": { + "category": "People & Body", + "name": "woman in steamy room", + "unicode": "1f9d6-2640", + "unicode_alt": "1f9d6-200d-2640-fe0f" + }, + ":sauropod:": { + "category": "Animals & Nature", + "name": "sauropod", + "unicode": "1f995" + }, + ":saxophone:": { + "category": "Objects", + "name": "saxophone", + "unicode": "1f3b7" + }, + ":scarf:": { + "category": "Objects", + "name": "scarf", + "unicode": "1f9e3" + }, + ":school:": { + "category": "Travel & Places", + "name": "school", + "unicode": "1f3eb" + }, + ":school_satchel:": { + "category": "Objects", + "name": "backpack", + "unicode": "1f392" + }, + ":scientist:": { + "category": "People & Body", + "name": "scientist", + "unicode": "1f9d1-1f52c", + "unicode_alt": "1f9d1-200d-1f52c" + }, + ":scissors:": { + "category": "Objects", + "name": "scissors", + "unicode": "2702", + "unicode_alt": "2702-fe0f" + }, + ":scorpion:": { + "category": "Animals & Nature", + "name": "scorpion", + "unicode": "1f982" + }, + ":scorpius:": { + "category": "Symbols", + "name": "Scorpio", + "unicode": "264f" + }, + ":scotland:": { + "category": "Flags", + "name": "flag: Scotland", + "unicode": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f" + }, + ":scream:": { + "category": "Smileys & Emotion", + "name": "face screaming in fear", + "unicode": "1f631" + }, + ":scream_cat:": { + "category": "Smileys & Emotion", + "name": "weary cat", + "unicode": "1f640" + }, + ":screwdriver:": { + "category": "Objects", + "name": "screwdriver", + "unicode": "1fa9b" + }, + ":scroll:": { + "category": "Objects", + "name": "scroll", + "unicode": "1f4dc" + }, + ":seal:": { + "category": "Animals & Nature", + "name": "seal", + "unicode": "1f9ad" + }, + ":seat:": { + "category": "Travel & Places", + "name": "seat", + "unicode": "1f4ba" + }, + ":secret:": { + "category": "Symbols", + "name": "Japanese \u201csecret\u201d button", + "unicode": "3299", + "unicode_alt": "3299-fe0f" + }, + ":see_no_evil:": { + "category": "Smileys & Emotion", + "name": "see-no-evil monkey", + "unicode": "1f648" + }, + ":seedling:": { + "category": "Animals & Nature", + "name": "seedling", + "unicode": "1f331" + }, + ":selfie:": { + "category": "People & Body", + "name": "selfie", + "unicode": "1f933" + }, + ":senegal:": { + "category": "Flags", + "name": "flag: Senegal", + "unicode": "1f1f8-1f1f3" + }, + ":serbia:": { + "category": "Flags", + "name": "flag: Serbia", + "unicode": "1f1f7-1f1f8" + }, + ":service_dog:": { + "category": "Animals & Nature", + "name": "service dog", + "unicode": "1f415-1f9ba", + "unicode_alt": "1f415-200d-1f9ba" + }, + ":seven:": { + "category": "Symbols", + "name": "keycap: 7", + "unicode": "0037-20e3", + "unicode_alt": "0037-fe0f-20e3" + }, + ":sewing_needle:": { + "category": "Activities", + "name": "sewing needle", + "unicode": "1faa1" + }, + ":seychelles:": { + "category": "Flags", + "name": "flag: Seychelles", + "unicode": "1f1f8-1f1e8" + }, + ":shaking_face:": { + "category": "Smileys & Emotion", + "name": "shaking face", + "unicode": "1fae8" + }, + ":shallow_pan_of_food:": { + "category": "Food & Drink", + "name": "shallow pan of food", + "unicode": "1f958" + }, + ":shamrock:": { + "category": "Animals & Nature", + "name": "shamrock", + "unicode": "2618", + "unicode_alt": "2618-fe0f" + }, + ":shark:": { + "category": "Animals & Nature", + "name": "shark", + "unicode": "1f988" + }, + ":shaved_ice:": { + "category": "Food & Drink", + "name": "shaved ice", + "unicode": "1f367" + }, + ":sheep:": { + "category": "Animals & Nature", + "name": "ewe", + "unicode": "1f411" + }, + ":shell:": { + "category": "Animals & Nature", + "name": "spiral shell", + "unicode": "1f41a" + }, + ":shield:": { + "category": "Objects", + "name": "shield", + "unicode": "1f6e1", + "unicode_alt": "1f6e1-fe0f" + }, + ":shinto_shrine:": { + "category": "Travel & Places", + "name": "shinto shrine", + "unicode": "26e9", + "unicode_alt": "26e9-fe0f" + }, + ":ship:": { + "category": "Travel & Places", + "name": "ship", + "unicode": "1f6a2" + }, + ":shirt:": { + "category": "Objects", + "name": "t-shirt", + "unicode": "1f455" + }, + ":shopping:": { + "category": "Objects", + "name": "shopping bags", + "unicode": "1f6cd", + "unicode_alt": "1f6cd-fe0f" + }, + ":shopping_cart:": { + "category": "Objects", + "name": "shopping cart", + "unicode": "1f6d2" + }, + ":shorts:": { + "category": "Objects", + "name": "shorts", + "unicode": "1fa73" + }, + ":shower:": { + "category": "Objects", + "name": "shower", + "unicode": "1f6bf" + }, + ":shrimp:": { + "category": "Food & Drink", + "name": "shrimp", + "unicode": "1f990" + }, + ":shrug:": { + "category": "People & Body", + "name": "person shrugging", + "unicode": "1f937" + }, + ":shushing_face:": { + "category": "Smileys & Emotion", + "name": "shushing face", + "unicode": "1f92b" + }, + ":sierra_leone:": { + "category": "Flags", + "name": "flag: Sierra Leone", + "unicode": "1f1f8-1f1f1" + }, + ":signal_strength:": { + "category": "Symbols", + "name": "antenna bars", + "unicode": "1f4f6" + }, + ":singapore:": { + "category": "Flags", + "name": "flag: Singapore", + "unicode": "1f1f8-1f1ec" + }, + ":singer:": { + "category": "People & Body", + "name": "singer", + "unicode": "1f9d1-1f3a4", + "unicode_alt": "1f9d1-200d-1f3a4" + }, + ":sint_maarten:": { + "category": "Flags", + "name": "flag: Sint Maarten", + "unicode": "1f1f8-1f1fd" + }, + ":six:": { + "category": "Symbols", + "name": "keycap: 6", + "unicode": "0036-20e3", + "unicode_alt": "0036-fe0f-20e3" + }, + ":six_pointed_star:": { + "category": "Symbols", + "name": "dotted six-pointed star", + "unicode": "1f52f" + }, + ":skateboard:": { + "category": "Travel & Places", + "name": "skateboard", + "unicode": "1f6f9" + }, + ":ski:": { + "category": "Activities", + "name": "skis", + "unicode": "1f3bf" + }, + ":skier:": { + "category": "People & Body", + "name": "skier", + "unicode": "26f7", + "unicode_alt": "26f7-fe0f" + }, + ":skull:": { + "category": "Smileys & Emotion", + "name": "skull", + "unicode": "1f480" + }, + ":skull_and_crossbones:": { + "category": "Smileys & Emotion", + "name": "skull and crossbones", + "unicode": "2620", + "unicode_alt": "2620-fe0f" + }, + ":skunk:": { + "category": "Animals & Nature", + "name": "skunk", + "unicode": "1f9a8" + }, + ":sled:": { + "category": "Activities", + "name": "sled", + "unicode": "1f6f7" + }, + ":sleeping:": { + "category": "Smileys & Emotion", + "name": "sleeping face", + "unicode": "1f634" + }, + ":sleeping_bed:": { + "category": "People & Body", + "name": "person in bed", + "unicode": "1f6cc" + }, + ":sleepy:": { + "category": "Smileys & Emotion", + "name": "sleepy face", + "unicode": "1f62a" + }, + ":slightly_frowning_face:": { + "category": "Smileys & Emotion", + "name": "slightly frowning face", + "unicode": "1f641" + }, + ":slightly_smiling_face:": { + "category": "Smileys & Emotion", + "name": "slightly smiling face", + "unicode": "1f642" + }, + ":slot_machine:": { + "category": "Activities", + "name": "slot machine", + "unicode": "1f3b0" + }, + ":sloth:": { + "category": "Animals & Nature", + "name": "sloth", + "unicode": "1f9a5" + }, + ":slovakia:": { + "category": "Flags", + "name": "flag: Slovakia", + "unicode": "1f1f8-1f1f0" + }, + ":slovenia:": { + "category": "Flags", + "name": "flag: Slovenia", + "unicode": "1f1f8-1f1ee" + }, + ":small_airplane:": { + "category": "Travel & Places", + "name": "small airplane", + "unicode": "1f6e9", + "unicode_alt": "1f6e9-fe0f" + }, + ":small_blue_diamond:": { + "category": "Symbols", + "name": "small blue diamond", + "unicode": "1f539" + }, + ":small_orange_diamond:": { + "category": "Symbols", + "name": "small orange diamond", + "unicode": "1f538" + }, + ":small_red_triangle:": { + "category": "Symbols", + "name": "red triangle pointed up", + "unicode": "1f53a" + }, + ":small_red_triangle_down:": { + "category": "Symbols", + "name": "red triangle pointed down", + "unicode": "1f53b" + }, + ":smile:": { + "category": "Smileys & Emotion", + "name": "grinning face with smiling eyes", + "unicode": "1f604" + }, + ":smile_cat:": { + "category": "Smileys & Emotion", + "name": "grinning cat with smiling eyes", + "unicode": "1f638" + }, + ":smiley:": { + "category": "Smileys & Emotion", + "name": "grinning face with big eyes", + "unicode": "1f603" + }, + ":smiley_cat:": { + "category": "Smileys & Emotion", + "name": "grinning cat", + "unicode": "1f63a" + }, + ":smiling_face_with_tear:": { + "category": "Smileys & Emotion", + "name": "smiling face with tear", + "unicode": "1f972" + }, + ":smiling_face_with_three_hearts:": { + "category": "Smileys & Emotion", + "name": "smiling face with hearts", + "unicode": "1f970" + }, + ":smiling_imp:": { + "category": "Smileys & Emotion", + "name": "smiling face with horns", + "unicode": "1f608" + }, + ":smirk:": { + "category": "Smileys & Emotion", + "name": "smirking face", + "unicode": "1f60f" + }, + ":smirk_cat:": { + "category": "Smileys & Emotion", + "name": "cat with wry smile", + "unicode": "1f63c" + }, + ":smoking:": { + "category": "Objects", + "name": "cigarette", + "unicode": "1f6ac" + }, + ":snail:": { + "category": "Animals & Nature", + "name": "snail", + "unicode": "1f40c" + }, + ":snake:": { + "category": "Animals & Nature", + "name": "snake", + "unicode": "1f40d" + }, + ":sneezing_face:": { + "category": "Smileys & Emotion", + "name": "sneezing face", + "unicode": "1f927" + }, + ":snowboarder:": { + "category": "People & Body", + "name": "snowboarder", + "unicode": "1f3c2" + }, + ":snowflake:": { + "category": "Travel & Places", + "name": "snowflake", + "unicode": "2744", + "unicode_alt": "2744-fe0f" + }, + ":snowman:": { + "category": "Travel & Places", + "name": "snowman without snow", + "unicode": "26c4" + }, + ":snowman_with_snow:": { + "category": "Travel & Places", + "name": "snowman", + "unicode": "2603", + "unicode_alt": "2603-fe0f" + }, + ":soap:": { + "category": "Objects", + "name": "soap", + "unicode": "1f9fc" + }, + ":sob:": { + "category": "Smileys & Emotion", + "name": "loudly crying face", + "unicode": "1f62d" + }, + ":soccer:": { + "category": "Activities", + "name": "soccer ball", + "unicode": "26bd" + }, + ":socks:": { + "category": "Objects", + "name": "socks", + "unicode": "1f9e6" + }, + ":softball:": { + "category": "Activities", + "name": "softball", + "unicode": "1f94e" + }, + ":solomon_islands:": { + "category": "Flags", + "name": "flag: Solomon Islands", + "unicode": "1f1f8-1f1e7" + }, + ":somalia:": { + "category": "Flags", + "name": "flag: Somalia", + "unicode": "1f1f8-1f1f4" + }, + ":soon:": { + "category": "Symbols", + "name": "SOON arrow", + "unicode": "1f51c" + }, + ":sos:": { + "category": "Symbols", + "name": "SOS button", + "unicode": "1f198" + }, + ":sound:": { + "category": "Objects", + "name": "speaker medium volume", + "unicode": "1f509" + }, + ":south_africa:": { + "category": "Flags", + "name": "flag: South Africa", + "unicode": "1f1ff-1f1e6" + }, + ":south_georgia_south_sandwich_islands:": { + "category": "Flags", + "name": "flag: South Georgia & South Sandwich Islands", + "unicode": "1f1ec-1f1f8" + }, + ":south_sudan:": { + "category": "Flags", + "name": "flag: South Sudan", + "unicode": "1f1f8-1f1f8" + }, + ":space_invader:": { + "category": "Smileys & Emotion", + "name": "alien monster", + "unicode": "1f47e" + }, + ":spades:": { + "category": "Activities", + "name": "spade suit", + "unicode": "2660", + "unicode_alt": "2660-fe0f" + }, + ":spaghetti:": { + "category": "Food & Drink", + "name": "spaghetti", + "unicode": "1f35d" + }, + ":sparkle:": { + "category": "Symbols", + "name": "sparkle", + "unicode": "2747", + "unicode_alt": "2747-fe0f" + }, + ":sparkler:": { + "category": "Activities", + "name": "sparkler", + "unicode": "1f387" + }, + ":sparkles:": { + "category": "Activities", + "name": "sparkles", + "unicode": "2728" + }, + ":sparkling_heart:": { + "category": "Smileys & Emotion", + "name": "sparkling heart", + "unicode": "1f496" + }, + ":speak_no_evil:": { + "category": "Smileys & Emotion", + "name": "speak-no-evil monkey", + "unicode": "1f64a" + }, + ":speaker:": { + "category": "Objects", + "name": "speaker low volume", + "unicode": "1f508" + }, + ":speaking_head:": { + "category": "People & Body", + "name": "speaking head", + "unicode": "1f5e3", + "unicode_alt": "1f5e3-fe0f" + }, + ":speech_balloon:": { + "category": "Smileys & Emotion", + "name": "speech balloon", + "unicode": "1f4ac" + }, + ":speedboat:": { + "category": "Travel & Places", + "name": "speedboat", + "unicode": "1f6a4" + }, + ":spider:": { + "category": "Animals & Nature", + "name": "spider", + "unicode": "1f577", + "unicode_alt": "1f577-fe0f" + }, + ":spider_web:": { + "category": "Animals & Nature", + "name": "spider web", + "unicode": "1f578", + "unicode_alt": "1f578-fe0f" + }, + ":spiral_calendar:": { + "category": "Objects", + "name": "spiral calendar", + "unicode": "1f5d3", + "unicode_alt": "1f5d3-fe0f" + }, + ":spiral_notepad:": { + "category": "Objects", + "name": "spiral notepad", + "unicode": "1f5d2", + "unicode_alt": "1f5d2-fe0f" + }, + ":sponge:": { + "category": "Objects", + "name": "sponge", + "unicode": "1f9fd" + }, + ":spoon:": { + "category": "Food & Drink", + "name": "spoon", + "unicode": "1f944" + }, + ":squid:": { + "category": "Food & Drink", + "name": "squid", + "unicode": "1f991" + }, + ":sri_lanka:": { + "category": "Flags", + "name": "flag: Sri Lanka", + "unicode": "1f1f1-1f1f0" + }, + ":st_barthelemy:": { + "category": "Flags", + "name": "flag: St. Barth\u00e9lemy", + "unicode": "1f1e7-1f1f1" + }, + ":st_helena:": { + "category": "Flags", + "name": "flag: St. Helena", + "unicode": "1f1f8-1f1ed" + }, + ":st_kitts_nevis:": { + "category": "Flags", + "name": "flag: St. Kitts & Nevis", + "unicode": "1f1f0-1f1f3" + }, + ":st_lucia:": { + "category": "Flags", + "name": "flag: St. Lucia", + "unicode": "1f1f1-1f1e8" + }, + ":st_martin:": { + "category": "Flags", + "name": "flag: St. Martin", + "unicode": "1f1f2-1f1eb" + }, + ":st_pierre_miquelon:": { + "category": "Flags", + "name": "flag: St. Pierre & Miquelon", + "unicode": "1f1f5-1f1f2" + }, + ":st_vincent_grenadines:": { + "category": "Flags", + "name": "flag: St. Vincent & Grenadines", + "unicode": "1f1fb-1f1e8" + }, + ":stadium:": { + "category": "Travel & Places", + "name": "stadium", + "unicode": "1f3df", + "unicode_alt": "1f3df-fe0f" + }, + ":standing_man:": { + "category": "People & Body", + "name": "man standing", + "unicode": "1f9cd-2642", + "unicode_alt": "1f9cd-200d-2642-fe0f" + }, + ":standing_person:": { + "category": "People & Body", + "name": "person standing", + "unicode": "1f9cd" + }, + ":standing_woman:": { + "category": "People & Body", + "name": "woman standing", + "unicode": "1f9cd-2640", + "unicode_alt": "1f9cd-200d-2640-fe0f" + }, + ":star2:": { + "category": "Travel & Places", + "name": "glowing star", + "unicode": "1f31f" + }, + ":star:": { + "category": "Travel & Places", + "name": "star", + "unicode": "2b50" + }, + ":star_and_crescent:": { + "category": "Symbols", + "name": "star and crescent", + "unicode": "262a", + "unicode_alt": "262a-fe0f" + }, + ":star_of_david:": { + "category": "Symbols", + "name": "star of David", + "unicode": "2721", + "unicode_alt": "2721-fe0f" + }, + ":star_struck:": { + "category": "Smileys & Emotion", + "name": "star-struck", + "unicode": "1f929" + }, + ":stars:": { + "category": "Travel & Places", + "name": "shooting star", + "unicode": "1f320" + }, + ":station:": { + "category": "Travel & Places", + "name": "station", + "unicode": "1f689" + }, + ":statue_of_liberty:": { + "category": "Travel & Places", + "name": "Statue of Liberty", + "unicode": "1f5fd" + }, + ":steam_locomotive:": { + "category": "Travel & Places", + "name": "locomotive", + "unicode": "1f682" + }, + ":stethoscope:": { + "category": "Objects", + "name": "stethoscope", + "unicode": "1fa7a" + }, + ":stew:": { + "category": "Food & Drink", + "name": "pot of food", + "unicode": "1f372" + }, + ":stop_button:": { + "category": "Symbols", + "name": "stop button", + "unicode": "23f9", + "unicode_alt": "23f9-fe0f" + }, + ":stop_sign:": { + "category": "Travel & Places", + "name": "stop sign", + "unicode": "1f6d1" + }, + ":stopwatch:": { + "category": "Travel & Places", + "name": "stopwatch", + "unicode": "23f1", + "unicode_alt": "23f1-fe0f" + }, + ":straight_ruler:": { + "category": "Objects", + "name": "straight ruler", + "unicode": "1f4cf" + }, + ":strawberry:": { + "category": "Food & Drink", + "name": "strawberry", + "unicode": "1f353" + }, + ":stuck_out_tongue:": { + "category": "Smileys & Emotion", + "name": "face with tongue", + "unicode": "1f61b" + }, + ":stuck_out_tongue_closed_eyes:": { + "category": "Smileys & Emotion", + "name": "squinting face with tongue", + "unicode": "1f61d" + }, + ":stuck_out_tongue_winking_eye:": { + "category": "Smileys & Emotion", + "name": "winking face with tongue", + "unicode": "1f61c" + }, + ":student:": { + "category": "People & Body", + "name": "student", + "unicode": "1f9d1-1f393", + "unicode_alt": "1f9d1-200d-1f393" + }, + ":studio_microphone:": { + "category": "Objects", + "name": "studio microphone", + "unicode": "1f399", + "unicode_alt": "1f399-fe0f" + }, + ":stuffed_flatbread:": { + "category": "Food & Drink", + "name": "stuffed flatbread", + "unicode": "1f959" + }, + ":sudan:": { + "category": "Flags", + "name": "flag: Sudan", + "unicode": "1f1f8-1f1e9" + }, + ":sun_behind_large_cloud:": { + "category": "Travel & Places", + "name": "sun behind large cloud", + "unicode": "1f325", + "unicode_alt": "1f325-fe0f" + }, + ":sun_behind_rain_cloud:": { + "category": "Travel & Places", + "name": "sun behind rain cloud", + "unicode": "1f326", + "unicode_alt": "1f326-fe0f" + }, + ":sun_behind_small_cloud:": { + "category": "Travel & Places", + "name": "sun behind small cloud", + "unicode": "1f324", + "unicode_alt": "1f324-fe0f" + }, + ":sun_with_face:": { + "category": "Travel & Places", + "name": "sun with face", + "unicode": "1f31e" + }, + ":sunflower:": { + "category": "Animals & Nature", + "name": "sunflower", + "unicode": "1f33b" + }, + ":sunglasses:": { + "category": "Smileys & Emotion", + "name": "smiling face with sunglasses", + "unicode": "1f60e" + }, + ":sunny:": { + "category": "Travel & Places", + "name": "sun", + "unicode": "2600", + "unicode_alt": "2600-fe0f" + }, + ":sunrise:": { + "category": "Travel & Places", + "name": "sunrise", + "unicode": "1f305" + }, + ":sunrise_over_mountains:": { + "category": "Travel & Places", + "name": "sunrise over mountains", + "unicode": "1f304" + }, + ":superhero:": { + "category": "People & Body", + "name": "superhero", + "unicode": "1f9b8" + }, + ":superhero_man:": { + "category": "People & Body", + "name": "man superhero", + "unicode": "1f9b8-2642", + "unicode_alt": "1f9b8-200d-2642-fe0f" + }, + ":superhero_woman:": { + "category": "People & Body", + "name": "woman superhero", + "unicode": "1f9b8-2640", + "unicode_alt": "1f9b8-200d-2640-fe0f" + }, + ":supervillain:": { + "category": "People & Body", + "name": "supervillain", + "unicode": "1f9b9" + }, + ":supervillain_man:": { + "category": "People & Body", + "name": "man supervillain", + "unicode": "1f9b9-2642", + "unicode_alt": "1f9b9-200d-2642-fe0f" + }, + ":supervillain_woman:": { + "category": "People & Body", + "name": "woman supervillain", + "unicode": "1f9b9-2640", + "unicode_alt": "1f9b9-200d-2640-fe0f" + }, + ":surfer:": { + "category": "People & Body", + "name": "person surfing", + "unicode": "1f3c4" + }, + ":surfing_man:": { + "category": "People & Body", + "name": "man surfing", + "unicode": "1f3c4-2642", + "unicode_alt": "1f3c4-200d-2642-fe0f" + }, + ":surfing_woman:": { + "category": "People & Body", + "name": "woman surfing", + "unicode": "1f3c4-2640", + "unicode_alt": "1f3c4-200d-2640-fe0f" + }, + ":suriname:": { + "category": "Flags", + "name": "flag: Suriname", + "unicode": "1f1f8-1f1f7" + }, + ":sushi:": { + "category": "Food & Drink", + "name": "sushi", + "unicode": "1f363" + }, + ":suspension_railway:": { + "category": "Travel & Places", + "name": "suspension railway", + "unicode": "1f69f" + }, + ":svalbard_jan_mayen:": { + "category": "Flags", + "name": "flag: Svalbard & Jan Mayen", + "unicode": "1f1f8-1f1ef" + }, + ":swan:": { + "category": "Animals & Nature", + "name": "swan", + "unicode": "1f9a2" + }, + ":swaziland:": { + "category": "Flags", + "name": "flag: Eswatini", + "unicode": "1f1f8-1f1ff" + }, + ":sweat:": { + "category": "Smileys & Emotion", + "name": "downcast face with sweat", + "unicode": "1f613" + }, + ":sweat_drops:": { + "category": "Smileys & Emotion", + "name": "sweat droplets", + "unicode": "1f4a6" + }, + ":sweat_smile:": { + "category": "Smileys & Emotion", + "name": "grinning face with sweat", + "unicode": "1f605" + }, + ":sweden:": { + "category": "Flags", + "name": "flag: Sweden", + "unicode": "1f1f8-1f1ea" + }, + ":sweet_potato:": { + "category": "Food & Drink", + "name": "roasted sweet potato", + "unicode": "1f360" + }, + ":swim_brief:": { + "category": "Objects", + "name": "briefs", + "unicode": "1fa72" + }, + ":swimmer:": { + "category": "People & Body", + "name": "person swimming", + "unicode": "1f3ca" + }, + ":swimming_man:": { + "category": "People & Body", + "name": "man swimming", + "unicode": "1f3ca-2642", + "unicode_alt": "1f3ca-200d-2642-fe0f" + }, + ":swimming_woman:": { + "category": "People & Body", + "name": "woman swimming", + "unicode": "1f3ca-2640", + "unicode_alt": "1f3ca-200d-2640-fe0f" + }, + ":switzerland:": { + "category": "Flags", + "name": "flag: Switzerland", + "unicode": "1f1e8-1f1ed" + }, + ":symbols:": { + "category": "Symbols", + "name": "input symbols", + "unicode": "1f523" + }, + ":synagogue:": { + "category": "Travel & Places", + "name": "synagogue", + "unicode": "1f54d" + }, + ":syria:": { + "category": "Flags", + "name": "flag: Syria", + "unicode": "1f1f8-1f1fe" + }, + ":syringe:": { + "category": "Objects", + "name": "syringe", + "unicode": "1f489" + }, + ":t-rex:": { + "category": "Animals & Nature", + "name": "T-Rex", + "unicode": "1f996" + }, + ":taco:": { + "category": "Food & Drink", + "name": "taco", + "unicode": "1f32e" + }, + ":tada:": { + "category": "Activities", + "name": "party popper", + "unicode": "1f389" + }, + ":taiwan:": { + "category": "Flags", + "name": "flag: Taiwan", + "unicode": "1f1f9-1f1fc" + }, + ":tajikistan:": { + "category": "Flags", + "name": "flag: Tajikistan", + "unicode": "1f1f9-1f1ef" + }, + ":takeout_box:": { + "category": "Food & Drink", + "name": "takeout box", + "unicode": "1f961" + }, + ":tamale:": { + "category": "Food & Drink", + "name": "tamale", + "unicode": "1fad4" + }, + ":tanabata_tree:": { + "category": "Activities", + "name": "tanabata tree", + "unicode": "1f38b" + }, + ":tangerine:": { + "category": "Food & Drink", + "name": "tangerine", + "unicode": "1f34a" + }, + ":tanzania:": { + "category": "Flags", + "name": "flag: Tanzania", + "unicode": "1f1f9-1f1ff" + }, + ":taurus:": { + "category": "Symbols", + "name": "Taurus", + "unicode": "2649" + }, + ":taxi:": { + "category": "Travel & Places", + "name": "taxi", + "unicode": "1f695" + }, + ":tea:": { + "category": "Food & Drink", + "name": "teacup without handle", + "unicode": "1f375" + }, + ":teacher:": { + "category": "People & Body", + "name": "teacher", + "unicode": "1f9d1-1f3eb", + "unicode_alt": "1f9d1-200d-1f3eb" + }, + ":teapot:": { + "category": "Food & Drink", + "name": "teapot", + "unicode": "1fad6" + }, + ":technologist:": { + "category": "People & Body", + "name": "technologist", + "unicode": "1f9d1-1f4bb", + "unicode_alt": "1f9d1-200d-1f4bb" + }, + ":teddy_bear:": { + "category": "Activities", + "name": "teddy bear", + "unicode": "1f9f8" + }, + ":telephone_receiver:": { + "category": "Objects", + "name": "telephone receiver", + "unicode": "1f4de" + }, + ":telescope:": { + "category": "Objects", + "name": "telescope", + "unicode": "1f52d" + }, + ":tennis:": { + "category": "Activities", + "name": "tennis", + "unicode": "1f3be" + }, + ":tent:": { + "category": "Travel & Places", + "name": "tent", + "unicode": "26fa" + }, + ":test_tube:": { + "category": "Objects", + "name": "test tube", + "unicode": "1f9ea" + }, + ":thailand:": { + "category": "Flags", + "name": "flag: Thailand", + "unicode": "1f1f9-1f1ed" + }, + ":thermometer:": { + "category": "Travel & Places", + "name": "thermometer", + "unicode": "1f321", + "unicode_alt": "1f321-fe0f" + }, + ":thinking:": { + "category": "Smileys & Emotion", + "name": "thinking face", + "unicode": "1f914" + }, + ":thong_sandal:": { + "category": "Objects", + "name": "thong sandal", + "unicode": "1fa74" + }, + ":thought_balloon:": { + "category": "Smileys & Emotion", + "name": "thought balloon", + "unicode": "1f4ad" + }, + ":thread:": { + "category": "Activities", + "name": "thread", + "unicode": "1f9f5" + }, + ":three:": { + "category": "Symbols", + "name": "keycap: 3", + "unicode": "0033-20e3", + "unicode_alt": "0033-fe0f-20e3" + }, + ":ticket:": { + "category": "Activities", + "name": "ticket", + "unicode": "1f3ab" + }, + ":tickets:": { + "category": "Activities", + "name": "admission tickets", + "unicode": "1f39f", + "unicode_alt": "1f39f-fe0f" + }, + ":tiger2:": { + "category": "Animals & Nature", + "name": "tiger", + "unicode": "1f405" + }, + ":tiger:": { + "category": "Animals & Nature", + "name": "tiger face", + "unicode": "1f42f" + }, + ":timer_clock:": { + "category": "Travel & Places", + "name": "timer clock", + "unicode": "23f2", + "unicode_alt": "23f2-fe0f" + }, + ":timor_leste:": { + "category": "Flags", + "name": "flag: Timor-Leste", + "unicode": "1f1f9-1f1f1" + }, + ":tipping_hand_man:": { + "category": "People & Body", + "name": "man tipping hand", + "unicode": "1f481-2642", + "unicode_alt": "1f481-200d-2642-fe0f" + }, + ":tipping_hand_person:": { + "category": "People & Body", + "name": "person tipping hand", + "unicode": "1f481" + }, + ":tipping_hand_woman:": { + "category": "People & Body", + "name": "woman tipping hand", + "unicode": "1f481-2640", + "unicode_alt": "1f481-200d-2640-fe0f" + }, + ":tired_face:": { + "category": "Smileys & Emotion", + "name": "tired face", + "unicode": "1f62b" + }, + ":tm:": { + "category": "Symbols", + "name": "trade mark", + "unicode": "2122", + "unicode_alt": "2122-fe0f" + }, + ":togo:": { + "category": "Flags", + "name": "flag: Togo", + "unicode": "1f1f9-1f1ec" + }, + ":toilet:": { + "category": "Objects", + "name": "toilet", + "unicode": "1f6bd" + }, + ":tokelau:": { + "category": "Flags", + "name": "flag: Tokelau", + "unicode": "1f1f9-1f1f0" + }, + ":tokyo_tower:": { + "category": "Travel & Places", + "name": "Tokyo tower", + "unicode": "1f5fc" + }, + ":tomato:": { + "category": "Food & Drink", + "name": "tomato", + "unicode": "1f345" + }, + ":tonga:": { + "category": "Flags", + "name": "flag: Tonga", + "unicode": "1f1f9-1f1f4" + }, + ":tongue:": { + "category": "People & Body", + "name": "tongue", + "unicode": "1f445" + }, + ":toolbox:": { + "category": "Objects", + "name": "toolbox", + "unicode": "1f9f0" + }, + ":tooth:": { + "category": "People & Body", + "name": "tooth", + "unicode": "1f9b7" + }, + ":toothbrush:": { + "category": "Objects", + "name": "toothbrush", + "unicode": "1faa5" + }, + ":top:": { + "category": "Symbols", + "name": "TOP arrow", + "unicode": "1f51d" + }, + ":tophat:": { + "category": "Objects", + "name": "top hat", + "unicode": "1f3a9" + }, + ":tornado:": { + "category": "Travel & Places", + "name": "tornado", + "unicode": "1f32a", + "unicode_alt": "1f32a-fe0f" + }, + ":tr:": { + "category": "Flags", + "name": "flag: Turkey", + "unicode": "1f1f9-1f1f7" + }, + ":trackball:": { + "category": "Objects", + "name": "trackball", + "unicode": "1f5b2", + "unicode_alt": "1f5b2-fe0f" + }, + ":tractor:": { + "category": "Travel & Places", + "name": "tractor", + "unicode": "1f69c" + }, + ":traffic_light:": { + "category": "Travel & Places", + "name": "horizontal traffic light", + "unicode": "1f6a5" + }, + ":train2:": { + "category": "Travel & Places", + "name": "train", + "unicode": "1f686" + }, + ":train:": { + "category": "Travel & Places", + "name": "tram car", + "unicode": "1f68b" + }, + ":tram:": { + "category": "Travel & Places", + "name": "tram", + "unicode": "1f68a" + }, + ":transgender_flag:": { + "category": "Flags", + "name": "transgender flag", + "unicode": "1f3f3-26a7", + "unicode_alt": "1f3f3-fe0f-200d-26a7-fe0f" + }, + ":transgender_symbol:": { + "category": "Symbols", + "name": "transgender symbol", + "unicode": "26a7", + "unicode_alt": "26a7-fe0f" + }, + ":triangular_flag_on_post:": { + "category": "Flags", + "name": "triangular flag", + "unicode": "1f6a9" + }, + ":triangular_ruler:": { + "category": "Objects", + "name": "triangular ruler", + "unicode": "1f4d0" + }, + ":trident:": { + "category": "Symbols", + "name": "trident emblem", + "unicode": "1f531" + }, + ":trinidad_tobago:": { + "category": "Flags", + "name": "flag: Trinidad & Tobago", + "unicode": "1f1f9-1f1f9" + }, + ":tristan_da_cunha:": { + "category": "Flags", + "name": "flag: Tristan da Cunha", + "unicode": "1f1f9-1f1e6" + }, + ":triumph:": { + "category": "Smileys & Emotion", + "name": "face with steam from nose", + "unicode": "1f624" + }, + ":troll:": { + "category": "People & Body", + "name": "troll", + "unicode": "1f9cc" + }, + ":trolleybus:": { + "category": "Travel & Places", + "name": "trolleybus", + "unicode": "1f68e" + }, + ":trophy:": { + "category": "Activities", + "name": "trophy", + "unicode": "1f3c6" + }, + ":tropical_drink:": { + "category": "Food & Drink", + "name": "tropical drink", + "unicode": "1f379" + }, + ":tropical_fish:": { + "category": "Animals & Nature", + "name": "tropical fish", + "unicode": "1f420" + }, + ":truck:": { + "category": "Travel & Places", + "name": "delivery truck", + "unicode": "1f69a" + }, + ":trumpet:": { + "category": "Objects", + "name": "trumpet", + "unicode": "1f3ba" + }, + ":tulip:": { + "category": "Animals & Nature", + "name": "tulip", + "unicode": "1f337" + }, + ":tumbler_glass:": { + "category": "Food & Drink", + "name": "tumbler glass", + "unicode": "1f943" + }, + ":tunisia:": { + "category": "Flags", + "name": "flag: Tunisia", + "unicode": "1f1f9-1f1f3" + }, + ":turkey:": { + "category": "Animals & Nature", + "name": "turkey", + "unicode": "1f983" + }, + ":turkmenistan:": { + "category": "Flags", + "name": "flag: Turkmenistan", + "unicode": "1f1f9-1f1f2" + }, + ":turks_caicos_islands:": { + "category": "Flags", + "name": "flag: Turks & Caicos Islands", + "unicode": "1f1f9-1f1e8" + }, + ":turtle:": { + "category": "Animals & Nature", + "name": "turtle", + "unicode": "1f422" + }, + ":tuvalu:": { + "category": "Flags", + "name": "flag: Tuvalu", + "unicode": "1f1f9-1f1fb" + }, + ":tv:": { + "category": "Objects", + "name": "television", + "unicode": "1f4fa" + }, + ":twisted_rightwards_arrows:": { + "category": "Symbols", + "name": "shuffle tracks button", + "unicode": "1f500" + }, + ":two:": { + "category": "Symbols", + "name": "keycap: 2", + "unicode": "0032-20e3", + "unicode_alt": "0032-fe0f-20e3" + }, + ":two_hearts:": { + "category": "Smileys & Emotion", + "name": "two hearts", + "unicode": "1f495" + }, + ":two_men_holding_hands:": { + "category": "People & Body", + "name": "men holding hands", + "unicode": "1f46c" + }, + ":two_women_holding_hands:": { + "category": "People & Body", + "name": "women holding hands", + "unicode": "1f46d" + }, + ":u5272:": { + "category": "Symbols", + "name": "Japanese \u201cdiscount\u201d button", + "unicode": "1f239" + }, + ":u5408:": { + "category": "Symbols", + "name": "Japanese \u201cpassing grade\u201d button", + "unicode": "1f234" + }, + ":u55b6:": { + "category": "Symbols", + "name": "Japanese \u201copen for business\u201d button", + "unicode": "1f23a" + }, + ":u6307:": { + "category": "Symbols", + "name": "Japanese \u201creserved\u201d button", + "unicode": "1f22f" + }, + ":u6708:": { + "category": "Symbols", + "name": "Japanese \u201cmonthly amount\u201d button", + "unicode": "1f237", + "unicode_alt": "1f237-fe0f" + }, + ":u6709:": { + "category": "Symbols", + "name": "Japanese \u201cnot free of charge\u201d button", + "unicode": "1f236" + }, + ":u6e80:": { + "category": "Symbols", + "name": "Japanese \u201cno vacancy\u201d button", + "unicode": "1f235" + }, + ":u7121:": { + "category": "Symbols", + "name": "Japanese \u201cfree of charge\u201d button", + "unicode": "1f21a" + }, + ":u7533:": { + "category": "Symbols", + "name": "Japanese \u201capplication\u201d button", + "unicode": "1f238" + }, + ":u7981:": { + "category": "Symbols", + "name": "Japanese \u201cprohibited\u201d button", + "unicode": "1f232" + }, + ":u7a7a:": { + "category": "Symbols", + "name": "Japanese \u201cvacancy\u201d button", + "unicode": "1f233" + }, + ":uganda:": { + "category": "Flags", + "name": "flag: Uganda", + "unicode": "1f1fa-1f1ec" + }, + ":ukraine:": { + "category": "Flags", + "name": "flag: Ukraine", + "unicode": "1f1fa-1f1e6" + }, + ":umbrella:": { + "category": "Travel & Places", + "name": "umbrella with rain drops", + "unicode": "2614" + }, + ":unamused:": { + "category": "Smileys & Emotion", + "name": "unamused face", + "unicode": "1f612" + }, + ":underage:": { + "category": "Symbols", + "name": "no one under eighteen", + "unicode": "1f51e" + }, + ":unicorn:": { + "category": "Animals & Nature", + "name": "unicorn", + "unicode": "1f984" + }, + ":united_arab_emirates:": { + "category": "Flags", + "name": "flag: United Arab Emirates", + "unicode": "1f1e6-1f1ea" + }, + ":united_nations:": { + "category": "Flags", + "name": "flag: United Nations", + "unicode": "1f1fa-1f1f3" + }, + ":unlock:": { + "category": "Objects", + "name": "unlocked", + "unicode": "1f513" + }, + ":up:": { + "category": "Symbols", + "name": "UP! button", + "unicode": "1f199" + }, + ":upside_down_face:": { + "category": "Smileys & Emotion", + "name": "upside-down face", + "unicode": "1f643" + }, + ":uruguay:": { + "category": "Flags", + "name": "flag: Uruguay", + "unicode": "1f1fa-1f1fe" + }, + ":us:": { + "category": "Flags", + "name": "flag: United States", + "unicode": "1f1fa-1f1f8" + }, + ":us_outlying_islands:": { + "category": "Flags", + "name": "flag: U.S. Outlying Islands", + "unicode": "1f1fa-1f1f2" + }, + ":us_virgin_islands:": { + "category": "Flags", + "name": "flag: U.S. Virgin Islands", + "unicode": "1f1fb-1f1ee" + }, + ":uzbekistan:": { + "category": "Flags", + "name": "flag: Uzbekistan", + "unicode": "1f1fa-1f1ff" + }, + ":v:": { + "category": "People & Body", + "name": "victory hand", + "unicode": "270c", + "unicode_alt": "270c-fe0f" + }, + ":vampire:": { + "category": "People & Body", + "name": "vampire", + "unicode": "1f9db" + }, + ":vampire_man:": { + "category": "People & Body", + "name": "man vampire", + "unicode": "1f9db-2642", + "unicode_alt": "1f9db-200d-2642-fe0f" + }, + ":vampire_woman:": { + "category": "People & Body", + "name": "woman vampire", + "unicode": "1f9db-2640", + "unicode_alt": "1f9db-200d-2640-fe0f" + }, + ":vanuatu:": { + "category": "Flags", + "name": "flag: Vanuatu", + "unicode": "1f1fb-1f1fa" + }, + ":vatican_city:": { + "category": "Flags", + "name": "flag: Vatican City", + "unicode": "1f1fb-1f1e6" + }, + ":venezuela:": { + "category": "Flags", + "name": "flag: Venezuela", + "unicode": "1f1fb-1f1ea" + }, + ":vertical_traffic_light:": { + "category": "Travel & Places", + "name": "vertical traffic light", + "unicode": "1f6a6" + }, + ":vhs:": { + "category": "Objects", + "name": "videocassette", + "unicode": "1f4fc" + }, + ":vibration_mode:": { + "category": "Symbols", + "name": "vibration mode", + "unicode": "1f4f3" + }, + ":video_camera:": { + "category": "Objects", + "name": "video camera", + "unicode": "1f4f9" + }, + ":video_game:": { + "category": "Activities", + "name": "video game", + "unicode": "1f3ae" + }, + ":vietnam:": { + "category": "Flags", + "name": "flag: Vietnam", + "unicode": "1f1fb-1f1f3" + }, + ":violin:": { + "category": "Objects", + "name": "violin", + "unicode": "1f3bb" + }, + ":virgo:": { + "category": "Symbols", + "name": "Virgo", + "unicode": "264d" + }, + ":volcano:": { + "category": "Travel & Places", + "name": "volcano", + "unicode": "1f30b" + }, + ":volleyball:": { + "category": "Activities", + "name": "volleyball", + "unicode": "1f3d0" + }, + ":vomiting_face:": { + "category": "Smileys & Emotion", + "name": "face vomiting", + "unicode": "1f92e" + }, + ":vs:": { + "category": "Symbols", + "name": "VS button", + "unicode": "1f19a" + }, + ":vulcan_salute:": { + "category": "People & Body", + "name": "vulcan salute", + "unicode": "1f596" + }, + ":waffle:": { + "category": "Food & Drink", + "name": "waffle", + "unicode": "1f9c7" + }, + ":wales:": { + "category": "Flags", + "name": "flag: Wales", + "unicode": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f" + }, + ":walking:": { + "category": "People & Body", + "name": "person walking", + "unicode": "1f6b6" + }, + ":walking_man:": { + "category": "People & Body", + "name": "man walking", + "unicode": "1f6b6-2642", + "unicode_alt": "1f6b6-200d-2642-fe0f" + }, + ":walking_woman:": { + "category": "People & Body", + "name": "woman walking", + "unicode": "1f6b6-2640", + "unicode_alt": "1f6b6-200d-2640-fe0f" + }, + ":wallis_futuna:": { + "category": "Flags", + "name": "flag: Wallis & Futuna", + "unicode": "1f1fc-1f1eb" + }, + ":waning_crescent_moon:": { + "category": "Travel & Places", + "name": "waning crescent moon", + "unicode": "1f318" + }, + ":waning_gibbous_moon:": { + "category": "Travel & Places", + "name": "waning gibbous moon", + "unicode": "1f316" + }, + ":warning:": { + "category": "Symbols", + "name": "warning", + "unicode": "26a0", + "unicode_alt": "26a0-fe0f" + }, + ":wastebasket:": { + "category": "Objects", + "name": "wastebasket", + "unicode": "1f5d1", + "unicode_alt": "1f5d1-fe0f" + }, + ":watch:": { + "category": "Travel & Places", + "name": "watch", + "unicode": "231a" + }, + ":water_buffalo:": { + "category": "Animals & Nature", + "name": "water buffalo", + "unicode": "1f403" + }, + ":water_polo:": { + "category": "People & Body", + "name": "person playing water polo", + "unicode": "1f93d" + }, + ":watermelon:": { + "category": "Food & Drink", + "name": "watermelon", + "unicode": "1f349" + }, + ":wave:": { + "category": "People & Body", + "name": "waving hand", + "unicode": "1f44b" + }, + ":wavy_dash:": { + "category": "Symbols", + "name": "wavy dash", + "unicode": "3030", + "unicode_alt": "3030-fe0f" + }, + ":waxing_crescent_moon:": { + "category": "Travel & Places", + "name": "waxing crescent moon", + "unicode": "1f312" + }, + ":wc:": { + "category": "Symbols", + "name": "water closet", + "unicode": "1f6be" + }, + ":weary:": { + "category": "Smileys & Emotion", + "name": "weary face", + "unicode": "1f629" + }, + ":wedding:": { + "category": "Travel & Places", + "name": "wedding", + "unicode": "1f492" + }, + ":weight_lifting:": { + "category": "People & Body", + "name": "person lifting weights", + "unicode": "1f3cb", + "unicode_alt": "1f3cb-fe0f" + }, + ":weight_lifting_man:": { + "category": "People & Body", + "name": "man lifting weights", + "unicode": "1f3cb-2642", + "unicode_alt": "1f3cb-fe0f-200d-2642-fe0f" + }, + ":weight_lifting_woman:": { + "category": "People & Body", + "name": "woman lifting weights", + "unicode": "1f3cb-2640", + "unicode_alt": "1f3cb-fe0f-200d-2640-fe0f" + }, + ":western_sahara:": { + "category": "Flags", + "name": "flag: Western Sahara", + "unicode": "1f1ea-1f1ed" + }, + ":whale2:": { + "category": "Animals & Nature", + "name": "whale", + "unicode": "1f40b" + }, + ":whale:": { + "category": "Animals & Nature", + "name": "spouting whale", + "unicode": "1f433" + }, + ":wheel:": { + "category": "Travel & Places", + "name": "wheel", + "unicode": "1f6de" + }, + ":wheel_of_dharma:": { + "category": "Symbols", + "name": "wheel of dharma", + "unicode": "2638", + "unicode_alt": "2638-fe0f" + }, + ":wheelchair:": { + "category": "Symbols", + "name": "wheelchair symbol", + "unicode": "267f" + }, + ":white_check_mark:": { + "category": "Symbols", + "name": "check mark button", + "unicode": "2705" + }, + ":white_circle:": { + "category": "Symbols", + "name": "white circle", + "unicode": "26aa" + }, + ":white_flag:": { + "category": "Flags", + "name": "white flag", + "unicode": "1f3f3", + "unicode_alt": "1f3f3-fe0f" + }, + ":white_flower:": { + "category": "Animals & Nature", + "name": "white flower", + "unicode": "1f4ae" + }, + ":white_haired_man:": { + "category": "People & Body", + "name": "man: white hair", + "unicode": "1f468-1f9b3", + "unicode_alt": "1f468-200d-1f9b3" + }, + ":white_haired_woman:": { + "category": "People & Body", + "name": "woman: white hair", + "unicode": "1f469-1f9b3", + "unicode_alt": "1f469-200d-1f9b3" + }, + ":white_heart:": { + "category": "Smileys & Emotion", + "name": "white heart", + "unicode": "1f90d" + }, + ":white_large_square:": { + "category": "Symbols", + "name": "white large square", + "unicode": "2b1c" + }, + ":white_medium_small_square:": { + "category": "Symbols", + "name": "white medium-small square", + "unicode": "25fd" + }, + ":white_medium_square:": { + "category": "Symbols", + "name": "white medium square", + "unicode": "25fb", + "unicode_alt": "25fb-fe0f" + }, + ":white_small_square:": { + "category": "Symbols", + "name": "white small square", + "unicode": "25ab", + "unicode_alt": "25ab-fe0f" + }, + ":white_square_button:": { + "category": "Symbols", + "name": "white square button", + "unicode": "1f533" + }, + ":wilted_flower:": { + "category": "Animals & Nature", + "name": "wilted flower", + "unicode": "1f940" + }, + ":wind_chime:": { + "category": "Activities", + "name": "wind chime", + "unicode": "1f390" + }, + ":wind_face:": { + "category": "Travel & Places", + "name": "wind face", + "unicode": "1f32c", + "unicode_alt": "1f32c-fe0f" + }, + ":window:": { + "category": "Objects", + "name": "window", + "unicode": "1fa9f" + }, + ":wine_glass:": { + "category": "Food & Drink", + "name": "wine glass", + "unicode": "1f377" + }, + ":wing:": { + "category": "Animals & Nature", + "name": "wing", + "unicode": "1fabd" + }, + ":wink:": { + "category": "Smileys & Emotion", + "name": "winking face", + "unicode": "1f609" + }, + ":wireless:": { + "category": "Symbols", + "name": "wireless", + "unicode": "1f6dc" + }, + ":wolf:": { + "category": "Animals & Nature", + "name": "wolf", + "unicode": "1f43a" + }, + ":woman:": { + "category": "People & Body", + "name": "woman", + "unicode": "1f469" + }, + ":woman_artist:": { + "category": "People & Body", + "name": "woman artist", + "unicode": "1f469-1f3a8", + "unicode_alt": "1f469-200d-1f3a8" + }, + ":woman_astronaut:": { + "category": "People & Body", + "name": "woman astronaut", + "unicode": "1f469-1f680", + "unicode_alt": "1f469-200d-1f680" + }, + ":woman_beard:": { + "category": "People & Body", + "name": "woman: beard", + "unicode": "1f9d4-2640", + "unicode_alt": "1f9d4-200d-2640-fe0f" + }, + ":woman_cartwheeling:": { + "category": "People & Body", + "name": "woman cartwheeling", + "unicode": "1f938-2640", + "unicode_alt": "1f938-200d-2640-fe0f" + }, + ":woman_cook:": { + "category": "People & Body", + "name": "woman cook", + "unicode": "1f469-1f373", + "unicode_alt": "1f469-200d-1f373" + }, + ":woman_dancing:": { + "category": "People & Body", + "name": "woman dancing", + "unicode": "1f483" + }, + ":woman_facepalming:": { + "category": "People & Body", + "name": "woman facepalming", + "unicode": "1f926-2640", + "unicode_alt": "1f926-200d-2640-fe0f" + }, + ":woman_factory_worker:": { + "category": "People & Body", + "name": "woman factory worker", + "unicode": "1f469-1f3ed", + "unicode_alt": "1f469-200d-1f3ed" + }, + ":woman_farmer:": { + "category": "People & Body", + "name": "woman farmer", + "unicode": "1f469-1f33e", + "unicode_alt": "1f469-200d-1f33e" + }, + ":woman_feeding_baby:": { + "category": "People & Body", + "name": "woman feeding baby", + "unicode": "1f469-1f37c", + "unicode_alt": "1f469-200d-1f37c" + }, + ":woman_firefighter:": { + "category": "People & Body", + "name": "woman firefighter", + "unicode": "1f469-1f692", + "unicode_alt": "1f469-200d-1f692" + }, + ":woman_health_worker:": { + "category": "People & Body", + "name": "woman health worker", + "unicode": "1f469-2695", + "unicode_alt": "1f469-200d-2695-fe0f" + }, + ":woman_in_manual_wheelchair:": { + "category": "People & Body", + "name": "woman in manual wheelchair", + "unicode": "1f469-1f9bd", + "unicode_alt": "1f469-200d-1f9bd" + }, + ":woman_in_motorized_wheelchair:": { + "category": "People & Body", + "name": "woman in motorized wheelchair", + "unicode": "1f469-1f9bc", + "unicode_alt": "1f469-200d-1f9bc" + }, + ":woman_in_tuxedo:": { + "category": "People & Body", + "name": "woman in tuxedo", + "unicode": "1f935-2640", + "unicode_alt": "1f935-200d-2640-fe0f" + }, + ":woman_judge:": { + "category": "People & Body", + "name": "woman judge", + "unicode": "1f469-2696", + "unicode_alt": "1f469-200d-2696-fe0f" + }, + ":woman_juggling:": { + "category": "People & Body", + "name": "woman juggling", + "unicode": "1f939-2640", + "unicode_alt": "1f939-200d-2640-fe0f" + }, + ":woman_mechanic:": { + "category": "People & Body", + "name": "woman mechanic", + "unicode": "1f469-1f527", + "unicode_alt": "1f469-200d-1f527" + }, + ":woman_office_worker:": { + "category": "People & Body", + "name": "woman office worker", + "unicode": "1f469-1f4bc", + "unicode_alt": "1f469-200d-1f4bc" + }, + ":woman_pilot:": { + "category": "People & Body", + "name": "woman pilot", + "unicode": "1f469-2708", + "unicode_alt": "1f469-200d-2708-fe0f" + }, + ":woman_playing_handball:": { + "category": "People & Body", + "name": "woman playing handball", + "unicode": "1f93e-2640", + "unicode_alt": "1f93e-200d-2640-fe0f" + }, + ":woman_playing_water_polo:": { + "category": "People & Body", + "name": "woman playing water polo", + "unicode": "1f93d-2640", + "unicode_alt": "1f93d-200d-2640-fe0f" + }, + ":woman_scientist:": { + "category": "People & Body", + "name": "woman scientist", + "unicode": "1f469-1f52c", + "unicode_alt": "1f469-200d-1f52c" + }, + ":woman_shrugging:": { + "category": "People & Body", + "name": "woman shrugging", + "unicode": "1f937-2640", + "unicode_alt": "1f937-200d-2640-fe0f" + }, + ":woman_singer:": { + "category": "People & Body", + "name": "woman singer", + "unicode": "1f469-1f3a4", + "unicode_alt": "1f469-200d-1f3a4" + }, + ":woman_student:": { + "category": "People & Body", + "name": "woman student", + "unicode": "1f469-1f393", + "unicode_alt": "1f469-200d-1f393" + }, + ":woman_teacher:": { + "category": "People & Body", + "name": "woman teacher", + "unicode": "1f469-1f3eb", + "unicode_alt": "1f469-200d-1f3eb" + }, + ":woman_technologist:": { + "category": "People & Body", + "name": "woman technologist", + "unicode": "1f469-1f4bb", + "unicode_alt": "1f469-200d-1f4bb" + }, + ":woman_with_headscarf:": { + "category": "People & Body", + "name": "woman with headscarf", + "unicode": "1f9d5" + }, + ":woman_with_probing_cane:": { + "category": "People & Body", + "name": "woman with white cane", + "unicode": "1f469-1f9af", + "unicode_alt": "1f469-200d-1f9af" + }, + ":woman_with_turban:": { + "category": "People & Body", + "name": "woman wearing turban", + "unicode": "1f473-2640", + "unicode_alt": "1f473-200d-2640-fe0f" + }, + ":woman_with_veil:": { + "category": "People & Body", + "name": "woman with veil", + "unicode": "1f470-2640", + "unicode_alt": "1f470-200d-2640-fe0f" + }, + ":womans_clothes:": { + "category": "Objects", + "name": "woman\u2019s clothes", + "unicode": "1f45a" + }, + ":womans_hat:": { + "category": "Objects", + "name": "woman\u2019s hat", + "unicode": "1f452" + }, + ":women_wrestling:": { + "category": "People & Body", + "name": "women wrestling", + "unicode": "1f93c-2640", + "unicode_alt": "1f93c-200d-2640-fe0f" + }, + ":womens:": { + "category": "Symbols", + "name": "women\u2019s room", + "unicode": "1f6ba" + }, + ":wood:": { + "category": "Travel & Places", + "name": "wood", + "unicode": "1fab5" + }, + ":woozy_face:": { + "category": "Smileys & Emotion", + "name": "woozy face", + "unicode": "1f974" + }, + ":world_map:": { + "category": "Travel & Places", + "name": "world map", + "unicode": "1f5fa", + "unicode_alt": "1f5fa-fe0f" + }, + ":worm:": { + "category": "Animals & Nature", + "name": "worm", + "unicode": "1fab1" + }, + ":worried:": { + "category": "Smileys & Emotion", + "name": "worried face", + "unicode": "1f61f" + }, + ":wrench:": { + "category": "Objects", + "name": "wrench", + "unicode": "1f527" + }, + ":wrestling:": { + "category": "People & Body", + "name": "people wrestling", + "unicode": "1f93c" + }, + ":writing_hand:": { + "category": "People & Body", + "name": "writing hand", + "unicode": "270d", + "unicode_alt": "270d-fe0f" + }, + ":x:": { + "category": "Symbols", + "name": "cross mark", + "unicode": "274c" + }, + ":x_ray:": { + "category": "Objects", + "name": "x-ray", + "unicode": "1fa7b" + }, + ":yarn:": { + "category": "Activities", + "name": "yarn", + "unicode": "1f9f6" + }, + ":yawning_face:": { + "category": "Smileys & Emotion", + "name": "yawning face", + "unicode": "1f971" + }, + ":yellow_circle:": { + "category": "Symbols", + "name": "yellow circle", + "unicode": "1f7e1" + }, + ":yellow_heart:": { + "category": "Smileys & Emotion", + "name": "yellow heart", + "unicode": "1f49b" + }, + ":yellow_square:": { + "category": "Symbols", + "name": "yellow square", + "unicode": "1f7e8" + }, + ":yemen:": { + "category": "Flags", + "name": "flag: Yemen", + "unicode": "1f1fe-1f1ea" + }, + ":yen:": { + "category": "Objects", + "name": "yen banknote", + "unicode": "1f4b4" + }, + ":yin_yang:": { + "category": "Symbols", + "name": "yin yang", + "unicode": "262f", + "unicode_alt": "262f-fe0f" + }, + ":yo_yo:": { + "category": "Activities", + "name": "yo-yo", + "unicode": "1fa80" + }, + ":yum:": { + "category": "Smileys & Emotion", + "name": "face savoring food", + "unicode": "1f60b" + }, + ":zambia:": { + "category": "Flags", + "name": "flag: Zambia", + "unicode": "1f1ff-1f1f2" + }, + ":zany_face:": { + "category": "Smileys & Emotion", + "name": "zany face", + "unicode": "1f92a" + }, + ":zap:": { + "category": "Travel & Places", + "name": "high voltage", + "unicode": "26a1" + }, + ":zebra:": { + "category": "Animals & Nature", + "name": "zebra", + "unicode": "1f993" + }, + ":zero:": { + "category": "Symbols", + "name": "keycap: 0", + "unicode": "0030-20e3", + "unicode_alt": "0030-fe0f-20e3" + }, + ":zimbabwe:": { + "category": "Flags", + "name": "flag: Zimbabwe", + "unicode": "1f1ff-1f1fc" + }, + ":zipper_mouth_face:": { + "category": "Smileys & Emotion", + "name": "zipper-mouth face", + "unicode": "1f910" + }, + ":zombie:": { + "category": "People & Body", + "name": "zombie", + "unicode": "1f9df" + }, + ":zombie_man:": { + "category": "People & Body", + "name": "man zombie", + "unicode": "1f9df-2642", + "unicode_alt": "1f9df-200d-2642-fe0f" + }, + ":zombie_woman:": { + "category": "People & Body", + "name": "woman zombie", + "unicode": "1f9df-2640", + "unicode_alt": "1f9df-200d-2640-fe0f" + }, + ":zzz:": { + "category": "Smileys & Emotion", + "name": "ZZZ", + "unicode": "1f4a4" + } +} +aliases = { + ":basketball_man:": ":bouncing_ball_man:", + ":basketball_woman:": ":bouncing_ball_woman:", + ":blonde_woman:": ":blond_haired_woman:", + ":bride_with_veil:": ":woman_with_veil:", + ":collision:": ":boom:", + ":cop:": ":police_officer:", + ":dancer:": ":woman_dancing:", + ":e-mail:": ":email:", + ":european_union:": ":eu:", + ":facepunch:": ":fist_oncoming:", + ":fist:": ":fist_raised:", + ":flipper:": ":dolphin:", + ":fu:": ":middle_finger:", + ":heavy_exclamation_mark:": ":exclamation:", + ":honeybee:": ":bee:", + ":information_desk_person:": ":tipping_hand_person:", + ":knife:": ":hocho:", + ":lantern:": ":izakaya_lantern:", + ":mandarin:": ":tangerine:", + ":ng_man:": ":no_good_man:", + ":ng_woman:": ":no_good_woman:", + ":open_book:": ":book:", + ":orange:": ":tangerine:", + ":paw_prints:": ":feet:", + ":pencil:": ":memo:", + ":poop:": ":hankey:", + ":pout:": ":rage:", + ":punch:": ":fist_oncoming:", + ":raised_hand:": ":hand:", + ":red_car:": ":car:", + ":running:": ":runner:", + ":sailboat:": ":boat:", + ":sassy_man:": ":tipping_hand_man:", + ":sassy_woman:": ":tipping_hand_woman:", + ":satisfied:": ":laughing:", + ":shit:": ":hankey:", + ":shoe:": ":mans_shoe:", + ":telephone:": ":phone:", + ":thumbsdown:": ":-1:", + ":thumbsup:": ":+1:", + ":tshirt:": ":shirt:", + ":uk:": ":gb:", + ":waxing_gibbous_moon:": ":moon:" +} diff --git a/micromamba_root/Lib/site-packages/pymdownx/highlight.py b/micromamba_root/Lib/site-packages/pymdownx/highlight.py new file mode 100644 index 0000000000000000000000000000000000000000..3f303dc5094acc9bc613d41e77961e9c20d93242 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/highlight.py @@ -0,0 +1,615 @@ +""" +Highlight. + +A library for managing code highlighting. + +All Changes Copyright 2014-2017 Isaac Muse. + +--- + +CodeHilite Extension for Python-Markdown +======================================== + +Adds code/syntax highlighting to standard Python-Markdown code blocks. + +See +for documentation. + +Original code Copyright 2006-2008 [Waylan Limberg](https://github.com/waylan). + +All changes Copyright 2008-2014 The Python Markdown Project + +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) +""" +import re +from markdown import Extension +from markdown.treeprocessors import Treeprocessor +import xml.etree.ElementTree as etree +import copy +from collections import OrderedDict +try: + from pygments import highlight + from pygments.lexers import get_lexer_by_name, guess_lexer + from pygments.formatters import find_formatter_class + from pygments import __version__ as pygments_ver + p_ver = tuple([int(n) for n in pygments_ver.split('.')[:2]]) + HtmlFormatter = find_formatter_class('html') + pygments = True +except ImportError: # pragma: no cover + pygments = False + p_ver = (0, 0) + +RE_PYG_CODE = re.compile(r'^<(div)(\s*class="(.*?)")?\s*>') +CODE_WRAP = '{}

  • ' +CODE_WRAP_ON_PRE = '{}' +CLASS_ATTR = ' class="{}"' +ID_ATTR = ' id="{}"' +DEFAULT_CONFIG = { + 'use_pygments': [ + True, + 'Use Pygments to highlight code blocks. ' + 'Disable if using a JavaScript library. ' + 'Default: True' + ], + 'guess_lang': [ + 0, + "Automatic language detection - Default: False" + ], + 'css_class': [ + 'highlight', + "CSS class to apply to wrapper element." + ], + 'pygments_style': [ + 'default', + 'Pygments HTML Formatter Style ' + '(color scheme) - Default: default' + ], + 'noclasses': [ + False, + 'Use inline styles instead of CSS classes - ' + 'Default false' + ], + 'linenums': [ + None, + 'Display line numbers in block code output (not inline) - Default: False' + ], + 'linenums_style': [ + 'table', + 'Line number style -Default: "table"' + ], + 'linenums_special': [ + -1, + 'Globally make nth line special - Default: -1' + ], + 'linenums_class': [ + "linenums", + "Control the linenums class name when not using Pygments - Default: 'linenums'" + ], + 'extend_pygments_lang': [ + [], + 'Extend pygments language with special language entry - Default: []' + ], + 'language_prefix': [ + 'language-', + 'Controls the language prefix for non-Pygments code blocks. - Defaults: "language-"' + ], + 'code_attr_on_pre': [ + False, + "Attach attribute list values on pre element instead of code element - Default: False" + ], + 'auto_title': [ + False, + 'Inject the lexer name as the title for block code - Defaults: False' + ], + 'auto_title_map': [ + {}, + 'User defined mapping of overrides for "auto_title" - Defaults: {}' + ], + 'line_spans': [ + '', + 'If set to a nonempty string, e.g. foo, the formatter will wrap each output line ' + 'in a span tag with an id of foo--. . - Defaults: ""' + ], + 'anchor_linenums': [ + False, + 'If set to True, will wrap line numbers in tags. Used in combination with linenums and line_anchors.' + ' - Defaults: False' + ], + 'line_anchors': [ + '', + 'If set to a nonempty string, e.g. foo, the formatter will wrap each output line in an anchor tag with' + ' an id (and name) of foo--. - Defaults: ""' + ], + 'pygments_lang_class': [ + False, + 'If set to True, the language name used will be included as a class attached to the element. - Defaults: False' + ], + 'stripnl': [ + True, + 'Strips leading and trailing newlines from code blocks. This is Pygments default behavior. Setting this to ' + 'False disables this and will retain leading and trailing newlines. This has no affect on inline code. ' + '- Defaults: True' + ], + 'default_lang': [ + '', + 'The assumed highlight language of a code block when no language is set. - Default text' + ], + '_enabled': [ + True, + 'Used internally to communicate if extension has been explicitly enabled - Default: False' + ] +} + +if pygments: + class InlineHtmlFormatter(HtmlFormatter): + """Format the code blocks.""" + + def _wrap_div(self, inner): + """Do not wrap with `div`.""" + + yield from inner + + def wrap(self, source): + """Overload wrap.""" + + return self._wrap_code(source) + + def _wrap_code(self, source): + """Return source, but do not wrap in inline block.""" + + yield 0, '' + for i, t in source: + yield i, t.strip() + yield 0, '' + + class BlockHtmlFormatter(HtmlFormatter): + """Adds ability to output line numbers in a new way.""" + + # Capture ` 1 ` + RE_SPAN_NUMS = re.compile(r'(]*?)(class="[^"]*\blinenos?\b[^"]*)"([^>]*)>([^<]+)()') + # Capture `
    ` that is not followed by ``
    +        RE_TABLE_NUMS = re.compile(r'(]*>)(?!)')
    +
    +        def __init__(self, **options):
    +            """Initialize."""
    +
    +            self.pymdownx_inline = options.get('linenos', False) == 'pymdownx-inline'
    +            if self.pymdownx_inline:
    +                options['linenos'] = 'inline'
    +            HtmlFormatter.__init__(self, **options)
    +
    +        def _format_custom_line(self, m):
    +            """Format the custom line number."""
    +
    +            # We've broken up the match in such a way that we not only
    +            # move the line number value to `data-linenos`, but we could
    +            # wrap the gutter number in the future with a highlight class.
    +            # The decision to do this has still not be made.
    +
    +            return (
    +                m.group(1) +
    +                m.group(2) +
    +                '"' +
    +                m.group(3) +
    +                ' data-linenos="' + m.group(4) + ' ">' +
    +                m.group(5)
    +            )
    +
    +        def _wrap_customlinenums(self, inner):
    +            """
    +            Wrapper to handle block inline line numbers.
    +
    +            For our special inline version, don't display line numbers via `  1`,
    +            but include as `` and use CSS to display them:
    +            `[data-linenos]:before {content: attr(data-linenos);}`.  This allows us to use
    +            inline and copy and paste without issue.
    +            """
    +
    +            for t, line in inner:
    +                if t:
    +                    line = self.RE_SPAN_NUMS.sub(self._format_custom_line, line)
    +                yield t, line
    +
    +        def wrap(self, source):
    +            """Wrap the source code."""
    +
    +            if self.linenos == 2 and self.pymdownx_inline:
    +                source = self._wrap_customlinenums(source)
    +            return HtmlFormatter.wrap(self, source)
    +
    +        def _wrap_tablelinenos(self, inner):
    +            """
    +            Wrapper to handle line numbers better in table.
    +
    +            Pygments currently has a bug with line step where leading blank lines collapse.
    +            Use the same fix Pygments uses for code content for code line numbers.
    +            This fix should be pull requested on the Pygments repository.
    +            """
    +
    +            for t, line in HtmlFormatter._wrap_tablelinenos(self, inner):
    +                yield t, self.RE_TABLE_NUMS.sub(r'\1', line)
    +
    +
    +class Highlight:
    +    """Highlight class."""
    +
    +    def __init__(
    +        self, guess_lang=False, pygments_style='default', use_pygments=True,
    +        noclasses=False, extend_pygments_lang=None, linenums=None, linenums_special=-1,
    +        linenums_style='table', linenums_class='linenums', language_prefix='language-',
    +        code_attr_on_pre=False, auto_title=False, auto_title_map=None, line_spans='',
    +        anchor_linenums=False, line_anchors='', pygments_lang_class=False, stripnl=True,
    +        default_lang=''
    +    ):
    +        """Initialize."""
    +
    +        self.guess_lang = guess_lang
    +        self.pygments_style = pygments_style
    +        self.use_pygments = use_pygments
    +        self.noclasses = noclasses
    +        self.linenums = linenums
    +        self.linenums_style = linenums_style
    +        self.linenums_special = linenums_special
    +        self.linenums_class = linenums_class
    +        self.language_prefix = language_prefix
    +        self.code_attr_on_pre = code_attr_on_pre
    +        self.auto_title = auto_title
    +        self.line_spans = line_spans
    +        self.line_anchors = line_anchors
    +        self.anchor_linenums = anchor_linenums
    +        self.pygments_lang_class = pygments_lang_class
    +        self.stripnl = stripnl
    +        self.default_lang = default_lang
    +
    +        if self.anchor_linenums and not self.line_anchors:
    +            self.line_anchors = '__codelineno'
    +
    +        if auto_title_map is None:
    +            auto_title_map = {}
    +        self.auto_title_map = auto_title_map
    +
    +        if extend_pygments_lang is None:  # pragma: no cover
    +            extend_pygments_lang = []
    +        self.extend_pygments_lang = {}
    +        for language in extend_pygments_lang:
    +            if isinstance(language, (dict, OrderedDict)):
    +                name = language.get('name')
    +                if name is not None and name not in self.extend_pygments_lang:
    +                    self.extend_pygments_lang[name.lower()] = [
    +                        language.get('lang'),
    +                        language.get('options', {})
    +                    ]
    +
    +    def get_extended_language(self, language):
    +        """Get extended language."""
    +
    +        return self.extend_pygments_lang.get(language.lower(), (language, {}))
    +
    +    def get_lexer(self, src, language, inline, stripnl):
    +        """Get the Pygments lexer."""
    +
    +        name = language
    +
    +        lexer_options = {'stripnl': stripnl}
    +        if language:
    +            language, options = self.get_extended_language(language)
    +            lexer_options.update(options)
    +
    +        # Try and get lexer by the name given.
    +        try:
    +            lexer = get_lexer_by_name(language, **lexer_options)
    +        except Exception:
    +            lexer = None
    +
    +        if lexer is None:
    +            if (self.guess_lang is True) or (self.guess_lang == 'inline' if inline else self.guess_lang == 'block'):
    +                try:
    +                    lexer = guess_lexer(src, **lexer_options)
    +                    name = lexer.aliases[0]
    +                except Exception:  # pragma: no cover
    +                    pass
    +        if lexer is None:
    +            lexer = get_lexer_by_name(self.default_lang or 'text', **lexer_options)
    +            name = lexer.aliases[0]
    +        return lexer, name
    +
    +    def escape(self, txt):
    +        """Basic HTML escaping."""
    +
    +        txt = txt.replace('&', '&')
    +        txt = txt.replace('<', '<')
    +        txt = txt.replace('>', '>')
    +        return txt
    +
    +    def highlight(
    +        self, src, language, css_class='highlight', hl_lines=None,
    +        linestart=-1, linestep=-1, linespecial=-1, inline=False, classes=None, id_value='', attrs=None,
    +        title=None, code_block_count=0
    +    ):
    +        """Highlight code."""
    +
    +        if attrs is None:
    +            attrs = {}
    +        class_names = classes[:] if classes else []
    +        linenums_enabled = (
    +            (self.linenums and linestart != 0) or
    +            (self.linenums is not False and linestart > 0)
    +        ) and not inline > 0
    +        class_str = ''
    +
    +        if not language and self.default_lang:
    +            language = self.default_lang
    +
    +        # Convert with Pygments.
    +        if pygments and self.use_pygments:
    +
    +            if p_ver < (2, 12):  # pragma: no cover
    +                raise RuntimeError('Pymdownx Highlight requires at least Pygments 2.12+ if enabling Pygments')
    +
    +            if inline:
    +                stripnl = True
    +            else:
    +                stripnl = self.stripnl
    +
    +            # Setup language lexer.
    +            lexer, lang_name = self.get_lexer(src, language, inline, stripnl)
    +            if self.pygments_lang_class:
    +                class_names.insert(0, self.language_prefix + lang_name)
    +            linenums = self.linenums_style if linenums_enabled else False
    +
    +            if class_names:
    +                if inline:
    +                    css_class = ' {}'.format('' if not css_class else css_class)
    +                    css_class = ' '.join(class_names) + css_class
    +                    stripped = css_class.strip()
    +                    css_class = stripped
    +
    +            id_str = ID_ATTR.format(id_value) if id_value else ''
    +
    +            lineno_id = id_value if id_value else str(code_block_count)
    +
    +            if not attrs:
    +                attr_str = ''
    +            else:
    +                temp = []
    +                for k, v in attrs.items():
    +                    if k.startswith('data-'):
    +                        temp.append(f'{k}="{v}"')
    +                attr_str = ' ' + ' '.join(temp) if temp else ''
    +
    +            # Setup line specific settings.
    +            if not linenums or linestep < 1:
    +                linestep = 1
    +            if not linenums or linestart < 1:
    +                linestart = 1
    +            if self.linenums_special >= 0 and linespecial < 0:
    +                linespecial = self.linenums_special
    +            if not linenums or linespecial < 0:
    +                linespecial = 0
    +            if hl_lines is None or inline:
    +                hl_lines = []
    +
    +            if title is None and self.auto_title:
    +                name = " ".join([w.title() if w.islower() else w for w in lexer.name.split()])
    +                title = self.auto_title_map.get(name, name)
    +            if title:
    +                title = title.strip()
    +            if title is None:
    +                title = ''
    +
    +            # Setup formatter
    +            html_formatter = InlineHtmlFormatter if inline else BlockHtmlFormatter
    +            formatter = html_formatter(
    +                cssclass=css_class,
    +                linenos=linenums,
    +                linenostart=linestart,
    +                linenostep=linestep,
    +                linenospecial=linespecial,
    +                style=self.pygments_style,
    +                noclasses=self.noclasses,
    +                hl_lines=hl_lines,
    +                wrapcode=True,
    +                filename=title if not inline else "",
    +                linespans=f"{self.line_spans}-{lineno_id}" if self.line_spans and not inline else '',
    +                lineanchors=(
    +                    f"{self.line_anchors}-{lineno_id}" if self.line_anchors and not inline else ""
    +                ),
    +                anchorlinenos=self.anchor_linenums if not inline else False
    +            )
    +
    +            # Convert
    +            code = highlight(src, lexer, formatter)
    +            if inline:
    +                class_str = css_class
    +                attr_str = ''
    +            else:
    +                m = RE_PYG_CODE.match(code)
    +                if m is not None:
    +                    end = m.end(0)
    +                    start = m.start(0)
    +                    if class_names:
    +                        if m.group(2):
    +                            classes = ' class="{} {}"'.format(' '.join(class_names), m.group(3).strip())
    +                        else:
    +                            classes = ' class="{}"'.format(' '.join(class_names))
    +                    else:
    +                        classes = ' ' + m.group(2).lstrip() if m.group(2) else ''
    +
    +                    code = f'{code[:start]}<{m.group(1)}{id_str}{classes}{attr_str}>{code[end:]}'
    +
    +        elif inline:
    +            # Format inline code for a JavaScript Syntax Highlighter by specifying language.
    +            code = self.escape(src)
    +            if css_class:
    +                class_names.insert(0, css_class)
    +            if language:
    +                class_names.insert(0, self.language_prefix + language)
    +            class_str = ' '.join(class_names) if class_names else ''
    +            id_str = id_value
    +        else:
    +            # Format block code for a JavaScript Syntax Highlighter by specifying language.
    +            if self.code_attr_on_pre and css_class:
    +                class_names.insert(0, css_class)
    +            if language:
    +                class_names.insert(0, self.language_prefix + language)
    +            class_str = CLASS_ATTR.format(' '.join(class_names)) if class_names else ''
    +            id_str = ID_ATTR.format(id_value) if id_value else ''
    +            attr_str = ' ' + ' '.join(f'{k}="{v}"' for k, v in attrs.items()) if attrs else ''
    +            if not self.code_attr_on_pre:
    +                highlight_class = (CLASS_ATTR.format(css_class)) if css_class else ''
    +                code = CODE_WRAP.format(highlight_class, id_str, class_str, attr_str, self.escape(src))
    +            else:
    +                code = CODE_WRAP_ON_PRE.format(id_str, class_str, attr_str, self.escape(src))
    +
    +        if inline:
    +            attributes = {}
    +
    +            if class_str:
    +                attributes['class'] = class_str
    +
    +            # This code exists for consistency, but we currently don't
    +            # ever feed extra ids or attributes for inline code.
    +            # We let `attr_list` handle this directly, but if we did
    +            # need this, we would then want to exercise this logic.
    +            if id_str:  # pragma: no cover
    +                attributes['id'] = id_str
    +            for k, v in attrs:  # pragma: no cover
    +                attributes[k] = v  # noqa: PERF403
    +
    +            el = etree.Element('code', attributes)
    +            el.text = code
    +            return el
    +        else:
    +            return code.strip()
    +
    +
    +class HighlightTreeprocessor(Treeprocessor):
    +    """Highlight source code in code blocks."""
    +
    +    def __init__(self, md, ext):
    +        """Initialize."""
    +
    +        self.ext = ext
    +        super().__init__(md)
    +
    +    def code_unescape(self, text):
    +        """Unescape code."""
    +        text = text.replace("<", "<")
    +        text = text.replace(">", ">")
    +        text = text.replace("&", "&")
    +        return text
    +
    +    def run(self, root):
    +        """Find code blocks and store in `htmlStash`."""
    +
    +        blocks = root.iter('pre')
    +        for block in blocks:
    +            if len(block) == 1 and block[0].tag == 'code':
    +
    +                self.ext.pygments_code_block += 1
    +                code = Highlight(
    +                    guess_lang=self.config['guess_lang'],
    +                    pygments_style=self.config['pygments_style'],
    +                    use_pygments=self.config['use_pygments'],
    +                    noclasses=self.config['noclasses'],
    +                    linenums=self.config['linenums'],
    +                    linenums_style=self.config['linenums_style'],
    +                    linenums_special=self.config['linenums_special'],
    +                    linenums_class=self.config['linenums_class'],
    +                    extend_pygments_lang=self.config['extend_pygments_lang'],
    +                    language_prefix=self.config['language_prefix'],
    +                    code_attr_on_pre=self.config['code_attr_on_pre'],
    +                    auto_title=self.config['auto_title'],
    +                    auto_title_map=self.config['auto_title_map'],
    +                    pygments_lang_class=self.config['pygments_lang_class'],
    +                    stripnl=self.config['stripnl'],
    +                    default_lang=self.config['default_lang']
    +                )
    +                placeholder = self.md.htmlStash.store(
    +                    code.highlight(
    +                        self.code_unescape(block[0].text).rstrip('\n'),
    +                        '',
    +                        self.config['css_class'],
    +                        code_block_count=self.ext.pygments_code_block
    +                    )
    +                )
    +
    +                # Clear code block in `etree` instance
    +                block.clear()
    +                # Change to `p` element which will later
    +                # be removed when inserting raw HTML
    +                block.tag = 'p'
    +                block.text = placeholder
    +
    +
    +class HighlightExtension(Extension):
    +    """Configure highlight settings globally."""
    +
    +    def __init__(self, *args, **kwargs):
    +        """Initialize."""
    +
    +        self.config = copy.deepcopy(DEFAULT_CONFIG)
    +        super().__init__(*args, **kwargs)
    +
    +    def get_pymdownx_highlight_settings(self):
    +        """Get the specified extension."""
    +
    +        target = None
    +
    +        if self.enabled:
    +            target = self.getConfigs()
    +
    +        if target is None:
    +            target = {}
    +            config_clone = copy.deepcopy(DEFAULT_CONFIG)
    +            for k in config_clone.keys():
    +                target[k] = config_clone[k][0]
    +
    +        return target
    +
    +    def get_pymdownx_highlighter(self):
    +        """Get the highlighter."""
    +
    +        return Highlight
    +
    +    def extendMarkdown(self, md):
    +        """Add support for code highlighting."""
    +
    +        config = self.getConfigs()
    +        self.pygments_code_block = -1
    +        self.md = md
    +        self.enabled = config.get("_enabled", False)
    +
    +        if self.enabled:
    +            ht = HighlightTreeprocessor(self.md, self)
    +            ht.config = self.getConfigs()
    +            self.md.treeprocessors.register(ht, "indent-highlight", 30)
    +
    +        index = 0
    +        register = None
    +        for ext in self.md.registeredExtensions:
    +            if isinstance(ext, HighlightExtension):
    +                register = not ext.enabled and self.enabled
    +                break
    +            index += 1
    +
    +        if register is None:
    +            register = True
    +            index = -1
    +
    +        if register:
    +            if index == -1:
    +                self.md.registerExtension(self)
    +            else:
    +                self.md.registeredExtensions[index] = self
    +
    +    def reset(self):
    +        """Reset."""
    +
    +        self.pygments_code_block = -1
    +
    +
    +def makeExtension(*args, **kwargs):
    +    """Return extension."""
    +
    +    return HighlightExtension(*args, **kwargs)
    diff --git a/micromamba_root/Lib/site-packages/pymdownx/inlinehilite.py b/micromamba_root/Lib/site-packages/pymdownx/inlinehilite.py
    new file mode 100644
    index 0000000000000000000000000000000000000000..4e3800a04fddbdb255894071b2407d8f64beddd3
    --- /dev/null
    +++ b/micromamba_root/Lib/site-packages/pymdownx/inlinehilite.py
    @@ -0,0 +1,228 @@
    +"""
    +Inline Highlighting.
    +
    +pymdownx.inlinehilite
    +
    +An alternative inline code extension that highlights code.  Can
    +use CodeHilite to source its settings or pymdownx.highlight.
    +
    +`:::javascript var test = 0;`
    +
    +- or -
    +
    +`#!javascript var test = 0;`
    +
    +Copyright 2014 - 2017 Isaac Muse 
    +"""
    +
    +from markdown import Extension
    +from markdown.inlinepatterns import InlineProcessor
    +from markdown import util as md_util
    +import xml.etree.ElementTree as etree
    +import functools
    +
    +ESCAPED_BSLASH = '{}{}{}'.format(md_util.STX, ord('\\'), md_util.ETX)
    +DOUBLE_BSLASH = '\\\\'
    +BACKTICK_CODE_RE = r'''(?x)
    +(?:
    +(?(?:\\{2})+)(?=`+) |  # Process code escapes before code
    +(?`+)
    +((?:\:{3,}|\#!)(?P[\w#.+-]*)\s+)? # Optional language
    +(?P.+?)                           # Code
    +(?', '>')
    +    return txt
    +
    +
    +def _test(language, test_language=None):
    +    """Test language."""
    +
    +    return test_language is None or test_language == '*' or language == test_language
    +
    +
    +def _formatter(src="", language="", md=None, class_name="", fmt=None):
    +    """Formatter wrapper."""
    +
    +    return fmt(src, language, class_name, md)
    +
    +
    +class InlineHilitePattern(InlineProcessor):
    +    """Handle the inline code patterns."""
    +
    +    def __init__(self, pattern, config, md):
    +        """Initialize."""
    +
    +        self.config = config
    +        InlineProcessor.__init__(self, pattern, md)
    +        self.md = md
    +
    +        self.formatters = [
    +            {
    +                "name": "inlinehilite",
    +                "test": _test,
    +                "formatter": self.highlight_code
    +            }
    +        ]
    +
    +        # Custom Fences
    +        custom_inline = self.config.get('custom_inline', [])
    +        for custom in custom_inline:
    +            name = custom.get('name')
    +            class_name = custom.get('class')
    +            inline_format = custom.get('format', self.highlight_code)
    +            if name is not None and class_name is not None:
    +                self.extend_custom_inline(
    +                    name,
    +                    functools.partial(_formatter, class_name=class_name, fmt=inline_format)
    +                )
    +
    +        self.get_hl_settings = False
    +
    +    def extend_custom_inline(self, name, formatter):
    +        """Extend SuperFences with the given name, language, and formatter."""
    +
    +        obj = {
    +            "name": name,
    +            "test": functools.partial(_test, test_language=name),
    +            "formatter": formatter
    +        }
    +
    +        if name == '*':
    +            self.formatters[0] = obj
    +        else:
    +            self.formatters.append(obj)
    +
    +    def get_settings(self):
    +        """Check for Highlight extension settings."""
    +
    +        if not self.get_hl_settings:
    +            self.get_hl_settings = True
    +            self.style_plain_text = self.config['style_plain_text']
    +
    +            config = None
    +            self.highlighter = None
    +            for ext in self.md.registeredExtensions:
    +                try:
    +                    config = ext.get_pymdownx_highlight_settings()
    +                    self.highlighter = ext.get_pymdownx_highlighter()
    +                    break
    +                except AttributeError:
    +                    pass
    +
    +            css_class = self.config['css_class']
    +            self.css_class = css_class if css_class else config['css_class']
    +
    +            self.extend_pygments_lang = config.get('extend_pygments_lang', None)
    +            self.guess_lang = config['guess_lang']
    +            self.pygments_style = config['pygments_style']
    +            self.use_pygments = config['use_pygments']
    +            self.noclasses = config['noclasses']
    +            self.language_prefix = config['language_prefix']
    +            self.pygments_lang_class = config['pygments_lang_class']
    +
    +    def highlight_code(self, src='', language='', classname=None, md=None):
    +        """Syntax highlight the inline code block."""
    +
    +        process_text = self.style_plain_text or language or self.guess_lang
    +        default_lang = self.style_plain_text if isinstance(self.style_plain_text, str) else ''
    +
    +        if process_text:
    +            el = self.highlighter(
    +                guess_lang=self.guess_lang,
    +                pygments_style=self.pygments_style,
    +                use_pygments=self.use_pygments,
    +                noclasses=self.noclasses,
    +                extend_pygments_lang=self.extend_pygments_lang,
    +                language_prefix=self.language_prefix,
    +                pygments_lang_class=self.pygments_lang_class,
    +                default_lang=default_lang
    +            ).highlight(src, language, self.css_class, inline=True)
    +            el.text = self.md.htmlStash.store(el.text)
    +        else:
    +            el = etree.Element('code')
    +            el.text = self.md.htmlStash.store(_escape(src))
    +        return el
    +
    +    def handle_code(self, lang, src):
    +        """Handle code block."""
    +
    +        for entry in reversed(self.formatters):
    +            if entry["test"](lang):
    +                value = entry["formatter"](
    +                    src=src,
    +                    language=lang,
    +                    md=self.md
    +                )
    +                if isinstance(value, str):
    +                    value = self.md.htmlStash.store(value)
    +                return value
    +
    +    def handleMatch(self, m, data):
    +        """Handle the pattern match."""
    +
    +        if m.group('escapes'):
    +            return m.group('escapes').replace(DOUBLE_BSLASH, ESCAPED_BSLASH), m.start(0), m.end(0)
    +        else:
    +            lang = m.group('lang') if m.group('lang') else ''
    +            src = m.group('code').strip()
    +            self.get_settings()
    +            try:
    +                return self.handle_code(lang, src), m.start(0), m.end(0)
    +            except InlineHiliteException:
    +                raise
    +            except Exception:
    +                return m.group(0), None, None
    +
    +
    +class InlineHiliteExtension(Extension):
    +    """Add inline highlighting extension to Markdown class."""
    +
    +    def __init__(self, *args, **kwargs):
    +        """Initialize."""
    +
    +        self.inlinehilite = []
    +        self.config = {
    +            'style_plain_text': [
    +                0,
    +                "Process inline code even when a language is not specified. "
    +                "When 'False', no classes will be added to code blocks without shebangs "
    +                "and no scoping will performed. The content will just be escaped."
    +                "If a language string is provided, then that language will be assumed "
    +                "for any inline code block without a shebang. "
    +                "- Default: False"
    +            ],
    +            'css_class': [
    +                '',
    +                "Set class name for wrapper element. The default of Highlight will be used"
    +                "if nothing is set. - "
    +                "Default: ''"
    +            ],
    +            'custom_inline': [[], "Custom inline - default []"]
    +        }
    +        super().__init__(*args, **kwargs)
    +
    +    def extendMarkdown(self, md):
    +        """Add support for `:::language code` and `#!language code` highlighting."""
    +
    +        config = self.getConfigs()
    +        md.inlinePatterns.register(InlineHilitePattern(BACKTICK_CODE_RE, config, md), "backtick", 190)
    +        md.registerExtensions(["pymdownx.highlight"], {"pymdownx.highlight": {"_enabled": False}})
    +
    +
    +def makeExtension(*args, **kwargs):
    +    """Return extension."""
    +
    +    return InlineHiliteExtension(*args, **kwargs)
    diff --git a/micromamba_root/Lib/site-packages/pymdownx/keymap_db.py b/micromamba_root/Lib/site-packages/pymdownx/keymap_db.py
    new file mode 100644
    index 0000000000000000000000000000000000000000..3c76ef3f694b174d44b466572286203df6024d1b
    --- /dev/null
    +++ b/micromamba_root/Lib/site-packages/pymdownx/keymap_db.py
    @@ -0,0 +1,324 @@
    +"""English US keymap."""
    +
    +keymap = {
    +    # Digits
    +    "0": "0",
    +    "1": "1",
    +    "2": "2",
    +    "3": "3",
    +    "4": "4",
    +    "5": "5",
    +    "6": "6",
    +    "7": "7",
    +    "8": "8",
    +    "9": "9",
    +
    +    # Letters
    +    "a": "A",
    +    "b": "B",
    +    "c": "C",
    +    "d": "D",
    +    "e": "E",
    +    "f": "F",
    +    "g": "G",
    +    "h": "H",
    +    "i": "I",
    +    "j": "J",
    +    "k": "K",
    +    "l": "L",
    +    "m": "M",
    +    "n": "N",
    +    "o": "O",
    +    "p": "P",
    +    "q": "Q",
    +    "r": "R",
    +    "s": "S",
    +    "t": "T",
    +    "u": "U",
    +    "v": "V",
    +    "w": "W",
    +    "x": "X",
    +    "y": "Y",
    +    "z": "Z",
    +
    +    # Space
    +    "space": "Space",
    +
    +    # Punctuation
    +    "backslash": "\\",
    +    "bar": "|",
    +    "brace-left": "{",
    +    "brace-right": "}",
    +    "bracket-left": "[",
    +    "bracket-right": "]",
    +    "colon": ":",
    +    "comma": ",",
    +    "double-quote": "\"",
    +    "equal": "=",
    +    "exclam": "!",
    +    "grave": "`",
    +    "greater": ">",
    +    "less": "<",
    +    "minus": "-",
    +    "period": ".",
    +    "plus": "+",
    +    "question": "?",
    +    "semicolon": ";",
    +    "single-quote": "'",
    +    "slash": "/",
    +    "tilde": "~",
    +    "underscore": "_",
    +
    +    # Navigation keys
    +    "arrow-up": "Up",
    +    "arrow-down": "Down",
    +    "arrow-left": "Left",
    +    "arrow-right": "Right",
    +    "page-up": "Page Up",
    +    "page-down": "Page Down",
    +    "home": "Home",
    +    "end": "End",
    +
    +
    +    # Edit keys
    +    "backspace": "Backspace",
    +    "delete": "Del",
    +    "insert": "Ins",
    +    "tab": "Tab",
    +
    +    # Action keys
    +    "break": "Break",
    +    "caps-lock": "Caps Lock",
    +    "clear": "Clear",
    +    "eject": "Eject",
    +    "enter": "Enter",
    +    "escape": "Esc",
    +    "help": "Help",
    +    "print-screen": "Print Screen",
    +    "scroll-lock": "Scroll Lock",
    +
    +    # Numeric keypad
    +    "num0": "Num 0",
    +    "num1": "Num 1",
    +    "num2": "Num 2",
    +    "num3": "Num 3",
    +    "num4": "Num 4",
    +    "num5": "Num 5",
    +    "num6": "Num 6",
    +    "num7": "Num 7",
    +    "num8": "Num 8",
    +    "num9": "Num 9",
    +    "num-asterisk": "Num *",
    +    "num-clear": "Num Clear",
    +    "num-delete": "Num Del",
    +    "num-equal": "Num =",
    +    "num-lock": "Num Lock",
    +    "num-minus": "Num -",
    +    "num-plus": "Num +",
    +    "num-separator": "Num .",
    +    "num-slash": "Num /",
    +    "num-enter": "Num Enter",
    +
    +    # Modifier keys
    +    "alt": "Alt",
    +    "alt-graph": "AltGr",
    +    "command": "Cmd",
    +    "control": "Ctrl",
    +    "function": "Fn",
    +    "left-alt": "Left Alt",
    +    "left-command": "Left Command",
    +    "left-control": "Left Ctrl",
    +    "left-meta": "Left Meta",
    +    "left-option": "Left Option",
    +    "left-shift": "Left Shift",
    +    "left-super": "Left Super",
    +    "left-windows": "Left Win",
    +    "meta": "Meta",
    +    "option": "Option",
    +    "right-alt": "Right Alt",
    +    "right-command": "Right Command",
    +    "right-control": "Right Ctrl",
    +    "right-meta": "Right Meta",
    +    "right-option": "Right Option",
    +    "right-shift": "Right Shift",
    +    "right-super": "Right Super",
    +    "right-windows": "Right Win",
    +    "shift": "Shift",
    +    "super": "Super",
    +    "windows": "Win",
    +
    +    # Function keys
    +    "f1": "F1",
    +    "f2": "F2",
    +    "f3": "F3",
    +    "f4": "F4",
    +    "f5": "F5",
    +    "f6": "F6",
    +    "f7": "F7",
    +    "f8": "F8",
    +    "f9": "F9",
    +    "f10": "F10",
    +    "f11": "F11",
    +    "f12": "F12",
    +    "f13": "F13",
    +    "f14": "F14",
    +    "f15": "F15",
    +    "f16": "F16",
    +    "f17": "F17",
    +    "f18": "F18",
    +    "f19": "F19",
    +    "f20": "F20",
    +    "f21": "F21",
    +    "f22": "F22",
    +    "f23": "F23",
    +    "f24": "F24",
    +
    +    # Extra keys
    +    "backtab": "Back Tab",
    +    "browser-back": "Browser Back",
    +    "browser-favorites": "Browser Favorites",
    +    "browser-forward": "Browser Forward",
    +    "browser-home": "Browser Home",
    +    "browser-refresh": "Browser Refresh",
    +    "browser-search": "Browser Search",
    +    "browser-stop": "Browser Stop",
    +    "context-menu": "Menu",
    +    "copy": "Copy",
    +    "mail": "Mail",
    +    "media": "Media",
    +    "media-next-track": "Next Track",
    +    "media-pause": "Pause",
    +    "media-play": "Play",
    +    "media-play-pause": "Play/Pause",
    +    "media-prev-track": "Previous Track",
    +    "media-stop": "Stop",
    +    "print": "Print",
    +    "reset": "Reset",
    +    "select": "Select",
    +    "sleep": "Sleep",
    +    "volume-down": "Volume Down",
    +    "volume-mute": "Mute",
    +    "volume-up": "Volume Up",
    +    "zoom": "Zoom",
    +    "power": "Power",
    +    "fingerprint": "Fingerprint",
    +
    +    # Mouse
    +    "left-button": "Left Button",
    +    "middle-button": "Middle Button",
    +    "right-button": "Right Button",
    +    "x-button1": "X Button 1",
    +    "x-button2": "X Button 2"
    +}
    +
    +aliases = {
    +    "add": "num-plus",
    +    "altgr": "alt-graph",
    +    "apps": "context-menu",
    +    "back": "backspace",
    +    "bksp": "backspace",
    +    "bktab": "backtab",
    +    "cancel": "break",
    +    "capital": "caps-lock",
    +    "close-brace": "brace-right",
    +    "close-bracket": "bracket-right",
    +    "clr": "clear",
    +    "cmd": "command",
    +    "cplk": "caps-lock",
    +    "ctrl": "control",
    +    "dblquote": "double-quote",
    +    "decimal": "num-separator",
    +    "del": "delete",
    +    "divide": "num-slash",
    +    "down": "arrow-down",
    +    "esc": "escape",
    +    "return": "enter",
    +    "exclamation": "exclam",
    +    "favorites": "browser-favorites",
    +    "fn": "function",
    +    "forward": "browser-forward",
    +    "grave-accent": "grave",
    +    "greater-than": "greater",
    +    "gt": "greater",
    +    "hyphen": "minus",
    +    "ins": "insert",
    +    "lalt": "left-alt",
    +    "launch-mail": "mail",
    +    "launch-media": "media",
    +    "lbutton": "left-button",
    +    "lcmd": "left-command",
    +    "lcommand": "left-command",
    +    "lcontrol": "left-control",
    +    "lctrl": "left-control",
    +    "left": "arrow-left",
    +    "left-cmd": "left-command",
    +    "left-ctrl": "left-control",
    +    "lopt": "left-option",
    +    "loption": "left-option",
    +    "left-opt": "left-option",
    +    "left-win": "left-windows",
    +    "less-than": "less",
    +    "lmeta": "left-meta",
    +    "lshift": "left-shift",
    +    "lsuper": "left-super",
    +    "lt": "less",
    +    "lwin": "left-windows",
    +    "lwindows": "left-windows",
    +    "mbutton": "middle-button",
    +    "menu": "context-menu",
    +    "multiply": "num-asterisk",
    +    "mute": "volume-mute",
    +    "next": "page-down",
    +    "next-track": "media-next-track",
    +    "num-del": "num-delete",
    +    "numlk": "num-lock",
    +    "open-brace": "brace-left",
    +    "open-bracket": "bracket-left",
    +    "opt": "option",
    +    "page-dn": "page-down",
    +    "page-up": "page-up",
    +    "pause": "media-pause",
    +    "pg-dn": "page-down",
    +    "pg-up": "page-up",
    +    "pipe": "bar",
    +    "play": "media-play",
    +    "play-pause": "media-play-pause",
    +    "prev-track": "media-prev-track",
    +    "prior": "page-up",
    +    "prtsc": "print-screen",
    +    "question-mark": "question",
    +    "ralt": "right-alt",
    +    "rbutton": "right-button",
    +    "rcontrol": "right-control",
    +    "rcmd": "right-command",
    +    "rcommand": "right-command",
    +    "rctrl": "right-control",
    +    "refresh": "browser-refresh",
    +    "right": "arrow-right",
    +    "right-cmd": "right-command",
    +    "right-ctrl": "right-control",
    +    "right-meta": "right-meta",
    +    "right-opt": "right-option",
    +    "right-win": "right-windows",
    +    "rmeta": "right-meta",
    +    "ropt": "right-option",
    +    "roption": "right-option",
    +    "rshift": "right-shift",
    +    "rsuper": "right-super",
    +    "rwin": "right-windows",
    +    "rwindows": "right-windows",
    +    "scroll": "scroll-lock",
    +    "search": "browser-search",
    +    "separator": "num-separator",
    +    "spc": "space",
    +    "stop": "media-stop",
    +    "subtract": "num-minus",
    +    "tabulator": "tab",
    +    "up": "arrow-up",
    +    "vol-down": "volume-down",
    +    "vol-mute": "volume-mute",
    +    "vol-up": "volume-up",
    +    "win": "windows",
    +    "xbutton1": "x-button1",
    +    "xbutton2": "x-button2"
    +}
    diff --git a/micromamba_root/Lib/site-packages/pymdownx/keys.py b/micromamba_root/Lib/site-packages/pymdownx/keys.py
    new file mode 100644
    index 0000000000000000000000000000000000000000..24f5b9066c0633d2efeb6ee2086216ed600e902d
    --- /dev/null
    +++ b/micromamba_root/Lib/site-packages/pymdownx/keys.py
    @@ -0,0 +1,240 @@
    +"""
    +Keys.
    +
    +pymdownx.keys
    +Markdown extension for keystroke (user keyboard input) formatting.
    +
    +It wraps the syntax `++key+key+key++` (for individual keystrokes with modifiers)
    +or `++"string"++` (for continuous keyboard input) into HTML `` elements.
    +
    +If a key is found in the extension's database, its `` element gets a matching class.
    +Common synonyms are included, e.g. `++pg-up++` will match as `++page-up++`.
    +
    +## Config
    +
    +If `strict` is `True`, the entire series of keystrokes is wrapped into an outer`` element, and then,
    +each keystroke is wrapped into a separate inner `` element, which matches the HTML5 spec.
    +If `strict` is `False`, an outer `` is used, which matches the practice on Github or StackOverflow.
    +
    +The resulting `` elements are separated by `separator` (`+` by default, can be `''` or something else).
    +
    +If `camel_case` is `True`, `++PageUp++` will match the same as `++page-up++`.
    +
    +The database can be extended or modified with the `key_map` dict.
    +
    +## Examples
    +
    +### Input
    +
    +```
    +Press ++Shift+Alt+PgUp++, type in ++"Hello"++ and press ++Enter++.
    +```
    +
    +### Config 1
    +
    +```
    +  pymdownx.keys:
    +    camel_case: true
    +    strict: false
    +    separator: '+'
    +```
    +
    +### Output 1
    +
    +```
    +

    Press Shift+Alt+Page Up, type in Hello and press Enter.

    +``` + +### Config 2 + +``` + pymdownx.keys: + camel_case: true + strict: true + separator: '' +``` + +### Output 2 + +``` +

    Press ShiftAltPage Up, type in Hello and press Enter.

    +``` + +Idea by Adam Twardoch and coded by Isaac Muse. + +Copyright (c) 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import html +from markdown import Extension +from markdown.inlinepatterns import InlineProcessor +from markdown import util as md_util +import xml.etree.ElementTree as etree +from . import util +from . import keymap_db as keymap +import re + +RE_EARLY_KBD = r'''(?x) +(?: + # Escape + (?(?:\\{2})+)(?=\+)| + # Key + (? pg-dn - Default: False'], + 'key_map': [{}, 'Additional keys to include or keys to override - Default: {}'] + } + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add support for keys.""" + + util.escape_chars(md, ['+']) + md.inlinePatterns.register(KeysPattern(RE_EARLY_KBD, self.getConfigs(), md, early=True), "keys-custom", 185) + md.inlinePatterns.register(KeysPattern(RE_KBD, self.getConfigs(), md), "keys", 70) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return KeysExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/magiclink.py b/micromamba_root/Lib/site-packages/pymdownx/magiclink.py new file mode 100644 index 0000000000000000000000000000000000000000..62c1dc94bd932242f78c89d10c55c4b849cf3fb1 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/magiclink.py @@ -0,0 +1,1332 @@ +""" +Magic Link. + +pymdownx.magiclink +An extension for Python Markdown. +Find HTML, FTP links, and email address and turn them to actual links + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.treeprocessors import Treeprocessor +from markdown import util as md_util +from .util import warn_deprecated +import xml.etree.ElementTree as etree +from . import util +import re +from markdown.inlinepatterns import LinkInlineProcessor, InlineProcessor + +MAGIC_LINK = 1 +MAGIC_AUTO_LINK = 2 + +DEFAULT_EXCLUDES = { + "bitbucket": ['dashboard', 'account', 'plans', 'support', 'repo'], + "github": ['marketplace', 'notifications', 'issues', 'pull', 'sponsors', 'settings', 'support'], + "gitlab": ['dashboard', '-', 'explore', 'help', 'projects'], + "twitter": ['i', 'messages', 'bookmarks', 'home'], + "x": ['i', 'messages', 'bookmarks', 'home'] +} + +# Bare link/email detection +RE_MAIL = r'''(?xi) +(?P + (? + (?:(?<=\b)|(?<=_))(?: + (?:ht|f)tps?://[^_\W][-\w]*(?:\.[-\w.]+)*| # (http|ftp):// + (?Pw{3}\.)[^_\W][-\w]*(?:\.[-\w.]+)* # www. + ) + /?[-\w.?,!'(){}\[\]/+&@%$#=:"|~;]* # url path, fragments, and query stuff + (?:[^_\W]|[-/#@$+=]) # allowed end chars +) +''' + +RE_AUTOLINK = r'(?i)<((?:ht|f)tps?://[^<>]*)>' + +RE_CUSTOM_NAME = re.compile(r'^[a-zA-Z0-9]+$') + +# Provider specific user regex rules +RE_TWITTER_USER = r'\w{1,15}' +RE_X_USER = r'\w{1,15}' +RE_GITHUB_USER = r'[a-zA-Z\d](?:[-a-zA-Z\d_]{0,37}[a-zA-Z\d])?' +RE_GITLAB_USER = r'[\.a-zA-Z\d_](?:[-a-zA-Z\d_\.]{0,37}[-a-zA-Z\d_])?' +RE_BITBUCKET_USER = r'[-a-zA-Z\d_]{1,39}' + +# External mention patterns +RE_ALL_EXT_MENTIONS = r'''(?x) +(?P + (?(? + (?[-._a-zA-Z\d]{{0,99}}[a-zA-Z\d])\b +''' + +# Internal repo mention patterns +RE_GIT_INT_REPO_MENTIONS = r'''(?x) +(?P(?[-._a-zA-Z\d]{{0,99}}[a-zA-Z\d])\b +''' + +# External reference patterns (issue, pull request, commit, compare) +RE_GIT_EXT_REFS = r'''(?x) +(?P(?\b{})/) +(?P[-._a-zA-Z\d]{{0,99}}[a-zA-Z\d]) +(?:(?P(?:\#|!|\?)[1-9][0-9]*)|(?P@[a-f\d]{{40}})(?:\.{{3}}(?P[a-f\d]{{40}}))?))\b +''' + +# Internal reference patterns (issue, pull request, commit, compare) +RE_GIT_INT_EXT_REFS = r'''(?x) +(?P(?\b{})/)? +(?P[-._a-zA-Z\d]{{0,99}}[a-zA-Z\d]) +(?:(?P(?:\#|!|\?)[1-9][0-9]*)|(?P@[a-f\d]{{40}})(?:\.{{3}}(?P[a-f\d]{{40}}))?))\b +''' + +# Internal reference patterns for default user and repository (issue, pull request, commit, compare) +RE_GIT_INT_MICRO_REFS = r'''(?x) +(?P + (?:(?(?:\#|!|\?)[1-9][0-9]*)|(?P(?[a-f\d]{40}))?) +)\b +''' + +RE_WWW = re.compile(r'(https?://)(?:www\\\.)?(.*)') + +REPO_LINK_TEMPLATES = { + 'github': ( + r''' + (?P(?P{}/ + (?P(?P{})/[^/]+))/ + (?:issues/(?P\d+)/?| + pull/(?P\d+)/?| + discussions/(?P\d+)/?| + commit/(?P[\da-f]{{7,40}})/?| + compare/(?P[\da-f]{{7,40}})\.{{3}} + (?P[\da-f]{{7,40}})))''', + RE_GITHUB_USER + ), + 'bitbucket': ( + r''' + (?P(?P{}/ + (?P(?P{})/[^/]+))/ + (?:issues/(?P\d+)(?:/[^/]+)?/?| + pull-requests/(?P\d+)(?:/[^/]+(?:/diff)?)?/?| + commits/commit/(?P[\da-f]{{7,40}})/?| + branches/commits/(?P[\da-f]{{7,40}}) + (?:\.{{2}}|%0d)(?P[\da-f]{{7,40}})\#diff))''', + RE_BITBUCKET_USER + ), + 'gitlab': ( + r''' + (?P(?P{}/ + (?P(?P{})/[^/]+))/(?:-/)? + (?:issues/(?P\d+)/?| + merge_requests/(?P\d+)/?| + commit/(?P[\da-f]{{8,40}})/?| + compare/(?P[\da-f]{{8,40}})\.{{3}} + (?P[\da-f]{{8,40}})))''', + RE_GITLAB_USER + ) +} + + +def create_repo_link_pattern(provider, host, www=True): + """Create repository link provider.""" + + template = REPO_LINK_TEMPLATES[provider] + host_pat = re.escape(host.lower().rstrip('/')) + if www: + m = RE_WWW.match(host_pat) + if m: + host_pat = m.group(1) + r'(?:w{3}\.)?' + m.group(2) + return template[0].format(host_pat, template[1]) + + +# Repository link shortening pattern +RE_REPO_LINK = re.compile( + r'''(?xi)^(?:{}|{}|{})/?$'''.format( + create_repo_link_pattern('github', "https://github.com"), + create_repo_link_pattern('bitbucket', "https://bitbucket.org"), + create_repo_link_pattern('gitlab', 'https://gitlab.com'), + ) +) + + +USER_LINK_TEMPLATES = { + 'github': ( + r''' + (?P(?P{}/ + (?P(?P{})(?:/(?P[^/]+))?))) + ''', + RE_GITHUB_USER + ), + 'bitbucket': ( + r''' + (?P(?P{}/ + (?P(?P{})(?:/(?P[^/]+)/?)?))) + ''', + RE_BITBUCKET_USER + ), + 'gitlab': ( + r''' + (?P(?P{}/ + (?P(?P{})(?:/(?P[^/]+))?))) + ''', + RE_GITLAB_USER + ) +} + + +def create_user_link_pattern(provider, host, www=True): + """Create repository link provider.""" + + template = USER_LINK_TEMPLATES[provider] + host_pat = re.escape(host.lower().rstrip('/')) + if www: + m = RE_WWW.match(host_pat) + if m: + host_pat = m.group(1) + r'(?:w{3}\.)?' + m.group(2) + return template[0].format(host_pat, template[1]) + + +# Repository link shortening pattern +RE_USER_REPO_LINK = re.compile( + r'''(?xi)^(?:{}|{}|{})/?$'''.format( + create_user_link_pattern('github', 'https://github.com'), + create_user_link_pattern('bitbucket', 'https://bitbucket.org'), + create_user_link_pattern('gitlab', 'https://gitlab.com') + ) +) + +RE_SOCIAL_LINK = re.compile( + r'''(?xi) + ^(?: + (?P(?Phttps://(?:w{{3}}\.)?twitter\.com/(?P{}))) | + (?P(?Phttps://(?:w{{3}}\.)?x\.com/(?P{}))) + )/?$ + '''.format(RE_TWITTER_USER, RE_X_USER) +) + +# Provider specific info (links, names, specific patterns, etc.) +SOCIAL_PROVIDERS = {'x', 'twitter'} + +# Templates for providers +PROVIDER_TEMPLATES = { + "gitlab": { + "provider": "GitLab", + "type": "gitlab", + "url": "{}", + "user_pattern": RE_GITLAB_USER, + "issue": "{}/{{}}/{{}}/-/issues/{{}}", + "pull": "{}/{{}}/{{}}/-/merge_requests/{{}}", + "commit": "{}/{{}}/{{}}/-/commit/{{}}", + "compare": "{}/{{}}/{{}}/-/compare/{{}}...{{}}", + "hash_size": 8 + }, + "bitbucket": { + "provider": "Bitbucket", + "type": "bitbucket", + "url": "{}", + "user_pattern": RE_BITBUCKET_USER, + "issue": "{}/{{}}/{{}}/issues/{{}}", + "pull": "{}/{{}}/{{}}/pull-requests/{{}}", + "commit": "{}/{{}}/{{}}/commits/commit/{{}}", + "compare": "{}/{{}}/{{}}/branches/commits/{{}}..{{}}#diff", + "hash_size": 7 + }, + "github": { + "provider": "GitHub", + "type": "github", + "url": "{}", + "user_pattern": RE_GITHUB_USER, + "issue": "{}/{{}}/{{}}/issues/{{}}", + "pull": "{}/{{}}/{{}}/pull/{{}}", + "discuss": '{}/{{}}/{{}}/discussions/{{}}', + "commit": "{}/{{}}/{{}}/commit/{{}}", + "compare": "{}/{{}}/{{}}/compare/{{}}...{{}}", + "hash_size": 7 + }, + "twitter": { + "provider": "Twitter", + "type": "twitter", + "url": "{}", + "user_pattern": RE_TWITTER_USER + }, + "x": { + "provider": "X", + "type": "x", + "url": "{}", + "user_pattern": RE_X_USER + } +} + + +def create_provider(provider, host): + """Create the provider with the provided host.""" + + entry = PROVIDER_TEMPLATES[provider].copy() + for key in ('url', 'issue', 'pull', 'commit', 'compare', 'discuss'): + if key not in entry: + continue + entry[key] = entry[key].format(host.lower().rstrip('/')) + return entry + + +PROVIDER_INFO = { + "twitter": create_provider('twitter', "https://twitter.com"), + "x": create_provider('x', "https://x.com"), + "gitlab": create_provider('gitlab', 'https://gitlab.com'), + "bitbucket": create_provider('bitbucket', "https://bitbucket.org"), + "github": create_provider('github', "https://github.com") +} + + +class _MagiclinkShorthandPattern(InlineProcessor): + """Base shorthand link class.""" + + def __init__(self, pattern, md, user, repo, provider, labels, normalize, provider_info): + """Initialize.""" + + self.user = user + self.repo = repo + self.labels = labels + self.normalize = normalize + self.provider_info = provider_info + self.provider = provider if provider in self.provider_info else '' + InlineProcessor.__init__(self, pattern, md) + + +class _MagiclinkReferencePattern(_MagiclinkShorthandPattern): + """Convert #1, repo#1, user/repo#1, !1, repo!1, user/repo!1, hash, repo@hash, or user/repo@hash to links.""" + + def process_issues(self, el, provider, user, repo, issue): + """Process issues.""" + + issue_type = issue[:1] + issue_value = issue[1:] + + if issue_type == '#': + issue_link = self.provider_info[provider]['issue'] + issue_label = self.labels.get('issue', 'Issue') + class_name = 'magiclink-issue' + icon = issue_type + elif issue_type == '!': + issue_link = self.provider_info[provider]['pull'] + issue_label = self.labels.get('pull', 'Pull Request') + class_name = 'magiclink-pull' + icon = '#' if self.normalize else issue_type + elif self.provider_info[provider]['type'] == "github" and issue_type == '?': + issue_link = self.provider_info[provider]['discuss'] + issue_label = self.labels.get('discuss', 'Discussion') + class_name = 'magiclink-discussion' + icon = '#' if self.normalize else issue_type + else: + return False + + if self.my_repo: + el.text = md_util.AtomicString(f'{icon}{issue_value}') + elif self.my_user: + el.text = md_util.AtomicString(f'{repo}{icon}{issue_value}') + else: + el.text = md_util.AtomicString(f'{user}/{repo}{icon}{issue_value}') + + el.set('href', issue_link.format(user, repo, issue_value)) + el.set('class', f'magiclink magiclink-{provider} {class_name}') + el.set( + 'title', + '{} {}: {}/{} #{}'.format( + self.provider_info[provider]['provider'], + issue_label, + user, + repo, + issue_value + ) + ) + return True + + def process_commit(self, el, provider, user, repo, commit): + """Process commit.""" + + hash_ref = commit[0:self.provider_info[provider]['hash_size']] + if self.my_repo: + text = hash_ref + elif self.my_user: + text = f'{repo}@{hash_ref}' + else: + text = f'{user}/{repo}@{hash_ref}' + + el.set('href', self.provider_info[provider]['commit'].format(user, repo, commit)) + el.text = md_util.AtomicString(text) + el.set('class', f'magiclink magiclink-{provider} magiclink-commit') + el.set( + 'title', + '{} {}: {}/{}@{}'.format( + self.provider_info[provider]['provider'], + self.labels.get('commit', 'Commit'), + user, + repo, + hash_ref + ) + ) + + def process_compare(self, el, provider, user, repo, commit1, commit2): + """Process commit.""" + + hash_ref1 = commit1[0:self.provider_info[provider]['hash_size']] + hash_ref2 = commit2[0:self.provider_info[provider]['hash_size']] + if self.my_repo: + text = f'{hash_ref1}...{hash_ref2}' + elif self.my_user: + text = f'{repo}@{hash_ref1}...{hash_ref2}' + else: + text = f'{user}/{repo}@{hash_ref1}...{hash_ref2}' + + el.set('href', self.provider_info[provider]['compare'].format(user, repo, commit1, commit2)) + el.text = md_util.AtomicString(text) + el.set('class', f'magiclink magiclink-{provider} magiclink-compare') + el.set( + 'title', + '{} {}: {}/{}@{}...{}'.format( + self.provider_info[provider]['provider'], + self.labels.get('compare', 'Compare'), + user, + repo, + hash_ref1, + hash_ref2 + ) + ) + + +class MagicShortenerTreeprocessor(Treeprocessor): + """Tree processor that finds repo issue and commit links and shortens them.""" + + # Repo link types + ISSUE = 0 + PULL = 1 + COMMIT = 2 + DISCUSS = 3 + DIFF = 4 + REPO = 5 + USER = 6 + + def __init__( + self, + md, + base_url, + base_user_url, + labels, + normalize, + repo_shortner, + social_shortener, + custom_shortners, + excludes, + provider, + provider_info + ): + """Initialize.""" + + self.base = base_url + self.repo_shortner = repo_shortner + self.social_shortener = social_shortener + self.custom_shortners = custom_shortners + self.base_user = base_user_url + self.repo_labels = labels + self.normalize = normalize + self.provider = provider + self.provider_info = provider_info + self.labels = { + "github": "GitHub", + "bitbucket": "Bitbucket", + "gitlab": "GitLab" + } + self.excludes = excludes + Treeprocessor.__init__(self, md) + + def shorten_repo(self, link, class_name, label, user_repo): + """Shorten repo link.""" + + text = user_repo + link.text = md_util.AtomicString(text) + + if 'magiclink-repository' not in class_name: + class_name.append('magiclink-repository') + + link.set( + 'title', + "{} {}: {}".format( + label, self.repo_labels.get('repository', 'Repository'), user_repo + ) + ) + + def shorten_user(self, link, class_name, label, user_repo): + """Shorten user link.""" + + link.text = md_util.AtomicString(f'@{user_repo}') + + if 'magiclink-mention' not in class_name: + class_name.append('magiclink-mention') + + link.set( + 'title', + "{} {}: {}".format( + label, self.repo_labels.get('metion', 'User'), user_repo + ) + ) + + def shorten_diff(self, link, class_name, label, user_repo, value, hash_size): + """Shorten diff/compare links.""" + + repo_label = self.repo_labels.get('compare', 'Compare') + if self.my_repo: + text = f'{value[0][0:hash_size]}...{value[1][0:hash_size]}' + elif self.my_user: + text = '{}@{}...{}'.format(user_repo.split('/')[1], value[0][0:hash_size], value[1][0:hash_size]) + else: + text = f'{user_repo}@{value[0][0:hash_size]}...{value[1][0:hash_size]}' + link.text = md_util.AtomicString(text) + + if 'magiclink-compare' not in class_name: + class_name.append('magiclink-compare') + + link.set( + 'title', + '{} {}: {}@{}...{}'.format( + label, repo_label, user_repo.rstrip('/'), value[0][0:hash_size], value[1][0:hash_size] + ) + ) + + def shorten_commit(self, link, class_name, label, user_repo, value, hash_size): + """Shorten commit link.""" + + # user/repo@hash + repo_label = self.repo_labels.get('commit', 'Commit') + if self.my_repo: + text = value[0:hash_size] + elif self.my_user: + text = '{}@{}'.format(user_repo.split('/')[1], value[0:hash_size]) + else: + text = f'{user_repo}@{value[0:hash_size]}' + link.text = md_util.AtomicString(text) + + if 'magiclink-commit' not in class_name: + class_name.append('magiclink-commit') + + link.set( + 'title', + '{} {}: {}@{}'.format(label, repo_label, user_repo.rstrip('/'), value[0:hash_size]) + ) + + def shorten_issue(self, provider, link, class_name, label, user_repo, value, link_type): + """Shorten issue/pull link.""" + + # user/repo#(issue|pull) + provider_type = self.provider_info[provider]['type'] + if link_type == self.ISSUE: + issue_type = self.repo_labels.get('issue', 'Issue') + icon = '#' + if 'magiclink-issue' not in class_name: + class_name.append('magiclink-issue') + elif link_type == self.PULL: + issue_type = self.repo_labels.get('pull', 'Pull Request') + icon = '#' if self.normalize else '!' + if 'magiclink-pull' not in class_name: + class_name.append('magiclink-pull') + elif provider_type == 'github' and link_type == self.DISCUSS: + issue_type = self.repo_labels.get('discuss', 'Discussion') + icon = '#' if self.normalize else '?' + if 'magiclink-discussion' not in class_name: + class_name.append('magiclink-discussion') + + if self.my_repo: + link.text = md_util.AtomicString(f"{icon}{value}") + elif self.my_user: + link.text = md_util.AtomicString("{}{}{}".format(user_repo.split('/')[1], icon, value)) + else: + link.text = md_util.AtomicString(f"{user_repo}{icon}{value}") + + link.set('title', '{} {}: {} #{}'.format(label, issue_type, user_repo.rstrip('/'), value)) + + def shorten_issue_commit(self, link, provider, link_type, user_repo, value, hash_size): + """Shorten URL.""" + + label = self.provider_info[provider]['provider'] + prov_class = f'magiclink-{provider}' + class_attr = link.get('class', '') + class_name = class_attr.split(' ') if class_attr else [] + + if 'magiclink' not in class_name: + class_name.append('magiclink') + + if prov_class not in class_name: + class_name.append(prov_class) + + # Link specific shortening logic + if link_type is self.DIFF: + self.shorten_diff(link, class_name, label, user_repo, value, hash_size) + elif link_type is self.COMMIT: + self.shorten_commit(link, class_name, label, user_repo, value, hash_size) + else: + self.shorten_issue(provider, link, class_name, label, user_repo, value, link_type) + link.set('class', ' '.join(class_name)) + + def shorten_user_repo(self, link, provider, link_type, user_repo): + """Shorten URL.""" + + label = self.provider_info[provider]['provider'] + prov_class = f'magiclink-{provider}' + class_attr = link.get('class', '') + class_name = class_attr.split(' ') if class_attr else [] + + if 'magiclink' not in class_name: + class_name.append('magiclink') + + if prov_class not in class_name: + class_name.append(prov_class) + + # Link specific shortening logic + if link_type is self.REPO: + self.shorten_repo(link, class_name, label, user_repo) + else: + self.shorten_user(link, class_name, label, user_repo) + link.set('class', ' '.join(class_name)) + + def get_provider_type(self, match): + """Get the provider and hash size.""" + + # Set provider specific variables + if match.group('github'): + provider = 'github' + elif match.group('bitbucket'): + provider = 'bitbucket' + elif match.group('gitlab'): + provider = 'gitlab' + return provider + + def get_social_provider(self, match): + """Get social provider.""" + + if match.group('twitter'): + provider = 'twitter' + + elif match.group('x'): + provider = 'x' + return provider + + def get_type(self, provider, match): + """Get the link type.""" + + try: + # Gather info about link type + if match.group(provider + '_diff1') is not None: + value = (match.group(provider + '_diff1'), match.group(provider + '_diff2')) + link_type = self.DIFF + elif match.group(provider + '_commit') is not None: + value = match.group(provider + '_commit') + link_type = self.COMMIT + elif match.group(provider + '_pull') is not None: + value = match.group(provider + '_pull') + link_type = self.PULL + elif provider == "github" and match.group(provider + '_discuss') is not None: + value = match.group(provider + '_discuss') + link_type = self.DISCUSS + else: + value = match.group(provider + '_issue') + link_type = self.ISSUE + except IndexError: + # Gather info about link type + found = False + try: + if match.group(provider + '_repo') is not None: + value = None + link_type = self.REPO + found = True + except IndexError: + pass + if not found: + value = None + link_type = self.USER + return value, link_type + + def is_my_repo(self, provider_type, match): + """Check if link is from our specified user and repo.""" + + # See if these links are from the specified repo. + return self.base and match.group(provider_type + '_base') + '/' == self.base + + def is_my_user(self, provider_type, match): + """Check if link is from our specified user.""" + + return self.base_user and match.group(provider_type + '_base').startswith(self.base_user) + + def excluded(self, provider_type, provider, match): + """Check if user has been excluded.""" + + user = match.group(provider_type + '_user') + return user.lower() in self.excludes.get(provider, set()) + + def run(self, root): + """Shorten popular git repository links.""" + + self.hide_protocol = self.config['hide_protocol'] + + links = root.iter('a') + for link in links: + has_child = len(list(link)) + is_magic = link.attrib.get('magiclink') + href = link.attrib.get('href', '') + text = link.text + found = False + + if is_magic: + del link.attrib['magiclink'] + + # We want a normal link. No sub-elements embedded in it, just a normal string. + if has_child or not text: # pragma: no cover + continue + + # Make sure the text matches the `href`. If needed, add back protocol to be sure. + # Not all links will pass through MagicLink, so we try both with and without protocol. + if (text == href or (is_magic and self.hide_protocol and ('https://' + text) == href)): + if self.repo_shortner: + m = RE_REPO_LINK.match(href) + if m: + provider_type = self.get_provider_type(m) + provider = provider_type + self.my_repo = self.is_my_repo(provider_type, m) + self.my_user = self.my_repo or self.is_my_user(provider_type, m) + value, link_type = self.get_type(provider_type, m) + found = True + + # All right, everything set, let's shorten. + if not self.excluded(provider_type, provider, m): + self.shorten_issue_commit( + link, + provider, + link_type, + m.group(provider_type + '_user_repo'), + value, + self.provider_info[provider]['hash_size'] + ) + if not found and self.repo_shortner: + m = RE_USER_REPO_LINK.match(href) + if m: + provider_type = self.get_provider_type(m) + provider = provider_type + self.my_repo = self.is_my_repo(provider_type, m) + self.my_user = self.my_repo or self.is_my_user(provider_type, m) + value, link_type = self.get_type(provider_type, m) + found = True + + if not self.excluded(provider_type, provider, m): + # All right, everything set, let's shorten. + self.shorten_user_repo( + link, + provider, + link_type, + m.group(provider_type + '_user_repo') + ) + if not found and self.custom_shortners: + for custom, entry in self.custom_shortners.items(): + m = entry['repo'].match(href) + if m: + provider = custom + provider_type = self.provider_info[custom]['type'] + self.my_repo = self.is_my_repo(provider_type, m) + self.my_user = self.my_repo or self.is_my_user(provider_type, m) + value, link_type = self.get_type(provider_type, m) + found = True + + # All right, everything set, let's shorten. + if not self.excluded(provider_type, provider, m): + self.shorten_issue_commit( + link, + provider, + link_type, + m.group(provider_type + '_user_repo'), + value, + self.provider_info[provider]['hash_size'] + ) + if not found: + m = entry['user'].match(href) + if m: + provider = custom + provider_type = self.provider_info[custom]['type'] + self.my_repo = self.is_my_repo(provider_type, m) + self.my_user = self.my_repo or self.is_my_user(provider_type, m) + value, link_type = self.get_type(provider_type, m) + found = True + + if not self.excluded(provider_type, provider, m): + # All right, everything set, let's shorten. + self.shorten_user_repo( + link, + provider, + link_type, + m.group(provider_type + '_user_repo') + ) + + if not found and self.social_shortener: + m = RE_SOCIAL_LINK.match(href) + if m: + provider = self.get_social_provider(m) + if provider == 'twitter': + warn_deprecated("The 'twitter' social provider has been deprecated, please use 'x' instead") + self.my_repo = self.is_my_repo(provider, m) + self.my_user = self.my_repo or self.is_my_user(provider, m) + value, link_type = self.get_type(provider, m) + + if not self.excluded(provider, provider, m): + # All right, everything set, let's shorten. + self.shorten_user_repo( + link, + provider, + link_type, + m.group(provider + '_user') + ) + return root + + +class MagiclinkPattern(LinkInlineProcessor): + """Convert html, ftp links to clickable links.""" + + ANCESTOR_EXCLUDES = ('a',) + + def handleMatch(self, m, data): + """Handle URL matches.""" + + el = etree.Element("a") + el.text = md_util.AtomicString(m.group('link')) + if m.group("www"): + href = "http://{}".format(m.group('link')) + else: + href = m.group('link') + if self.config['hide_protocol']: + el.text = md_util.AtomicString(el.text[el.text.find("://") + 3:]) + el.set("href", self.unescape(href.strip())) + + if self.config.get('repo_url_shortener', False): + el.set('magiclink', str(MAGIC_LINK)) + + return el, m.start(0), m.end(0) + + +class MagiclinkAutoPattern(InlineProcessor): + """Return a link Element given an auto link ``.""" + + def handleMatch(self, m, data): + """Return link optionally without protocol.""" + + el = etree.Element("a") + el.set('href', self.unescape(m.group(1))) + el.text = md_util.AtomicString(m.group(1)) + if self.config['hide_protocol']: + el.text = md_util.AtomicString(el.text[el.text.find("://") + 3:]) + + if self.config.get('repo_url_shortener', False): + el.set('magiclink', str(MAGIC_AUTO_LINK)) + + return el, m.start(0), m.end(0) + + +class MagiclinkMailPattern(InlineProcessor): + """Convert emails to clickable email links.""" + + ANCESTOR_EXCLUDES = ('a',) + + def email_encode(self, code): + """Return entity definition by code, or the code if not defined.""" + return f"{md_util.AMP_SUBSTITUTE}#{code:d};" + + def handleMatch(self, m, data): + """Handle email link patterns.""" + + el = etree.Element("a") + email = self.unescape(m.group('mail')) + href = f"mailto:{email}" + el.text = md_util.AtomicString(''.join([self.email_encode(ord(c)) for c in email])) + el.set("href", ''.join([md_util.AMP_SUBSTITUTE + f'#{ord(c):d};' for c in href])) + return el, m.start(0), m.end(0) + + +class MagiclinkMentionPattern(_MagiclinkShorthandPattern): + """Convert @mention to links.""" + + ANCESTOR_EXCLUDES = ('a',) + + def handleMatch(self, m, data): + """Handle email link patterns.""" + + text = m.group('mention')[1:] + parts = text.split(':') + if len(parts) > 1: + provider = parts[0] + mention = parts[1] + else: + provider = self.provider + mention = parts[0] + + if provider == 'twitter': + warn_deprecated("The 'twitter' social provider has been deprecated, please use 'x' instead") + + el = etree.Element("a") + el.set('href', '{}/{}'.format(self.provider_info[provider]['url'], mention)) + el.set( + 'title', + "{} {}: {}".format(self.provider_info[provider]['provider'], self.labels.get('mention', "User"), mention) + ) + el.set('class', f'magiclink magiclink-{provider} magiclink-mention') + el.text = md_util.AtomicString(f'@{mention}') + + return el, m.start(0), m.end(0) + + +class MagiclinkRepositoryPattern(_MagiclinkShorthandPattern): + """Convert @user/repo to links.""" + + ANCESTOR_EXCLUDES = ('a',) + + def handleMatch(self, m, data): + """Handle email link patterns.""" + + text = m.group('mention')[1:] + parts = text.split(':') + if len(parts) > 1: + provider = parts[0] + user = parts[1] + else: + provider = self.provider + user = parts[0] + repo = m.group('mention_repo') + + el = etree.Element("a") + el.set('href', '{}/{}/{}'.format(self.provider_info[provider]['url'], user, repo)) + el.set( + 'title', + "{} {}: {}/{}".format( + self.provider_info[provider]['provider'], self.labels.get('repository', 'Repository'), user, repo + ) + ) + el.set('class', f'magiclink magiclink-{provider} magiclink-repository') + el.text = md_util.AtomicString(f'{user}/{repo}') + return el, m.start(0), m.end(0) + + +class MagiclinkExternalRefsPattern(_MagiclinkReferencePattern): + """Convert repo#1, user/repo#1, repo!1, user/repo!1, repo@hash, or user/repo@hash to links.""" + + ANCESTOR_EXCLUDES = ('a',) + + def handleMatch(self, m, data): + """Handle email link patterns.""" + + is_commit = m.group('commit') + is_diff = m.group('diff') + value = m.group('commit')[1:] if is_commit else m.group('issue') + value2 = m.group('diff') if is_diff else None + repo = m.group('repo') + user = m.group('user') + + if not user: + user = self.user + + parts = user.split(':') + if len(parts) > 1: + provider = parts[0] + user = parts[1] + else: + provider = self.provider + + # If there is no valid user or provider, reject + if not user: + return None, None, None + + self.my_user = user == self.user and provider == self.provider + self.my_repo = self.my_user and repo == self.repo + + el = etree.Element("a") + if is_diff: + self.process_compare(el, provider, user, repo, value, value2) + elif is_commit: + self.process_commit(el, provider, user, repo, value) + else: + if not self.process_issues(el, provider, user, repo, value): + return m.group(0), m.start(0), m.end(0) + return el, m.start(0), m.end(0) + + +class MagiclinkInternalRefsPattern(_MagiclinkReferencePattern): + """Convert #1, !1, and commit_hash.""" + + ANCESTOR_EXCLUDES = ('a',) + + def handleMatch(self, m, data): + """Handle email link patterns.""" + + # We don't have a valid provider, user, and repo, reject + if not self.user or not self.repo: + return None, None, None + + is_commit = m.group('commit') + is_diff = m.group('diff') + value = m.group('commit') if is_commit else m.group('issue') + value2 = m.group('diff') if is_diff else None + + repo = self.repo + user = self.user + provider = self.provider + self.my_repo = True + self.my_user = True + + el = etree.Element("a") + if is_diff: + self.process_compare(el, provider, user, repo, value, value2) + elif is_commit: + self.process_commit(el, provider, user, repo, value) + else: + if not self.process_issues(el, provider, user, repo, value): + return m.group(0), m.start(0), m.end(0) + return el, m.start(0), m.end(0) + + +class MagiclinkExtension(Extension): + """Add auto link and link transformation extensions to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'hide_protocol': [ + False, + "If 'True', links are displayed without the initial ftp://, http:// or https://" + "- Default: False" + ], + 'repo_url_shortener': [ + False, + "If 'True' repo commit and issue links are shortened - Default: False" + ], + 'social_url_shortener': [ + False, + "If 'True' social links are shortened - Default: False" + ], + 'shortener_user_exclude': [ + { + "bitbucket": ['dashboard', 'account', 'plans', 'support', 'repo'], + "github": ['marketplace', 'notifications', 'issues', 'pull', 'sponsors', 'settings', 'support'], + "gitlab": ['dashboard', '-', 'explore', 'help', 'projects'], + "twitter": ['i', 'messages', 'bookmarks', 'home'], + "x": ['i', 'messages', 'bookmarks', 'home'] + }, + "A list of user names to exclude from URL shortening." + ], + 'repo_url_shorthand': [ + False, + "If 'True' repo shorthand syntax is converted to links - Default: False" + ], + 'social_url_shorthand': [ + False, + "If 'True' social shorthand syntax is converted to links - Default: False" + ], + 'provider': [ + 'github', + 'The base provider to use (github, gitlab, bitbucket, x) - Default: "github"' + ], + 'labels': [ + {}, + "Title labels - Default: {}" + ], + 'normalize_issue_symbols': [ + False, + 'Normalize issue, pull, and discussions symbols all to use # - Default: False' + ], + 'user': [ + '', + 'The base user name to use - Default: ""' + ], + 'repo': [ + '', + 'The base repo to use - Default: ""' + ], + 'custom': [ + {}, + "Custom repositories hosts - Default {}" + ] + } + super().__init__(*args, **kwargs) + + def setup_autolinks(self, md, config): + """Setup auto links.""" + + # Setup general link patterns + auto_link_pattern = MagiclinkAutoPattern(RE_AUTOLINK, md) + auto_link_pattern.config = config + md.inlinePatterns.register(auto_link_pattern, "autolink", 120) + + link_pattern = MagiclinkPattern(RE_LINK, md) + link_pattern.config = config + md.inlinePatterns.register(link_pattern, "magic-link", 85) + + md.inlinePatterns.register(MagiclinkMailPattern(RE_MAIL, md), "magic-mail", 84.9) + + def setup_shorthand(self, md): + """Setup shorthand.""" + + # Setup URL shortener + escape_chars = ['@'] + util.escape_chars(md, escape_chars) + + # Repository shorthand + if self.git_short: + git_ext_repo = MagiclinkRepositoryPattern( + self.re_git_ext_repo_mentions, + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_ext_repo, "magic-repo-ext-mention", 79.9) + if not self.is_social: + git_int_repo = MagiclinkRepositoryPattern( + RE_GIT_INT_REPO_MENTIONS.format(self.int_mentions), + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_int_repo, "magic-repo-int-mention", 79.8) + + # Mentions + pattern = RE_ALL_EXT_MENTIONS.format('|'.join(self.ext_mentions)) + git_mention = MagiclinkMentionPattern( + pattern, + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_mention, "magic-ext-mention", 79.7) + + git_mention = MagiclinkMentionPattern( + RE_INT_MENTIONS.format(self.int_mentions), + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_mention, "magic-int-mention", 79.6) + + # Other project refs + if self.git_short: + git_ext_refs = MagiclinkExternalRefsPattern( + self.re_git_ext_refs, + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_ext_refs, "magic-ext-refs", 79.5) + if not self.is_social: + git_int_refs = MagiclinkExternalRefsPattern( + RE_GIT_INT_EXT_REFS.format(self.int_mentions), + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_int_refs, "magic-int-refs", 79.4) + git_int_micro_refs = MagiclinkInternalRefsPattern( + RE_GIT_INT_MICRO_REFS, + md, + self.user, + self.repo, + self.provider, + self.labels, + self.normalize, + self.provider_info + ) + md.inlinePatterns.register(git_int_micro_refs, "magic-int-micro-refs", 79.3) + + def setup_shortener( + self, + md, + config + ): + """Setup shortener.""" + + shortener = MagicShortenerTreeprocessor( + md, + self.base_url, + self.base_user_url, + self.labels, + self.normalize, + self.repo_shortner, + self.social_shortener, + self.custom_shortners, + self.shortener_exclusions, + self.provider, + self.provider_info + ) + shortener.config = config + md.treeprocessors.register(shortener, "magic-repo-shortener", 9.9) + + def get_base_urls(self, config): + """Get base URLs.""" + + base_url = '' + base_user_url = '' + + if self.is_social: + return base_url, base_user_url + + if self.user and self.repo: + base_url = '{}/{}/{}/'.format(self.provider_info[self.provider]['url'], self.user, self.repo) + base_user_url = '{}/{}/'.format(self.provider_info[self.provider]['url'], self.user) + + return base_url, base_user_url + + def extendMarkdown(self, md): + """Add support for turning html links and emails to link tags.""" + + config = self.getConfigs() + + # Setup repo variables + self.user = config.get('user', '') + self.repo = config.get('repo', '') + self.provider = config.get('provider', 'github') + self.labels = config.get('labels', {}) + self.normalize = config.get('normalize_issue_symbols', False) + self.is_social = self.provider in SOCIAL_PROVIDERS + self.git_short = config.get('repo_url_shorthand', False) + self.social_short = config.get('social_url_shorthand', False) + self.repo_shortner = config.get('repo_url_shortener', False) + self.social_shortener = config.get('social_url_shortener', False) + self.shortener_exclusions = {k: set(v) for k, v in DEFAULT_EXCLUDES.items()} + + self.provider_info = PROVIDER_INFO.copy() + custom_provider = config.get('custom', {}) + excludes = config.get('shortener_user_exclude', {}) + self.custom_shortners = {} + external_users = [RE_GITHUB_EXT_MENTIONS, RE_GITLAB_EXT_MENTIONS, RE_BITBUCKET_EXT_MENTIONS] + for custom, entry in custom_provider.items(): + if not RE_CUSTOM_NAME.match(custom): + raise ValueError( + f"Name '{custom}' not allowed, provider name must contain only letters and numbers" + ) + if custom not in self.provider_info: + self.provider_info[custom] = create_provider(entry['type'], entry['host']) + self.provider_info[custom]['provider'] = entry['label'] + self.custom_shortners[custom] = { + 'repo': re.compile( + r'(?xi)^{}/?$'.format( + create_repo_link_pattern(entry['type'], entry['host'], entry.get('www', True)) + ) + ), + 'user': re.compile( + r'(?xi)^{}/?$'.format( + create_user_link_pattern(entry['type'], entry['host'], entry.get('www', True)) + ) + ) + } + if custom not in excludes: + excludes[custom] = excludes.get(entry['type'], []) + external_users.append(create_ext_mentions(custom, entry['type'])) + + self.re_git_ext_repo_mentions = RE_GIT_EXT_REPO_MENTIONS.format('|'.join(external_users)) + self.re_git_ext_refs = RE_GIT_EXT_REFS.format('|'.join(external_users)) + + for key, value in config.get('shortener_user_exclude', {}).items(): + if key in self.provider_info and isinstance(value, (list, tuple, set)): + self.shortener_exclusions[key] = {x.lower() for x in value} + + # Ensure valid provider + if self.provider not in self.provider_info: + self.provider = 'github' + + self.setup_autolinks(md, config) + + if self.git_short or self.social_short: + self.ext_mentions = [] + if self.git_short: + self.ext_mentions.extend(external_users) + + if self.social_short: + self.ext_mentions.append(RE_X_EXT_MENTIONS) + self.ext_mentions.append(RE_TWITTER_EXT_MENTIONS) + self.int_mentions = self.provider_info[self.provider]['user_pattern'] + self.setup_shorthand(md) + + # Setup link post processor for shortening repository links + if self.repo_shortner or self.social_shortener: + self.base_url, self.base_user_url = self.get_base_urls(config) + self.setup_shortener(md, config) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return MagiclinkExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/mark.py b/micromamba_root/Lib/site-packages/pymdownx/mark.py new file mode 100644 index 0000000000000000000000000000000000000000..99ca2deefe058eb090a431b3ae9994681c3fd2ad --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/mark.py @@ -0,0 +1,91 @@ +""" +Mark. + +pymdownx.mark +Really simple plugin to add support for +test tags as ==test== + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import re +from markdown import Extension +from markdown.inlinepatterns import SimpleTextInlineProcessor +from . import util + +SMART_CONTENT = r'((?:(?<=\s)=+?(?=\s)|.)+?=*?)' +CONTENT = r'((?:[^=]|(?test` tags as `==test==`.""" + + config = self.getConfigs() + smart = bool(config.get('smart_mark', True)) + + md.registerExtension(self) + + escape_chars = [] + escape_chars.append('=') + util.escape_chars(md, escape_chars) + + md.inlinePatterns.register(SimpleTextInlineProcessor(NOT_MARK), 'not_tilde', 70) + mark = MarkSmartProcessor(r'=') if smart else MarkProcessor(r'=') + md.inlinePatterns.register(mark, "mark", 65) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return MarkExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/pathconverter.py b/micromamba_root/Lib/site-packages/pymdownx/pathconverter.py new file mode 100644 index 0000000000000000000000000000000000000000..b2359ebc927d34c73cf06386b46575b3954184ee --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/pathconverter.py @@ -0,0 +1,190 @@ +""" +Path Converter. + +pymdownx.pathconverter +An extension for Python Markdown. + +An extension to covert tag paths to relative or absolute: + +Given an absolute base and a target relative path, this extension searches for file +references that are relative and converts them to a path relative +to the base path. + +-or- + +Given an absolute base path, this extension searches for file +references that are relative and converts them to absolute paths. + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.postprocessors import Postprocessor +from . import util +import os +import re +from urllib.parse import urlunparse + +RE_TAG_HTML = r'''(?xus) + (?: + (?P + <\s*(?Pscript|style)[^>]*>.*? | + (?:(\r?\n?\s*)(\s*)(?=\r?\n)|) + )| + (?P<\s*(?P(?:%s))) + (?P(?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'))?)*) + (?P\s*(?:\/?)>) + ) + ''' + +RE_TAG_LINK_ATTR = re.compile( + r'''(?xus) + (?P + (?: + (?P\s+(?:href|src)\s*=\s*) + (?P"[^"]*"|'[^']*') + ) + ) + ''' +) + + +def repl_relative(m, base_path, relative_path): + """Replace path with relative path.""" + + link = m.group(0) + try: + scheme, netloc, path, params, query, fragment, is_url, is_absolute = util.parse_url(m.group('path')[1:-1]) + + if not is_url: + # Get the absolute path of the file or return + # if we can't resolve the path + path = util.url2path(path) + if (not is_absolute): + # Convert current relative path to absolute + path = os.path.relpath( + os.path.normpath(os.path.join(base_path, path)), + os.path.normpath(relative_path) + ) + # Convert the path, URL encode it, and format it as a link + path = util.path2url(path) + link = '{}"{}"'.format( + m.group('name'), + urlunparse((scheme, netloc, path, params, query, fragment)) + ) + except Exception: # pragma: no cover + # Parsing crashed and burned; no need to continue. + pass + + return link + + +def repl_absolute(m, base_path, file_scheme): + """Replace path with absolute path.""" + + link = m.group(0) + try: + scheme, netloc, path, params, query, fragment, is_url, is_absolute = util.parse_url(m.group('path')[1:-1]) + + if (not is_absolute and not is_url): + path = util.url2path(path) + path = os.path.normpath(os.path.join(base_path, path)) + path = util.path2url(path) + if file_scheme: + if not path.startswith('/'): + path = '/' + path + link = '{}"{}"'.format( + m.group('name'), + urlunparse(("file", netloc, path, params, query, fragment)) + ) + else: + start = '/' if not path.startswith('/') else '' + link = '{}"{}{}"'.format( + m.group('name'), + start, + urlunparse((scheme, netloc, path, params, query, fragment)) + ) + except Exception: # pragma: no cover + # Parsing crashed and burned; no need to continue. + pass + + return link + + +def repl(m, base_path, rel_path=None, file_scheme=None): + """Replace.""" + + if m.group('avoid'): + tag = m.group('avoid') + else: + tag = m.group('open') + if rel_path is None: + tag += RE_TAG_LINK_ATTR.sub(lambda m2: repl_absolute(m2, base_path, file_scheme), m.group('attr')) + else: + tag += RE_TAG_LINK_ATTR.sub(lambda m2: repl_relative(m2, base_path, rel_path), m.group('attr')) + tag += m.group('close') + return tag + + +class PathConverterPostprocessor(Postprocessor): + """Post process to find tag lings to convert.""" + + def run(self, text): + """Find and convert paths.""" + + basepath = self.config['base_path'] + relativepath = self.config['relative_path'] + absolute = bool(self.config['absolute']) + filescheme = bool(self.config['file_scheme']) + tags = re.compile(RE_TAG_HTML % '|'.join(self.config['tags'].split())) + if not absolute and basepath and relativepath: + text = tags.sub(lambda m: repl(m, basepath, rel_path=relativepath), text) + elif absolute and basepath: + text = tags.sub(lambda m: repl(m, basepath, file_scheme=filescheme), text) + return text + + +class PathConverterExtension(Extension): + """PathConverter extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'base_path': ["", "Base path used to find files - Default: \"\""], + 'relative_path': ["", "Path that files will be relative to (not needed if using absolute) - Default: \"\""], + 'absolute': [False, "Paths are absolute by default; disable for relative - Default: False"], + 'tags': ["img script a link", "tags to convert src and/or href in - Default: 'img scripts a link'"], + 'file_scheme': [False, "Use file:// scheme for absolute paths - Default: False"], + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add post processor to Markdown instance.""" + + rel_path = PathConverterPostprocessor(md) + rel_path.config = self.getConfigs() + md.postprocessors.register(rel_path, "path-converter", 2) + md.registerExtension(self) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return PathConverterExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/progressbar.py b/micromamba_root/Lib/site-packages/pymdownx/progressbar.py new file mode 100644 index 0000000000000000000000000000000000000000..01f959596f550acb76e23f5fff142c2d9fcc302c --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/progressbar.py @@ -0,0 +1,252 @@ +""" +Progress Bar. + +pymdownx.progressbar +Simple plugin to add support for progress bars + +``` +/* No label */ +[==30%] + +/* Label */ +[==30% MyLabel] + +/* works with attr_list inline style */ +[==50/200 MyLabel]{: .additional-class } +``` + +New line is not required before the progress bar but suggested unless in a table. +Can take percentages and divisions. +Floats are okay. Numbers must be positive. This is an experimental extension. +Functionality is subject to change. + +Minimum Recommended Styling +(but you could add gloss, candy striping, animation, or anything else): + +``` +.progress { + display: block; + width: 300px; + margin: 10px 0; + height: 24px; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background-color: #F8F8F8; + position: relative; + box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1); +} + +.progress-label { + position: absolute; + text-align: center; + font-weight: bold; + width: 100%; margin: 0; + line-height: 24px; + color: #333; + -webkit-font-smoothing: antialiased !important; + white-space: nowrap; + overflow: hidden; +} + +.progress-bar { + height: 24px; + float: left; + border-right: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background-color: #34c2e3; + box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5); +} + +For Level Colors + +.progress-100plus .progress-bar { + background-color: #1ee038; +} + +.progress-80plus .progress-bar { + background-color: #86e01e; +} + +.progress-60plus .progress-bar { + background-color: #f2d31b; +} + +.progress-40plus .progress-bar { + background-color: #f2b01e; +} + +.progress-20plus .progress-bar { + background-color: #f27011; +} + +.progress-0plus .progress-bar { + background-color: #f63a0f; +} +``` + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.inlinepatterns import InlineProcessor, dequote +import xml.etree.ElementTree as etree +from markdown.extensions.attr_list import AttrListTreeprocessor +from . import util + +RE_PROGRESS = r'''(?x) +\[={1,}\s* # Opening +(?: + (?P100(?:.0+)?|[1-9]?[0-9](?:\.\d+)?)% | # Percent + (?:(?P\d+(?:\.\d+)?)\s*/\s*(?P\d+(?:\.\d+)?)) # Fraction +) +(?P\s+(?P<quote>['"]).*?(?P=quote))?\s* # Title +\] # Closing +(?P<attr_list>\{\:?([^\}]*)\})? # Optional attr list +''' + +CLASS_LEVEL = "progress-%dplus" + + +class ProgressBarTreeProcessor(AttrListTreeprocessor): + """Used for AttrList compatibility.""" + + def run(self, elem): + """Inline check for attributes at start of tail.""" + + if elem.tail: + m = self.INLINE_RE.match(elem.tail) + if m: + self.assign_attrs(elem, m.group(1)) + elem.tail = elem.tail[m.end():] + + +class ProgressBarPattern(InlineProcessor): + """Pattern handler for the progress bars.""" + + def __init__(self, pattern, md): + """Initialize.""" + + InlineProcessor.__init__(self, pattern, md) + + def create_tag(self, width, label, add_classes, alist): + """Create the tag.""" + + # Create list of all classes and remove duplicates + classes = list( + set( + ["progress"] + + self.config.get('add_classes', '').split() + + add_classes + ) + ) + classes.sort() + el = etree.Element("div") + el.set('class', ' '.join(classes)) + bar = etree.SubElement(el, 'div') + bar.set('class', "progress-bar") + bar.set('style', 'width:%s%%' % width) + p = etree.SubElement(bar, 'p') + p.set('class', 'progress-label') + p.text = label + if alist is not None: + el.tail = alist + if 'attr_list' in self.md.treeprocessors: + ProgressBarTreeProcessor(self.md).run(el) + return el + + def handleMatch(self, m, data): + """Handle the match.""" + + label = "" + level_class = self.config.get('level_class', False) + increment = self.config.get('progress_increment', 20) + add_classes = [] + alist = None + if m.group(5): + label = dequote(self.unescape(m.group('title').strip())) + if m.group('attr_list'): + alist = m.group('attr_list') + if m.group('percent'): + value = float(m.group('percent')) + else: + try: + num = float(m.group('frac_num')) + except Exception: # pragma: no cover + num = 0.0 + try: + den = float(m.group('frac_den')) + except Exception: # pragma: no cover + den = 0.0 + if den == 0.0: + value = 0.0 + else: + value = (num / den) * 100.0 + + # We can never get a value < 0, + # but we must check for > 100. + if value > 100.0: + value = 100.0 + + # Round down to nearest increment step and include class if desired + if level_class: + add_classes.append(CLASS_LEVEL % int(value - (value % increment))) + + return self.create_tag('%.2f' % value, label, add_classes, alist), m.start(0), m.end(0) + + +class ProgressBarExtension(Extension): + """Add progress bar extension to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'level_class': [ + True, + "Include class that defines progress level - Default: True" + ], + 'progress_increment': [ + 20, + "Progress increment step - Default: 20" + ], + 'add_classes': [ + '', + "Add additional classes to the progress tag for styling. " + "Classes are separated by spaces. - Default: None" + ] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add the progress bar pattern handler.""" + + util.escape_chars(md, ['=']) + progress = ProgressBarPattern(RE_PROGRESS, md) + progress.config = self.getConfigs() + md.inlinePatterns.register(progress, "progress-bar", 179) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return ProgressBarExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/quotes.py b/micromamba_root/Lib/site-packages/pymdownx/quotes.py new file mode 100644 index 0000000000000000000000000000000000000000..9b3f5db2b94d54df3c0d30633b69a483f2704a47 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/quotes.py @@ -0,0 +1,149 @@ +""" +Extension for "enhanced" blockquotes. + +This extension deviates from Python Markdown's original blockquote extension by: + +- not grouping consecutive block quotes together. +- Allowing optional callout behavior that mimics GitHub or Obsidian. +""" +import re +import xml.etree.ElementTree as etree +from markdown.blockprocessors import BlockProcessor +from markdown.treeprocessors import Treeprocessor +from markdown import util +from markdown import Extension, Markdown +from markdown.blockparser import BlockParser +from typing import Any + + +class QuotesProcessor(BlockProcessor): + """Process blockquotes.""" + + RE = re.compile(r'(^|\n)[ ]{0,3}>[ ]?(.*)') + RE_CALLOUT = re.compile(r'> *\[!([\w-]+(?: *\| *[\w-]+)*)]([-+])?(.*?)(?:\n|$)') + + def __init__(self, parser: BlockParser, config: dict[str, Any]) -> None: + """Initialize.""" + + super().__init__(parser) + self.callouts = config['callouts'] + + def test(self, parent: etree.Element, block: str) -> bool: + """Test for block quote.""" + + return bool(self.RE.search(block)) and not util.nearing_recursion_limit() + + def run(self, parent: etree.Element, blocks: list[str]) -> None: + """Create blockquote.""" + + block = blocks.pop(0) + alert = [] + details = '' + m = self.RE.search(block) + if m: + before = block[:m.start()] # Lines before blockquote + # Pass lines before blockquote in recursively for parsing first. + self.parser.parseBlocks(parent, [before]) + # Remove `> ` from beginning of each line. + lines = block[m.start():].split('\n') + if lines and self.callouts: + m2 = None + index = 0 + for line in lines: + if line and line.strip() != '>': + m2 = self.RE_CALLOUT.match(line) + break + index += 1 + if m2: + alert = [x.strip() for x in m2.group(1).split('|')] + if m2.group(2): + details = 'open' if m2.group(2) == '+' else 'closed' + title = m2.group(3).strip() if m2.group(3) else '' + if not title: + title = alert[0].title() + lines[index] = '' + lines.insert(index, title) + if alert: + alert[0] = alert[0].lower() + block = '\n'.join([self.clean(l) for l in lines]) + + # This is a new blockquote. Create a new parent element. + attrs = {'data-alert': ' '.join(alert), 'data-alert-collapse': details} if alert else {} + quote = etree.SubElement(parent, 'blockquote', attrs) + + # Recursively parse block with blockquote as parent. + # change parser state so blockquotes embedded in lists use `p` tags + self.parser.state.set('blockquote') + self.parser.parseChunk(quote, block) + self.parser.state.reset() + + def clean(self, line: str) -> str: + """Remove `>` from beginning of a line.""" + + m = self.RE.match(line) + if line.strip() == ">": + return "" + elif m: + return m.group(2) + else: + return line + + +class QuotesTreeprocessor(Treeprocessor): + """Convert "special" quotes to the common output format for Admonitions and Details.""" + + def run(self, root: etree.Element) -> etree.Element: + """Find and convert "special" blockquotes.""" + + for b in root.iter('blockquote'): + if b.attrib.get('data-alert'): + collapse = b.attrib.get('data-alert-collapse', '') + if collapse: + b.tag = 'details' + child = b.find('*') + if collapse == 'open': + b.attrib['open'] = 'open' + c = b.attrib.get('class', '').split(' ') + if child is not None and child.tag.lower() == 'p': + child.tag = 'summary' + else: + b.tag = 'div' + child = b.find('*') + c = b.attrib.get('class', '').split(' ') + c.append('admonition') + if child is not None and child.tag.lower() == 'p': + c2 = child.attrib.get('class', '').split(' ') + c2.append('admonition-title') + child.attrib['class'] = ' '.join(_c for _c in c2 if _c) + c.append(b.attrib.get('data-alert', '')) + b.attrib['class'] = ' '.join(_c for _c in c if _c) + del b.attrib['data-alert'] + del b.attrib['data-alert-collapse'] + return root + + +class QuotesExtension(Extension): + """Add blockquotes extension to Markdown class.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + """Initialize.""" + + self.config = { + 'callouts': [False, "Enable GitHub/Obsidian style callouts - Default: False"] + } + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md: Markdown) -> None: + """Add support for blockquotes.""" + + md.registerExtension(self) + config = self.getConfigs() + md.parser.blockprocessors.register(QuotesProcessor(md.parser, config), "quote", 20) + if config['callouts']: + md.treeprocessors.register(QuotesTreeprocessor(md), 'quotes', 19.99) + + +def makeExtension(*args: Any, **kwargs: Any) -> Extension: + """Return extension.""" + + return QuotesExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/saneheaders.py b/micromamba_root/Lib/site-packages/pymdownx/saneheaders.py new file mode 100644 index 0000000000000000000000000000000000000000..53e2c3d2bc705f116660ac48d3a0ea5faa3e2cb5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/saneheaders.py @@ -0,0 +1,33 @@ +""" +Sane headers. + +Allow for a header implementation that requires `#` headers to have a space +after the `#` portion. This allows for things like Magiclink issues to work +at the beginning of lines, and potentially other things like tag extensions +etc. +""" +import re +from markdown import Extension +from markdown.blockprocessors import HashHeaderProcessor + + +class SaneHeadersProcessor(HashHeaderProcessor): + """Process hash headers syntax.""" + + RE = re.compile(r'(?:^|\n)(?P<level>#{1,6})(?=[ ])(?P<header>(?:\\.|[^\\])*?)#*(?:\n|$)') + + +class SaneHeadersExtension(Extension): + """Adds the sane headers extension.""" + + def extendMarkdown(self, md): + """Extend the inline and block processor objects.""" + + md.parser.blockprocessors.register(SaneHeadersProcessor(md.parser), 'hashheader', 70) + md.registerExtension(self) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return SaneHeadersExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/slugs.py b/micromamba_root/Lib/site-packages/pymdownx/slugs.py new file mode 100644 index 0000000000000000000000000000000000000000..8a3870e27ea19d1ad52977211d3563688f973121 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/slugs.py @@ -0,0 +1,125 @@ +""" +Slugs. + +Additional slug outputs. + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import re +import unicodedata +import functools +from urllib.parse import quote +from . import util + +RE_TAGS = re.compile(r'</?[^>]*>', re.UNICODE) +RE_INVALID_SLUG_CHAR = re.compile(r'[^\w\- ]', re.UNICODE) +RE_SEP = re.compile(r' ', re.UNICODE) +RE_ASCII_LETTERS = re.compile(r'[A-Z]', re.UNICODE) + + +def _uslugify(text, sep, case="none", percent_encode=False, normalize='NFC'): + """Unicode slugify (`utf-8`).""" + + # Normalize, Strip html tags, strip leading and trailing whitespace, and lower + slug = RE_TAGS.sub('', unicodedata.normalize(normalize, text)).strip() + + if case == 'lower': + slug = slug.lower() + elif case == 'lower-ascii': + def lower(m): + """Lowercase character.""" + return m.group(0).lower() + + slug = RE_ASCII_LETTERS.sub(lower, slug) + elif case == 'fold': + slug = slug.casefold() + + # Remove non word characters, non spaces, and non dashes, and convert spaces to dashes. + slug = RE_SEP.sub(sep, RE_INVALID_SLUG_CHAR.sub('', slug)) + + return quote(slug.encode('utf-8')) if percent_encode else slug + + +def slugify(**kwargs): + """Configurable slugify.""" + + case = kwargs.get('case', 'none') + percent = kwargs.get('percent_encode', False) + normalize = kwargs.get('normalize', 'NFC') + return functools.partial(_uslugify, case=case, percent_encode=percent, normalize=normalize) + + +@util.deprecated( + "'uslugify' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def uslugify(text, sep): + """Unicode slugify.""" + + return slugify(case='lower')(text, sep) + + +@util.deprecated( + "'uslugify_encoded' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def uslugify_encoded(text, sep): + """Unicode slugify (percent encoded).""" + + return slugify(case='lower', percent_encode=True)(text, sep) + + +@util.deprecated( + "'uslugify_cased' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def uslugify_cased(text, sep): + """Unicode slugify cased (keep case) (`utf-8`).""" + + return slugify()(text, sep) + + +@util.deprecated( + "'uslugify_cased_encode' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def uslugify_cased_encoded(text, sep): + """Unicode slugify cased (keep case) (percent encoded).""" + + return slugify(percent_encode=True)(text, sep) + + +@util.deprecated( + "'gfm' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def gfm(text, sep): + """Unicode slugify cased (cased Unicode only) (`utf-8`).""" + + return slugify(case="lower-ascii")(text, sep) + + +@util.deprecated( + "'gfm_encoded' is deprecated in favor of the configurable 'slugify' function. " + "See documentation for more info." +) +def gfm_encoded(text, sep): + """Unicode slugify cased (cased Unicode only) (percent encoded).""" + + return slugify(case='lower-ascii', percent_encode=True)(text, sep) diff --git a/micromamba_root/Lib/site-packages/pymdownx/smartsymbols.py b/micromamba_root/Lib/site-packages/pymdownx/smartsymbols.py new file mode 100644 index 0000000000000000000000000000000000000000..18b584192eafd2a799fba5417370d03fb932c507 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/smartsymbols.py @@ -0,0 +1,173 @@ +""" +Smart Symbols. + +pymdownx.smartsymbols +Really simple plugin to add support for: + copyright, trademark, and registered symbols + plus/minus, not equal, arrows via: + + copyright = `(c)` + trademark = `(tm)` + registered = `(r)` + plus/minus = `+/-` + care/of = `c/o` + fractions = `1/2` etc. + (only certain available unicode fractions) + arrows: + left = `<--` + right = `-->` + both = `<-->` + not equal = `=/=` + (maybe this could be =/= in the future as this might be more + intuitive to non-programmers) + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown import treeprocessors +from markdown.util import Registry +from markdown.inlinepatterns import HtmlInlineProcessor + +RE_TRADE = ("smart-trademark", r'\(tm\)', r'™') +RE_COPY = ("smart-copyright", r'\(c\)', r'©') +RE_REG = ("smart-registered", r'\(r\)', r'®') +RE_PLUSMINUS = ("smart-plus-minus", r'\+/-', r'±') +RE_NOT_EQUAL = ("smart-not-equal", r'=/=', r'≠') +RE_CARE_OF = ("smart-care-of", r'\bc/o\b', r'℅') +RE_ORDINAL_NUMBERS = ( + "smart-ordinal-numbers", + r'''(?x) + \b + (?P<leading>(?:[1-9][0-9]*)?) + (?P<tail>(?<=1)(?:1|2|3)th|1st|2nd|3rd|[04-9]th) + \b + ''', + lambda m: '{}{}<sup>{}</sup>'.format( + m.group('leading') if m.group('leading') else '', + m.group('tail')[:-2], m.group('tail')[1:] + ) +) +RE_ARROWS = ( + "smart-arrows", + r'(?P<arrows>\<-{2}\>|(?<!-)-{2}\>|\<-{2}(?!-))', + lambda m: ARR[m.group('arrows')] +) +RE_FRACTIONS = ( + "smart-fractions", + r'(?<!\d)(?P<fractions>1/4|1/2|3/4|1/3|2/3|1/5|2/5|3/5|4/5|1/6|5/6|1/8|3/8|5/8|7/8)(?!\d)', + lambda m: FRAC[m.group('fractions')] +) + +REPL = { + 'trademark': RE_TRADE, + 'copyright': RE_COPY, + 'registered': RE_REG, + 'plusminus': RE_PLUSMINUS, + 'arrows': RE_ARROWS, + 'notequal': RE_NOT_EQUAL, + 'fractions': RE_FRACTIONS, + 'ordinal_numbers': RE_ORDINAL_NUMBERS, + 'care_of': RE_CARE_OF +} + +FRAC = { + "1/4": "¼", + "1/2": "½", + "3/4": "¾", + "1/3": "⅓", + "2/3": "⅔", + "1/5": "⅕", + "2/5": "⅖", + "3/5": "⅗", + "4/5": "⅘", + "1/6": "⅙", + "5/6": "⅚", + "1/8": "⅛", + "3/8": "⅜", + "5/8": "⅝", + "7/8": "⅞" +} + +ARR = { + '-->': "→", + '<--': "←", + '<-->': "↔" +} + + +class SmartSymbolsPattern(HtmlInlineProcessor): + """Smart symbols patterns handler.""" + + def __init__(self, pattern, replace, md): + """Setup replace pattern.""" + + super().__init__(pattern, md) + self.replace = replace + + def handleMatch(self, m, data): + """Replace symbol.""" + + return self.md.htmlStash.store( + m.expand(self.replace(m) if callable(self.replace) else self.replace), + ), m.start(0), m.end(0) + + +class SmartSymbolsExtension(Extension): + """Smart Symbols extension.""" + + def __init__(self, *args, **kwargs): + """Setup config of which symbols are enabled.""" + + self.config = { + 'trademark': [True, 'Trademark'], + 'copyright': [True, 'Copyright'], + 'registered': [True, 'Registered'], + 'plusminus': [True, 'Plus/Minus'], + 'arrows': [True, 'Arrows'], + 'notequal': [True, 'Not Equal'], + 'fractions': [True, 'Fractions'], + 'ordinal_numbers': [True, 'Ordinal Numbers'], + 'care_of': [True, 'Care/of'] + } + super().__init__(*args, **kwargs) + + def add_pattern(self, patterns, md): + """Construct the inline symbol pattern.""" + + self.patterns.register(SmartSymbolsPattern(patterns[1], patterns[2], md), patterns[0], 30) + + def extendMarkdown(self, md): + """Create a dict of inline replace patterns and add to the tree processor.""" + + configs = self.getConfigs() + self.patterns = Registry() + + for k, v in REPL.items(): + if configs[k]: + self.add_pattern(v, md) + + inline_processor = treeprocessors.InlineProcessor(md) + inline_processor.inlinePatterns = self.patterns + md.treeprocessors.register(inline_processor, "smart-symbols", 6.1) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return SmartSymbolsExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/snippets.py b/micromamba_root/Lib/site-packages/pymdownx/snippets.py new file mode 100644 index 0000000000000000000000000000000000000000..305c7c0aae68516f4aad77c2430234762e981688 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/snippets.py @@ -0,0 +1,473 @@ +""" +Snippet ---8<---. + +pymdownx.snippet +Inject snippets + +MIT license. + +Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.preprocessors import Preprocessor +import functools +import urllib +import re +import os +from . import util +import textwrap +import time + +MI = 1024 * 1024 # mebibyte (MiB) +DEFAULT_URL_SIZE = MI * 32 +DEFAULT_URL_TIMEOUT = 10.0 # in seconds +DEFAULT_URL_REQUEST_HEADERS = {} +DEFAULT_MAX_RETRIES = 3 +DEFAULT_BACKOFF_FACTOR = 2 + + +class SnippetMissingError(Exception): + """Snippet missing exception.""" + + +class SnippetPreprocessor(Preprocessor): + """Handle snippets in Markdown content.""" + + RE_ALL_SNIPPETS = re.compile( + r'''(?x) + ^(?P<space>[ \t]*) + (?P<escape>;*) + (?P<all> + (?P<inline_marker>-{1,}8<-{1,}[ \t]+) + (?P<snippet>(?:"(?:\\"|[^"\n\r])+?"|'(?:\\'|[^'\n\r])+?'))(?![ \t]) | + (?P<block_marker>-{1,}8<-{1,})(?![ \t]) + )\r?$ + ''' + ) + + RE_SNIPPET = re.compile( + r'''(?x) + ^(?P<space>[ \t]*) + (?P<snippet>.*?)\r?$ + ''' + ) + + RE_SNIPPET_SECTION = re.compile( + r'''(?xi) + ^(?P<pre>.*?) + (?P<escape>;*) + (?P<inline_marker>-{1,}8<-{1,}[ \t]+) + (?P<section>\[[ \t]*(?P<type>start|end)[ \t]*:[ \t]*(?P<name>[a-z][-_0-9a-z]*)[ \t]*\]) + (?P<post>.*?)$ + ''' + ) + + RE_SNIPPET_FILE = re.compile( + r'(?i)(.*?)(?:((?::-?[0-9]*){1,2}(?:(?:,(?=[-0-9:])-?[0-9]*)(?::-?[0-9]*)?)*)|(:[a-z][-_0-9a-z]*))?$' + ) + + def __init__(self, config, md): + """Initialize.""" + + base = config.get('base_path') + if isinstance(base, (str, os.PathLike)): + base = [base] + self.base_path = [os.path.abspath(b) for b in base] + self.restrict_base_path = config['restrict_base_path'] + self.encoding = config.get('encoding') + self.check_paths = config.get('check_paths') + self.auto_append = config.get('auto_append') + self.url_download = config['url_download'] + self.url_max_size = config['url_max_size'] + self.url_timeout = config['url_timeout'] + self.url_request_headers = config['url_request_headers'] + self.dedent_subsections = config['dedent_subsections'] + self.max_retries = config['max_retries'] + self.backoff_factor = config['backoff_factor'] + self.tab_length = md.tab_length + super().__init__() + + self.download.cache_clear() + + def extract_section(self, section, lines): + """Extract the specified section from the lines.""" + + new_lines = [] + start = False + found = False + for l in lines: + + # Found a snippet section marker with our specified name + m = self.RE_SNIPPET_SECTION.match(l) + + # Handle escaped line + if m and start and m.group('escape'): + l = ( + m.group('pre') + m.group('escape').replace(';', '', 1) + m.group('inline_marker') + + m.group('section') + m.group('post') + ) + + # Found a section we are looking for. + elif m is not None and m.group('name') == section: + + # We found the start + if not start and m.group('type') == 'start': + start = True + found = True + continue + + # Ignore duplicate start + elif start and m.group('type') == 'start': + continue + + # We found the end + elif start and m.group('type') == 'end': + start = False + break + + # We found an end, but no start + else: + break + + # Found a section we don't care about, so ignore it. + elif m and start: + continue + + # We are currently in a section, so append the line + if start: + new_lines.append(l) + + if not found and self.check_paths: + raise SnippetMissingError(f"Snippet section '{section}' could not be located") + + return self.dedent(new_lines) if self.dedent_subsections else new_lines + + def dedent(self, lines): + """De-indent lines.""" + + return textwrap.dedent('\n'.join(lines)).split('\n') + + def get_snippet_path(self, path): + """Get snippet path.""" + + snippet = None + for base in self.base_path: + if os.path.exists(base): + if os.path.isdir(base): + if self.restrict_base_path: + filename = os.path.abspath(os.path.join(base, path)) + # If the absolute path is no longer under the specified base path, reject the file + if not filename.startswith(base): + continue + else: + filename = os.path.join(base, path) + if os.path.exists(filename): + snippet = filename + break + else: + dirname = os.path.dirname(base) + filename = os.path.join(dirname, path) + if os.path.exists(filename) and os.path.samefile(filename, base): + snippet = filename + break + return snippet + + @functools.lru_cache # noqa: B019 + def download(self, url): + """ + Actually download the snippet pointed to by the passed URL. + + The most recently used files are kept in a cache until the next reset. + """ + + retries = self.max_retries + + while True: + try: + http_request = urllib.request.Request(url, headers=self.url_request_headers) + timeout = None if self.url_timeout == 0 else self.url_timeout + with urllib.request.urlopen(http_request, timeout=timeout) as response: + # Fail if status is not OK + status = response.status if util.PY39 else response.code + + if status != 200: + raise SnippetMissingError(f"Cannot download snippet '{url}' (HTTP Error {status})") + + # We provide some basic protection against absurdly large files. + # 32MB is chosen as an arbitrary upper limit. This can be raised if desired. + content = None + if "content-length" not in response.headers: + # we have to read to know if we went over the max, but never more than `url_max_size` + # where `url_max_size` == 0 means unlimited + content = response.read(self.url_max_size) if self.url_max_size != 0 else response.read() + content_length = len(content) + else: + content_length = int(response.headers["content-length"]) + + if self.url_max_size != 0 and content_length >= self.url_max_size: + raise ValueError(f"refusing to read payloads larger than or equal to {self.url_max_size}") + + # Nothing to return + if content_length == 0: + return [''] + + if content is None: + # content-length was in the header, so we did not read yet + content = response.read() + + # Process lines + last = content.endswith((b'\r', b'\n')) + s_lines = [l.decode(self.encoding) for l in content.splitlines()] + if last: + s_lines.append('') + return s_lines + + except urllib.error.HTTPError as e: # noqa: PERF203 + # Handle rate limited error codes + if e.code == 429 and retries: + retries -= 1 + wait = self.backoff_factor * (self.max_retries - retries) + time.sleep(wait) + continue + raise SnippetMissingError(f"Cannot download snippet '{url}' (HTTP Error {e.code})") from e + + + def parse_snippets(self, lines, file_name=None, is_url=False, is_section=False): + """Parse snippets snippet.""" + + if file_name: + # Track this file. + self.seen.add(file_name) + + new_lines = [] + inline = False + block = False + for line in lines: + # Check for snippets on line + inline = False + m = self.RE_ALL_SNIPPETS.match(line) + if m: + if m.group('escape'): + # The snippet has been escaped, replace first `;` and continue. + new_lines.append(line.replace(';', '', 1)) + continue + + if block and m.group('inline_marker'): + # Don't use inline notation directly under a block. + # It's okay if inline is used again in sub file though. + continue + + elif m.group('inline_marker'): + # Inline + inline = True + + else: + # Block + block = not block + continue + + elif not block: + if not is_section: + # Check for section line, if present remove, if escaped, reformat it + m2 = self.RE_SNIPPET_SECTION.match(line) + if m2 and m2.group('escape'): + line = ( + m2.group('pre') + m2.group('escape').replace(';', '', 1) + m2.group('inline_marker') + + m2.group('section') + m2.group('post') + ) + m2 = None + + # Found a section that must be removed + if m2 is not None: + continue + + # Not in snippet, and we didn't find an inline, + # so just a normal line + new_lines.append(line) + continue + + if block and not inline: + # We are in a block and we didn't just find a nested inline + # So check if a block path + m = self.RE_SNIPPET.match(line) + + if m: + # Get spaces and snippet path. Remove quotes if inline. + space = m.group('space').expandtabs(self.tab_length) + path = m.group('snippet')[1:-1].strip() if inline else m.group('snippet').strip() + + if not inline: + # Block path handling + if not path: + # Empty path line, insert a blank line + new_lines.append('') + continue + + # Ignore commented out lines + if path.startswith(';'): + continue + + # Get line numbers (if specified) + end = [] + start = [] + section = None + m = self.RE_SNIPPET_FILE.match(path) + path = '' if m is None else m.group(1).strip() + # Looks like we have an empty file and only lines specified + if not path: + if self.check_paths: + raise SnippetMissingError(f"Snippet at path '{path}' could not be found") + else: + continue + if m.group(2): + for nums in m.group(2)[1:].split(','): + span = nums.split(':') + st = int(span[0]) if span[0] else None + start.append(st if st is None or st < 0 else max(0, st - 1)) + en = int(span[1]) if len(span) > 1 and span[1] else None + end.append(en) + elif m.group(3): + section = m.group(3)[1:] + + # Ignore path links if we are in external, downloaded content + is_link = path.lower().startswith(('https://', 'http://')) + if is_url and not is_link: + continue + + # If this is a link, and we are allowing URLs, set `url` to true. + # Make sure we don't process `path` as a local file reference. + url = self.url_download and is_link + snippet = self.get_snippet_path(path) if not url else path + + if snippet: + + # This is in the stack and we don't want an infinite loop! + if snippet in self.seen: + continue + + if not url: + # Read file content + with open(snippet, 'r', encoding=self.encoding) as f: + last = False + s_lines = [] + for l in f: + last = l.endswith(('\r', '\n')) + s_lines.append(l.strip('\r\n')) + if last: + s_lines.append('') + else: + # Read URL content + try: + s_lines = self.download(snippet) + except SnippetMissingError: + if self.check_paths: + raise + s_lines = [] + + if s_lines: + total = len(s_lines) + if start and end: + final_lines = [] + for sel in zip(start, end): + s_start = util.clamp(total + sel[0], 0, total) if sel[0] and sel[0] < 0 else sel[0] + s_end = util.clamp(total + 1 + sel[1], 0, total) if sel[1] and sel[1] < 0 else sel[1] + final_lines.extend(s_lines[slice(s_start, s_end, None)]) + s_lines = self.dedent(final_lines) if self.dedent_subsections else final_lines + elif section: + s_lines = self.extract_section(section, s_lines) + + # Process lines looking for more snippets + new_lines.extend( + [ + space + l2 for l2 in self.parse_snippets( + s_lines, + snippet, + is_url=url, + is_section=section is not None + ) + ] + ) + + elif self.check_paths: + raise SnippetMissingError(f"Snippet at path '{path}' could not be found") + + # Pop the current file name out of the cache + if file_name: + self.seen.remove(file_name) + + return new_lines + + def run(self, lines): + """Process snippets.""" + + self.seen = set() + if self.auto_append: + lines.extend("\n\n-8<-\n{}\n-8<-\n".format('\n\n'.join(self.auto_append)).split('\n')) + + return self.parse_snippets(lines) + + +class SnippetExtension(Extension): + """Snippet extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'base_path': [["."], "Base path for snippet paths - Default: [\".\"]"], + 'restrict_base_path': [ + True, + "Restrict snippet paths such that they are under the base paths - Default: True" + ], + 'encoding': ["utf-8", "Encoding of snippets - Default: \"utf-8\""], + 'check_paths': [False, "Make the build fail if a snippet can't be found - Default: \"False\""], + "auto_append": [ + [], + "A list of snippets (relative to the 'base_path') to auto append to the Markdown content - Default: []" + ], + 'url_download': [False, "Download external URLs as snippets - Default: \"False\""], + 'url_max_size': [DEFAULT_URL_SIZE, "External URL max size (0 means no limit)- Default: 32 MiB"], + 'url_timeout': [DEFAULT_URL_TIMEOUT, 'Defualt URL timeout (0 means no timeout) - Default: 10 sec'], + 'url_request_headers': [DEFAULT_URL_REQUEST_HEADERS, "Extra request Headers - Default: {}"], + 'dedent_subsections': [False, "Dedent subsection extractions e.g. 'sections' and/or 'lines'."], + 'max_retries': [ + DEFAULT_MAX_RETRIES, "Maximum number of retry attempts for rate-limited requests - Default: 3" + ], + 'backoff_factor': [DEFAULT_BACKOFF_FACTOR, "Backoff factor for retry attempts - Default: 2"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Register the extension.""" + + self.md = md + md.registerExtension(self) + config = self.getConfigs() + snippet = SnippetPreprocessor(config, md) + md.preprocessors.register(snippet, "snippet", 32) + + def reset(self): + """Reset.""" + + self.md.preprocessors['snippet'].download.cache_clear() + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return SnippetExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/striphtml.py b/micromamba_root/Lib/site-packages/pymdownx/striphtml.py new file mode 100644 index 0000000000000000000000000000000000000000..1bc4312a0d9b15db229a6807b50a284db36412e6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/striphtml.py @@ -0,0 +1,151 @@ +""" +Strip HTML (previously named Plain HTML). + +pymdownx.striphtml +An extension for Python Markdown. +Strip classes, styles, and ids from html + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.postprocessors import Postprocessor +import re + + +RE_TAG_HTML = re.compile( + r'''(?x) + (?: + (?P<comments>(?:\r?\n?\s*)<!--(?:-(?!->)|[^-])*?-->(?:\s*)(?=\r?\n)|<!--[\s\S]*?-->)| + (?P<scripts> + (?P<script_open><(?P<script_name>style|script)) + (?P<script_attr>(?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'`=<>]+))?)*) + (?P<script_rest>\s*>.*?</(?P=script_name)\s*>) + )| + (?P<open><(?P<name>[\w\:\.\-]+)) + (?P<attr>(?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'`=<>]+))?)*) + (?P<close>\s*(?P<self_close>/)?>)| + (?P<close_tag></(?P<close_name>[\w\:\.\-]+)\s*>) + ) + ''', + re.DOTALL | re.UNICODE +) + +TAG_BAD_ATTR = r'''(?x) +(?P<attr> + (?: + \s+(?:%s) + (?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'`=<>]+)) + )* +) +''' + + +class StripHtmlPostprocessor(Postprocessor): + """Post processor to strip out unwanted content.""" + + def __init__(self, strip_comments, strip_js_on_attributes, strip_attributes, md): + """Initialize.""" + + self.strip_comments = strip_comments + self.re_attributes = None + attributes = [re.escape(a.strip()) for a in strip_attributes] + if strip_js_on_attributes: + attributes.append(r'on[\w]+') + if attributes: + self.re_attributes = re.compile( + TAG_BAD_ATTR % '|'.join(attributes), + re.DOTALL | re.UNICODE + ) + + super().__init__(md) + + def repl(self, m): + """Replace comments and unwanted attributes.""" + + if m.group('comments'): + tag = '' if self.strip_comments else m.group('comments') + else: + if m.group('scripts'): + tag = m.group('script_open') + if self.re_attributes is not None: + tag += self.re_attributes.sub('', m.group('script_attr')) + else: + tag += m.group('script_attr') + tag += m.group('script_rest') + elif m.group('close_tag'): + tag = m.group(0) + else: + tag = m.group('open') + if self.re_attributes is not None: + tag += self.re_attributes.sub('', m.group('attr')) + else: + tag += m.group('attr') + tag += m.group('close') + return tag + + def run(self, text): + """Strip out ids and classes for a simplified HTML output.""" + + strip = self.strip_comments or self.strip_js_on_attributes or self.re_attributes + return RE_TAG_HTML.sub(self.repl, text) if strip else text + + +class StripHtmlExtension(Extension): + """StripHTML extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'strip_comments': [ + True, + "Strip HTML comments at the end of processing. " + "- Default: True" + ], + 'strip_attributes': [ + [], + "A string of attributes separated by spaces." + "- Default: 'id class style']" + ], + 'strip_js_on_attributes': [ + True, + "Strip JavaScript script attribues with the pattern on*. " + " - Default: True" + ] + } + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Strip unwanted HTML attributes and/or comments.""" + + md.registerExtension(self) + config = self.getConfigs() + striphtml = StripHtmlPostprocessor( + config.get('strip_comments'), + config.get('strip_js_on_attributes'), + config.get('strip_attributes'), + md + ) + md.postprocessors.register(striphtml, "strip-html", 1) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return StripHtmlExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/superfences.py b/micromamba_root/Lib/site-packages/pymdownx/superfences.py new file mode 100644 index 0000000000000000000000000000000000000000..b1115942ca930480207d1c4d630d6e12595843f4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/superfences.py @@ -0,0 +1,1070 @@ +""" +SuperFences. + +pymdownx.superfences +Nested Fenced Code Blocks + +This is a modification of the original Fenced Code Extension. +Algorithm has been rewritten to allow for fenced blocks in blockquotes, +lists, etc. And also , allow for special UML fences like 'flow' for flowcharts +and `sequence` for sequence diagrams. + +Modified: 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> +--- + +Fenced Code Extension for Python Markdown +========================================= + +This extension adds Fenced Code Blocks to Python-Markdown. + +See <https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html> +for documentation. + +Original code Copyright 2007-2008 [Waylan Limberg](https://github.com/waylan). + + +All changes Copyright 2008-2014 The Python Markdown Project + +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) +""" +from markdown.extensions import Extension +from markdown.preprocessors import Preprocessor +from markdown.blockprocessors import CodeBlockProcessor +from markdown.extensions.attr_list import get_attrs +from markdown import util as md_util +import functools +import re +from .quotes import QuotesExtension + +SOH = '\u0001' # start +EOT = '\u0004' # end + +PREFIX_CHARS = ('>', ' ', '\t') + +RE_NESTED_FENCE_START = re.compile( + r'''(?x) + (?P<fence>~{3,}|`{3,}) + (?:[ \t]*\.?(?P<lang>[\w#.+-]+)(?=[\t ]|$))? # Language + (?: + [ \t]*(\{(?P<attrs>[^\n]*)\}) | # Optional attributes or + (?P<options> + (?: + (?:[ \t]*[a-zA-Z][a-zA-Z0-9_]*(?:=(?P<quot>"|').*?(?P=quot))?)(?=[\t ]|$) # Options + )+ + ) | + (?P<unrecognized> + (?:([ \t]*[^\s]+)(?=[\t ]|$))+ + ) + )?[ \t]*$ + ''' +) + +RE_HL_LINES = re.compile(r'^(?P<hl_lines>\d+(?:-\d+)?(?:[ \t]+\d+(?:-\d+)?)*)$') +RE_LINENUMS = re.compile(r'(?P<linestart>[\d]+)(?:[ \t]+(?P<linestep>[\d]+))?(?:[ \t]+(?P<linespecial>[\d]+))?') +RE_OPTIONS = re.compile( + r'''(?x) + (?: + (?P<key>[a-zA-Z][a-zA-Z0-9_]*)(?:=(?P<quot>"|')(?P<value>.*?)(?P=quot))? + ) + ''' +) + +NESTED_FENCE_END = r'%s[ \t]*$' + +FENCED_BLOCK_RE = re.compile( + r'^([\> ]*){}({}){}$'.format( + md_util.HTML_PLACEHOLDER[0], + md_util.HTML_PLACEHOLDER[1:-1] % r'([0-9]+)', + md_util.HTML_PLACEHOLDER[-1] + ) +) + + +class SuperFencesException(Exception): + """Special exception to ensure one is raised when a fence fails.""" + + +def _escape(txt): + """Basic html escaping.""" + + txt = txt.replace('&', '&') + txt = txt.replace('<', '<') + txt = txt.replace('>', '>') + return txt + + +class CodeStash: + """ + Stash code for later retrieval. + + Store original fenced code here in case we were + too greedy and need to restore in an indented code + block. + """ + + def __init__(self): + """Initialize.""" + + self.stash = {} + + def __len__(self): # pragma: no cover + """Length of stash.""" + + return len(self.stash) + + def get(self, key, default=None): + """Get the code from the key.""" + + code = self.stash.get(key, default) + return code + + def remove(self, key): + """Remove the stashed code.""" + + del self.stash[key] + + def store(self, key, code, indent_level): + """Store the code in the stash.""" + + self.stash[key] = (code, indent_level) + + def clear_stash(self): + """Clear the stash.""" + + self.stash = {} + + +def fence_code_format(source, language, class_name, options, md, **kwargs): + """Format source as code blocks.""" + + classes = kwargs['classes'] + id_value = kwargs['id_value'] + attrs = kwargs['attrs'] + + if class_name: + classes.insert(0, class_name) + + id_value = f' id="{id_value}"' if id_value else '' + classes = ' class="{}"'.format(' '.join(classes)) if classes else '' + attrs = ' ' + ' '.join(f'{k}="{v}"' for k, v in attrs.items()) if attrs else '' + + return '<pre{}{}{}><code>{}</code></pre>'.format(id_value, classes, attrs, _escape(source)) + + +def fence_div_format(source, language, class_name, options, md, **kwargs): + """Format source as div.""" + + classes = kwargs['classes'] + id_value = kwargs['id_value'] + attrs = kwargs['attrs'] + + if class_name: + classes.insert(0, class_name) + + id_value = f' id="{id_value}"' if id_value else '' + classes = ' class="{}"'.format(' '.join(classes)) if classes else '' + attrs = ' ' + ' '.join(f'{k}="{v}"' for k, v in attrs.items()) if attrs else '' + + return '<div{}{}{}>{}</div>'.format(id_value, classes, attrs, _escape(source)) + + +def highlight_validator(language, inputs, options, attrs, md): + """Highlight validator.""" + + use_pygments = md.preprocessors['fenced_code_block'].use_pygments + + for k, v in inputs.items(): + matched = False + if use_pygments: + if k.startswith('data-'): + attrs[k] = v + continue + for opt, validator in (('hl_lines', RE_HL_LINES), ('linenums', RE_LINENUMS), ('title', None)): + if k == opt: + if v is not True and (validator is None or validator.match(v) is not None): + options[k] = v + matched = True + break + if not matched: + attrs[k] = v + + return True + + +def default_validator(language, inputs, options, attrs, md): + """Default validator.""" + + for k, v in inputs.items(): + attrs[k] = v + return True + + +def _validator(language, inputs, options, attrs, md, validator=None): + """Validator wrapper.""" + + md.preprocessors['fenced_code_block'].get_hl_settings() + return validator(language, inputs, options, attrs, md) + + +def _formatter(src='', language='', options=None, md=None, class_name="", _fmt=None, **kwargs): + """Formatter wrapper.""" + + return _fmt(src, language, class_name, options, md, **kwargs) + + +def _test(language, test_language=None): + """Test language.""" + + return test_language is None or test_language == "*" or language == test_language + + +class SuperFencesCodeExtension(Extension): + """SuperFences code block extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.superfences = [] + self.config = { + 'disable_indented_code_blocks': [False, "Disable indented code blocks - Default: False"], + 'custom_fences': [[], 'Specify custom fences. Default: See documentation.'], + 'css_class': [ + '', + "Set class name for wrapper element. The default of CodeHilite or Highlight will be used" + "if nothing is set. - " + "Default: ''" + ], + 'preserve_tabs': [False, "Preserve tabs in fences - Default: False"], + 'relaxed_headers': [False, "Relaxed fenced code headers - Default: False"] + } + super().__init__(*args, **kwargs) + + def extend_super_fences(self, name, formatter, validator): + """Extend SuperFences with the given name, language, and formatter.""" + + obj = { + "name": name, + "test": functools.partial(_test, test_language=name), + "formatter": formatter, + "validator": validator + } + + if name == '*': + self.superfences[0] = obj + else: + self.superfences.append(obj) + + def extendMarkdown(self, md): + """Add fenced block preprocessor to the Markdown instance.""" + + # Not super yet, so let's make it super + md.registerExtension(self) + config = self.getConfigs() + + # Default fenced blocks + self.superfences.insert( + 0, + { + "name": "superfences", + "test": _test, + "formatter": None, + "validator": functools.partial(_validator, validator=highlight_validator) + } + ) + + # Custom Fences + custom_fences = config.get('custom_fences', []) + for custom in custom_fences: + name = custom.get('name') + class_name = custom.get('class') + fence_format = custom.get('format', fence_code_format) + validator = custom.get('validator', default_validator) + if name is not None and class_name is not None: + self.extend_super_fences( + name, + functools.partial(_formatter, class_name=class_name, _fmt=fence_format), + functools.partial(_validator, validator=validator) + ) + + self.md = md + self.patch_fenced_rule() + self.stash = CodeStash() + + def patch_fenced_rule(self): + """ + Patch Python Markdown with our own fenced block extension. + + We don't attempt to protect against a user loading the `fenced_code` extension with this. + Most likely they will have issues, but they shouldn't have loaded them together in the first place :). + """ + + config = self.getConfigs() + + fenced = SuperFencesBlockPreprocessor(self.md) + fenced.config = config + fenced.extension = self + if self.superfences[0]['name'] == "superfences": + self.superfences[0]["formatter"] = fenced.highlight + self.md.preprocessors.register(fenced, "fenced_code_block", 25) + + indented_code = SuperFencesCodeBlockProcessor(self.md.parser) + indented_code.config = config + indented_code.extension = self + self.md.parser.blockprocessors.register(indented_code, "code", 80) + + if config["preserve_tabs"]: + # Need to squeeze in right after critic. + raw_fenced = SuperFencesRawBlockPreprocessor(self.md) + raw_fenced.config = config + raw_fenced.extension = self + self.md.preprocessors.register(raw_fenced, "fenced_raw_block", 31.05) + self.md.registerExtensions(["pymdownx._bypassnorm"], {}) + + # Add the highlight extension, but do so in a disabled state so we can just retrieve default configurations + self.md.registerExtensions(["pymdownx.highlight"], {"pymdownx.highlight": {"_enabled": False}}) + + def reset(self): + """Clear the stash.""" + + self.stash.clear_stash() + + +class SuperFencesBlockPreprocessor(Preprocessor): + """ + Preprocessor to find fenced code blocks. + + Because this is done as a preprocessor, it might be too greedy. + We will stash the blocks code and restore if we mistakenly processed + text from an indented code block. + """ + + CODE_WRAP = '<pre%s><code%s>%s</code></pre>' + + def __init__(self, md): + """Initialize.""" + + super().__init__(md) + self.tab_len = self.md.tab_length + self.checked_hl_settings = False + self.codehilite_conf = {} + self.checked_quotes = False + self.quotes_logic = False + + def normalize_ws(self, text): + """Normalize whitespace.""" + + return text.expandtabs(self.tab_len) + + def rebuild_block(self, lines): + """Dedent the fenced block lines.""" + + return '\n'.join([line[self.ws_virtual_len:] for line in lines]) + + def is_pymdownx_quotes_logic(self): + """Check if we are using the Quotes blockquote logic.""" + + if not self.checked_quotes: + self.checked_quotes = True + for ext in self.md.registeredExtensions: + if isinstance(ext, QuotesExtension): + self.quotes_logic = True + break + return self.quotes_logic + + def get_hl_settings(self): + """Check for Highlight extension to get its configurations.""" + + if not self.checked_hl_settings: + self.checked_hl_settings = True + + config = None + self.highlighter = None + for ext in self.md.registeredExtensions: + self.highlight_ext = ext + try: + config = ext.get_pymdownx_highlight_settings() + self.highlighter = ext.get_pymdownx_highlighter() + break + except AttributeError: + pass + + self.attr_list = 'attr_list' in self.md.treeprocessors + + css_class = self.config['css_class'] + self.css_class = css_class if css_class else config['css_class'] + + self.relaxed_headers = self.config.get('relaxed_headers', False) + self.extend_pygments_lang = config.get('extend_pygments_lang', None) + self.guess_lang = config['guess_lang'] + self.pygments_style = config['pygments_style'] + self.use_pygments = config['use_pygments'] + self.noclasses = config['noclasses'] + self.linenums = config['linenums'] + self.linenums_style = config.get('linenums_style', 'table') + self.linenums_class = config.get('linenums_class', 'linenums') + self.linenums_special = config.get('linenums_special', -1) + self.language_prefix = config.get('language_prefix', 'language-') + self.code_attr_on_pre = config.get('code_attr_on_pre', False) + self.auto_title = config.get('auto_title', False) + self.auto_title_map = config.get('auto_title_map', {}) + self.line_spans = config.get('line_spans', '') + self.line_anchors = config.get('line_anchors', '') + self.anchor_linenums = config.get('anchor_linenums', False) + self.pygments_lang_class = config.get('pygments_lang_class', False) + self.stripnl = config.get('stripnl', True) + self.default_lang = config.get('default_lang', True) + + def clear(self): + """Reset the class variables.""" + + self.ws = None + self.ws_len = 0 + self.ws_virtual_len = 0 + self.fence = None + self.lang = None + self.quote_level = 0 + self.code = [] + self.empty_lines = 0 + self.fence_end = None + self.options = {} + self.classes = [] + self.id = '' + self.attrs = {} + self.formatter = None + + def eval_fence(self, ws, content, start, end): + """Evaluate a normal fence.""" + + if (ws + content).strip() == '': + # Empty line is okay + self.empty_lines += 1 + self.code.append(ws + content) + elif len(ws) != self.ws_virtual_len and content != '': + # Not indented enough + self.clear() + elif self.fence_end.match(content) is not None and not content.startswith((' ', '\t')): + # End of fence + try: + self.process_nested_block(ws, content, start, end) + except SuperFencesException: + raise + except Exception: + self.clear() + else: + # Content line + self.empty_lines = 0 + self.code.append(ws + content) + + def eval_quoted(self, ws, content, quote_level, start, end): + """Evaluate fence inside a blockquote.""" + + quotes_logic = self.is_pymdownx_quotes_logic() + + if quote_level > self.quote_level: + # Quote level exceeds the starting quote level + self.clear() + return + + if quotes_logic and quote_level != self.quote_level: + # If we are using the Quotes extension, quote levels on each line must match. + self.clear() + return + + if content == '': + # Empty line is okay + self.code.append(ws + content) + self.empty_lines += 1 + elif len(ws) < self.ws_len: + # Not indented enough + self.clear() + elif self.empty_lines and quote_level < self.quote_level: + # Quote levels don't match and we are signified + # the end of the block with an empty line + self.clear() + elif self.fence_end.match(content) is not None: + # End of fence + try: + self.process_nested_block(ws, content, start, end) + except SuperFencesException: + raise + except Exception: + self.clear() + else: + # Content line + self.empty_lines = 0 + self.code.append(ws + content) + + def process_nested_block(self, ws, content, start, end): + """Process the contents of the nested block.""" + + self.last = ws + self.normalize_ws(content) + code = None + if self.formatter is not None: + self.line_count = end - start - 2 + + code = self.formatter( + src=self.rebuild_block(self.code), + language=self.lang, + md=self.md, + options=self.options, + classes=self.classes, + id_value=self.id, + attrs=self.attrs if self.attr_list else {} + ) + + if code is not None: + self._store(self.normalize_ws('\n'.join(self.code)) + '\n', code, start, end) + self.clear() + + def normalize_hl_line(self, number): + """ + Normalize highlight line number. + + Clamp outrages numbers. Numbers out of range will be only one increment out range. + This prevents people from create massive buffers of line numbers that exceed real + number of code lines. + """ + + number = int(number) + if number < 1: + number = 0 + elif number > self.line_count: + number = self.line_count + 1 + return number + + def parse_hl_lines(self, hl_lines): + """Parse the lines to highlight.""" + + lines = [] + if hl_lines: + for entry in hl_lines.split(): + line_range = [self.normalize_hl_line(e) for e in entry.split('-')] + if len(line_range) > 1: + if line_range[0] <= line_range[1]: + lines.extend(list(range(line_range[0], line_range[1] + 1))) + elif 1 <= line_range[0] <= self.line_count: + lines.extend(line_range) + return lines + + def parse_line_start(self, linestart): + """Parse line start.""" + + return int(linestart) if linestart else -1 + + def parse_line_step(self, linestep): + """Parse line start.""" + + step = int(linestep) if linestep else -1 + + return step if step > 1 else -1 + + def parse_line_special(self, linespecial): + """Parse line start.""" + + return int(linespecial) if linespecial else -1 + + def parse_fence_line(self, line): + """Parse fence line.""" + + ws_len = 0 + ws_virtual_len = 0 + ws = [] + index = 0 + for c in line: + if ws_virtual_len >= self.ws_virtual_len: + break + if c not in PREFIX_CHARS: + break + ws_len += 1 + if c == '\t': + tab_size = self.tab_len - (index % self.tab_len) + ws_virtual_len += tab_size + ws.append(' ' * tab_size) + else: + tab_size = 1 + ws_virtual_len += 1 + ws.append(c) + index += tab_size + + return ''.join(ws), line[ws_len:] + + def parse_whitespace(self, line): + """Parse the whitespace (blockquote syntax is counted as well).""" + + self.ws_len = 0 + self.ws_virtual_len = 0 + ws = [] + for c in line: + if c not in PREFIX_CHARS: + break + self.ws_len += 1 + ws.append(c) + + ws = self.normalize_ws(''.join(ws)) + self.ws_virtual_len = len(ws) + + return ws + + def parse_options(self, m): + """Get options.""" + + okay = False + + if m.group('lang'): + self.lang = m.group('lang') + + string = m.group('options') + + self.options = {} + self.attrs = {} + self.formatter = None + values = {} + if string: + for m2 in RE_OPTIONS.finditer(string): + key = m2.group('key') + value = m2.group('value') + if value is None: + value = key + values[key] = value + + # Run per language validator + for entry in reversed(self.extension.superfences): + if entry["test"](self.lang): + options = {} + attrs = {} + validator = entry.get("validator", functools.partial(_validator, validator=default_validator)) + try: + okay = validator(self.lang, values, options, attrs, self.md) + except SuperFencesException: + raise + except Exception: + pass + if attrs: + okay = False + if okay: + self.formatter = entry.get("formatter") + self.options = options + break + + if not okay and self.relaxed_headers: + return self.handle_unrecognized(m) + + return okay + + def handle_unrecognized(self, m): + """Handle unrecognized code headers.""" + + okay = False + if not self.relaxed_headers: + return okay + + if m.group('lang'): + self.lang = m.group('lang') + + self.options = {} + self.attrs = {} + self.formatter = None + + # Run per language validator + for entry in reversed(self.extension.superfences): + if entry["test"](self.lang): + options = {} + attrs = {} + validator = entry.get("validator", functools.partial(_validator, validator=default_validator)) + try: + okay = validator(self.lang, {}, options, attrs, self.md) + except SuperFencesException: + raise + except Exception: + pass + if okay: + self.formatter = entry.get("formatter") + self.options = options + if self.attr_list: + self.attrs = attrs + break + + if not okay: + self.lang = None # pragma: no cover + return True + + def handle_attrs(self, m): + """Handle attribute list.""" + + okay = False + attributes = get_attrs(m.group('attrs').replace('\t', ' ' * self.tab_len)) + + self.options = {} + self.attrs = {} + self.formatter = None + values = {} + for k, v in attributes: + if k == 'id': + self.id = v + elif k == '.': + self.classes.append(v) + else: + values[k] = v + + if m.group('lang'): + self.lang = m.group('lang') + else: + self.lang = self.classes.pop(0) if self.classes else '' + + # Run per language validator + for entry in reversed(self.extension.superfences): + if entry["test"](self.lang): + options = {} + attrs = {} + validator = entry.get("validator", functools.partial(_validator, validator=default_validator)) + try: + okay = validator(self.lang, values, options, attrs, self.md) + except SuperFencesException: + raise + except Exception: + pass + if okay: + self.formatter = entry.get("formatter") + self.options = options + if self.attr_list: + self.attrs = attrs + break + + if not okay and self.relaxed_headers: + return self.handle_unrecognized(m) # pragma: no cover + + return okay + + def search_nested(self, lines): + """Search for nested fenced blocks.""" + + count = 0 + for line in lines: + # Strip carriage returns if the lines end with them. + # This is necessary since we are handling preserved tabs + # Before whitespace normalization. + line = line.rstrip('\r') + if self.fence is None: + ws = self.parse_whitespace(line) + + # Found the start of a fenced block. + m = RE_NESTED_FENCE_START.match(line, self.ws_len) + if m is not None: + + # Parse options + if m.group('unrecognized'): + okay = self.handle_unrecognized(m) + elif m.group('attrs'): + okay = self.handle_attrs(m) + else: + okay = self.parse_options(m) + + if okay: + # Valid fence options, handle fence + start = count + self.first = ws + self.normalize_ws(m.group(0)) + self.ws = ws + self.quote_level = self.ws.count(">") + self.empty_lines = 0 + self.fence = m.group('fence') + self.fence_end = re.compile(NESTED_FENCE_END % self.fence) + else: + # Option parsing failed, abandon fence + self.clear() + else: + # Evaluate lines + # - Determine if it is the ending line or content line + # - If is a content line, make sure it is all indented + # with the opening and closing lines (lines with just + # whitespace will be stripped so those don't matter). + # - When content lines are inside blockquotes, make sure + # the nested block quote levels make sense according to + # blockquote rules. + ws, content = self.parse_fence_line(line) + + end = count + 1 + quote_level = ws.count(">") + + if self.quote_level: + # Handle blockquotes + self.eval_quoted(ws, content, quote_level, start, end) + elif quote_level == 0: + # Handle all other cases + self.eval_fence(ws, content, start, end) + else: + # Looks like we got a blockquote line + # when not in a blockquote. + self.clear() + + count += 1 + + return self.reassemble(lines) + + def reassemble(self, lines): + """Reassemble text.""" + + # Now that we are done iterating the lines, + # let's replace the original content with the + # fenced blocks. + while len(self.stack): + fenced, start, end = self.stack.pop() + lines = lines[:start] + [fenced] + lines[end:] + return lines + + def highlight(self, src="", language="", options=None, md=None, **kwargs): + """ + Syntax highlight the code block. + + If configuration is not empty, then the CodeHilite extension + is enabled, so we call into it to highlight the code. + """ + + classes = kwargs['classes'] + id_value = kwargs['id_value'] + attrs = kwargs['attrs'] + + if classes is None: # pragma: no cover + classes = [] + + # Default format options + linestep = None + linestart = None + linespecial = None + hl_lines = None + title = None + + if self.use_pygments: + if 'hl_lines' in options: + m = RE_HL_LINES.match(options['hl_lines']) + hl_lines = m.group('hl_lines') + del options['hl_lines'] + if 'linenums' in options: + m = RE_LINENUMS.match(options['linenums']) + linestart = m.group('linestart') + linestep = m.group('linestep') + linespecial = m.group('linespecial') + del options['linenums'] + if 'title' in options: + title = options['title'] + del options['title'] + + linestep = self.parse_line_step(linestep) + linestart = self.parse_line_start(linestart) + linespecial = self.parse_line_special(linespecial) + hl_lines = self.parse_hl_lines(hl_lines) + + self.highlight_ext.pygments_code_block += 1 + + el = self.highlighter( + guess_lang=self.guess_lang, + pygments_style=self.pygments_style, + use_pygments=self.use_pygments, + noclasses=self.noclasses, + linenums=self.linenums, + linenums_style=self.linenums_style, + linenums_special=self.linenums_special, + linenums_class=self.linenums_class, + extend_pygments_lang=self.extend_pygments_lang, + language_prefix=self.language_prefix, + code_attr_on_pre=self.code_attr_on_pre, + auto_title=self.auto_title, + auto_title_map=self.auto_title_map, + line_spans=self.line_spans, + line_anchors=self.line_anchors, + anchor_linenums=self.anchor_linenums, + pygments_lang_class=self.pygments_lang_class, + stripnl=self.stripnl, + default_lang=self.default_lang + ).highlight( + src, + language, + self.css_class, + hl_lines=hl_lines, + linestart=linestart, + linestep=linestep, + linespecial=linespecial, + classes=classes, + id_value=id_value, + attrs=attrs, + title=title, + code_block_count=self.highlight_ext.pygments_code_block + ) + + return el + + def _store(self, source, code, start, end): + """ + Store the fenced blocks in the stack to be replaced when done iterating. + + Store the original text in case we need to restore if we are too greedy. + """ + # Save the fenced blocks to add once we are done iterating the lines + placeholder = self.md.htmlStash.store(code) + self.stack.append(('{}{}'.format(self.ws, placeholder), start, end)) + if not self.disabled_indented: + # If an indented block consumes this placeholder, + # we can restore the original source + self.extension.stash.store( + placeholder[1:-1], + "{}\n{}{}".format(self.first, self.normalize_ws(source), self.last), + self.ws_virtual_len + ) + + def reindent(self, text, pos, level): + """Reindent the code to where it is supposed to be.""" + + indented = [] + for line in text.split('\n'): + index = pos - level + indented.append(line[index:]) + return indented + + def restore_raw_text(self, lines): + """Revert a prematurely converted fenced block.""" + + new_lines = [] + for line in lines: + m = FENCED_BLOCK_RE.match(line) + if m: + key = m.group(2) + indent_level = len(m.group(1)) + original = None + original, pos = self.extension.stash.get(key, (None, None)) + if original is not None: + code = self.reindent(original, pos, indent_level) + new_lines.extend(code) + self.extension.stash.remove(key) + if original is None: # pragma: no cover + # Too much work to test this. This is just a fall back in case + # we find a placeholder, and we went to revert it and it wasn't in our stash. + # Most likely this would be caused by someone else. We just want to put it + # back in the block if we can't revert it. Maybe we can do a more directed + # unit test in the future. + new_lines.append(line) + else: + new_lines.append(line) + return new_lines + + def run(self, lines): + """Search for fenced blocks.""" + + self.get_hl_settings() + self.clear() + self.stack = [] + self.disabled_indented = self.config.get("disable_indented_code_blocks", False) + self.preserve_tabs = self.config.get("preserve_tabs", False) + + if self.preserve_tabs: + lines = self.restore_raw_text(lines) + return self.search_nested(lines) + + +class SuperFencesRawBlockPreprocessor(SuperFencesBlockPreprocessor): + """Special class for preserving tabs before normalizing whitespace.""" + + def process_nested_block(self, ws, content, start, end): + """Process the contents of the nested block.""" + + self.last = ws + self.normalize_ws(content) + code = '\n'.join(self.code) + self._store(code + '\n', code, start, end) + self.clear() + + def _store(self, source, code, start, end): + """ + Store the fenced blocks in the stack to be replaced when done iterating. + + Store the original text in case we need to restore if we are too greedy. + """ + # Just get a placeholder, we won't ever actually retrieve this source + placeholder = self.md.htmlStash.store('') + self.stack.append(('{}{}'.format(self.ws, placeholder), start, end)) + # Here is the source we'll actually retrieve. + self.extension.stash.store( + placeholder[1:-1], + "{}\n{}{}".format(self.first, source, self.last), + self.ws_virtual_len + ) + + def reassemble(self, lines): + """Reassemble text.""" + + # Now that we are done iterating the lines, + # let's replace the original content with the + # fenced blocks. + while len(self.stack): + fenced, start, end = self.stack.pop() + lines = lines[:start] + [fenced.replace(md_util.STX, SOH, 1)[:-1] + EOT] + lines[end:] + return lines + + def run(self, lines): + """Search for fenced blocks.""" + + self.get_hl_settings() + self.clear() + self.stack = [] + self.disabled_indented = self.config.get("disable_indented_code_blocks", False) + return self.search_nested(lines) + + +class SuperFencesCodeBlockProcessor(CodeBlockProcessor): + """Process indented code blocks to see if we accidentally processed its content as a fenced block.""" + + def test(self, parent, block): + """Test method that is one day to be deprecated.""" + + return True + + def reindent(self, text, pos, level): + """Reindent the code to where it is supposed to be.""" + + indented = [] + for line in text.split('\n'): + index = pos - level + indented.append(line[index:]) + return '\n'.join(indented) + + def revert_greedy_fences(self, block): + """Revert a prematurely converted fenced block.""" + + new_block = [] + for line in block.split('\n'): + m = FENCED_BLOCK_RE.match(line) + if m: + key = m.group(2) + indent_level = len(m.group(1)) + original = None + original, pos = self.extension.stash.get(key, (None, None)) + if original is not None: + code = self.reindent(original, pos, indent_level) + new_block.append(code) + self.extension.stash.remove(key) + if original is None: # pragma: no cover + # Too much work to test this. This is just a fall back in case + # we find a placeholder, and we went to revert it and it wasn't in our stash. + # Most likely this would be caused by someone else. We just want to put it + # back in the block if we can't revert it. Maybe we can do a more directed + # unit test in the future. + new_block.append(line) + else: + new_block.append(line) + return '\n'.join(new_block) + + def run(self, parent, blocks): + """Look for and parse code block.""" + + handled = False + + if not self.config.get("disable_indented_code_blocks", False): + handled = CodeBlockProcessor.test(self, parent, blocks[0]) + if handled: + if self.config.get("nested", True): + blocks[0] = self.revert_greedy_fences(blocks[0]) + handled = CodeBlockProcessor.run(self, parent, blocks) is not False + return handled + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return SuperFencesCodeExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/tabbed.py b/micromamba_root/Lib/site-packages/pymdownx/tabbed.py new file mode 100644 index 0000000000000000000000000000000000000000..858fbf3da63a530ebcbea20367e07197b99e828a --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/tabbed.py @@ -0,0 +1,427 @@ +""" +Tabbed. + +pymdownx.tabbed + +MIT license. + +Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.blockprocessors import BlockProcessor +from markdown.treeprocessors import Treeprocessor +from markdown.extensions import toc +import xml.etree.ElementTree as etree +import re +import html + +HEADERS = {'h1', 'h2', 'h3', 'h4', 'h5', 'h6'} + + +class TabbedProcessor(BlockProcessor): + """Tabbed block processor.""" + + START = re.compile( + r'(?:^|\n)={3}(\+|\+!|!\+|!)? +"(.*?)" *(?:\n|$)' + ) + COMPRESS_SPACES = re.compile(r' {2,}') + + def __init__(self, parser, config): + """Initialize.""" + + super().__init__(parser) + self.tab_group_count = 0 + self.current_sibling = None + self.content_indention = 0 + self.alternate_style = config['alternate_style'] + self.slugify = callable(config['slugify']) + + def detab_by_length(self, text, length): + """Remove a tab from the front of each line of the given text.""" + + newtext = [] + lines = text.split('\n') + for line in lines: + if line.startswith(' ' * length): + newtext.append(line[length:]) + elif not line.strip(): + newtext.append('') # pragma: no cover + else: + break + return '\n'.join(newtext), '\n'.join(lines[len(newtext):]) + + def parse_content(self, parent, block): + """ + Get sibling tab. + + Retrieve the appropriate sibling element. This can get tricky when + dealing with lists. + + """ + + old_block = block + non_tabs = '' + tabbed_set = 'tabbed-set' if not self.alternate_style else 'tabbed-set tabbed-alternate' + + # We already acquired the block via test + if self.current_sibling is not None: + sibling = self.current_sibling + block, non_tabs = self.detab_by_length(block, self.content_indent) + self.current_sibling = None + self.content_indent = 0 + return sibling, block, non_tabs + + sibling = self.lastChild(parent) + + if sibling is None or sibling.tag.lower() != 'div' or sibling.attrib.get('class', '') != tabbed_set: + sibling = None + else: + # If the last child is a list and the content is indented sufficient + # to be under it, then the content's is sibling is in the list. + if self.alternate_style: + last_child = self.lastChild(self.lastChild(sibling)) + tabbed_content = 'tabbed-block' + else: + last_child = self.lastChild(sibling) + tabbed_content = 'tabbed-content' + child_class = last_child.attrib.get('class', '') if last_child is not None else '' + indent = 0 + while last_child is not None: + if ( + sibling is not None and block.startswith(' ' * self.tab_length * 2) and + last_child is not None and ( + last_child.tag in ('ul', 'ol', 'dl') or + ( + last_child.tag == 'div' and + child_class == tabbed_content + ) + ) + ): + + # Handle nested tabbed content + if last_child.tag == 'div' and child_class == tabbed_content: + temp_child = self.lastChild(last_child) + if temp_child is None or temp_child.tag not in ('ul', 'ol', 'dl'): + break + last_child = temp_child + child_class = last_child.attrib.get('class', '') if last_child is not None else '' + + # The expectation is that we'll find an `<li>`. + # We should get it's last child as well. + sibling = self.lastChild(last_child) + last_child = self.lastChild(sibling) if sibling is not None else None + child_class = last_child.attrib.get('class', '') if last_child is not None else '' + + # Context has been lost at this point, so we must adjust the + # text's indentation level so it will be evaluated correctly + # under the list. + block = block[self.tab_length:] + indent += self.tab_length + else: + last_child = None + + if not block.startswith(' ' * self.tab_length): + sibling = None + + if sibling is not None: + indent += self.tab_length + block, non_tabs = self.detab_by_length(old_block, indent) + self.current_sibling = sibling + self.content_indent = indent + + return sibling, block, non_tabs + + def test(self, parent, block): + """Test block.""" + + if self.START.search(block): + return True + else: + return self.parse_content(parent, block)[0] is not None + + def run(self, parent, blocks): + """Convert to tabbed block.""" + + block = blocks.pop(0) + m = self.START.search(block) + tabbed_set = 'tabbed-set' if not self.alternate_style else 'tabbed-set tabbed-alternate' + + if m: + # removes the first line + if m.start() > 0: + self.parser.parseBlocks(parent, [block[:m.start()]]) + block = block[m.end():] + sibling = self.lastChild(parent) + block, non_tabs = self.detab(block) + else: + sibling, block, non_tabs = self.parse_content(parent, block) + + if m: + special = m.group(1) if m.group(1) else '' + title = m.group(2) if m.group(2) else m.group(3) + index = 0 + labels = None + content = None + + if ( + sibling is not None and sibling.tag.lower() == 'div' and + sibling.attrib.get('class', '') == tabbed_set and + '!' not in special + ): + first = False + tab_group = sibling + if self.alternate_style: + index = [index for index, _ in enumerate(tab_group.findall('input'), 1)][-1] + for d in tab_group.findall('div'): + if d.attrib['class'] == 'tabbed-labels': + labels = d + elif d.attrib['class'] == 'tabbed-content': + content = d + if labels is not None and content is not None: + break + else: + first = True + self.tab_group_count += 1 + tab_group = etree.SubElement( + parent, + 'div', + {'class': tabbed_set, 'data-tabs': '%d:0' % self.tab_group_count} + ) + if self.alternate_style: + labels = etree.SubElement( + tab_group, + 'div', + {'class': 'tabbed-labels'} + ) + content = etree.SubElement( + tab_group, + 'div', + {'class': 'tabbed-content'} + ) + + data = tab_group.attrib['data-tabs'].split(':') + tab_set = int(data[0]) + tab_count = int(data[1]) + 1 + + attributes = { + "name": "__tabbed_%d" % tab_set, + "type": "radio" + } + + if not self.slugify: + attributes['id'] = "__tabbed_%d_%d" % (tab_set, tab_count) + + if first or '+' in special: + attributes['checked'] = 'checked' + # Remove any previously assigned "checked states" to siblings + for i in tab_group.findall('input'): + if i.attrib.get('name', '') == f'__tabbed_{tab_set}': + if 'checked' in i.attrib: + del i.attrib['checked'] + + attributes2 = {"for": "__tabbed_%d_%d" % (tab_set, tab_count)} if not self.slugify else {} + + if self.alternate_style: + input_el = etree.Element( + 'input', + attributes + ) + tab_group.insert(index, input_el) + lab = etree.SubElement( + labels, + "label", + attributes2 + ) + lab.text = title + + div = etree.SubElement( + content, + "div", + {'class': 'tabbed-block'} + ) + else: + etree.SubElement( + tab_group, + 'input', + attributes + ) + lab = etree.SubElement( + tab_group, + "label", + attributes2 + ) + lab.text = title + + div = etree.SubElement( + tab_group, + "div", + { + "class": "tabbed-content" + } + ) + + tab_group.attrib['data-tabs'] = '%d:%d' % (tab_set, tab_count) + else: + if sibling.tag in ('li', 'dd') and sibling.text: + # Sibling is a list item, but we need to wrap it's content should be wrapped in <p> + text = sibling.text + sibling.text = '' + p = etree.SubElement(sibling, 'p') + p.text = text + div = sibling + elif sibling.tag == 'div' and sibling.attrib.get('class', '') == tabbed_set: + # Get `tabbed-content` under `tabbed-set` + if self.alternate_style: + div = self.lastChild(self.lastChild(sibling)) + else: + div = self.lastChild(sibling) + else: + # Pass anything else as the parent + div = sibling + + self.parser.parseChunk(div, block) + + if non_tabs: + # Insert the tabbed content back into blocks + blocks.insert(0, non_tabs) + + +class TabbedTreeprocessor(Treeprocessor): + """Tab tree processor.""" + + def __init__(self, md, config): + """Initialize.""" + + super().__init__(md) + + self.slugify = config["slugify"] + self.alternate = config["alternate_style"] + self.sep = config["separator"] + self.combine_header_slug = config["combine_header_slug"] + + def get_parent_header_slug(self, root, header_map, parent_map, el): + """Attempt retrieval of parent header slug.""" + + parent = el + last_parent = parent + while parent is not root: + last_parent = parent + parent = parent_map[parent] + if parent in header_map: + headers = header_map[parent] + header = None + for i in list(parent): + if i is el and header is None: + break + if i is last_parent and header is not None: + return header.attrib.get("id", '') + if i in headers: + header = i + return '' + + def run(self, doc): + """Update tab IDs.""" + + # Get a list of id attributes + used_ids = set() + parent_map = {} + header_map = {} + + if self.combine_header_slug: + parent_map = {c: p for p in doc.iter() for c in p} + + for el in doc.iter(): + if "id" in el.attrib: + if self.combine_header_slug and el.tag in HEADERS: + parent = parent_map[el] + if parent in header_map: + header_map[parent].append(el) + else: + header_map[parent] = [el] + used_ids.add(el.attrib["id"]) + + for el in doc.iter(): + if isinstance(el.tag, str) and el.tag.lower() == 'div': + classes = el.attrib.get('class', '').split() + if 'tabbed-set' in classes and (not self.alternate or 'tabbed-alternate' in classes): + inputs = [] + labels = [] + if self.alternate: + for i in list(el): + if i.tag == 'input': + inputs.append(i) + if i.tag == 'div' and i.attrib.get('class', '') == 'tabbed-labels': + labels = [j for j in list(i) if j.tag == 'label'] + else: + for i in list(el): + if i.tag == 'input': + inputs.append(i) + if i.tag == 'label': + labels.append(i) + + # Generate slugged IDs + for inpt, label in zip(inputs, labels): + innerhtml = toc.render_inner_html(toc.remove_fnrefs(label), self.md) + innertext = html.unescape(toc.strip_tags(innerhtml)) + if self.combine_header_slug: + parent_slug = self.get_parent_header_slug(doc, header_map, parent_map, el) + else: + parent_slug = '' + slug = self.slugify(innertext, self.sep) + if parent_slug: + slug = parent_slug + self.sep + slug + slug = toc.unique(slug, used_ids) + inpt.attrib["id"] = slug + label.attrib["for"] = slug + + +class TabbedExtension(Extension): + """Add Tabbed extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'alternate_style': [False, "Use alternate style - Default: False"], + 'slugify': [0, "Slugify function used to create tab specific IDs - Default: None"], + 'combine_header_slug': [False, "Combine the tab slug with the slug of the parent header - Default: False"], + 'separator': ['-', "Slug separator - Default: '-'"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add Tabbed to Markdown instance.""" + md.registerExtension(self) + + config = self.getConfigs() + self.tab_processor = TabbedProcessor(md.parser, config) + md.parser.blockprocessors.register(self.tab_processor, "tabbed", 105) + if config['slugify']: + slugs = TabbedTreeprocessor(md, config) + md.treeprocessors.register(slugs, 'tab_slugs', 4) + + def reset(self): + """Reset.""" + + self.tab_processor.tab_group_count = 0 + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return TabbedExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/tasklist.py b/micromamba_root/Lib/site-packages/pymdownx/tasklist.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7cd95c6cc118c37a510e3148f83aab1d2e0e71 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/tasklist.py @@ -0,0 +1,149 @@ +""" +Tasklist. + +pymdownx.tasklist +An extension for Python Markdown. +Github style tasklists + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +from markdown import Extension +from markdown.treeprocessors import Treeprocessor +import re + +RE_CHECKBOX = re.compile(r"^(?P<checkbox> *\[(?P<state>(?:x|X| ){1})\] +)(?P<line>.*)", re.DOTALL) + + +def get_checkbox(state, custom_checkbox=False, clickable_checkbox=False): + """Get checkbox tag.""" + + if custom_checkbox: + return ( + '<label class="task-list-control">' + + '<input type="checkbox"{}{}/>'.format( + ' disabled' if not clickable_checkbox else '', + ' checked' if state.lower() == 'x' else '') + + '<span class="task-list-indicator"></span></label> ' + ) + return '<input type="checkbox"{}{}/> '.format( + ' disabled' if not clickable_checkbox else '', + ' checked' if state.lower() == 'x' else '') + + +class TasklistTreeprocessor(Treeprocessor): + """Tasklist tree processor that finds lists with checkboxes.""" + + def __init__(self, md): + """Initialize.""" + + super().__init__(md) + + def inline(self, li): + """Search for checkbox directly in `li` tag.""" + + found = False + m = RE_CHECKBOX.match(li.text) + if m is not None: + li.text = self.md.htmlStash.store( + get_checkbox(m.group('state'), self.custom_checkbox, self.clickable_checkbox) + ) + m.group('line') + found = True + return found + + def sub_paragraph(self, li): + """Search for checkbox in sub-paragraph.""" + + found = False + if len(li): + first = next(iter(li)) + if first.tag == "p" and first.text is not None: + m = RE_CHECKBOX.match(first.text) + if m is not None: + first.text = self.md.htmlStash.store( + get_checkbox(m.group('state'), self.custom_checkbox, self.clickable_checkbox) + ) + m.group('line') + found = True + return found + + def run(self, root): + """Find list items that start with [ ] or [x] or [X].""" + + self.custom_checkbox = bool(self.config["custom_checkbox"]) + self.clickable_checkbox = bool(self.config["clickable_checkbox"]) + parent_map = {c: p for p in root.iter() for c in p} + task_items = [] + lilinks = root.iter('li') + for li in lilinks: + if li.text is None or li.text == "": + if not self.sub_paragraph(li): + continue + elif not self.inline(li): + continue + + # Checkbox found + c = li.attrib.get("class", "") + classes = [] if c == "" else c.split() + classes.append("task-list-item") + li.attrib["class"] = ' '.join(classes) + task_items.append(li) + + for li in task_items: + parent = parent_map[li] + c = parent.attrib.get("class", "") + classes = [] if c == "" else c.split() + if "task-list" not in classes: + classes.append("task-list") + parent.attrib["class"] = ' '.join(classes) + return root + + +class TasklistExtension(Extension): + """Tasklist extension.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'custom_checkbox': [ + False, + "Add an empty label tag after the input tag to allow for custom styling - Default: False" + ], + 'clickable_checkbox': [ + False, + "Allow user to check/uncheck the checkbox - Default: False" + ], + 'delete': [True, "Enable delete - Default: True"], + 'subscript': [True, "Enable subscript - Default: True"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Add checklist tree processor to Markdown instance.""" + + tasklist = TasklistTreeprocessor(md) + tasklist.config = self.getConfigs() + md.treeprocessors.register(tasklist, "task-list", 25) + md.registerExtension(self) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return TasklistExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/tilde.py b/micromamba_root/Lib/site-packages/pymdownx/tilde.py new file mode 100644 index 0000000000000000000000000000000000000000..e58c1f6a7ccc72240d68d70b8dc5fcff70ae8032 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/tilde.py @@ -0,0 +1,185 @@ +""" +Tilde. + +pymdownx.tilde +Really simple plugin to add support for +`<del>test</del>` tags as `~~test~~` and +`<sub>test</sub>` tags as `~test~` + +MIT license. + +Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +""" +import re +from markdown import Extension +from markdown.inlinepatterns import SimpleTextInlineProcessor +from . import util + +SMART_CONTENT = r'(.+?~*?)' +SMART_LIMITED_CONTENT = r'((?:[^~]|(?<=\w)~+?(?=\w)|(?<=\s)~+?(?=\s))+?)' +CONTENT = r'(~|[^\s]+?)' +CONTENT2 = r'((?:[^~]|(?<!~{2})~)+?)' + +# Avoid starting a pattern with tilde tokens that are surrounded by white space. +NOT_TILDE = r'((^|(?<=\s))(~+)(?=\s|$))' + +# `~~~del,sub~~~` +DEL_SUB = r'(~{3})(?!\s)(~{1,2}|[^~\s]+?)(?<!\s)\1' +# `~~~del,sub~del~~` +DEL_SUB2 = r'(~{{3}})(?![\s~]){}(?<!\s)~{}(?<!\s)~{{2}}'.format(CONTENT, CONTENT2) +# `~~~sub,del~~sub~` +SUB_DEL = r'(~{{3}})(?![\s~]){}(?<!\s)~{{2}}{}(?<!\s)~'.format(CONTENT, CONTENT) +# `~~del~sub,del~~~` +DEL_SUB3 = r'(~{{2}})(?![\s~]){}~(?![\s~]){}(?<!\s)~{{3}}'.format(CONTENT2, CONTENT) +# `~~del~~` +DEL = r'(~{{2}})(?!\s){}(?<!\s)\1'.format(CONTENT2) +# `~sub~` +SUB = r'(~)(?!\s){}(?<!\s)\1'.format(CONTENT) +# `~sub ~~sub,del~~~` +SUB_DEL2 = r'(?<!~)(~)(?![~\s]){}~{{2}}{}~{{3}}'.format(CONTENT, CONTENT) +# Prioritize ~value~ when ~~value~~ is nested within +SUB2 = r'(?<!~)(~)(?![~\s])((?:[^\s~]|~{2,})+?)(?<![~\s])(~)(?!~)' + +# Smart rules for when "smart tilde" is enabled +# SMART: `~~~del,sub~~~` +SMART_DEL_SUB = r'(~{{3}})(?![\s~]){}(?<!\s)\1'.format(CONTENT) +# SMART: `~~~del,sub~ del~~` +SMART_DEL_SUB2 = \ + r'(~{{3}})(?![\s~]){}(?<!\s)~(?:(?=_)|(?![\w~])){}(?<!\s)~{{2}}'.format( + CONTENT, SMART_LIMITED_CONTENT + ) +# SMART: `~~~sub,del~~ sub~` +SMART_SUB_DEL = \ + r'(~{{3}})(?![\s~]){}(?<!\s)~{{2}}(?:(?=_)|(?![\w~])){}(?<!\s)~'.format( + CONTENT, CONTENT + ) +# SMART: `~~del~~` +SMART_DEL = r'(?:(?<=_)|(?<![\w~]))(~{{2}})(?![\s~]){}(?<!\s)\1(?:(?=_)|(?![\w~]))'.format(SMART_CONTENT) +# SMART: `~sub ~~sub,del~~~` +SMART_SUB_DEL2 = \ + r'(?<!~)(~)(?![\s~]){}(?:(?<=_)|(?<![\w~]))~{{2}}(?![\s~]){}(?<!\s)~{{3}}'.format( + CONTENT, CONTENT + ) +# SMART: `~sub ~~sub,del~~~` +SMART_DEL_SUB3 = \ + r'(?<!~)(~{{2}})(?![\s~]){}(?:(?<=_)|(?<![\w~]))~(?![\s~]){}(?<!\s)~{{3}}'.format( + SMART_LIMITED_CONTENT, CONTENT + ) + + +class TildeProcessor(util.PatternSequenceProcessor): + """Emphasis processor for handling delete and subscript matches.""" + + PATTERNS = [ + util.PatSeqItem(re.compile(DEL_SUB, re.DOTALL | re.UNICODE), 'double', 'del,sub'), + util.PatSeqItem(re.compile(SUB_DEL, re.DOTALL | re.UNICODE), 'double', 'sub,del'), + util.PatSeqItem(re.compile(DEL_SUB2, re.DOTALL | re.UNICODE), 'double', 'del,sub'), + util.PatSeqItem(re.compile(DEL_SUB3, re.DOTALL | re.UNICODE), 'double2', 'del,sub'), + util.PatSeqItem(re.compile(DEL, re.DOTALL | re.UNICODE), 'single', 'del'), + util.PatSeqItem(re.compile(SUB_DEL2, re.DOTALL | re.UNICODE), 'double2', 'sub,del'), + util.PatSeqItem(re.compile(SUB2, re.DOTALL | re.UNICODE), 'single', 'sub', True), + util.PatSeqItem(re.compile(SUB, re.DOTALL | re.UNICODE), 'single', 'sub') + ] + + +class TildeSmartProcessor(util.PatternSequenceProcessor): + """Smart delete and subscript processor.""" + + PATTERNS = [ + util.PatSeqItem(re.compile(SMART_DEL_SUB, re.DOTALL | re.UNICODE), 'double', 'del,sub'), + util.PatSeqItem(re.compile(SMART_SUB_DEL, re.DOTALL | re.UNICODE), 'double', 'sub,del'), + util.PatSeqItem(re.compile(SMART_DEL_SUB2, re.DOTALL | re.UNICODE), 'double', 'del,sub'), + util.PatSeqItem(re.compile(SMART_DEL_SUB3, re.DOTALL | re.UNICODE), 'double2', 'del,sub'), + util.PatSeqItem(re.compile(SMART_DEL, re.DOTALL | re.UNICODE), 'single', 'del'), + util.PatSeqItem(re.compile(SMART_SUB_DEL2, re.DOTALL | re.UNICODE), 'double2', 'sub,del'), + util.PatSeqItem(re.compile(SUB2, re.DOTALL | re.UNICODE), 'single', 'sub', True), + util.PatSeqItem(re.compile(SUB, re.DOTALL | re.UNICODE), 'single', 'sub') + ] + + +class TildeSubProcessor(util.PatternSequenceProcessor): + """Just subscript processor.""" + + PATTERNS = [ + util.PatSeqItem(re.compile(SUB, re.DOTALL | re.UNICODE), 'single', 'sub') + ] + + +class TildeDeleteProcessor(util.PatternSequenceProcessor): + """Just delete processor.""" + + PATTERNS = [ + util.PatSeqItem(re.compile(DEL, re.DOTALL | re.UNICODE), 'single', 'del') + ] + + +class TildeSmartDeleteProcessor(util.PatternSequenceProcessor): + """Just smart delete processor.""" + + PATTERNS = [ + util.PatSeqItem(re.compile(SMART_DEL, re.DOTALL | re.UNICODE), 'single', 'del') + ] + + +class DeleteSubExtension(Extension): + """Add delete and/or subscript extension to Markdown class.""" + + def __init__(self, *args, **kwargs): + """Initialize.""" + + self.config = { + 'smart_delete': [True, "Treat ~~connected~~words~~ intelligently - Default: True"], + 'delete': [True, "Enable delete - Default: True"], + 'subscript': [True, "Enable subscript - Default: True"] + } + + super().__init__(*args, **kwargs) + + def extendMarkdown(self, md): + """Insert `<del>test</del>` tags as `~~test~~` and `<sub>test</sub>` tags as `~test~`.""" + + config = self.getConfigs() + delete = bool(config.get('delete', True)) + subscript = bool(config.get('subscript', True)) + smart = bool(config.get('smart_delete', True)) + + md.registerExtension(self) + + escape_chars = [] + if delete or subscript: + escape_chars.append('~') + if subscript: + escape_chars.append(' ') + util.escape_chars(md, escape_chars) + + tilde = None + md.inlinePatterns.register(SimpleTextInlineProcessor(NOT_TILDE), 'not_tilde', 70) + if delete and subscript: + tilde = TildeSmartProcessor(r'~') if smart else TildeProcessor(r'~') + elif delete: + tilde = TildeSmartDeleteProcessor(r'~') if smart else TildeDeleteProcessor(r'~') + elif subscript: + tilde = TildeSubProcessor(r'~') + + if tilde is not None: + md.inlinePatterns.register(tilde, "sub_del", 65) + + +def makeExtension(*args, **kwargs): + """Return extension.""" + + return DeleteSubExtension(*args, **kwargs) diff --git a/micromamba_root/Lib/site-packages/pymdownx/twemoji_db.py b/micromamba_root/Lib/site-packages/pymdownx/twemoji_db.py new file mode 100644 index 0000000000000000000000000000000000000000..ba932da956bbc12bf8578f3300c3c56c6aea1fb9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/twemoji_db.py @@ -0,0 +1,21637 @@ +"""Twemoji autogen. + +Names from emojione database. Do not edit by hand. +""" +version = "v16.0.1" +index_version = "10.0.0" +name = "twemoji" +emoji = { + ":100:": { + "category": "symbols", + "name": "hundred points", + "unicode": "1f4af" + }, + ":1234:": { + "category": "symbols", + "name": "input numbers", + "unicode": "1f522" + }, + ":8ball:": { + "category": "activity", + "name": "pool 8 ball", + "unicode": "1f3b1" + }, + ":a:": { + "category": "symbols", + "name": "A button (blood type)", + "unicode": "1f170" + }, + ":ab:": { + "category": "symbols", + "name": "AB button (blood type)", + "unicode": "1f18e" + }, + ":abacus:": { + "category": "objects", + "name": "abacus", + "unicode": "1f9ee" + }, + ":abc:": { + "category": "symbols", + "name": "input latin letters", + "unicode": "1f524" + }, + ":abcd:": { + "category": "symbols", + "name": "input latin lowercase", + "unicode": "1f521" + }, + ":accept:": { + "category": "symbols", + "name": "Japanese \u201cacceptable\u201d button", + "unicode": "1f251" + }, + ":accordion:": { + "category": "activity", + "name": "accordion", + "unicode": "1fa97" + }, + ":adhesive_bandage:": { + "category": "objects", + "name": "adhesive bandage", + "unicode": "1fa79" + }, + ":adult:": { + "category": "people", + "name": "person", + "unicode": "1f9d1" + }, + ":adult_tone1:": { + "category": "people", + "name": "person: light skin tone", + "unicode": "1f9d1-1f3fb" + }, + ":adult_tone2:": { + "category": "people", + "name": "person: medium-light skin tone", + "unicode": "1f9d1-1f3fc" + }, + ":adult_tone3:": { + "category": "people", + "name": "person: medium skin tone", + "unicode": "1f9d1-1f3fd" + }, + ":adult_tone4:": { + "category": "people", + "name": "person: medium-dark skin tone", + "unicode": "1f9d1-1f3fe" + }, + ":adult_tone5:": { + "category": "people", + "name": "person: dark skin tone", + "unicode": "1f9d1-1f3ff" + }, + ":aerial_tramway:": { + "category": "travel", + "name": "aerial tramway", + "unicode": "1f6a1" + }, + ":airplane:": { + "category": "travel", + "name": "airplane", + "unicode": "2708" + }, + ":airplane_arriving:": { + "category": "travel", + "name": "airplane arrival", + "unicode": "1f6ec" + }, + ":airplane_departure:": { + "category": "travel", + "name": "airplane departure", + "unicode": "1f6eb" + }, + ":airplane_small:": { + "category": "travel", + "name": "small airplane", + "unicode": "1f6e9" + }, + ":alarm_clock:": { + "category": "objects", + "name": "alarm clock", + "unicode": "23f0" + }, + ":alembic:": { + "category": "objects", + "name": "alembic", + "unicode": "2697" + }, + ":alien:": { + "category": "people", + "name": "alien", + "unicode": "1f47d" + }, + ":ambulance:": { + "category": "travel", + "name": "ambulance", + "unicode": "1f691" + }, + ":amphora:": { + "category": "objects", + "name": "amphora", + "unicode": "1f3fa" + }, + ":anatomical_heart:": { + "category": "people", + "name": "anatomical heart", + "unicode": "1fac0" + }, + ":anchor:": { + "category": "travel", + "name": "anchor", + "unicode": "2693" + }, + ":angel:": { + "category": "people", + "name": "baby angel", + "unicode": "1f47c" + }, + ":angel_tone1:": { + "category": "people", + "name": "baby angel: light skin tone", + "unicode": "1f47c-1f3fb" + }, + ":angel_tone2:": { + "category": "people", + "name": "baby angel: medium-light skin tone", + "unicode": "1f47c-1f3fc" + }, + ":angel_tone3:": { + "category": "people", + "name": "baby angel: medium skin tone", + "unicode": "1f47c-1f3fd" + }, + ":angel_tone4:": { + "category": "people", + "name": "baby angel: medium-dark skin tone", + "unicode": "1f47c-1f3fe" + }, + ":angel_tone5:": { + "category": "people", + "name": "baby angel: dark skin tone", + "unicode": "1f47c-1f3ff" + }, + ":anger:": { + "category": "symbols", + "name": "anger symbol", + "unicode": "1f4a2" + }, + ":anger_right:": { + "category": "symbols", + "name": "right anger bubble", + "unicode": "1f5ef" + }, + ":angry:": { + "category": "people", + "name": "angry face", + "unicode": "1f620" + }, + ":anguished:": { + "category": "people", + "name": "anguished face", + "unicode": "1f627" + }, + ":ant:": { + "category": "nature", + "name": "ant", + "unicode": "1f41c" + }, + ":apple:": { + "category": "food", + "name": "red apple", + "unicode": "1f34e" + }, + ":aquarius:": { + "category": "symbols", + "name": "Aquarius", + "unicode": "2652" + }, + ":aries:": { + "category": "symbols", + "name": "Aries", + "unicode": "2648" + }, + ":arrow_backward:": { + "category": "symbols", + "name": "reverse button", + "unicode": "25c0" + }, + ":arrow_double_down:": { + "category": "symbols", + "name": "fast down button", + "unicode": "23ec" + }, + ":arrow_double_up:": { + "category": "symbols", + "name": "fast up button", + "unicode": "23eb" + }, + ":arrow_down:": { + "category": "symbols", + "name": "down arrow", + "unicode": "2b07" + }, + ":arrow_down_small:": { + "category": "symbols", + "name": "downwards button", + "unicode": "1f53d" + }, + ":arrow_forward:": { + "category": "symbols", + "name": "play button", + "unicode": "25b6" + }, + ":arrow_heading_down:": { + "category": "symbols", + "name": "right arrow curving down", + "unicode": "2935" + }, + ":arrow_heading_up:": { + "category": "symbols", + "name": "right arrow curving up", + "unicode": "2934" + }, + ":arrow_left:": { + "category": "symbols", + "name": "left arrow", + "unicode": "2b05" + }, + ":arrow_lower_left:": { + "category": "symbols", + "name": "down-left arrow", + "unicode": "2199" + }, + ":arrow_lower_right:": { + "category": "symbols", + "name": "down-right arrow", + "unicode": "2198" + }, + ":arrow_right:": { + "category": "symbols", + "name": "right arrow", + "unicode": "27a1" + }, + ":arrow_right_hook:": { + "category": "symbols", + "name": "left arrow curving right", + "unicode": "21aa" + }, + ":arrow_up:": { + "category": "symbols", + "name": "up arrow", + "unicode": "2b06" + }, + ":arrow_up_down:": { + "category": "symbols", + "name": "up-down arrow", + "unicode": "2195" + }, + ":arrow_up_small:": { + "category": "symbols", + "name": "upwards button", + "unicode": "1f53c" + }, + ":arrow_upper_left:": { + "category": "symbols", + "name": "up-left arrow", + "unicode": "2196" + }, + ":arrow_upper_right:": { + "category": "symbols", + "name": "up-right arrow", + "unicode": "2197" + }, + ":arrows_clockwise:": { + "category": "symbols", + "name": "clockwise vertical arrows", + "unicode": "1f503" + }, + ":arrows_counterclockwise:": { + "category": "symbols", + "name": "counterclockwise arrows button", + "unicode": "1f504" + }, + ":art:": { + "category": "activity", + "name": "artist palette", + "unicode": "1f3a8" + }, + ":articulated_lorry:": { + "category": "travel", + "name": "articulated lorry", + "unicode": "1f69b" + }, + ":artist:": { + "category": "people", + "name": "artist", + "unicode": "1f9d1-200d-1f3a8" + }, + ":artist_tone1:": { + "category": "people", + "name": "artist: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f3a8" + }, + ":artist_tone2:": { + "category": "people", + "name": "artist: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f3a8" + }, + ":artist_tone3:": { + "category": "people", + "name": "artist: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f3a8" + }, + ":artist_tone4:": { + "category": "people", + "name": "artist: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f3a8" + }, + ":artist_tone5:": { + "category": "people", + "name": "artist: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f3a8" + }, + ":asterisk:": { + "category": "symbols", + "name": "keycap: asterisk", + "unicode": "2a-20e3", + "unicode_alt": "002a-20e3" + }, + ":astonished:": { + "category": "people", + "name": "astonished face", + "unicode": "1f632" + }, + ":astronaut:": { + "category": "people", + "name": "astronaut", + "unicode": "1f9d1-200d-1f680" + }, + ":astronaut_tone1:": { + "category": "people", + "name": "astronaut: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f680" + }, + ":astronaut_tone2:": { + "category": "people", + "name": "astronaut: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f680" + }, + ":astronaut_tone3:": { + "category": "people", + "name": "astronaut: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f680" + }, + ":astronaut_tone4:": { + "category": "people", + "name": "astronaut: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f680" + }, + ":astronaut_tone5:": { + "category": "people", + "name": "astronaut: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f680" + }, + ":athletic_shoe:": { + "category": "people", + "name": "running shoe", + "unicode": "1f45f" + }, + ":atm:": { + "category": "symbols", + "name": "ATM sign", + "unicode": "1f3e7" + }, + ":atom:": { + "category": "symbols", + "name": "atom symbol", + "unicode": "269b" + }, + ":auto_rickshaw:": { + "category": "travel", + "name": "auto rickshaw", + "unicode": "1f6fa" + }, + ":avocado:": { + "category": "food", + "name": "avocado", + "unicode": "1f951" + }, + ":axe:": { + "category": "objects", + "name": "axe", + "unicode": "1fa93" + }, + ":b:": { + "category": "symbols", + "name": "B button (blood type)", + "unicode": "1f171" + }, + ":baby:": { + "category": "people", + "name": "baby", + "unicode": "1f476" + }, + ":baby_bottle:": { + "category": "food", + "name": "baby bottle", + "unicode": "1f37c" + }, + ":baby_chick:": { + "category": "nature", + "name": "baby chick", + "unicode": "1f424" + }, + ":baby_symbol:": { + "category": "symbols", + "name": "baby symbol", + "unicode": "1f6bc" + }, + ":baby_tone1:": { + "category": "people", + "name": "baby: light skin tone", + "unicode": "1f476-1f3fb" + }, + ":baby_tone2:": { + "category": "people", + "name": "baby: medium-light skin tone", + "unicode": "1f476-1f3fc" + }, + ":baby_tone3:": { + "category": "people", + "name": "baby: medium skin tone", + "unicode": "1f476-1f3fd" + }, + ":baby_tone4:": { + "category": "people", + "name": "baby: medium-dark skin tone", + "unicode": "1f476-1f3fe" + }, + ":baby_tone5:": { + "category": "people", + "name": "baby: dark skin tone", + "unicode": "1f476-1f3ff" + }, + ":back:": { + "category": "symbols", + "name": "BACK arrow", + "unicode": "1f519" + }, + ":bacon:": { + "category": "food", + "name": "bacon", + "unicode": "1f953" + }, + ":badger:": { + "category": "nature", + "name": "badger", + "unicode": "1f9a1" + }, + ":badminton:": { + "category": "activity", + "name": "badminton", + "unicode": "1f3f8" + }, + ":bagel:": { + "category": "food", + "name": "bagel", + "unicode": "1f96f" + }, + ":baggage_claim:": { + "category": "symbols", + "name": "baggage claim", + "unicode": "1f6c4" + }, + ":bald:": { + "category": "people", + "name": "bald", + "unicode": "1f9b2" + }, + ":ballet_shoes:": { + "category": "activity", + "name": "ballet shoes", + "unicode": "1fa70" + }, + ":balloon:": { + "category": "objects", + "name": "balloon", + "unicode": "1f388" + }, + ":ballot_box:": { + "category": "objects", + "name": "ballot box with ballot", + "unicode": "1f5f3" + }, + ":ballot_box_with_check:": { + "category": "symbols", + "name": "check box with check", + "unicode": "2611" + }, + ":bamboo:": { + "category": "nature", + "name": "pine decoration", + "unicode": "1f38d" + }, + ":banana:": { + "category": "food", + "name": "banana", + "unicode": "1f34c" + }, + ":bangbang:": { + "category": "symbols", + "name": "double exclamation mark", + "unicode": "203c" + }, + ":banjo:": { + "category": "activity", + "name": "banjo", + "unicode": "1fa95" + }, + ":bank:": { + "category": "travel", + "name": "bank", + "unicode": "1f3e6" + }, + ":bar_chart:": { + "category": "objects", + "name": "bar chart", + "unicode": "1f4ca" + }, + ":barber:": { + "category": "objects", + "name": "barber pole", + "unicode": "1f488" + }, + ":baseball:": { + "category": "activity", + "name": "baseball", + "unicode": "26be" + }, + ":basket:": { + "category": "objects", + "name": "basket", + "unicode": "1f9fa" + }, + ":basketball:": { + "category": "activity", + "name": "basketball", + "unicode": "1f3c0" + }, + ":bat:": { + "category": "nature", + "name": "bat", + "unicode": "1f987" + }, + ":bath:": { + "category": "objects", + "name": "person taking bath", + "unicode": "1f6c0" + }, + ":bath_tone1:": { + "category": "objects", + "name": "person taking bath: light skin tone", + "unicode": "1f6c0-1f3fb" + }, + ":bath_tone2:": { + "category": "objects", + "name": "person taking bath: medium-light skin tone", + "unicode": "1f6c0-1f3fc" + }, + ":bath_tone3:": { + "category": "objects", + "name": "person taking bath: medium skin tone", + "unicode": "1f6c0-1f3fd" + }, + ":bath_tone4:": { + "category": "objects", + "name": "person taking bath: medium-dark skin tone", + "unicode": "1f6c0-1f3fe" + }, + ":bath_tone5:": { + "category": "objects", + "name": "person taking bath: dark skin tone", + "unicode": "1f6c0-1f3ff" + }, + ":bathtub:": { + "category": "objects", + "name": "bathtub", + "unicode": "1f6c1" + }, + ":battery:": { + "category": "objects", + "name": "battery", + "unicode": "1f50b" + }, + ":beach:": { + "category": "travel", + "name": "beach with umbrella", + "unicode": "1f3d6" + }, + ":beach_umbrella:": { + "category": "travel", + "name": "umbrella on ground", + "unicode": "26f1" + }, + ":beans:": { + "category": "food", + "name": "beans", + "unicode": "1fad8" + }, + ":bear:": { + "category": "nature", + "name": "bear", + "unicode": "1f43b" + }, + ":bearded_person:": { + "category": "people", + "name": "person: beard", + "unicode": "1f9d4" + }, + ":bearded_person_tone1:": { + "category": "people", + "name": "bearded person: light skin tone", + "unicode": "1f9d4-1f3fb" + }, + ":bearded_person_tone2:": { + "category": "people", + "name": "bearded person: medium-light skin tone", + "unicode": "1f9d4-1f3fc" + }, + ":bearded_person_tone3:": { + "category": "people", + "name": "bearded person: medium skin tone", + "unicode": "1f9d4-1f3fd" + }, + ":bearded_person_tone4:": { + "category": "people", + "name": "bearded person: medium-dark skin tone", + "unicode": "1f9d4-1f3fe" + }, + ":bearded_person_tone5:": { + "category": "people", + "name": "bearded person: dark skin tone", + "unicode": "1f9d4-1f3ff" + }, + ":beaver:": { + "category": "nature", + "name": "beaver", + "unicode": "1f9ab" + }, + ":bed:": { + "category": "objects", + "name": "bed", + "unicode": "1f6cf" + }, + ":bee:": { + "category": "nature", + "name": "honeybee", + "unicode": "1f41d" + }, + ":beer:": { + "category": "food", + "name": "beer mug", + "unicode": "1f37a" + }, + ":beers:": { + "category": "food", + "name": "clinking beer mugs", + "unicode": "1f37b" + }, + ":beetle:": { + "category": "nature", + "name": "beetle", + "unicode": "1fab2" + }, + ":beginner:": { + "category": "symbols", + "name": "Japanese symbol for beginner", + "unicode": "1f530" + }, + ":bell:": { + "category": "symbols", + "name": "bell", + "unicode": "1f514" + }, + ":bell_pepper:": { + "category": "food", + "name": "bell pepper", + "unicode": "1fad1" + }, + ":bellhop:": { + "category": "objects", + "name": "bellhop bell", + "unicode": "1f6ce" + }, + ":bento:": { + "category": "food", + "name": "bento box", + "unicode": "1f371" + }, + ":beverage_box:": { + "category": "food", + "name": "beverage box", + "unicode": "1f9c3" + }, + ":bike:": { + "category": "travel", + "name": "bicycle", + "unicode": "1f6b2" + }, + ":bikini:": { + "category": "people", + "name": "bikini", + "unicode": "1f459" + }, + ":billed_cap:": { + "category": "people", + "name": "billed cap", + "unicode": "1f9e2" + }, + ":biohazard:": { + "category": "symbols", + "name": "biohazard", + "unicode": "2623" + }, + ":bird:": { + "category": "nature", + "name": "bird", + "unicode": "1f426" + }, + ":birthday:": { + "category": "food", + "name": "birthday cake", + "unicode": "1f382" + }, + ":bison:": { + "category": "nature", + "name": "bison", + "unicode": "1f9ac" + }, + ":biting_lip:": { + "category": "people", + "name": "biting lip", + "unicode": "1fae6" + }, + ":black_bird:": { + "category": "nature", + "name": "black bird", + "unicode": "1f426-200d-2b1b" + }, + ":black_cat:": { + "category": "nature", + "name": "black cat", + "unicode": "1f408-200d-2b1b" + }, + ":black_circle:": { + "category": "symbols", + "name": "black circle", + "unicode": "26ab" + }, + ":black_heart:": { + "category": "symbols", + "name": "black heart", + "unicode": "1f5a4" + }, + ":black_joker:": { + "category": "symbols", + "name": "joker", + "unicode": "1f0cf" + }, + ":black_large_square:": { + "category": "symbols", + "name": "black large square", + "unicode": "2b1b" + }, + ":black_medium_small_square:": { + "category": "symbols", + "name": "black medium-small square", + "unicode": "25fe" + }, + ":black_medium_square:": { + "category": "symbols", + "name": "black medium square", + "unicode": "25fc" + }, + ":black_nib:": { + "category": "objects", + "name": "black nib", + "unicode": "2712" + }, + ":black_small_square:": { + "category": "symbols", + "name": "black small square", + "unicode": "25aa" + }, + ":black_square_button:": { + "category": "symbols", + "name": "black square button", + "unicode": "1f532" + }, + ":blond-haired_man:": { + "category": "people", + "name": "man: blond hair", + "unicode": "1f471-200d-2642-fe0f" + }, + ":blond-haired_man_tone1:": { + "category": "people", + "name": "blond-haired man: light skin tone", + "unicode": "1f471-1f3fb-200d-2642-fe0f" + }, + ":blond-haired_man_tone2:": { + "category": "people", + "name": "blond-haired man: medium-light skin tone", + "unicode": "1f471-1f3fc-200d-2642-fe0f" + }, + ":blond-haired_man_tone3:": { + "category": "people", + "name": "blond-haired man: medium skin tone", + "unicode": "1f471-1f3fd-200d-2642-fe0f" + }, + ":blond-haired_man_tone4:": { + "category": "people", + "name": "blond-haired man: medium-dark skin tone", + "unicode": "1f471-1f3fe-200d-2642-fe0f" + }, + ":blond-haired_man_tone5:": { + "category": "people", + "name": "blond-haired man: dark skin tone", + "unicode": "1f471-1f3ff-200d-2642-fe0f" + }, + ":blond-haired_woman:": { + "category": "people", + "name": "woman: blond hair", + "unicode": "1f471-200d-2640-fe0f" + }, + ":blond-haired_woman_tone1:": { + "category": "people", + "name": "blond-haired woman: light skin tone", + "unicode": "1f471-1f3fb-200d-2640-fe0f" + }, + ":blond-haired_woman_tone2:": { + "category": "people", + "name": "blond-haired woman: medium-light skin tone", + "unicode": "1f471-1f3fc-200d-2640-fe0f" + }, + ":blond-haired_woman_tone3:": { + "category": "people", + "name": "blond-haired woman: medium skin tone", + "unicode": "1f471-1f3fd-200d-2640-fe0f" + }, + ":blond-haired_woman_tone4:": { + "category": "people", + "name": "blond-haired woman: medium-dark skin tone", + "unicode": "1f471-1f3fe-200d-2640-fe0f" + }, + ":blond-haired_woman_tone5:": { + "category": "people", + "name": "blond-haired woman: dark skin tone", + "unicode": "1f471-1f3ff-200d-2640-fe0f" + }, + ":blond_haired_person:": { + "category": "people", + "name": "person: blond hair", + "unicode": "1f471" + }, + ":blond_haired_person_tone1:": { + "category": "people", + "name": "blond-haired person: light skin tone", + "unicode": "1f471-1f3fb" + }, + ":blond_haired_person_tone2:": { + "category": "people", + "name": "blond-haired person: medium-light skin tone", + "unicode": "1f471-1f3fc" + }, + ":blond_haired_person_tone3:": { + "category": "people", + "name": "blond-haired person: medium skin tone", + "unicode": "1f471-1f3fd" + }, + ":blond_haired_person_tone4:": { + "category": "people", + "name": "blond-haired person: medium-dark skin tone", + "unicode": "1f471-1f3fe" + }, + ":blond_haired_person_tone5:": { + "category": "people", + "name": "blond-haired person: dark skin tone", + "unicode": "1f471-1f3ff" + }, + ":blossom:": { + "category": "nature", + "name": "blossom", + "unicode": "1f33c" + }, + ":blowfish:": { + "category": "nature", + "name": "blowfish", + "unicode": "1f421" + }, + ":blue_book:": { + "category": "objects", + "name": "blue book", + "unicode": "1f4d8" + }, + ":blue_car:": { + "category": "travel", + "name": "sport utility vehicle", + "unicode": "1f699" + }, + ":blue_circle:": { + "category": "symbols", + "name": "blue circle", + "unicode": "1f535" + }, + ":blue_heart:": { + "category": "symbols", + "name": "blue heart", + "unicode": "1f499" + }, + ":blue_square:": { + "category": "symbols", + "name": "blue square", + "unicode": "1f7e6" + }, + ":blueberries:": { + "category": "food", + "name": "blueberries", + "unicode": "1fad0" + }, + ":blush:": { + "category": "people", + "name": "smiling face with smiling eyes", + "unicode": "1f60a" + }, + ":boar:": { + "category": "nature", + "name": "boar", + "unicode": "1f417" + }, + ":bomb:": { + "category": "objects", + "name": "bomb", + "unicode": "1f4a3" + }, + ":bone:": { + "category": "food", + "name": "bone", + "unicode": "1f9b4" + }, + ":book:": { + "category": "objects", + "name": "open book", + "unicode": "1f4d6" + }, + ":bookmark:": { + "category": "objects", + "name": "bookmark", + "unicode": "1f516" + }, + ":bookmark_tabs:": { + "category": "objects", + "name": "bookmark tabs", + "unicode": "1f4d1" + }, + ":books:": { + "category": "objects", + "name": "books", + "unicode": "1f4da" + }, + ":boom:": { + "category": "nature", + "name": "collision", + "unicode": "1f4a5" + }, + ":boomerang:": { + "category": "activity", + "name": "boomerang", + "unicode": "1fa83" + }, + ":boot:": { + "category": "people", + "name": "woman\u2019s boot", + "unicode": "1f462" + }, + ":bouquet:": { + "category": "nature", + "name": "bouquet", + "unicode": "1f490" + }, + ":bow_and_arrow:": { + "category": "activity", + "name": "bow and arrow", + "unicode": "1f3f9" + }, + ":bowl_with_spoon:": { + "category": "food", + "name": "bowl with spoon", + "unicode": "1f963" + }, + ":bowling:": { + "category": "activity", + "name": "bowling", + "unicode": "1f3b3" + }, + ":boxing_glove:": { + "category": "activity", + "name": "boxing glove", + "unicode": "1f94a" + }, + ":boy:": { + "category": "people", + "name": "boy", + "unicode": "1f466" + }, + ":boy_tone1:": { + "category": "people", + "name": "boy: light skin tone", + "unicode": "1f466-1f3fb" + }, + ":boy_tone2:": { + "category": "people", + "name": "boy: medium-light skin tone", + "unicode": "1f466-1f3fc" + }, + ":boy_tone3:": { + "category": "people", + "name": "boy: medium skin tone", + "unicode": "1f466-1f3fd" + }, + ":boy_tone4:": { + "category": "people", + "name": "boy: medium-dark skin tone", + "unicode": "1f466-1f3fe" + }, + ":boy_tone5:": { + "category": "people", + "name": "boy: dark skin tone", + "unicode": "1f466-1f3ff" + }, + ":brain:": { + "category": "people", + "name": "brain", + "unicode": "1f9e0" + }, + ":bread:": { + "category": "food", + "name": "bread", + "unicode": "1f35e" + }, + ":breast_feeding:": { + "category": "people", + "name": "breast-feeding", + "unicode": "1f931" + }, + ":breast_feeding_tone1:": { + "category": "people", + "name": "breast-feeding: light skin tone", + "unicode": "1f931-1f3fb" + }, + ":breast_feeding_tone2:": { + "category": "people", + "name": "breast-feeding: medium-light skin tone", + "unicode": "1f931-1f3fc" + }, + ":breast_feeding_tone3:": { + "category": "people", + "name": "breast-feeding: medium skin tone", + "unicode": "1f931-1f3fd" + }, + ":breast_feeding_tone4:": { + "category": "people", + "name": "breast-feeding: medium-dark skin tone", + "unicode": "1f931-1f3fe" + }, + ":breast_feeding_tone5:": { + "category": "people", + "name": "breast-feeding: dark skin tone", + "unicode": "1f931-1f3ff" + }, + ":bricks:": { + "category": "objects", + "name": "brick", + "unicode": "1f9f1" + }, + ":bridge_at_night:": { + "category": "travel", + "name": "bridge at night", + "unicode": "1f309" + }, + ":briefcase:": { + "category": "people", + "name": "briefcase", + "unicode": "1f4bc" + }, + ":briefs:": { + "category": "people", + "name": "briefs", + "unicode": "1fa72" + }, + ":broccoli:": { + "category": "food", + "name": "broccoli", + "unicode": "1f966" + }, + ":broken_chain:": { + "category": "objects", + "name": "broken chain", + "unicode": "26d3-fe0f-200d-1f4a5" + }, + ":broken_heart:": { + "category": "symbols", + "name": "broken heart", + "unicode": "1f494" + }, + ":broom:": { + "category": "objects", + "name": "broom", + "unicode": "1f9f9" + }, + ":brown_circle:": { + "category": "symbols", + "name": "brown circle", + "unicode": "1f7e4" + }, + ":brown_heart:": { + "category": "symbols", + "name": "brown heart", + "unicode": "1f90e" + }, + ":brown_mushroom:": { + "category": "nature", + "name": "brown mushroom", + "unicode": "1f344-200d-1f7eb" + }, + ":brown_square:": { + "category": "symbols", + "name": "brown square", + "unicode": "1f7eb" + }, + ":bubble_tea:": { + "category": "food", + "name": "bubble tea", + "unicode": "1f9cb" + }, + ":bubbles:": { + "category": "nature", + "name": "bubbles", + "unicode": "1fae7" + }, + ":bucket:": { + "category": "objects", + "name": "bucket", + "unicode": "1faa3" + }, + ":bug:": { + "category": "nature", + "name": "bug", + "unicode": "1f41b" + }, + ":bulb:": { + "category": "objects", + "name": "light bulb", + "unicode": "1f4a1" + }, + ":bullettrain_front:": { + "category": "travel", + "name": "bullet train", + "unicode": "1f685" + }, + ":bullettrain_side:": { + "category": "travel", + "name": "high-speed train", + "unicode": "1f684" + }, + ":burrito:": { + "category": "food", + "name": "burrito", + "unicode": "1f32f" + }, + ":bus:": { + "category": "travel", + "name": "bus", + "unicode": "1f68c" + }, + ":busstop:": { + "category": "travel", + "name": "bus stop", + "unicode": "1f68f" + }, + ":bust_in_silhouette:": { + "category": "people", + "name": "bust in silhouette", + "unicode": "1f464" + }, + ":busts_in_silhouette:": { + "category": "people", + "name": "busts in silhouette", + "unicode": "1f465" + }, + ":butter:": { + "category": "food", + "name": "butter", + "unicode": "1f9c8" + }, + ":butterfly:": { + "category": "nature", + "name": "butterfly", + "unicode": "1f98b" + }, + ":cactus:": { + "category": "nature", + "name": "cactus", + "unicode": "1f335" + }, + ":cake:": { + "category": "food", + "name": "shortcake", + "unicode": "1f370" + }, + ":calendar:": { + "category": "objects", + "name": "tear-off calendar", + "unicode": "1f4c6" + }, + ":calendar_spiral:": { + "category": "objects", + "name": "spiral calendar", + "unicode": "1f5d3" + }, + ":call_me:": { + "category": "people", + "name": "call me hand", + "unicode": "1f919" + }, + ":call_me_tone1:": { + "category": "people", + "name": "call me hand: light skin tone", + "unicode": "1f919-1f3fb" + }, + ":call_me_tone2:": { + "category": "people", + "name": "call me hand: medium-light skin tone", + "unicode": "1f919-1f3fc" + }, + ":call_me_tone3:": { + "category": "people", + "name": "call me hand: medium skin tone", + "unicode": "1f919-1f3fd" + }, + ":call_me_tone4:": { + "category": "people", + "name": "call me hand: medium-dark skin tone", + "unicode": "1f919-1f3fe" + }, + ":call_me_tone5:": { + "category": "people", + "name": "call me hand: dark skin tone", + "unicode": "1f919-1f3ff" + }, + ":calling:": { + "category": "objects", + "name": "mobile phone with arrow", + "unicode": "1f4f2" + }, + ":camel:": { + "category": "nature", + "name": "two-hump camel", + "unicode": "1f42b" + }, + ":camera:": { + "category": "objects", + "name": "camera", + "unicode": "1f4f7" + }, + ":camera_with_flash:": { + "category": "objects", + "name": "camera with flash", + "unicode": "1f4f8" + }, + ":camping:": { + "category": "travel", + "name": "camping", + "unicode": "1f3d5" + }, + ":cancer:": { + "category": "symbols", + "name": "Cancer", + "unicode": "264b" + }, + ":candle:": { + "category": "objects", + "name": "candle", + "unicode": "1f56f" + }, + ":candy:": { + "category": "food", + "name": "candy", + "unicode": "1f36c" + }, + ":canned_food:": { + "category": "food", + "name": "canned food", + "unicode": "1f96b" + }, + ":canoe:": { + "category": "travel", + "name": "canoe", + "unicode": "1f6f6" + }, + ":capital_abcd:": { + "category": "symbols", + "name": "input latin uppercase", + "unicode": "1f520" + }, + ":capricorn:": { + "category": "symbols", + "name": "Capricorn", + "unicode": "2651" + }, + ":card_box:": { + "category": "objects", + "name": "card file box", + "unicode": "1f5c3" + }, + ":card_index:": { + "category": "objects", + "name": "card index", + "unicode": "1f4c7" + }, + ":carousel_horse:": { + "category": "travel", + "name": "carousel horse", + "unicode": "1f3a0" + }, + ":carpentry_saw:": { + "category": "objects", + "name": "carpentry saw", + "unicode": "1fa9a" + }, + ":carrot:": { + "category": "food", + "name": "carrot", + "unicode": "1f955" + }, + ":cat2:": { + "category": "nature", + "name": "cat", + "unicode": "1f408" + }, + ":cat:": { + "category": "nature", + "name": "cat face", + "unicode": "1f431" + }, + ":cd:": { + "category": "objects", + "name": "optical disk", + "unicode": "1f4bf" + }, + ":chains:": { + "category": "objects", + "name": "chains", + "unicode": "26d3" + }, + ":chair:": { + "category": "objects", + "name": "chair", + "unicode": "1fa91" + }, + ":champagne:": { + "category": "food", + "name": "bottle with popping cork", + "unicode": "1f37e" + }, + ":champagne_glass:": { + "category": "food", + "name": "clinking glasses", + "unicode": "1f942" + }, + ":chart:": { + "category": "symbols", + "name": "chart increasing with yen", + "unicode": "1f4b9" + }, + ":chart_with_downwards_trend:": { + "category": "objects", + "name": "chart decreasing", + "unicode": "1f4c9" + }, + ":chart_with_upwards_trend:": { + "category": "objects", + "name": "chart increasing", + "unicode": "1f4c8" + }, + ":checkered_flag:": { + "category": "flags", + "name": "chequered flag", + "unicode": "1f3c1" + }, + ":cheese:": { + "category": "food", + "name": "cheese wedge", + "unicode": "1f9c0" + }, + ":cherries:": { + "category": "food", + "name": "cherries", + "unicode": "1f352" + }, + ":cherry_blossom:": { + "category": "nature", + "name": "cherry blossom", + "unicode": "1f338" + }, + ":chess_pawn:": { + "category": "activity", + "name": "chess pawn", + "unicode": "265f" + }, + ":chestnut:": { + "category": "food", + "name": "chestnut", + "unicode": "1f330" + }, + ":chicken:": { + "category": "nature", + "name": "chicken", + "unicode": "1f414" + }, + ":child:": { + "category": "people", + "name": "child", + "unicode": "1f9d2" + }, + ":child_tone1:": { + "category": "people", + "name": "child: light skin tone", + "unicode": "1f9d2-1f3fb" + }, + ":child_tone2:": { + "category": "people", + "name": "child: medium-light skin tone", + "unicode": "1f9d2-1f3fc" + }, + ":child_tone3:": { + "category": "people", + "name": "child: medium skin tone", + "unicode": "1f9d2-1f3fd" + }, + ":child_tone4:": { + "category": "people", + "name": "child: medium-dark skin tone", + "unicode": "1f9d2-1f3fe" + }, + ":child_tone5:": { + "category": "people", + "name": "child: dark skin tone", + "unicode": "1f9d2-1f3ff" + }, + ":children_crossing:": { + "category": "symbols", + "name": "children crossing", + "unicode": "1f6b8" + }, + ":chipmunk:": { + "category": "nature", + "name": "chipmunk", + "unicode": "1f43f" + }, + ":chocolate_bar:": { + "category": "food", + "name": "chocolate bar", + "unicode": "1f36b" + }, + ":chopsticks:": { + "category": "food", + "name": "chopsticks", + "unicode": "1f962" + }, + ":christmas_tree:": { + "category": "nature", + "name": "Christmas tree", + "unicode": "1f384" + }, + ":church:": { + "category": "travel", + "name": "church", + "unicode": "26ea" + }, + ":cinema:": { + "category": "symbols", + "name": "cinema", + "unicode": "1f3a6" + }, + ":circus_tent:": { + "category": "activity", + "name": "circus tent", + "unicode": "1f3aa" + }, + ":city_dusk:": { + "category": "travel", + "name": "cityscape at dusk", + "unicode": "1f306" + }, + ":city_sunset:": { + "category": "travel", + "name": "sunset", + "unicode": "1f307" + }, + ":cityscape:": { + "category": "travel", + "name": "cityscape", + "unicode": "1f3d9" + }, + ":cl:": { + "category": "symbols", + "name": "CL button", + "unicode": "1f191" + }, + ":clap:": { + "category": "people", + "name": "clapping hands", + "unicode": "1f44f" + }, + ":clap_tone1:": { + "category": "people", + "name": "clapping hands: light skin tone", + "unicode": "1f44f-1f3fb" + }, + ":clap_tone2:": { + "category": "people", + "name": "clapping hands: medium-light skin tone", + "unicode": "1f44f-1f3fc" + }, + ":clap_tone3:": { + "category": "people", + "name": "clapping hands: medium skin tone", + "unicode": "1f44f-1f3fd" + }, + ":clap_tone4:": { + "category": "people", + "name": "clapping hands: medium-dark skin tone", + "unicode": "1f44f-1f3fe" + }, + ":clap_tone5:": { + "category": "people", + "name": "clapping hands: dark skin tone", + "unicode": "1f44f-1f3ff" + }, + ":clapper:": { + "category": "activity", + "name": "clapper board", + "unicode": "1f3ac" + }, + ":classical_building:": { + "category": "travel", + "name": "classical building", + "unicode": "1f3db" + }, + ":clipboard:": { + "category": "objects", + "name": "clipboard", + "unicode": "1f4cb" + }, + ":clock1030:": { + "category": "symbols", + "name": "ten-thirty", + "unicode": "1f565" + }, + ":clock10:": { + "category": "symbols", + "name": "ten o\u2019clock", + "unicode": "1f559" + }, + ":clock1130:": { + "category": "symbols", + "name": "eleven-thirty", + "unicode": "1f566" + }, + ":clock11:": { + "category": "symbols", + "name": "eleven o\u2019clock", + "unicode": "1f55a" + }, + ":clock1230:": { + "category": "symbols", + "name": "twelve-thirty", + "unicode": "1f567" + }, + ":clock12:": { + "category": "symbols", + "name": "twelve o\u2019clock", + "unicode": "1f55b" + }, + ":clock130:": { + "category": "symbols", + "name": "one-thirty", + "unicode": "1f55c" + }, + ":clock1:": { + "category": "symbols", + "name": "one o\u2019clock", + "unicode": "1f550" + }, + ":clock230:": { + "category": "symbols", + "name": "two-thirty", + "unicode": "1f55d" + }, + ":clock2:": { + "category": "symbols", + "name": "two o\u2019clock", + "unicode": "1f551" + }, + ":clock330:": { + "category": "symbols", + "name": "three-thirty", + "unicode": "1f55e" + }, + ":clock3:": { + "category": "symbols", + "name": "three o\u2019clock", + "unicode": "1f552" + }, + ":clock430:": { + "category": "symbols", + "name": "four-thirty", + "unicode": "1f55f" + }, + ":clock4:": { + "category": "symbols", + "name": "four o\u2019clock", + "unicode": "1f553" + }, + ":clock530:": { + "category": "symbols", + "name": "five-thirty", + "unicode": "1f560" + }, + ":clock5:": { + "category": "symbols", + "name": "five o\u2019clock", + "unicode": "1f554" + }, + ":clock630:": { + "category": "symbols", + "name": "six-thirty", + "unicode": "1f561" + }, + ":clock6:": { + "category": "symbols", + "name": "six o\u2019clock", + "unicode": "1f555" + }, + ":clock730:": { + "category": "symbols", + "name": "seven-thirty", + "unicode": "1f562" + }, + ":clock7:": { + "category": "symbols", + "name": "seven o\u2019clock", + "unicode": "1f556" + }, + ":clock830:": { + "category": "symbols", + "name": "eight-thirty", + "unicode": "1f563" + }, + ":clock8:": { + "category": "symbols", + "name": "eight o\u2019clock", + "unicode": "1f557" + }, + ":clock930:": { + "category": "symbols", + "name": "nine-thirty", + "unicode": "1f564" + }, + ":clock9:": { + "category": "symbols", + "name": "nine o\u2019clock", + "unicode": "1f558" + }, + ":clock:": { + "category": "objects", + "name": "mantelpiece clock", + "unicode": "1f570" + }, + ":closed_book:": { + "category": "objects", + "name": "closed book", + "unicode": "1f4d5" + }, + ":closed_lock_with_key:": { + "category": "objects", + "name": "locked with key", + "unicode": "1f510" + }, + ":closed_umbrella:": { + "category": "people", + "name": "closed umbrella", + "unicode": "1f302" + }, + ":cloud:": { + "category": "nature", + "name": "cloud", + "unicode": "2601" + }, + ":cloud_lightning:": { + "category": "nature", + "name": "cloud with lightning", + "unicode": "1f329" + }, + ":cloud_rain:": { + "category": "nature", + "name": "cloud with rain", + "unicode": "1f327" + }, + ":cloud_snow:": { + "category": "nature", + "name": "cloud with snow", + "unicode": "1f328" + }, + ":cloud_tornado:": { + "category": "nature", + "name": "tornado", + "unicode": "1f32a" + }, + ":clown:": { + "category": "people", + "name": "clown face", + "unicode": "1f921" + }, + ":clubs:": { + "category": "symbols", + "name": "club suit", + "unicode": "2663" + }, + ":coat:": { + "category": "people", + "name": "coat", + "unicode": "1f9e5" + }, + ":cockroach:": { + "category": "nature", + "name": "cockroach", + "unicode": "1fab3" + }, + ":cocktail:": { + "category": "food", + "name": "cocktail glass", + "unicode": "1f378" + }, + ":coconut:": { + "category": "food", + "name": "coconut", + "unicode": "1f965" + }, + ":coffee:": { + "category": "food", + "name": "hot beverage", + "unicode": "2615" + }, + ":coffin:": { + "category": "objects", + "name": "coffin", + "unicode": "26b0" + }, + ":coin:": { + "category": "objects", + "name": "coin", + "unicode": "1fa99" + }, + ":cold_face:": { + "category": "people", + "name": "cold face", + "unicode": "1f976" + }, + ":cold_sweat:": { + "category": "people", + "name": "anxious face with sweat", + "unicode": "1f630" + }, + ":comet:": { + "category": "nature", + "name": "comet", + "unicode": "2604" + }, + ":compass:": { + "category": "objects", + "name": "compass", + "unicode": "1f9ed" + }, + ":compression:": { + "category": "objects", + "name": "clamp", + "unicode": "1f5dc" + }, + ":computer:": { + "category": "objects", + "name": "laptop computer", + "unicode": "1f4bb" + }, + ":confetti_ball:": { + "category": "objects", + "name": "confetti ball", + "unicode": "1f38a" + }, + ":confounded:": { + "category": "people", + "name": "confounded face", + "unicode": "1f616" + }, + ":confused:": { + "category": "people", + "name": "confused face", + "unicode": "1f615" + }, + ":congratulations:": { + "category": "symbols", + "name": "Japanese \u201ccongratulations\u201d button", + "unicode": "3297" + }, + ":construction:": { + "category": "travel", + "name": "construction", + "unicode": "1f6a7" + }, + ":construction_site:": { + "category": "travel", + "name": "building construction", + "unicode": "1f3d7" + }, + ":construction_worker:": { + "category": "people", + "name": "construction worker", + "unicode": "1f477" + }, + ":construction_worker_tone1:": { + "category": "people", + "name": "construction worker: light skin tone", + "unicode": "1f477-1f3fb" + }, + ":construction_worker_tone2:": { + "category": "people", + "name": "construction worker: medium-light skin tone", + "unicode": "1f477-1f3fc" + }, + ":construction_worker_tone3:": { + "category": "people", + "name": "construction worker: medium skin tone", + "unicode": "1f477-1f3fd" + }, + ":construction_worker_tone4:": { + "category": "people", + "name": "construction worker: medium-dark skin tone", + "unicode": "1f477-1f3fe" + }, + ":construction_worker_tone5:": { + "category": "people", + "name": "construction worker: dark skin tone", + "unicode": "1f477-1f3ff" + }, + ":control_knobs:": { + "category": "objects", + "name": "control knobs", + "unicode": "1f39b" + }, + ":convenience_store:": { + "category": "travel", + "name": "convenience store", + "unicode": "1f3ea" + }, + ":cook:": { + "category": "people", + "name": "cook", + "unicode": "1f9d1-200d-1f373" + }, + ":cook_tone1:": { + "category": "people", + "name": "cook: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f373" + }, + ":cook_tone2:": { + "category": "people", + "name": "cook: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f373" + }, + ":cook_tone3:": { + "category": "people", + "name": "cook: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f373" + }, + ":cook_tone4:": { + "category": "people", + "name": "cook: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f373" + }, + ":cook_tone5:": { + "category": "people", + "name": "cook: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f373" + }, + ":cookie:": { + "category": "food", + "name": "cookie", + "unicode": "1f36a" + }, + ":cooking:": { + "category": "food", + "name": "cooking", + "unicode": "1f373" + }, + ":cool:": { + "category": "symbols", + "name": "COOL button", + "unicode": "1f192" + }, + ":copyright:": { + "category": "symbols", + "name": "copyright", + "unicode": "a9", + "unicode_alt": "00a9" + }, + ":coral:": { + "category": "nature", + "name": "coral", + "unicode": "1fab8" + }, + ":corn:": { + "category": "food", + "name": "ear of corn", + "unicode": "1f33d" + }, + ":couch:": { + "category": "objects", + "name": "couch and lamp", + "unicode": "1f6cb" + }, + ":couple:": { + "category": "people", + "name": "woman and man holding hands", + "unicode": "1f46b" + }, + ":couple_mm:": { + "category": "people", + "name": "couple with heart: man, man", + "unicode": "1f468-200d-2764-fe0f-200d-1f468" + }, + ":couple_with_heart:": { + "category": "people", + "name": "couple with heart", + "unicode": "1f491" + }, + ":couple_with_heart_man_man_tone1:": { + "category": "people", + "name": "couple with heart: man, man, light skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_man_man_tone1_tone2:": { + "category": "people", + "name": "couple with heart: man, man, light skin tone, medium-light skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_man_man_tone1_tone3:": { + "category": "people", + "name": "couple with heart: man, man, light skin tone, medium skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_man_man_tone1_tone4:": { + "category": "people", + "name": "couple with heart: man, man, light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_man_man_tone1_tone5:": { + "category": "people", + "name": "couple with heart: man, man, light skin tone, dark skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_man_man_tone2:": { + "category": "people", + "name": "couple with heart: man, man, medium-light skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_man_man_tone2_tone1:": { + "category": "people", + "name": "couple with heart: man, man, medium-light skin tone, light skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_man_man_tone2_tone3:": { + "category": "people", + "name": "couple with heart: man, man, medium-light skin tone, medium skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_man_man_tone2_tone4:": { + "category": "people", + "name": "couple with heart: man, man, medium-light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_man_man_tone2_tone5:": { + "category": "people", + "name": "couple with heart: man, man, medium-light skin tone, dark skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_man_man_tone3:": { + "category": "people", + "name": "couple with heart: man, man, medium skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_man_man_tone3_tone1:": { + "category": "people", + "name": "couple with heart: man, man, medium skin tone, light skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_man_man_tone3_tone2:": { + "category": "people", + "name": "couple with heart: man, man, medium skin tone, medium-light skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_man_man_tone3_tone4:": { + "category": "people", + "name": "couple with heart: man, man, medium skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_man_man_tone3_tone5:": { + "category": "people", + "name": "couple with heart: man, man, medium skin tone, dark skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_man_man_tone4:": { + "category": "people", + "name": "couple with heart: man, man, medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_man_man_tone4_tone1:": { + "category": "people", + "name": "couple with heart: man, man, medium-dark skin tone, light skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_man_man_tone4_tone2:": { + "category": "people", + "name": "couple with heart: man, man, medium-dark skin tone, medium-light skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_man_man_tone4_tone3:": { + "category": "people", + "name": "couple with heart: man, man, medium-dark skin tone, medium skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_man_man_tone4_tone5:": { + "category": "people", + "name": "couple with heart: man, man, medium-dark skin tone, dark skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_man_man_tone5:": { + "category": "people", + "name": "couple with heart: man, man, dark skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_man_man_tone5_tone1:": { + "category": "people", + "name": "couple with heart: man, man, dark skin tone, light skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_man_man_tone5_tone2:": { + "category": "people", + "name": "couple with heart: man, man, dark skin tone, medium-light skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_man_man_tone5_tone3:": { + "category": "people", + "name": "couple with heart: man, man, dark skin tone, medium skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_man_man_tone5_tone4:": { + "category": "people", + "name": "couple with heart: man, man, dark skin tone, medium-dark skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_person_person_tone1_tone2:": { + "category": "people", + "name": "couple with heart: person, person, light skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fc" + }, + ":couple_with_heart_person_person_tone1_tone3:": { + "category": "people", + "name": "couple with heart: person, person, light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fd" + }, + ":couple_with_heart_person_person_tone1_tone4:": { + "category": "people", + "name": "couple with heart: person, person, light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fe" + }, + ":couple_with_heart_person_person_tone1_tone5:": { + "category": "people", + "name": "couple with heart: person, person, light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3ff" + }, + ":couple_with_heart_person_person_tone2_tone1:": { + "category": "people", + "name": "couple with heart: person, person, medium-light skin tone, light skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fb" + }, + ":couple_with_heart_person_person_tone2_tone3:": { + "category": "people", + "name": "couple with heart: person, person, medium-light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fd" + }, + ":couple_with_heart_person_person_tone2_tone4:": { + "category": "people", + "name": "couple with heart: person, person, medium-light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fe" + }, + ":couple_with_heart_person_person_tone2_tone5:": { + "category": "people", + "name": "couple with heart: person, person, medium-light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3ff" + }, + ":couple_with_heart_person_person_tone3_tone1:": { + "category": "people", + "name": "couple with heart: person, person, medium skin tone, light skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fb" + }, + ":couple_with_heart_person_person_tone3_tone2:": { + "category": "people", + "name": "couple with heart: person, person, medium skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fc" + }, + ":couple_with_heart_person_person_tone3_tone4:": { + "category": "people", + "name": "couple with heart: person, person, medium skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fe" + }, + ":couple_with_heart_person_person_tone3_tone5:": { + "category": "people", + "name": "couple with heart: person, person, medium skin tone, dark skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3ff" + }, + ":couple_with_heart_person_person_tone4_tone1:": { + "category": "people", + "name": "couple with heart: person, person, medium-dark skin tone, light skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fb" + }, + ":couple_with_heart_person_person_tone4_tone2:": { + "category": "people", + "name": "couple with heart: person, person, medium-dark skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fc" + }, + ":couple_with_heart_person_person_tone4_tone3:": { + "category": "people", + "name": "couple with heart: person, person, medium-dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fd" + }, + ":couple_with_heart_person_person_tone4_tone5:": { + "category": "people", + "name": "couple with heart: person, person, medium-dark skin tone, dark skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3ff" + }, + ":couple_with_heart_person_person_tone5_tone1:": { + "category": "people", + "name": "couple with heart: person, person, dark skin tone, light skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fb" + }, + ":couple_with_heart_person_person_tone5_tone2:": { + "category": "people", + "name": "couple with heart: person, person, dark skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fc" + }, + ":couple_with_heart_person_person_tone5_tone3:": { + "category": "people", + "name": "couple with heart: person, person, dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fd" + }, + ":couple_with_heart_person_person_tone5_tone4:": { + "category": "people", + "name": "couple with heart: person, person, dark skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fe" + }, + ":couple_with_heart_tone1:": { + "category": "people", + "name": "couple with heart: light skin tone", + "unicode": "1f491-1f3fb" + }, + ":couple_with_heart_tone2:": { + "category": "people", + "name": "couple with heart: medium-light skin tone", + "unicode": "1f491-1f3fc" + }, + ":couple_with_heart_tone3:": { + "category": "people", + "name": "couple with heart: medium skin tone", + "unicode": "1f491-1f3fd" + }, + ":couple_with_heart_tone4:": { + "category": "people", + "name": "couple with heart: medium-dark skin tone", + "unicode": "1f491-1f3fe" + }, + ":couple_with_heart_tone5:": { + "category": "people", + "name": "couple with heart: dark skin tone", + "unicode": "1f491-1f3ff" + }, + ":couple_with_heart_woman_man:": { + "category": "people", + "name": "couple with heart: woman, man", + "unicode": "1f469-200d-2764-fe0f-200d-1f468" + }, + ":couple_with_heart_woman_man_tone1:": { + "category": "people", + "name": "couple with heart: woman, man, light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_woman_man_tone1_tone2:": { + "category": "people", + "name": "couple with heart: woman, man, light skin tone, medium-light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_woman_man_tone1_tone3:": { + "category": "people", + "name": "couple with heart: woman, man, light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_woman_man_tone1_tone4:": { + "category": "people", + "name": "couple with heart: woman, man, light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_woman_man_tone1_tone5:": { + "category": "people", + "name": "couple with heart: woman, man, light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_woman_man_tone2:": { + "category": "people", + "name": "couple with heart: woman, man, medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_woman_man_tone2_tone1:": { + "category": "people", + "name": "couple with heart: woman, man, medium-light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_woman_man_tone2_tone3:": { + "category": "people", + "name": "couple with heart: woman, man, medium-light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_woman_man_tone2_tone4:": { + "category": "people", + "name": "couple with heart: woman, man, medium-light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_woman_man_tone2_tone5:": { + "category": "people", + "name": "couple with heart: woman, man, medium-light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_woman_man_tone3:": { + "category": "people", + "name": "couple with heart: woman, man, medium skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_woman_man_tone3_tone1:": { + "category": "people", + "name": "couple with heart: woman, man, medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_woman_man_tone3_tone2:": { + "category": "people", + "name": "couple with heart: woman, man, medium skin tone, medium-light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_woman_man_tone3_tone4:": { + "category": "people", + "name": "couple with heart: woman, man, medium skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_woman_man_tone3_tone5:": { + "category": "people", + "name": "couple with heart: woman, man, medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_woman_man_tone4:": { + "category": "people", + "name": "couple with heart: woman, man, medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_woman_man_tone4_tone1:": { + "category": "people", + "name": "couple with heart: woman, man, medium-dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_woman_man_tone4_tone2:": { + "category": "people", + "name": "couple with heart: woman, man, medium-dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_woman_man_tone4_tone3:": { + "category": "people", + "name": "couple with heart: woman, man, medium-dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_woman_man_tone4_tone5:": { + "category": "people", + "name": "couple with heart: woman, man, medium-dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_woman_man_tone5:": { + "category": "people", + "name": "couple with heart: woman, man, dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" + }, + ":couple_with_heart_woman_man_tone5_tone1:": { + "category": "people", + "name": "couple with heart: woman, man, dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb" + }, + ":couple_with_heart_woman_man_tone5_tone2:": { + "category": "people", + "name": "couple with heart: woman, man, dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc" + }, + ":couple_with_heart_woman_man_tone5_tone3:": { + "category": "people", + "name": "couple with heart: woman, man, dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd" + }, + ":couple_with_heart_woman_man_tone5_tone4:": { + "category": "people", + "name": "couple with heart: woman, man, dark skin tone, medium-dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe" + }, + ":couple_with_heart_woman_woman_tone1:": { + "category": "people", + "name": "couple with heart: woman, woman, light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fb" + }, + ":couple_with_heart_woman_woman_tone1_tone2:": { + "category": "people", + "name": "couple with heart: woman, woman, light skin tone, medium-light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fc" + }, + ":couple_with_heart_woman_woman_tone1_tone3:": { + "category": "people", + "name": "couple with heart: woman, woman, light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fd" + }, + ":couple_with_heart_woman_woman_tone1_tone4:": { + "category": "people", + "name": "couple with heart: woman, woman, light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fe" + }, + ":couple_with_heart_woman_woman_tone1_tone5:": { + "category": "people", + "name": "couple with heart: woman, woman, light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3ff" + }, + ":couple_with_heart_woman_woman_tone2:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fc" + }, + ":couple_with_heart_woman_woman_tone2_tone1:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fb" + }, + ":couple_with_heart_woman_woman_tone2_tone3:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fd" + }, + ":couple_with_heart_woman_woman_tone2_tone4:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fe" + }, + ":couple_with_heart_woman_woman_tone2_tone5:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3ff" + }, + ":couple_with_heart_woman_woman_tone3:": { + "category": "people", + "name": "couple with heart: woman, woman, medium skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fd" + }, + ":couple_with_heart_woman_woman_tone3_tone1:": { + "category": "people", + "name": "couple with heart: woman, woman, medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fb" + }, + ":couple_with_heart_woman_woman_tone3_tone2:": { + "category": "people", + "name": "couple with heart: woman, woman, medium skin tone, medium-light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fc" + }, + ":couple_with_heart_woman_woman_tone3_tone4:": { + "category": "people", + "name": "couple with heart: woman, woman, medium skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fe" + }, + ":couple_with_heart_woman_woman_tone3_tone5:": { + "category": "people", + "name": "couple with heart: woman, woman, medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3ff" + }, + ":couple_with_heart_woman_woman_tone4:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fe" + }, + ":couple_with_heart_woman_woman_tone4_tone1:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fb" + }, + ":couple_with_heart_woman_woman_tone4_tone2:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fc" + }, + ":couple_with_heart_woman_woman_tone4_tone3:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fd" + }, + ":couple_with_heart_woman_woman_tone4_tone5:": { + "category": "people", + "name": "couple with heart: woman, woman, medium-dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3ff" + }, + ":couple_with_heart_woman_woman_tone5:": { + "category": "people", + "name": "couple with heart: woman, woman, dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3ff" + }, + ":couple_with_heart_woman_woman_tone5_tone1:": { + "category": "people", + "name": "couple with heart: woman, woman, dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fb" + }, + ":couple_with_heart_woman_woman_tone5_tone2:": { + "category": "people", + "name": "couple with heart: woman, woman, dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fc" + }, + ":couple_with_heart_woman_woman_tone5_tone3:": { + "category": "people", + "name": "couple with heart: woman, woman, dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fd" + }, + ":couple_with_heart_woman_woman_tone5_tone4:": { + "category": "people", + "name": "couple with heart: woman, woman, dark skin tone, medium-dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fe" + }, + ":couple_ww:": { + "category": "people", + "name": "couple with heart: woman, woman", + "unicode": "1f469-200d-2764-fe0f-200d-1f469" + }, + ":couplekiss:": { + "category": "people", + "name": "kiss", + "unicode": "1f48f" + }, + ":cow2:": { + "category": "nature", + "name": "cow", + "unicode": "1f404" + }, + ":cow:": { + "category": "nature", + "name": "cow face", + "unicode": "1f42e" + }, + ":cowboy:": { + "category": "people", + "name": "cowboy hat face", + "unicode": "1f920" + }, + ":crab:": { + "category": "nature", + "name": "crab", + "unicode": "1f980" + }, + ":crayon:": { + "category": "objects", + "name": "crayon", + "unicode": "1f58d" + }, + ":credit_card:": { + "category": "objects", + "name": "credit card", + "unicode": "1f4b3" + }, + ":crescent_moon:": { + "category": "nature", + "name": "crescent moon", + "unicode": "1f319" + }, + ":cricket:": { + "category": "nature", + "name": "cricket", + "unicode": "1f997" + }, + ":cricket_game:": { + "category": "activity", + "name": "cricket game", + "unicode": "1f3cf" + }, + ":crocodile:": { + "category": "nature", + "name": "crocodile", + "unicode": "1f40a" + }, + ":croissant:": { + "category": "food", + "name": "croissant", + "unicode": "1f950" + }, + ":cross:": { + "category": "symbols", + "name": "latin cross", + "unicode": "271d" + }, + ":crossed_flags:": { + "category": "flags", + "name": "crossed flags", + "unicode": "1f38c" + }, + ":crossed_swords:": { + "category": "objects", + "name": "crossed swords", + "unicode": "2694" + }, + ":crown:": { + "category": "people", + "name": "crown", + "unicode": "1f451" + }, + ":cruise_ship:": { + "category": "travel", + "name": "passenger ship", + "unicode": "1f6f3" + }, + ":crutch:": { + "category": "travel", + "name": "crutch", + "unicode": "1fa7c" + }, + ":cry:": { + "category": "people", + "name": "crying face", + "unicode": "1f622" + }, + ":crying_cat_face:": { + "category": "people", + "name": "crying cat", + "unicode": "1f63f" + }, + ":crystal_ball:": { + "category": "objects", + "name": "crystal ball", + "unicode": "1f52e" + }, + ":cucumber:": { + "category": "food", + "name": "cucumber", + "unicode": "1f952" + }, + ":cup_with_straw:": { + "category": "food", + "name": "cup with straw", + "unicode": "1f964" + }, + ":cupcake:": { + "category": "food", + "name": "cupcake", + "unicode": "1f9c1" + }, + ":cupid:": { + "category": "symbols", + "name": "heart with arrow", + "unicode": "1f498" + }, + ":curling_stone:": { + "category": "activity", + "name": "curling stone", + "unicode": "1f94c" + }, + ":curly_haired:": { + "category": "people", + "name": "curly hair", + "unicode": "1f9b1" + }, + ":curly_loop:": { + "category": "symbols", + "name": "curly loop", + "unicode": "27b0" + }, + ":currency_exchange:": { + "category": "symbols", + "name": "currency exchange", + "unicode": "1f4b1" + }, + ":curry:": { + "category": "food", + "name": "curry rice", + "unicode": "1f35b" + }, + ":custard:": { + "category": "food", + "name": "custard", + "unicode": "1f36e" + }, + ":customs:": { + "category": "symbols", + "name": "customs", + "unicode": "1f6c3" + }, + ":cut_of_meat:": { + "category": "food", + "name": "cut of meat", + "unicode": "1f969" + }, + ":cyclone:": { + "category": "symbols", + "name": "cyclone", + "unicode": "1f300" + }, + ":dagger:": { + "category": "objects", + "name": "dagger", + "unicode": "1f5e1" + }, + ":dancer:": { + "category": "people", + "name": "woman dancing", + "unicode": "1f483" + }, + ":dancer_tone1:": { + "category": "people", + "name": "woman dancing: light skin tone", + "unicode": "1f483-1f3fb" + }, + ":dancer_tone2:": { + "category": "people", + "name": "woman dancing: medium-light skin tone", + "unicode": "1f483-1f3fc" + }, + ":dancer_tone3:": { + "category": "people", + "name": "woman dancing: medium skin tone", + "unicode": "1f483-1f3fd" + }, + ":dancer_tone4:": { + "category": "people", + "name": "woman dancing: medium-dark skin tone", + "unicode": "1f483-1f3fe" + }, + ":dancer_tone5:": { + "category": "people", + "name": "woman dancing: dark skin tone", + "unicode": "1f483-1f3ff" + }, + ":dango:": { + "category": "food", + "name": "dango", + "unicode": "1f361" + }, + ":dark_sunglasses:": { + "category": "people", + "name": "sunglasses", + "unicode": "1f576" + }, + ":dart:": { + "category": "activity", + "name": "direct hit", + "unicode": "1f3af" + }, + ":dash:": { + "category": "nature", + "name": "dashing away", + "unicode": "1f4a8" + }, + ":date:": { + "category": "objects", + "name": "calendar", + "unicode": "1f4c5" + }, + ":deaf_man:": { + "category": "people", + "name": "deaf man", + "unicode": "1f9cf-200d-2642-fe0f" + }, + ":deaf_man_tone1:": { + "category": "people", + "name": "deaf man: light skin tone", + "unicode": "1f9cf-1f3fb-200d-2642-fe0f" + }, + ":deaf_man_tone2:": { + "category": "people", + "name": "deaf man: medium-light skin tone", + "unicode": "1f9cf-1f3fc-200d-2642-fe0f" + }, + ":deaf_man_tone3:": { + "category": "people", + "name": "deaf man: medium skin tone", + "unicode": "1f9cf-1f3fd-200d-2642-fe0f" + }, + ":deaf_man_tone4:": { + "category": "people", + "name": "deaf man: medium-dark skin tone", + "unicode": "1f9cf-1f3fe-200d-2642-fe0f" + }, + ":deaf_man_tone5:": { + "category": "people", + "name": "deaf man: dark skin tone", + "unicode": "1f9cf-1f3ff-200d-2642-fe0f" + }, + ":deaf_person:": { + "category": "people", + "name": "deaf person", + "unicode": "1f9cf" + }, + ":deaf_person_tone1:": { + "category": "people", + "name": "deaf person: light skin tone", + "unicode": "1f9cf-1f3fb" + }, + ":deaf_person_tone2:": { + "category": "people", + "name": "deaf person: medium-light skin tone", + "unicode": "1f9cf-1f3fc" + }, + ":deaf_person_tone3:": { + "category": "people", + "name": "deaf person: medium skin tone", + "unicode": "1f9cf-1f3fd" + }, + ":deaf_person_tone4:": { + "category": "people", + "name": "deaf person: medium-dark skin tone", + "unicode": "1f9cf-1f3fe" + }, + ":deaf_person_tone5:": { + "category": "people", + "name": "deaf person: dark skin tone", + "unicode": "1f9cf-1f3ff" + }, + ":deaf_woman:": { + "category": "people", + "name": "deaf woman", + "unicode": "1f9cf-200d-2640-fe0f" + }, + ":deaf_woman_tone1:": { + "category": "people", + "name": "deaf woman: light skin tone", + "unicode": "1f9cf-1f3fb-200d-2640-fe0f" + }, + ":deaf_woman_tone2:": { + "category": "people", + "name": "deaf woman: medium-light skin tone", + "unicode": "1f9cf-1f3fc-200d-2640-fe0f" + }, + ":deaf_woman_tone3:": { + "category": "people", + "name": "deaf woman: medium skin tone", + "unicode": "1f9cf-1f3fd-200d-2640-fe0f" + }, + ":deaf_woman_tone4:": { + "category": "people", + "name": "deaf woman: medium-dark skin tone", + "unicode": "1f9cf-1f3fe-200d-2640-fe0f" + }, + ":deaf_woman_tone5:": { + "category": "people", + "name": "deaf woman: dark skin tone", + "unicode": "1f9cf-1f3ff-200d-2640-fe0f" + }, + ":deciduous_tree:": { + "category": "nature", + "name": "deciduous tree", + "unicode": "1f333" + }, + ":deer:": { + "category": "nature", + "name": "deer", + "unicode": "1f98c" + }, + ":department_store:": { + "category": "travel", + "name": "department store", + "unicode": "1f3ec" + }, + ":desert:": { + "category": "travel", + "name": "desert", + "unicode": "1f3dc" + }, + ":desktop:": { + "category": "objects", + "name": "desktop computer", + "unicode": "1f5a5" + }, + ":detective:": { + "category": "people", + "name": "detective", + "unicode": "1f575" + }, + ":detective_tone1:": { + "category": "people", + "name": "detective: light skin tone", + "unicode": "1f575-1f3fb" + }, + ":detective_tone2:": { + "category": "people", + "name": "detective: medium-light skin tone", + "unicode": "1f575-1f3fc" + }, + ":detective_tone3:": { + "category": "people", + "name": "detective: medium skin tone", + "unicode": "1f575-1f3fd" + }, + ":detective_tone4:": { + "category": "people", + "name": "detective: medium-dark skin tone", + "unicode": "1f575-1f3fe" + }, + ":detective_tone5:": { + "category": "people", + "name": "detective: dark skin tone", + "unicode": "1f575-1f3ff" + }, + ":diamond_shape_with_a_dot_inside:": { + "category": "symbols", + "name": "diamond with a dot", + "unicode": "1f4a0" + }, + ":diamonds:": { + "category": "symbols", + "name": "diamond suit", + "unicode": "2666" + }, + ":disappointed:": { + "category": "people", + "name": "disappointed face", + "unicode": "1f61e" + }, + ":disappointed_relieved:": { + "category": "people", + "name": "sad but relieved face", + "unicode": "1f625" + }, + ":disguised_face:": { + "category": "people", + "name": "disguised face", + "unicode": "1f978" + }, + ":dividers:": { + "category": "objects", + "name": "card index dividers", + "unicode": "1f5c2" + }, + ":diving_mask:": { + "category": "activity", + "name": "diving mask", + "unicode": "1f93f" + }, + ":diya_lamp:": { + "category": "objects", + "name": "diya lamp", + "unicode": "1fa94" + }, + ":dizzy:": { + "category": "nature", + "name": "dizzy", + "unicode": "1f4ab" + }, + ":dizzy_face:": { + "category": "people", + "name": "dizzy face", + "unicode": "1f635" + }, + ":dna:": { + "category": "objects", + "name": "dna", + "unicode": "1f9ec" + }, + ":do_not_litter:": { + "category": "symbols", + "name": "no littering", + "unicode": "1f6af" + }, + ":dodo:": { + "category": "nature", + "name": "dodo", + "unicode": "1f9a4" + }, + ":dog2:": { + "category": "nature", + "name": "dog", + "unicode": "1f415" + }, + ":dog:": { + "category": "nature", + "name": "dog face", + "unicode": "1f436" + }, + ":dollar:": { + "category": "objects", + "name": "dollar banknote", + "unicode": "1f4b5" + }, + ":dolls:": { + "category": "objects", + "name": "Japanese dolls", + "unicode": "1f38e" + }, + ":dolphin:": { + "category": "nature", + "name": "dolphin", + "unicode": "1f42c" + }, + ":donkey:": { + "category": "nature", + "name": "donkey", + "unicode": "1facf" + }, + ":door:": { + "category": "objects", + "name": "door", + "unicode": "1f6aa" + }, + ":dotted_line_face:": { + "category": "people", + "name": "dotted line face", + "unicode": "1fae5" + }, + ":doughnut:": { + "category": "food", + "name": "doughnut", + "unicode": "1f369" + }, + ":dove:": { + "category": "nature", + "name": "dove", + "unicode": "1f54a" + }, + ":dragon:": { + "category": "nature", + "name": "dragon", + "unicode": "1f409" + }, + ":dragon_face:": { + "category": "nature", + "name": "dragon face", + "unicode": "1f432" + }, + ":dress:": { + "category": "people", + "name": "dress", + "unicode": "1f457" + }, + ":dromedary_camel:": { + "category": "nature", + "name": "camel", + "unicode": "1f42a" + }, + ":drooling_face:": { + "category": "people", + "name": "drooling face", + "unicode": "1f924" + }, + ":drop_of_blood:": { + "category": "objects", + "name": "drop of blood", + "unicode": "1fa78" + }, + ":droplet:": { + "category": "nature", + "name": "droplet", + "unicode": "1f4a7" + }, + ":drum:": { + "category": "activity", + "name": "drum", + "unicode": "1f941" + }, + ":duck:": { + "category": "nature", + "name": "duck", + "unicode": "1f986" + }, + ":dumpling:": { + "category": "food", + "name": "dumpling", + "unicode": "1f95f" + }, + ":dvd:": { + "category": "objects", + "name": "dvd", + "unicode": "1f4c0" + }, + ":e-mail:": { + "category": "objects", + "name": "e-mail", + "unicode": "1f4e7" + }, + ":eagle:": { + "category": "nature", + "name": "eagle", + "unicode": "1f985" + }, + ":ear:": { + "category": "people", + "name": "ear", + "unicode": "1f442" + }, + ":ear_of_rice:": { + "category": "nature", + "name": "sheaf of rice", + "unicode": "1f33e" + }, + ":ear_tone1:": { + "category": "people", + "name": "ear: light skin tone", + "unicode": "1f442-1f3fb" + }, + ":ear_tone2:": { + "category": "people", + "name": "ear: medium-light skin tone", + "unicode": "1f442-1f3fc" + }, + ":ear_tone3:": { + "category": "people", + "name": "ear: medium skin tone", + "unicode": "1f442-1f3fd" + }, + ":ear_tone4:": { + "category": "people", + "name": "ear: medium-dark skin tone", + "unicode": "1f442-1f3fe" + }, + ":ear_tone5:": { + "category": "people", + "name": "ear: dark skin tone", + "unicode": "1f442-1f3ff" + }, + ":ear_with_hearing_aid:": { + "category": "people", + "name": "ear with hearing aid", + "unicode": "1f9bb" + }, + ":ear_with_hearing_aid_tone1:": { + "category": "people", + "name": "ear with hearing aid: light skin tone", + "unicode": "1f9bb-1f3fb" + }, + ":ear_with_hearing_aid_tone2:": { + "category": "people", + "name": "ear with hearing aid: medium-light skin tone", + "unicode": "1f9bb-1f3fc" + }, + ":ear_with_hearing_aid_tone3:": { + "category": "people", + "name": "ear with hearing aid: medium skin tone", + "unicode": "1f9bb-1f3fd" + }, + ":ear_with_hearing_aid_tone4:": { + "category": "people", + "name": "ear with hearing aid: medium-dark skin tone", + "unicode": "1f9bb-1f3fe" + }, + ":ear_with_hearing_aid_tone5:": { + "category": "people", + "name": "ear with hearing aid: dark skin tone", + "unicode": "1f9bb-1f3ff" + }, + ":earth_africa:": { + "category": "nature", + "name": "globe showing Europe-Africa", + "unicode": "1f30d" + }, + ":earth_americas:": { + "category": "nature", + "name": "globe showing Americas", + "unicode": "1f30e" + }, + ":earth_asia:": { + "category": "nature", + "name": "globe showing Asia-Australia", + "unicode": "1f30f" + }, + ":egg:": { + "category": "food", + "name": "egg", + "unicode": "1f95a" + }, + ":eggplant:": { + "category": "food", + "name": "eggplant", + "unicode": "1f346" + }, + ":eight:": { + "category": "symbols", + "name": "keycap: 8", + "unicode": "38-20e3", + "unicode_alt": "0038-20e3" + }, + ":eight_pointed_black_star:": { + "category": "symbols", + "name": "eight-pointed star", + "unicode": "2734" + }, + ":eight_spoked_asterisk:": { + "category": "symbols", + "name": "eight-spoked asterisk", + "unicode": "2733" + }, + ":eject:": { + "category": "symbols", + "name": "eject button", + "unicode": "23cf" + }, + ":electric_plug:": { + "category": "objects", + "name": "electric plug", + "unicode": "1f50c" + }, + ":elephant:": { + "category": "nature", + "name": "elephant", + "unicode": "1f418" + }, + ":elevator:": { + "category": "symbols", + "name": "elevator", + "unicode": "1f6d7" + }, + ":elf:": { + "category": "people", + "name": "elf", + "unicode": "1f9dd" + }, + ":elf_tone1:": { + "category": "people", + "name": "elf: light skin tone", + "unicode": "1f9dd-1f3fb" + }, + ":elf_tone2:": { + "category": "people", + "name": "elf: medium-light skin tone", + "unicode": "1f9dd-1f3fc" + }, + ":elf_tone3:": { + "category": "people", + "name": "elf: medium skin tone", + "unicode": "1f9dd-1f3fd" + }, + ":elf_tone4:": { + "category": "people", + "name": "elf: medium-dark skin tone", + "unicode": "1f9dd-1f3fe" + }, + ":elf_tone5:": { + "category": "people", + "name": "elf: dark skin tone", + "unicode": "1f9dd-1f3ff" + }, + ":empty_nest:": { + "category": "nature", + "name": "empty nest", + "unicode": "1fab9" + }, + ":end:": { + "category": "symbols", + "name": "END arrow", + "unicode": "1f51a" + }, + ":england:": { + "category": "flags", + "name": "flag: England", + "unicode": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f" + }, + ":envelope:": { + "category": "objects", + "name": "envelope", + "unicode": "2709" + }, + ":envelope_with_arrow:": { + "category": "objects", + "name": "envelope with arrow", + "unicode": "1f4e9" + }, + ":euro:": { + "category": "objects", + "name": "euro banknote", + "unicode": "1f4b6" + }, + ":european_castle:": { + "category": "travel", + "name": "castle", + "unicode": "1f3f0" + }, + ":european_post_office:": { + "category": "travel", + "name": "post office", + "unicode": "1f3e4" + }, + ":evergreen_tree:": { + "category": "nature", + "name": "evergreen tree", + "unicode": "1f332" + }, + ":exclamation:": { + "category": "symbols", + "name": "exclamation mark", + "unicode": "2757" + }, + ":exploding_head:": { + "category": "people", + "name": "exploding head", + "unicode": "1f92f" + }, + ":expressionless:": { + "category": "people", + "name": "expressionless face", + "unicode": "1f611" + }, + ":eye:": { + "category": "people", + "name": "eye", + "unicode": "1f441" + }, + ":eye_in_speech_bubble:": { + "category": "symbols", + "name": "eye in speech bubble", + "unicode": "1f441-200d-1f5e8" + }, + ":eyeglasses:": { + "category": "people", + "name": "glasses", + "unicode": "1f453" + }, + ":eyes:": { + "category": "people", + "name": "eyes", + "unicode": "1f440" + }, + ":face_exhaling:": { + "category": "people", + "name": "face exhaling", + "unicode": "1f62e-200d-1f4a8" + }, + ":face_holding_back_tears:": { + "category": "people", + "name": "face holding back tears", + "unicode": "1f979" + }, + ":face_in_clouds:": { + "category": "people", + "name": "face in clouds", + "unicode": "1f636-200d-1f32b-fe0f" + }, + ":face_vomiting:": { + "category": "people", + "name": "face vomiting", + "unicode": "1f92e" + }, + ":face_with_bags_under_eyes:": { + "category": "people", + "name": "face with bags under eyes", + "unicode": "1fae9" + }, + ":face_with_diagonal_mouth:": { + "category": "people", + "name": "face with diagonal mouth", + "unicode": "1fae4" + }, + ":face_with_hand_over_mouth:": { + "category": "people", + "name": "face with hand over mouth", + "unicode": "1f92d" + }, + ":face_with_monocle:": { + "category": "people", + "name": "face with monocle", + "unicode": "1f9d0" + }, + ":face_with_open_eyes_and_hand_over_mouth:": { + "category": "people", + "name": "face with open eyes and hand over mouth", + "unicode": "1fae2" + }, + ":face_with_peeking_eye:": { + "category": "people", + "name": "face with peeking eye", + "unicode": "1fae3" + }, + ":face_with_raised_eyebrow:": { + "category": "people", + "name": "face with raised eyebrow", + "unicode": "1f928" + }, + ":face_with_spiral_eyes:": { + "category": "people", + "name": "face with spiral eyes", + "unicode": "1f635-200d-1f4ab" + }, + ":face_with_symbols_over_mouth:": { + "category": "people", + "name": "face with symbols on mouth", + "unicode": "1f92c" + }, + ":factory:": { + "category": "travel", + "name": "factory", + "unicode": "1f3ed" + }, + ":factory_worker:": { + "category": "people", + "name": "factory worker", + "unicode": "1f9d1-200d-1f3ed" + }, + ":factory_worker_tone1:": { + "category": "people", + "name": "factory worker: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f3ed" + }, + ":factory_worker_tone2:": { + "category": "people", + "name": "factory worker: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f3ed" + }, + ":factory_worker_tone3:": { + "category": "people", + "name": "factory worker: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f3ed" + }, + ":factory_worker_tone4:": { + "category": "people", + "name": "factory worker: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f3ed" + }, + ":factory_worker_tone5:": { + "category": "people", + "name": "factory worker: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f3ed" + }, + ":fairy:": { + "category": "people", + "name": "fairy", + "unicode": "1f9da" + }, + ":fairy_tone1:": { + "category": "people", + "name": "fairy: light skin tone", + "unicode": "1f9da-1f3fb" + }, + ":fairy_tone2:": { + "category": "people", + "name": "fairy: medium-light skin tone", + "unicode": "1f9da-1f3fc" + }, + ":fairy_tone3:": { + "category": "people", + "name": "fairy: medium skin tone", + "unicode": "1f9da-1f3fd" + }, + ":fairy_tone4:": { + "category": "people", + "name": "fairy: medium-dark skin tone", + "unicode": "1f9da-1f3fe" + }, + ":fairy_tone5:": { + "category": "people", + "name": "fairy: dark skin tone", + "unicode": "1f9da-1f3ff" + }, + ":falafel:": { + "category": "food", + "name": "falafel", + "unicode": "1f9c6" + }, + ":fallen_leaf:": { + "category": "nature", + "name": "fallen leaf", + "unicode": "1f342" + }, + ":family:": { + "category": "people", + "name": "family", + "unicode": "1f46a" + }, + ":family_adult_adult_child:": { + "category": "people", + "name": "family: adult, adult, child", + "unicode": "1f9d1-200d-1f9d1-200d-1f9d2" + }, + ":family_adult_adult_child_child:": { + "category": "people", + "name": "family: adult, adult, child, child", + "unicode": "1f9d1-200d-1f9d1-200d-1f9d2-200d-1f9d2" + }, + ":family_adult_child:": { + "category": "people", + "name": "family: adult, child", + "unicode": "1f9d1-200d-1f9d2" + }, + ":family_adult_child_child:": { + "category": "people", + "name": "family: adult, child, child", + "unicode": "1f9d1-200d-1f9d2-200d-1f9d2" + }, + ":family_man_boy:": { + "category": "people", + "name": "family: man, boy", + "unicode": "1f468-200d-1f466" + }, + ":family_man_boy_boy:": { + "category": "people", + "name": "family: man, boy, boy", + "unicode": "1f468-200d-1f466-200d-1f466" + }, + ":family_man_girl:": { + "category": "people", + "name": "family: man, girl", + "unicode": "1f468-200d-1f467" + }, + ":family_man_girl_boy:": { + "category": "people", + "name": "family: man, girl, boy", + "unicode": "1f468-200d-1f467-200d-1f466" + }, + ":family_man_girl_girl:": { + "category": "people", + "name": "family: man, girl, girl", + "unicode": "1f468-200d-1f467-200d-1f467" + }, + ":family_man_woman_boy:": { + "category": "people", + "name": "family: man, woman, boy", + "unicode": "1f468-200d-1f469-200d-1f466" + }, + ":family_mmb:": { + "category": "people", + "name": "family: man, man, boy", + "unicode": "1f468-200d-1f468-200d-1f466" + }, + ":family_mmbb:": { + "category": "people", + "name": "family: man, man, boy, boy", + "unicode": "1f468-200d-1f468-200d-1f466-200d-1f466" + }, + ":family_mmg:": { + "category": "people", + "name": "family: man, man, girl", + "unicode": "1f468-200d-1f468-200d-1f467" + }, + ":family_mmgb:": { + "category": "people", + "name": "family: man, man, girl, boy", + "unicode": "1f468-200d-1f468-200d-1f467-200d-1f466" + }, + ":family_mmgg:": { + "category": "people", + "name": "family: man, man, girl, girl", + "unicode": "1f468-200d-1f468-200d-1f467-200d-1f467" + }, + ":family_mwbb:": { + "category": "people", + "name": "family: man, woman, boy, boy", + "unicode": "1f468-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_mwg:": { + "category": "people", + "name": "family: man, woman, girl", + "unicode": "1f468-200d-1f469-200d-1f467" + }, + ":family_mwgb:": { + "category": "people", + "name": "family: man, woman, girl, boy", + "unicode": "1f468-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_mwgg:": { + "category": "people", + "name": "family: man, woman, girl, girl", + "unicode": "1f468-200d-1f469-200d-1f467-200d-1f467" + }, + ":family_woman_boy:": { + "category": "people", + "name": "family: woman, boy", + "unicode": "1f469-200d-1f466" + }, + ":family_woman_boy_boy:": { + "category": "people", + "name": "family: woman, boy, boy", + "unicode": "1f469-200d-1f466-200d-1f466" + }, + ":family_woman_girl:": { + "category": "people", + "name": "family: woman, girl", + "unicode": "1f469-200d-1f467" + }, + ":family_woman_girl_boy:": { + "category": "people", + "name": "family: woman, girl, boy", + "unicode": "1f469-200d-1f467-200d-1f466" + }, + ":family_woman_girl_girl:": { + "category": "people", + "name": "family: woman, girl, girl", + "unicode": "1f469-200d-1f467-200d-1f467" + }, + ":family_wwb:": { + "category": "people", + "name": "family: woman, woman, boy", + "unicode": "1f469-200d-1f469-200d-1f466" + }, + ":family_wwbb:": { + "category": "people", + "name": "family: woman, woman, boy, boy", + "unicode": "1f469-200d-1f469-200d-1f466-200d-1f466" + }, + ":family_wwg:": { + "category": "people", + "name": "family: woman, woman, girl", + "unicode": "1f469-200d-1f469-200d-1f467" + }, + ":family_wwgb:": { + "category": "people", + "name": "family: woman, woman, girl, boy", + "unicode": "1f469-200d-1f469-200d-1f467-200d-1f466" + }, + ":family_wwgg:": { + "category": "people", + "name": "family: woman, woman, girl, girl", + "unicode": "1f469-200d-1f469-200d-1f467-200d-1f467" + }, + ":farmer:": { + "category": "people", + "name": "farmer", + "unicode": "1f9d1-200d-1f33e" + }, + ":farmer_tone1:": { + "category": "people", + "name": "farmer: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f33e" + }, + ":farmer_tone2:": { + "category": "people", + "name": "farmer: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f33e" + }, + ":farmer_tone3:": { + "category": "people", + "name": "farmer: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f33e" + }, + ":farmer_tone4:": { + "category": "people", + "name": "farmer: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f33e" + }, + ":farmer_tone5:": { + "category": "people", + "name": "farmer: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f33e" + }, + ":fast_forward:": { + "category": "symbols", + "name": "fast-forward button", + "unicode": "23e9" + }, + ":fax:": { + "category": "objects", + "name": "fax machine", + "unicode": "1f4e0" + }, + ":fearful:": { + "category": "people", + "name": "fearful face", + "unicode": "1f628" + }, + ":feather:": { + "category": "nature", + "name": "feather", + "unicode": "1fab6" + }, + ":feet:": { + "category": "nature", + "name": "paw prints", + "unicode": "1f43e" + }, + ":female_sign:": { + "category": "symbols", + "name": "female sign", + "unicode": "2640" + }, + ":ferris_wheel:": { + "category": "travel", + "name": "ferris wheel", + "unicode": "1f3a1" + }, + ":ferry:": { + "category": "travel", + "name": "ferry", + "unicode": "26f4" + }, + ":field_hockey:": { + "category": "activity", + "name": "field hockey", + "unicode": "1f3d1" + }, + ":file_cabinet:": { + "category": "objects", + "name": "file cabinet", + "unicode": "1f5c4" + }, + ":file_folder:": { + "category": "objects", + "name": "file folder", + "unicode": "1f4c1" + }, + ":film_frames:": { + "category": "objects", + "name": "film frames", + "unicode": "1f39e" + }, + ":fingerprint:": { + "category": "people", + "name": "fingerprint", + "unicode": "1fac6" + }, + ":fingers_crossed:": { + "category": "people", + "name": "crossed fingers", + "unicode": "1f91e" + }, + ":fingers_crossed_tone1:": { + "category": "people", + "name": "crossed fingers: light skin tone", + "unicode": "1f91e-1f3fb" + }, + ":fingers_crossed_tone2:": { + "category": "people", + "name": "crossed fingers: medium-light skin tone", + "unicode": "1f91e-1f3fc" + }, + ":fingers_crossed_tone3:": { + "category": "people", + "name": "crossed fingers: medium skin tone", + "unicode": "1f91e-1f3fd" + }, + ":fingers_crossed_tone4:": { + "category": "people", + "name": "crossed fingers: medium-dark skin tone", + "unicode": "1f91e-1f3fe" + }, + ":fingers_crossed_tone5:": { + "category": "people", + "name": "crossed fingers: dark skin tone", + "unicode": "1f91e-1f3ff" + }, + ":fire:": { + "category": "nature", + "name": "fire", + "unicode": "1f525" + }, + ":fire_engine:": { + "category": "travel", + "name": "fire engine", + "unicode": "1f692" + }, + ":fire_extinguisher:": { + "category": "objects", + "name": "fire extinguisher", + "unicode": "1f9ef" + }, + ":firecracker:": { + "category": "objects", + "name": "firecracker", + "unicode": "1f9e8" + }, + ":firefighter:": { + "category": "people", + "name": "firefighter", + "unicode": "1f9d1-200d-1f692" + }, + ":firefighter_tone1:": { + "category": "people", + "name": "firefighter: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f692" + }, + ":firefighter_tone2:": { + "category": "people", + "name": "firefighter: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f692" + }, + ":firefighter_tone3:": { + "category": "people", + "name": "firefighter: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f692" + }, + ":firefighter_tone4:": { + "category": "people", + "name": "firefighter: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f692" + }, + ":firefighter_tone5:": { + "category": "people", + "name": "firefighter: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f692" + }, + ":fireworks:": { + "category": "travel", + "name": "fireworks", + "unicode": "1f386" + }, + ":first_place:": { + "category": "activity", + "name": "1st place medal", + "unicode": "1f947" + }, + ":first_quarter_moon:": { + "category": "nature", + "name": "first quarter moon", + "unicode": "1f313" + }, + ":first_quarter_moon_with_face:": { + "category": "nature", + "name": "first quarter moon face", + "unicode": "1f31b" + }, + ":fish:": { + "category": "nature", + "name": "fish", + "unicode": "1f41f" + }, + ":fish_cake:": { + "category": "food", + "name": "fish cake with swirl", + "unicode": "1f365" + }, + ":fishing_pole_and_fish:": { + "category": "activity", + "name": "fishing pole", + "unicode": "1f3a3" + }, + ":fist:": { + "category": "people", + "name": "raised fist", + "unicode": "270a" + }, + ":fist_tone1:": { + "category": "people", + "name": "raised fist: light skin tone", + "unicode": "270a-1f3fb" + }, + ":fist_tone2:": { + "category": "people", + "name": "raised fist: medium-light skin tone", + "unicode": "270a-1f3fc" + }, + ":fist_tone3:": { + "category": "people", + "name": "raised fist: medium skin tone", + "unicode": "270a-1f3fd" + }, + ":fist_tone4:": { + "category": "people", + "name": "raised fist: medium-dark skin tone", + "unicode": "270a-1f3fe" + }, + ":fist_tone5:": { + "category": "people", + "name": "raised fist: dark skin tone", + "unicode": "270a-1f3ff" + }, + ":five:": { + "category": "symbols", + "name": "keycap: 5", + "unicode": "35-20e3", + "unicode_alt": "0035-20e3" + }, + ":flag_ac:": { + "category": "flags", + "name": "flag: Ascension Island", + "unicode": "1f1e6-1f1e8" + }, + ":flag_ad:": { + "category": "flags", + "name": "flag: Andorra", + "unicode": "1f1e6-1f1e9" + }, + ":flag_ae:": { + "category": "flags", + "name": "flag: United Arab Emirates", + "unicode": "1f1e6-1f1ea" + }, + ":flag_af:": { + "category": "flags", + "name": "flag: Afghanistan", + "unicode": "1f1e6-1f1eb" + }, + ":flag_ag:": { + "category": "flags", + "name": "flag: Antigua & Barbuda", + "unicode": "1f1e6-1f1ec" + }, + ":flag_ai:": { + "category": "flags", + "name": "flag: Anguilla", + "unicode": "1f1e6-1f1ee" + }, + ":flag_al:": { + "category": "flags", + "name": "flag: Albania", + "unicode": "1f1e6-1f1f1" + }, + ":flag_am:": { + "category": "flags", + "name": "flag: Armenia", + "unicode": "1f1e6-1f1f2" + }, + ":flag_ao:": { + "category": "flags", + "name": "flag: Angola", + "unicode": "1f1e6-1f1f4" + }, + ":flag_aq:": { + "category": "flags", + "name": "flag: Antarctica", + "unicode": "1f1e6-1f1f6" + }, + ":flag_ar:": { + "category": "flags", + "name": "flag: Argentina", + "unicode": "1f1e6-1f1f7" + }, + ":flag_as:": { + "category": "flags", + "name": "flag: American Samoa", + "unicode": "1f1e6-1f1f8" + }, + ":flag_at:": { + "category": "flags", + "name": "flag: Austria", + "unicode": "1f1e6-1f1f9" + }, + ":flag_au:": { + "category": "flags", + "name": "flag: Australia", + "unicode": "1f1e6-1f1fa" + }, + ":flag_aw:": { + "category": "flags", + "name": "flag: Aruba", + "unicode": "1f1e6-1f1fc" + }, + ":flag_ax:": { + "category": "flags", + "name": "flag: \u00c5land Islands", + "unicode": "1f1e6-1f1fd" + }, + ":flag_az:": { + "category": "flags", + "name": "flag: Azerbaijan", + "unicode": "1f1e6-1f1ff" + }, + ":flag_ba:": { + "category": "flags", + "name": "flag: Bosnia & Herzegovina", + "unicode": "1f1e7-1f1e6" + }, + ":flag_bb:": { + "category": "flags", + "name": "flag: Barbados", + "unicode": "1f1e7-1f1e7" + }, + ":flag_bd:": { + "category": "flags", + "name": "flag: Bangladesh", + "unicode": "1f1e7-1f1e9" + }, + ":flag_be:": { + "category": "flags", + "name": "flag: Belgium", + "unicode": "1f1e7-1f1ea" + }, + ":flag_bf:": { + "category": "flags", + "name": "flag: Burkina Faso", + "unicode": "1f1e7-1f1eb" + }, + ":flag_bg:": { + "category": "flags", + "name": "flag: Bulgaria", + "unicode": "1f1e7-1f1ec" + }, + ":flag_bh:": { + "category": "flags", + "name": "flag: Bahrain", + "unicode": "1f1e7-1f1ed" + }, + ":flag_bi:": { + "category": "flags", + "name": "flag: Burundi", + "unicode": "1f1e7-1f1ee" + }, + ":flag_bj:": { + "category": "flags", + "name": "flag: Benin", + "unicode": "1f1e7-1f1ef" + }, + ":flag_bl:": { + "category": "flags", + "name": "flag: St. Barth\u00e9lemy", + "unicode": "1f1e7-1f1f1" + }, + ":flag_black:": { + "category": "flags", + "name": "black flag", + "unicode": "1f3f4" + }, + ":flag_bm:": { + "category": "flags", + "name": "flag: Bermuda", + "unicode": "1f1e7-1f1f2" + }, + ":flag_bn:": { + "category": "flags", + "name": "flag: Brunei", + "unicode": "1f1e7-1f1f3" + }, + ":flag_bo:": { + "category": "flags", + "name": "flag: Bolivia", + "unicode": "1f1e7-1f1f4" + }, + ":flag_bq:": { + "category": "flags", + "name": "flag: Caribbean Netherlands", + "unicode": "1f1e7-1f1f6" + }, + ":flag_br:": { + "category": "flags", + "name": "flag: Brazil", + "unicode": "1f1e7-1f1f7" + }, + ":flag_bs:": { + "category": "flags", + "name": "flag: Bahamas", + "unicode": "1f1e7-1f1f8" + }, + ":flag_bt:": { + "category": "flags", + "name": "flag: Bhutan", + "unicode": "1f1e7-1f1f9" + }, + ":flag_bv:": { + "category": "flags", + "name": "flag: Bouvet Island", + "unicode": "1f1e7-1f1fb" + }, + ":flag_bw:": { + "category": "flags", + "name": "flag: Botswana", + "unicode": "1f1e7-1f1fc" + }, + ":flag_by:": { + "category": "flags", + "name": "flag: Belarus", + "unicode": "1f1e7-1f1fe" + }, + ":flag_bz:": { + "category": "flags", + "name": "flag: Belize", + "unicode": "1f1e7-1f1ff" + }, + ":flag_ca:": { + "category": "flags", + "name": "flag: Canada", + "unicode": "1f1e8-1f1e6" + }, + ":flag_cc:": { + "category": "flags", + "name": "flag: Cocos (Keeling) Islands", + "unicode": "1f1e8-1f1e8" + }, + ":flag_cd:": { + "category": "flags", + "name": "flag: Congo - Kinshasa", + "unicode": "1f1e8-1f1e9" + }, + ":flag_cf:": { + "category": "flags", + "name": "flag: Central African Republic", + "unicode": "1f1e8-1f1eb" + }, + ":flag_cg:": { + "category": "flags", + "name": "flag: Congo - Brazzaville", + "unicode": "1f1e8-1f1ec" + }, + ":flag_ch:": { + "category": "flags", + "name": "flag: Switzerland", + "unicode": "1f1e8-1f1ed" + }, + ":flag_ci:": { + "category": "flags", + "name": "flag: C\u00f4te d\u2019Ivoire", + "unicode": "1f1e8-1f1ee" + }, + ":flag_ck:": { + "category": "flags", + "name": "flag: Cook Islands", + "unicode": "1f1e8-1f1f0" + }, + ":flag_cl:": { + "category": "flags", + "name": "flag: Chile", + "unicode": "1f1e8-1f1f1" + }, + ":flag_cm:": { + "category": "flags", + "name": "flag: Cameroon", + "unicode": "1f1e8-1f1f2" + }, + ":flag_cn:": { + "category": "flags", + "name": "flag: China", + "unicode": "1f1e8-1f1f3" + }, + ":flag_co:": { + "category": "flags", + "name": "flag: Colombia", + "unicode": "1f1e8-1f1f4" + }, + ":flag_cp:": { + "category": "flags", + "name": "flag: Clipperton Island", + "unicode": "1f1e8-1f1f5" + }, + ":flag_cr:": { + "category": "flags", + "name": "flag: Costa Rica", + "unicode": "1f1e8-1f1f7" + }, + ":flag_cu:": { + "category": "flags", + "name": "flag: Cuba", + "unicode": "1f1e8-1f1fa" + }, + ":flag_cv:": { + "category": "flags", + "name": "flag: Cape Verde", + "unicode": "1f1e8-1f1fb" + }, + ":flag_cw:": { + "category": "flags", + "name": "flag: Cura\u00e7ao", + "unicode": "1f1e8-1f1fc" + }, + ":flag_cx:": { + "category": "flags", + "name": "flag: Christmas Island", + "unicode": "1f1e8-1f1fd" + }, + ":flag_cy:": { + "category": "flags", + "name": "flag: Cyprus", + "unicode": "1f1e8-1f1fe" + }, + ":flag_cz:": { + "category": "flags", + "name": "flag: Czechia", + "unicode": "1f1e8-1f1ff" + }, + ":flag_de:": { + "category": "flags", + "name": "flag: Germany", + "unicode": "1f1e9-1f1ea" + }, + ":flag_dg:": { + "category": "flags", + "name": "flag: Diego Garcia", + "unicode": "1f1e9-1f1ec" + }, + ":flag_dj:": { + "category": "flags", + "name": "flag: Djibouti", + "unicode": "1f1e9-1f1ef" + }, + ":flag_dk:": { + "category": "flags", + "name": "flag: Denmark", + "unicode": "1f1e9-1f1f0" + }, + ":flag_dm:": { + "category": "flags", + "name": "flag: Dominica", + "unicode": "1f1e9-1f1f2" + }, + ":flag_do:": { + "category": "flags", + "name": "flag: Dominican Republic", + "unicode": "1f1e9-1f1f4" + }, + ":flag_dz:": { + "category": "flags", + "name": "flag: Algeria", + "unicode": "1f1e9-1f1ff" + }, + ":flag_ea:": { + "category": "flags", + "name": "flag: Ceuta & Melilla", + "unicode": "1f1ea-1f1e6" + }, + ":flag_ec:": { + "category": "flags", + "name": "flag: Ecuador", + "unicode": "1f1ea-1f1e8" + }, + ":flag_ee:": { + "category": "flags", + "name": "flag: Estonia", + "unicode": "1f1ea-1f1ea" + }, + ":flag_eg:": { + "category": "flags", + "name": "flag: Egypt", + "unicode": "1f1ea-1f1ec" + }, + ":flag_eh:": { + "category": "flags", + "name": "flag: Western Sahara", + "unicode": "1f1ea-1f1ed" + }, + ":flag_er:": { + "category": "flags", + "name": "flag: Eritrea", + "unicode": "1f1ea-1f1f7" + }, + ":flag_es:": { + "category": "flags", + "name": "flag: Spain", + "unicode": "1f1ea-1f1f8" + }, + ":flag_et:": { + "category": "flags", + "name": "flag: Ethiopia", + "unicode": "1f1ea-1f1f9" + }, + ":flag_eu:": { + "category": "flags", + "name": "flag: European Union", + "unicode": "1f1ea-1f1fa" + }, + ":flag_fi:": { + "category": "flags", + "name": "flag: Finland", + "unicode": "1f1eb-1f1ee" + }, + ":flag_fj:": { + "category": "flags", + "name": "flag: Fiji", + "unicode": "1f1eb-1f1ef" + }, + ":flag_fk:": { + "category": "flags", + "name": "flag: Falkland Islands", + "unicode": "1f1eb-1f1f0" + }, + ":flag_fm:": { + "category": "flags", + "name": "flag: Micronesia", + "unicode": "1f1eb-1f1f2" + }, + ":flag_fo:": { + "category": "flags", + "name": "flag: Faroe Islands", + "unicode": "1f1eb-1f1f4" + }, + ":flag_fr:": { + "category": "flags", + "name": "flag: France", + "unicode": "1f1eb-1f1f7" + }, + ":flag_ga:": { + "category": "flags", + "name": "flag: Gabon", + "unicode": "1f1ec-1f1e6" + }, + ":flag_gb:": { + "category": "flags", + "name": "flag: United Kingdom", + "unicode": "1f1ec-1f1e7" + }, + ":flag_gd:": { + "category": "flags", + "name": "flag: Grenada", + "unicode": "1f1ec-1f1e9" + }, + ":flag_ge:": { + "category": "flags", + "name": "flag: Georgia", + "unicode": "1f1ec-1f1ea" + }, + ":flag_gf:": { + "category": "flags", + "name": "flag: French Guiana", + "unicode": "1f1ec-1f1eb" + }, + ":flag_gg:": { + "category": "flags", + "name": "flag: Guernsey", + "unicode": "1f1ec-1f1ec" + }, + ":flag_gh:": { + "category": "flags", + "name": "flag: Ghana", + "unicode": "1f1ec-1f1ed" + }, + ":flag_gi:": { + "category": "flags", + "name": "flag: Gibraltar", + "unicode": "1f1ec-1f1ee" + }, + ":flag_gl:": { + "category": "flags", + "name": "flag: Greenland", + "unicode": "1f1ec-1f1f1" + }, + ":flag_gm:": { + "category": "flags", + "name": "flag: Gambia", + "unicode": "1f1ec-1f1f2" + }, + ":flag_gn:": { + "category": "flags", + "name": "flag: Guinea", + "unicode": "1f1ec-1f1f3" + }, + ":flag_gp:": { + "category": "flags", + "name": "flag: Guadeloupe", + "unicode": "1f1ec-1f1f5" + }, + ":flag_gq:": { + "category": "flags", + "name": "flag: Equatorial Guinea", + "unicode": "1f1ec-1f1f6" + }, + ":flag_gr:": { + "category": "flags", + "name": "flag: Greece", + "unicode": "1f1ec-1f1f7" + }, + ":flag_gs:": { + "category": "flags", + "name": "flag: South Georgia & South Sandwich Islands", + "unicode": "1f1ec-1f1f8" + }, + ":flag_gt:": { + "category": "flags", + "name": "flag: Guatemala", + "unicode": "1f1ec-1f1f9" + }, + ":flag_gu:": { + "category": "flags", + "name": "flag: Guam", + "unicode": "1f1ec-1f1fa" + }, + ":flag_gw:": { + "category": "flags", + "name": "flag: Guinea-Bissau", + "unicode": "1f1ec-1f1fc" + }, + ":flag_gy:": { + "category": "flags", + "name": "flag: Guyana", + "unicode": "1f1ec-1f1fe" + }, + ":flag_hk:": { + "category": "flags", + "name": "flag: Hong Kong SAR China", + "unicode": "1f1ed-1f1f0" + }, + ":flag_hm:": { + "category": "flags", + "name": "flag: Heard & McDonald Islands", + "unicode": "1f1ed-1f1f2" + }, + ":flag_hn:": { + "category": "flags", + "name": "flag: Honduras", + "unicode": "1f1ed-1f1f3" + }, + ":flag_hr:": { + "category": "flags", + "name": "flag: Croatia", + "unicode": "1f1ed-1f1f7" + }, + ":flag_ht:": { + "category": "flags", + "name": "flag: Haiti", + "unicode": "1f1ed-1f1f9" + }, + ":flag_hu:": { + "category": "flags", + "name": "flag: Hungary", + "unicode": "1f1ed-1f1fa" + }, + ":flag_ic:": { + "category": "flags", + "name": "flag: Canary Islands", + "unicode": "1f1ee-1f1e8" + }, + ":flag_id:": { + "category": "flags", + "name": "flag: Indonesia", + "unicode": "1f1ee-1f1e9" + }, + ":flag_ie:": { + "category": "flags", + "name": "flag: Ireland", + "unicode": "1f1ee-1f1ea" + }, + ":flag_il:": { + "category": "flags", + "name": "flag: Israel", + "unicode": "1f1ee-1f1f1" + }, + ":flag_im:": { + "category": "flags", + "name": "flag: Isle of Man", + "unicode": "1f1ee-1f1f2" + }, + ":flag_in:": { + "category": "flags", + "name": "flag: India", + "unicode": "1f1ee-1f1f3" + }, + ":flag_io:": { + "category": "flags", + "name": "flag: British Indian Ocean Territory", + "unicode": "1f1ee-1f1f4" + }, + ":flag_iq:": { + "category": "flags", + "name": "flag: Iraq", + "unicode": "1f1ee-1f1f6" + }, + ":flag_ir:": { + "category": "flags", + "name": "flag: Iran", + "unicode": "1f1ee-1f1f7" + }, + ":flag_is:": { + "category": "flags", + "name": "flag: Iceland", + "unicode": "1f1ee-1f1f8" + }, + ":flag_it:": { + "category": "flags", + "name": "flag: Italy", + "unicode": "1f1ee-1f1f9" + }, + ":flag_je:": { + "category": "flags", + "name": "flag: Jersey", + "unicode": "1f1ef-1f1ea" + }, + ":flag_jm:": { + "category": "flags", + "name": "flag: Jamaica", + "unicode": "1f1ef-1f1f2" + }, + ":flag_jo:": { + "category": "flags", + "name": "flag: Jordan", + "unicode": "1f1ef-1f1f4" + }, + ":flag_jp:": { + "category": "flags", + "name": "flag: Japan", + "unicode": "1f1ef-1f1f5" + }, + ":flag_ke:": { + "category": "flags", + "name": "flag: Kenya", + "unicode": "1f1f0-1f1ea" + }, + ":flag_kg:": { + "category": "flags", + "name": "flag: Kyrgyzstan", + "unicode": "1f1f0-1f1ec" + }, + ":flag_kh:": { + "category": "flags", + "name": "flag: Cambodia", + "unicode": "1f1f0-1f1ed" + }, + ":flag_ki:": { + "category": "flags", + "name": "flag: Kiribati", + "unicode": "1f1f0-1f1ee" + }, + ":flag_km:": { + "category": "flags", + "name": "flag: Comoros", + "unicode": "1f1f0-1f1f2" + }, + ":flag_kn:": { + "category": "flags", + "name": "flag: St. Kitts & Nevis", + "unicode": "1f1f0-1f1f3" + }, + ":flag_kp:": { + "category": "flags", + "name": "flag: North Korea", + "unicode": "1f1f0-1f1f5" + }, + ":flag_kr:": { + "category": "flags", + "name": "flag: South Korea", + "unicode": "1f1f0-1f1f7" + }, + ":flag_kw:": { + "category": "flags", + "name": "flag: Kuwait", + "unicode": "1f1f0-1f1fc" + }, + ":flag_ky:": { + "category": "flags", + "name": "flag: Cayman Islands", + "unicode": "1f1f0-1f1fe" + }, + ":flag_kz:": { + "category": "flags", + "name": "flag: Kazakhstan", + "unicode": "1f1f0-1f1ff" + }, + ":flag_la:": { + "category": "flags", + "name": "flag: Laos", + "unicode": "1f1f1-1f1e6" + }, + ":flag_lb:": { + "category": "flags", + "name": "flag: Lebanon", + "unicode": "1f1f1-1f1e7" + }, + ":flag_lc:": { + "category": "flags", + "name": "flag: St. Lucia", + "unicode": "1f1f1-1f1e8" + }, + ":flag_li:": { + "category": "flags", + "name": "flag: Liechtenstein", + "unicode": "1f1f1-1f1ee" + }, + ":flag_lk:": { + "category": "flags", + "name": "flag: Sri Lanka", + "unicode": "1f1f1-1f1f0" + }, + ":flag_lr:": { + "category": "flags", + "name": "flag: Liberia", + "unicode": "1f1f1-1f1f7" + }, + ":flag_ls:": { + "category": "flags", + "name": "flag: Lesotho", + "unicode": "1f1f1-1f1f8" + }, + ":flag_lt:": { + "category": "flags", + "name": "flag: Lithuania", + "unicode": "1f1f1-1f1f9" + }, + ":flag_lu:": { + "category": "flags", + "name": "flag: Luxembourg", + "unicode": "1f1f1-1f1fa" + }, + ":flag_lv:": { + "category": "flags", + "name": "flag: Latvia", + "unicode": "1f1f1-1f1fb" + }, + ":flag_ly:": { + "category": "flags", + "name": "flag: Libya", + "unicode": "1f1f1-1f1fe" + }, + ":flag_ma:": { + "category": "flags", + "name": "flag: Morocco", + "unicode": "1f1f2-1f1e6" + }, + ":flag_mc:": { + "category": "flags", + "name": "flag: Monaco", + "unicode": "1f1f2-1f1e8" + }, + ":flag_md:": { + "category": "flags", + "name": "flag: Moldova", + "unicode": "1f1f2-1f1e9" + }, + ":flag_me:": { + "category": "flags", + "name": "flag: Montenegro", + "unicode": "1f1f2-1f1ea" + }, + ":flag_mf:": { + "category": "flags", + "name": "flag: St. Martin", + "unicode": "1f1f2-1f1eb" + }, + ":flag_mg:": { + "category": "flags", + "name": "flag: Madagascar", + "unicode": "1f1f2-1f1ec" + }, + ":flag_mh:": { + "category": "flags", + "name": "flag: Marshall Islands", + "unicode": "1f1f2-1f1ed" + }, + ":flag_mk:": { + "category": "flags", + "name": "flag: Macedonia", + "unicode": "1f1f2-1f1f0" + }, + ":flag_ml:": { + "category": "flags", + "name": "flag: Mali", + "unicode": "1f1f2-1f1f1" + }, + ":flag_mm:": { + "category": "flags", + "name": "flag: Myanmar (Burma)", + "unicode": "1f1f2-1f1f2" + }, + ":flag_mn:": { + "category": "flags", + "name": "flag: Mongolia", + "unicode": "1f1f2-1f1f3" + }, + ":flag_mo:": { + "category": "flags", + "name": "flag: Macao SAR China", + "unicode": "1f1f2-1f1f4" + }, + ":flag_mp:": { + "category": "flags", + "name": "flag: Northern Mariana Islands", + "unicode": "1f1f2-1f1f5" + }, + ":flag_mq:": { + "category": "flags", + "name": "flag: Martinique", + "unicode": "1f1f2-1f1f6" + }, + ":flag_mr:": { + "category": "flags", + "name": "flag: Mauritania", + "unicode": "1f1f2-1f1f7" + }, + ":flag_ms:": { + "category": "flags", + "name": "flag: Montserrat", + "unicode": "1f1f2-1f1f8" + }, + ":flag_mt:": { + "category": "flags", + "name": "flag: Malta", + "unicode": "1f1f2-1f1f9" + }, + ":flag_mu:": { + "category": "flags", + "name": "flag: Mauritius", + "unicode": "1f1f2-1f1fa" + }, + ":flag_mv:": { + "category": "flags", + "name": "flag: Maldives", + "unicode": "1f1f2-1f1fb" + }, + ":flag_mw:": { + "category": "flags", + "name": "flag: Malawi", + "unicode": "1f1f2-1f1fc" + }, + ":flag_mx:": { + "category": "flags", + "name": "flag: Mexico", + "unicode": "1f1f2-1f1fd" + }, + ":flag_my:": { + "category": "flags", + "name": "flag: Malaysia", + "unicode": "1f1f2-1f1fe" + }, + ":flag_mz:": { + "category": "flags", + "name": "flag: Mozambique", + "unicode": "1f1f2-1f1ff" + }, + ":flag_na:": { + "category": "flags", + "name": "flag: Namibia", + "unicode": "1f1f3-1f1e6" + }, + ":flag_nc:": { + "category": "flags", + "name": "flag: New Caledonia", + "unicode": "1f1f3-1f1e8" + }, + ":flag_ne:": { + "category": "flags", + "name": "flag: Niger", + "unicode": "1f1f3-1f1ea" + }, + ":flag_nf:": { + "category": "flags", + "name": "flag: Norfolk Island", + "unicode": "1f1f3-1f1eb" + }, + ":flag_ng:": { + "category": "flags", + "name": "flag: Nigeria", + "unicode": "1f1f3-1f1ec" + }, + ":flag_ni:": { + "category": "flags", + "name": "flag: Nicaragua", + "unicode": "1f1f3-1f1ee" + }, + ":flag_nl:": { + "category": "flags", + "name": "flag: Netherlands", + "unicode": "1f1f3-1f1f1" + }, + ":flag_no:": { + "category": "flags", + "name": "flag: Norway", + "unicode": "1f1f3-1f1f4" + }, + ":flag_np:": { + "category": "flags", + "name": "flag: Nepal", + "unicode": "1f1f3-1f1f5" + }, + ":flag_nr:": { + "category": "flags", + "name": "flag: Nauru", + "unicode": "1f1f3-1f1f7" + }, + ":flag_nu:": { + "category": "flags", + "name": "flag: Niue", + "unicode": "1f1f3-1f1fa" + }, + ":flag_nz:": { + "category": "flags", + "name": "flag: New Zealand", + "unicode": "1f1f3-1f1ff" + }, + ":flag_om:": { + "category": "flags", + "name": "flag: Oman", + "unicode": "1f1f4-1f1f2" + }, + ":flag_pa:": { + "category": "flags", + "name": "flag: Panama", + "unicode": "1f1f5-1f1e6" + }, + ":flag_pe:": { + "category": "flags", + "name": "flag: Peru", + "unicode": "1f1f5-1f1ea" + }, + ":flag_pf:": { + "category": "flags", + "name": "flag: French Polynesia", + "unicode": "1f1f5-1f1eb" + }, + ":flag_pg:": { + "category": "flags", + "name": "flag: Papua New Guinea", + "unicode": "1f1f5-1f1ec" + }, + ":flag_ph:": { + "category": "flags", + "name": "flag: Philippines", + "unicode": "1f1f5-1f1ed" + }, + ":flag_pk:": { + "category": "flags", + "name": "flag: Pakistan", + "unicode": "1f1f5-1f1f0" + }, + ":flag_pl:": { + "category": "flags", + "name": "flag: Poland", + "unicode": "1f1f5-1f1f1" + }, + ":flag_pm:": { + "category": "flags", + "name": "flag: St. Pierre & Miquelon", + "unicode": "1f1f5-1f1f2" + }, + ":flag_pn:": { + "category": "flags", + "name": "flag: Pitcairn Islands", + "unicode": "1f1f5-1f1f3" + }, + ":flag_pr:": { + "category": "flags", + "name": "flag: Puerto Rico", + "unicode": "1f1f5-1f1f7" + }, + ":flag_ps:": { + "category": "flags", + "name": "flag: Palestinian Territories", + "unicode": "1f1f5-1f1f8" + }, + ":flag_pt:": { + "category": "flags", + "name": "flag: Portugal", + "unicode": "1f1f5-1f1f9" + }, + ":flag_pw:": { + "category": "flags", + "name": "flag: Palau", + "unicode": "1f1f5-1f1fc" + }, + ":flag_py:": { + "category": "flags", + "name": "flag: Paraguay", + "unicode": "1f1f5-1f1fe" + }, + ":flag_qa:": { + "category": "flags", + "name": "flag: Qatar", + "unicode": "1f1f6-1f1e6" + }, + ":flag_re:": { + "category": "flags", + "name": "flag: R\u00e9union", + "unicode": "1f1f7-1f1ea" + }, + ":flag_ro:": { + "category": "flags", + "name": "flag: Romania", + "unicode": "1f1f7-1f1f4" + }, + ":flag_rs:": { + "category": "flags", + "name": "flag: Serbia", + "unicode": "1f1f7-1f1f8" + }, + ":flag_ru:": { + "category": "flags", + "name": "flag: Russia", + "unicode": "1f1f7-1f1fa" + }, + ":flag_rw:": { + "category": "flags", + "name": "flag: Rwanda", + "unicode": "1f1f7-1f1fc" + }, + ":flag_sa:": { + "category": "flags", + "name": "flag: Saudi Arabia", + "unicode": "1f1f8-1f1e6" + }, + ":flag_sark:": { + "category": "flags", + "name": "flag: Sark", + "unicode": "1f1e8-1f1f6" + }, + ":flag_sb:": { + "category": "flags", + "name": "flag: Solomon Islands", + "unicode": "1f1f8-1f1e7" + }, + ":flag_sc:": { + "category": "flags", + "name": "flag: Seychelles", + "unicode": "1f1f8-1f1e8" + }, + ":flag_sd:": { + "category": "flags", + "name": "flag: Sudan", + "unicode": "1f1f8-1f1e9" + }, + ":flag_se:": { + "category": "flags", + "name": "flag: Sweden", + "unicode": "1f1f8-1f1ea" + }, + ":flag_sg:": { + "category": "flags", + "name": "flag: Singapore", + "unicode": "1f1f8-1f1ec" + }, + ":flag_sh:": { + "category": "flags", + "name": "flag: St. Helena", + "unicode": "1f1f8-1f1ed" + }, + ":flag_si:": { + "category": "flags", + "name": "flag: Slovenia", + "unicode": "1f1f8-1f1ee" + }, + ":flag_sj:": { + "category": "flags", + "name": "flag: Svalbard & Jan Mayen", + "unicode": "1f1f8-1f1ef" + }, + ":flag_sk:": { + "category": "flags", + "name": "flag: Slovakia", + "unicode": "1f1f8-1f1f0" + }, + ":flag_sl:": { + "category": "flags", + "name": "flag: Sierra Leone", + "unicode": "1f1f8-1f1f1" + }, + ":flag_sm:": { + "category": "flags", + "name": "flag: San Marino", + "unicode": "1f1f8-1f1f2" + }, + ":flag_sn:": { + "category": "flags", + "name": "flag: Senegal", + "unicode": "1f1f8-1f1f3" + }, + ":flag_so:": { + "category": "flags", + "name": "flag: Somalia", + "unicode": "1f1f8-1f1f4" + }, + ":flag_sr:": { + "category": "flags", + "name": "flag: Suriname", + "unicode": "1f1f8-1f1f7" + }, + ":flag_ss:": { + "category": "flags", + "name": "flag: South Sudan", + "unicode": "1f1f8-1f1f8" + }, + ":flag_st:": { + "category": "flags", + "name": "flag: S\u00e3o Tom\u00e9 & Pr\u00edncipe", + "unicode": "1f1f8-1f1f9" + }, + ":flag_sv:": { + "category": "flags", + "name": "flag: El Salvador", + "unicode": "1f1f8-1f1fb" + }, + ":flag_sx:": { + "category": "flags", + "name": "flag: Sint Maarten", + "unicode": "1f1f8-1f1fd" + }, + ":flag_sy:": { + "category": "flags", + "name": "flag: Syria", + "unicode": "1f1f8-1f1fe" + }, + ":flag_sz:": { + "category": "flags", + "name": "flag: Eswatini", + "unicode": "1f1f8-1f1ff" + }, + ":flag_ta:": { + "category": "flags", + "name": "flag: Tristan da Cunha", + "unicode": "1f1f9-1f1e6" + }, + ":flag_tc:": { + "category": "flags", + "name": "flag: Turks & Caicos Islands", + "unicode": "1f1f9-1f1e8" + }, + ":flag_td:": { + "category": "flags", + "name": "flag: Chad", + "unicode": "1f1f9-1f1e9" + }, + ":flag_tf:": { + "category": "flags", + "name": "flag: French Southern Territories", + "unicode": "1f1f9-1f1eb" + }, + ":flag_tg:": { + "category": "flags", + "name": "flag: Togo", + "unicode": "1f1f9-1f1ec" + }, + ":flag_th:": { + "category": "flags", + "name": "flag: Thailand", + "unicode": "1f1f9-1f1ed" + }, + ":flag_tj:": { + "category": "flags", + "name": "flag: Tajikistan", + "unicode": "1f1f9-1f1ef" + }, + ":flag_tk:": { + "category": "flags", + "name": "flag: Tokelau", + "unicode": "1f1f9-1f1f0" + }, + ":flag_tl:": { + "category": "flags", + "name": "flag: Timor-Leste", + "unicode": "1f1f9-1f1f1" + }, + ":flag_tm:": { + "category": "flags", + "name": "flag: Turkmenistan", + "unicode": "1f1f9-1f1f2" + }, + ":flag_tn:": { + "category": "flags", + "name": "flag: Tunisia", + "unicode": "1f1f9-1f1f3" + }, + ":flag_to:": { + "category": "flags", + "name": "flag: Tonga", + "unicode": "1f1f9-1f1f4" + }, + ":flag_tr:": { + "category": "flags", + "name": "flag: Turkey", + "unicode": "1f1f9-1f1f7" + }, + ":flag_tt:": { + "category": "flags", + "name": "flag: Trinidad & Tobago", + "unicode": "1f1f9-1f1f9" + }, + ":flag_tv:": { + "category": "flags", + "name": "flag: Tuvalu", + "unicode": "1f1f9-1f1fb" + }, + ":flag_tw:": { + "category": "flags", + "name": "flag: Taiwan", + "unicode": "1f1f9-1f1fc" + }, + ":flag_tz:": { + "category": "flags", + "name": "flag: Tanzania", + "unicode": "1f1f9-1f1ff" + }, + ":flag_ua:": { + "category": "flags", + "name": "flag: Ukraine", + "unicode": "1f1fa-1f1e6" + }, + ":flag_ug:": { + "category": "flags", + "name": "flag: Uganda", + "unicode": "1f1fa-1f1ec" + }, + ":flag_um:": { + "category": "flags", + "name": "flag: U.S. Outlying Islands", + "unicode": "1f1fa-1f1f2" + }, + ":flag_us:": { + "category": "flags", + "name": "flag: United States", + "unicode": "1f1fa-1f1f8" + }, + ":flag_uy:": { + "category": "flags", + "name": "flag: Uruguay", + "unicode": "1f1fa-1f1fe" + }, + ":flag_uz:": { + "category": "flags", + "name": "flag: Uzbekistan", + "unicode": "1f1fa-1f1ff" + }, + ":flag_va:": { + "category": "flags", + "name": "flag: Vatican City", + "unicode": "1f1fb-1f1e6" + }, + ":flag_vc:": { + "category": "flags", + "name": "flag: St. Vincent & Grenadines", + "unicode": "1f1fb-1f1e8" + }, + ":flag_ve:": { + "category": "flags", + "name": "flag: Venezuela", + "unicode": "1f1fb-1f1ea" + }, + ":flag_vg:": { + "category": "flags", + "name": "flag: British Virgin Islands", + "unicode": "1f1fb-1f1ec" + }, + ":flag_vi:": { + "category": "flags", + "name": "flag: U.S. Virgin Islands", + "unicode": "1f1fb-1f1ee" + }, + ":flag_vn:": { + "category": "flags", + "name": "flag: Vietnam", + "unicode": "1f1fb-1f1f3" + }, + ":flag_vu:": { + "category": "flags", + "name": "flag: Vanuatu", + "unicode": "1f1fb-1f1fa" + }, + ":flag_wf:": { + "category": "flags", + "name": "flag: Wallis & Futuna", + "unicode": "1f1fc-1f1eb" + }, + ":flag_white:": { + "category": "flags", + "name": "white flag", + "unicode": "1f3f3" + }, + ":flag_ws:": { + "category": "flags", + "name": "flag: Samoa", + "unicode": "1f1fc-1f1f8" + }, + ":flag_xk:": { + "category": "flags", + "name": "flag: Kosovo", + "unicode": "1f1fd-1f1f0" + }, + ":flag_ye:": { + "category": "flags", + "name": "flag: Yemen", + "unicode": "1f1fe-1f1ea" + }, + ":flag_yt:": { + "category": "flags", + "name": "flag: Mayotte", + "unicode": "1f1fe-1f1f9" + }, + ":flag_za:": { + "category": "flags", + "name": "flag: South Africa", + "unicode": "1f1ff-1f1e6" + }, + ":flag_zm:": { + "category": "flags", + "name": "flag: Zambia", + "unicode": "1f1ff-1f1f2" + }, + ":flag_zw:": { + "category": "flags", + "name": "flag: Zimbabwe", + "unicode": "1f1ff-1f1fc" + }, + ":flags:": { + "category": "objects", + "name": "carp streamer", + "unicode": "1f38f" + }, + ":flamingo:": { + "category": "nature", + "name": "flamingo", + "unicode": "1f9a9" + }, + ":flashlight:": { + "category": "objects", + "name": "flashlight", + "unicode": "1f526" + }, + ":flatbread:": { + "category": "food", + "name": "flatbread", + "unicode": "1fad3" + }, + ":fleur-de-lis:": { + "category": "symbols", + "name": "fleur-de-lis", + "unicode": "269c" + }, + ":floppy_disk:": { + "category": "objects", + "name": "floppy disk", + "unicode": "1f4be" + }, + ":flower_playing_cards:": { + "category": "symbols", + "name": "flower playing cards", + "unicode": "1f3b4" + }, + ":flushed:": { + "category": "people", + "name": "flushed face", + "unicode": "1f633" + }, + ":flute:": { + "category": "activity", + "name": "flute", + "unicode": "1fa88" + }, + ":fly:": { + "category": "nature", + "name": "fly", + "unicode": "1fab0" + }, + ":flying_disc:": { + "category": "activity", + "name": "flying disc", + "unicode": "1f94f" + }, + ":flying_saucer:": { + "category": "travel", + "name": "flying saucer", + "unicode": "1f6f8" + }, + ":fog:": { + "category": "nature", + "name": "fog", + "unicode": "1f32b" + }, + ":foggy:": { + "category": "travel", + "name": "foggy", + "unicode": "1f301" + }, + ":folding_hand_fan:": { + "category": "objects", + "name": "folding hand fan", + "unicode": "1faad" + }, + ":fondue:": { + "category": "food", + "name": "fondue", + "unicode": "1fad5" + }, + ":foot:": { + "category": "people", + "name": "foot", + "unicode": "1f9b6" + }, + ":foot_tone1:": { + "category": "people", + "name": "foot: light skin tone", + "unicode": "1f9b6-1f3fb" + }, + ":foot_tone2:": { + "category": "people", + "name": "foot: medium-light skin tone", + "unicode": "1f9b6-1f3fc" + }, + ":foot_tone3:": { + "category": "people", + "name": "foot: medium skin tone", + "unicode": "1f9b6-1f3fd" + }, + ":foot_tone4:": { + "category": "people", + "name": "foot: medium-dark skin tone", + "unicode": "1f9b6-1f3fe" + }, + ":foot_tone5:": { + "category": "people", + "name": "foot: dark skin tone", + "unicode": "1f9b6-1f3ff" + }, + ":football:": { + "category": "activity", + "name": "american football", + "unicode": "1f3c8" + }, + ":footprints:": { + "category": "people", + "name": "footprints", + "unicode": "1f463" + }, + ":fork_and_knife:": { + "category": "food", + "name": "fork and knife", + "unicode": "1f374" + }, + ":fork_knife_plate:": { + "category": "food", + "name": "fork and knife with plate", + "unicode": "1f37d" + }, + ":fortune_cookie:": { + "category": "food", + "name": "fortune cookie", + "unicode": "1f960" + }, + ":fountain:": { + "category": "travel", + "name": "fountain", + "unicode": "26f2" + }, + ":four:": { + "category": "symbols", + "name": "keycap: 4", + "unicode": "34-20e3", + "unicode_alt": "0034-20e3" + }, + ":four_leaf_clover:": { + "category": "nature", + "name": "four leaf clover", + "unicode": "1f340" + }, + ":fox:": { + "category": "nature", + "name": "fox", + "unicode": "1f98a" + }, + ":frame_photo:": { + "category": "objects", + "name": "framed picture", + "unicode": "1f5bc" + }, + ":free:": { + "category": "symbols", + "name": "FREE button", + "unicode": "1f193" + }, + ":french_bread:": { + "category": "food", + "name": "baguette bread", + "unicode": "1f956" + }, + ":fried_shrimp:": { + "category": "food", + "name": "fried shrimp", + "unicode": "1f364" + }, + ":fries:": { + "category": "food", + "name": "french fries", + "unicode": "1f35f" + }, + ":frog:": { + "category": "nature", + "name": "frog", + "unicode": "1f438" + }, + ":frowning2:": { + "category": "people", + "name": "frowning face", + "unicode": "2639" + }, + ":frowning:": { + "category": "people", + "name": "frowning face with open mouth", + "unicode": "1f626" + }, + ":fuelpump:": { + "category": "travel", + "name": "fuel pump", + "unicode": "26fd" + }, + ":full_moon:": { + "category": "nature", + "name": "full moon", + "unicode": "1f315" + }, + ":full_moon_with_face:": { + "category": "nature", + "name": "full moon face", + "unicode": "1f31d" + }, + ":game_die:": { + "category": "activity", + "name": "game die", + "unicode": "1f3b2" + }, + ":garlic:": { + "category": "food", + "name": "garlic", + "unicode": "1f9c4" + }, + ":gear:": { + "category": "objects", + "name": "gear", + "unicode": "2699" + }, + ":gem:": { + "category": "objects", + "name": "gem stone", + "unicode": "1f48e" + }, + ":gemini:": { + "category": "symbols", + "name": "Gemini", + "unicode": "264a" + }, + ":genie:": { + "category": "people", + "name": "genie", + "unicode": "1f9de" + }, + ":ghost:": { + "category": "people", + "name": "ghost", + "unicode": "1f47b" + }, + ":gift:": { + "category": "objects", + "name": "wrapped gift", + "unicode": "1f381" + }, + ":gift_heart:": { + "category": "symbols", + "name": "heart with ribbon", + "unicode": "1f49d" + }, + ":ginger_root:": { + "category": "food", + "name": "ginger root", + "unicode": "1fada" + }, + ":giraffe:": { + "category": "nature", + "name": "giraffe", + "unicode": "1f992" + }, + ":girl:": { + "category": "people", + "name": "girl", + "unicode": "1f467" + }, + ":girl_tone1:": { + "category": "people", + "name": "girl: light skin tone", + "unicode": "1f467-1f3fb" + }, + ":girl_tone2:": { + "category": "people", + "name": "girl: medium-light skin tone", + "unicode": "1f467-1f3fc" + }, + ":girl_tone3:": { + "category": "people", + "name": "girl: medium skin tone", + "unicode": "1f467-1f3fd" + }, + ":girl_tone4:": { + "category": "people", + "name": "girl: medium-dark skin tone", + "unicode": "1f467-1f3fe" + }, + ":girl_tone5:": { + "category": "people", + "name": "girl: dark skin tone", + "unicode": "1f467-1f3ff" + }, + ":globe_with_meridians:": { + "category": "symbols", + "name": "globe with meridians", + "unicode": "1f310" + }, + ":gloves:": { + "category": "people", + "name": "gloves", + "unicode": "1f9e4" + }, + ":goal:": { + "category": "activity", + "name": "goal net", + "unicode": "1f945" + }, + ":goat:": { + "category": "nature", + "name": "goat", + "unicode": "1f410" + }, + ":goggles:": { + "category": "people", + "name": "goggles", + "unicode": "1f97d" + }, + ":golf:": { + "category": "activity", + "name": "flag in hole", + "unicode": "26f3" + }, + ":goose:": { + "category": "nature", + "name": "goose", + "unicode": "1fabf" + }, + ":gorilla:": { + "category": "nature", + "name": "gorilla", + "unicode": "1f98d" + }, + ":grapes:": { + "category": "food", + "name": "grapes", + "unicode": "1f347" + }, + ":green_apple:": { + "category": "food", + "name": "green apple", + "unicode": "1f34f" + }, + ":green_book:": { + "category": "objects", + "name": "green book", + "unicode": "1f4d7" + }, + ":green_circle:": { + "category": "symbols", + "name": "green circle", + "unicode": "1f7e2" + }, + ":green_heart:": { + "category": "symbols", + "name": "green heart", + "unicode": "1f49a" + }, + ":green_square:": { + "category": "symbols", + "name": "green square", + "unicode": "1f7e9" + }, + ":grey_exclamation:": { + "category": "symbols", + "name": "white exclamation mark", + "unicode": "2755" + }, + ":grey_heart:": { + "category": "symbols", + "name": "grey heart", + "unicode": "1fa76" + }, + ":grey_question:": { + "category": "symbols", + "name": "white question mark", + "unicode": "2754" + }, + ":grimacing:": { + "category": "people", + "name": "grimacing face", + "unicode": "1f62c" + }, + ":grin:": { + "category": "people", + "name": "beaming face with smiling eyes", + "unicode": "1f601" + }, + ":grinning:": { + "category": "people", + "name": "grinning face", + "unicode": "1f600" + }, + ":guard:": { + "category": "people", + "name": "guard", + "unicode": "1f482" + }, + ":guard_tone1:": { + "category": "people", + "name": "guard: light skin tone", + "unicode": "1f482-1f3fb" + }, + ":guard_tone2:": { + "category": "people", + "name": "guard: medium-light skin tone", + "unicode": "1f482-1f3fc" + }, + ":guard_tone3:": { + "category": "people", + "name": "guard: medium skin tone", + "unicode": "1f482-1f3fd" + }, + ":guard_tone4:": { + "category": "people", + "name": "guard: medium-dark skin tone", + "unicode": "1f482-1f3fe" + }, + ":guard_tone5:": { + "category": "people", + "name": "guard: dark skin tone", + "unicode": "1f482-1f3ff" + }, + ":guide_dog:": { + "category": "nature", + "name": "guide dog", + "unicode": "1f9ae" + }, + ":guitar:": { + "category": "activity", + "name": "guitar", + "unicode": "1f3b8" + }, + ":gun:": { + "category": "objects", + "name": "pistol", + "unicode": "1f52b" + }, + ":hair_pick:": { + "category": "objects", + "name": "hair pick", + "unicode": "1faae" + }, + ":hamburger:": { + "category": "food", + "name": "hamburger", + "unicode": "1f354" + }, + ":hammer:": { + "category": "objects", + "name": "hammer", + "unicode": "1f528" + }, + ":hammer_pick:": { + "category": "objects", + "name": "hammer and pick", + "unicode": "2692" + }, + ":hamsa:": { + "category": "objects", + "name": "hamsa", + "unicode": "1faac" + }, + ":hamster:": { + "category": "nature", + "name": "hamster", + "unicode": "1f439" + }, + ":hand_splayed:": { + "category": "people", + "name": "hand with fingers splayed", + "unicode": "1f590" + }, + ":hand_splayed_tone1:": { + "category": "people", + "name": "hand with fingers splayed: light skin tone", + "unicode": "1f590-1f3fb" + }, + ":hand_splayed_tone2:": { + "category": "people", + "name": "hand with fingers splayed: medium-light skin tone", + "unicode": "1f590-1f3fc" + }, + ":hand_splayed_tone3:": { + "category": "people", + "name": "hand with fingers splayed: medium skin tone", + "unicode": "1f590-1f3fd" + }, + ":hand_splayed_tone4:": { + "category": "people", + "name": "hand with fingers splayed: medium-dark skin tone", + "unicode": "1f590-1f3fe" + }, + ":hand_splayed_tone5:": { + "category": "people", + "name": "hand with fingers splayed: dark skin tone", + "unicode": "1f590-1f3ff" + }, + ":hand_with_index_finger_and_thumb_crossed:": { + "category": "people", + "name": "hand with index finger and thumb crossed", + "unicode": "1faf0" + }, + ":hand_with_index_finger_and_thumb_crossed_tone1:": { + "category": "people", + "name": "hand with index finger and thumb crossed: light skin tone", + "unicode": "1faf0-1f3fb" + }, + ":hand_with_index_finger_and_thumb_crossed_tone2:": { + "category": "people", + "name": "hand with index finger and thumb crossed: medium-light skin tone", + "unicode": "1faf0-1f3fc" + }, + ":hand_with_index_finger_and_thumb_crossed_tone3:": { + "category": "people", + "name": "hand with index finger and thumb crossed: medium skin tone", + "unicode": "1faf0-1f3fd" + }, + ":hand_with_index_finger_and_thumb_crossed_tone4:": { + "category": "people", + "name": "hand with index finger and thumb crossed: medium-dark skin tone", + "unicode": "1faf0-1f3fe" + }, + ":hand_with_index_finger_and_thumb_crossed_tone5:": { + "category": "people", + "name": "hand with index finger and thumb crossed: dark skin tone", + "unicode": "1faf0-1f3ff" + }, + ":handbag:": { + "category": "people", + "name": "handbag", + "unicode": "1f45c" + }, + ":handshake:": { + "category": "people", + "name": "handshake", + "unicode": "1f91d" + }, + ":handshake_tone1:": { + "category": "people", + "name": "handshake: light skin tone", + "unicode": "1f91d-1f3fb" + }, + ":handshake_tone1_tone2:": { + "category": "people", + "name": "handshake: light skin tone, medium-light skin tone", + "unicode": "1faf1-1f3fb-200d-1faf2-1f3fc" + }, + ":handshake_tone1_tone3:": { + "category": "people", + "name": "handshake: light skin tone, medium skin tone", + "unicode": "1faf1-1f3fb-200d-1faf2-1f3fd" + }, + ":handshake_tone1_tone4:": { + "category": "people", + "name": "handshake: light skin tone, medium-dark skin tone", + "unicode": "1faf1-1f3fb-200d-1faf2-1f3fe" + }, + ":handshake_tone1_tone5:": { + "category": "people", + "name": "handshake: light skin tone, dark skin tone", + "unicode": "1faf1-1f3fb-200d-1faf2-1f3ff" + }, + ":handshake_tone2:": { + "category": "people", + "name": "handshake: medium-light skin tone", + "unicode": "1f91d-1f3fc" + }, + ":handshake_tone2_tone1:": { + "category": "people", + "name": "handshake: medium-light skin tone, light skin tone", + "unicode": "1faf1-1f3fc-200d-1faf2-1f3fb" + }, + ":handshake_tone2_tone3:": { + "category": "people", + "name": "handshake: medium-light skin tone, medium skin tone", + "unicode": "1faf1-1f3fc-200d-1faf2-1f3fd" + }, + ":handshake_tone2_tone4:": { + "category": "people", + "name": "handshake: medium-light skin tone, medium-dark skin tone", + "unicode": "1faf1-1f3fc-200d-1faf2-1f3fe" + }, + ":handshake_tone2_tone5:": { + "category": "people", + "name": "handshake: medium-light skin tone, dark skin tone", + "unicode": "1faf1-1f3fc-200d-1faf2-1f3ff" + }, + ":handshake_tone3:": { + "category": "people", + "name": "handshake: medium skin tone", + "unicode": "1f91d-1f3fd" + }, + ":handshake_tone3_tone1:": { + "category": "people", + "name": "handshake: medium skin tone, light skin tone", + "unicode": "1faf1-1f3fd-200d-1faf2-1f3fb" + }, + ":handshake_tone3_tone2:": { + "category": "people", + "name": "handshake: medium skin tone, medium-light skin tone", + "unicode": "1faf1-1f3fd-200d-1faf2-1f3fc" + }, + ":handshake_tone3_tone4:": { + "category": "people", + "name": "handshake: medium skin tone, medium-dark skin tone", + "unicode": "1faf1-1f3fd-200d-1faf2-1f3fe" + }, + ":handshake_tone3_tone5:": { + "category": "people", + "name": "handshake: medium skin tone, dark skin tone", + "unicode": "1faf1-1f3fd-200d-1faf2-1f3ff" + }, + ":handshake_tone4:": { + "category": "people", + "name": "handshake: medium-dark skin tone", + "unicode": "1f91d-1f3fe" + }, + ":handshake_tone4_tone1:": { + "category": "people", + "name": "handshake: medium-dark skin tone, light skin tone", + "unicode": "1faf1-1f3fe-200d-1faf2-1f3fb" + }, + ":handshake_tone4_tone2:": { + "category": "people", + "name": "handshake: medium-dark skin tone, medium-light skin tone", + "unicode": "1faf1-1f3fe-200d-1faf2-1f3fc" + }, + ":handshake_tone4_tone3:": { + "category": "people", + "name": "handshake: medium-dark skin tone, medium skin tone", + "unicode": "1faf1-1f3fe-200d-1faf2-1f3fd" + }, + ":handshake_tone4_tone5:": { + "category": "people", + "name": "handshake: medium-dark skin tone, dark skin tone", + "unicode": "1faf1-1f3fe-200d-1faf2-1f3ff" + }, + ":handshake_tone5:": { + "category": "people", + "name": "handshake: dark skin tone", + "unicode": "1f91d-1f3ff" + }, + ":handshake_tone5_tone1:": { + "category": "people", + "name": "handshake: dark skin tone, light skin tone", + "unicode": "1faf1-1f3ff-200d-1faf2-1f3fb" + }, + ":handshake_tone5_tone2:": { + "category": "people", + "name": "handshake: dark skin tone, medium-light skin tone", + "unicode": "1faf1-1f3ff-200d-1faf2-1f3fc" + }, + ":handshake_tone5_tone3:": { + "category": "people", + "name": "handshake: dark skin tone, medium skin tone", + "unicode": "1faf1-1f3ff-200d-1faf2-1f3fd" + }, + ":handshake_tone5_tone4:": { + "category": "people", + "name": "handshake: dark skin tone, medium-dark skin tone", + "unicode": "1faf1-1f3ff-200d-1faf2-1f3fe" + }, + ":harp:": { + "category": "activity", + "name": "harp", + "unicode": "1fa89" + }, + ":hash:": { + "category": "symbols", + "name": "keycap: pound", + "unicode": "23-20e3", + "unicode_alt": "0023-20e3" + }, + ":hatched_chick:": { + "category": "nature", + "name": "front-facing baby chick", + "unicode": "1f425" + }, + ":hatching_chick:": { + "category": "nature", + "name": "hatching chick", + "unicode": "1f423" + }, + ":head_bandage:": { + "category": "people", + "name": "face with head-bandage", + "unicode": "1f915" + }, + ":head_shaking_horizontally:": { + "category": "people", + "name": "head shaking horizontally", + "unicode": "1f642-200d-2194-fe0f" + }, + ":head_shaking_vertically:": { + "category": "people", + "name": "head shaking vertically", + "unicode": "1f642-200d-2195-fe0f" + }, + ":headphones:": { + "category": "activity", + "name": "headphone", + "unicode": "1f3a7" + }, + ":headstone:": { + "category": "objects", + "name": "headstone", + "unicode": "1faa6" + }, + ":health_worker:": { + "category": "people", + "name": "health worker", + "unicode": "1f9d1-200d-2695-fe0f" + }, + ":health_worker_tone1:": { + "category": "people", + "name": "health worker: light skin tone", + "unicode": "1f9d1-1f3fb-200d-2695-fe0f" + }, + ":health_worker_tone2:": { + "category": "people", + "name": "health worker: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-2695-fe0f" + }, + ":health_worker_tone3:": { + "category": "people", + "name": "health worker: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-2695-fe0f" + }, + ":health_worker_tone4:": { + "category": "people", + "name": "health worker: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-2695-fe0f" + }, + ":health_worker_tone5:": { + "category": "people", + "name": "health worker: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-2695-fe0f" + }, + ":hear_no_evil:": { + "category": "nature", + "name": "hear-no-evil monkey", + "unicode": "1f649" + }, + ":heart:": { + "category": "symbols", + "name": "red heart", + "unicode": "2764" + }, + ":heart_decoration:": { + "category": "symbols", + "name": "heart decoration", + "unicode": "1f49f" + }, + ":heart_exclamation:": { + "category": "symbols", + "name": "heart exclamation", + "unicode": "2763" + }, + ":heart_eyes:": { + "category": "people", + "name": "smiling face with heart-eyes", + "unicode": "1f60d" + }, + ":heart_eyes_cat:": { + "category": "people", + "name": "smiling cat with heart-eyes", + "unicode": "1f63b" + }, + ":heart_hands:": { + "category": "people", + "name": "heart hands", + "unicode": "1faf6" + }, + ":heart_hands_tone1:": { + "category": "people", + "name": "heart hands: light skin tone", + "unicode": "1faf6-1f3fb" + }, + ":heart_hands_tone2:": { + "category": "people", + "name": "heart hands: medium-light skin tone", + "unicode": "1faf6-1f3fc" + }, + ":heart_hands_tone3:": { + "category": "people", + "name": "heart hands: medium skin tone", + "unicode": "1faf6-1f3fd" + }, + ":heart_hands_tone4:": { + "category": "people", + "name": "heart hands: medium-dark skin tone", + "unicode": "1faf6-1f3fe" + }, + ":heart_hands_tone5:": { + "category": "people", + "name": "heart hands: dark skin tone", + "unicode": "1faf6-1f3ff" + }, + ":heart_on_fire:": { + "category": "symbols", + "name": "heart on fire", + "unicode": "2764-fe0f-200d-1f525" + }, + ":heartbeat:": { + "category": "symbols", + "name": "beating heart", + "unicode": "1f493" + }, + ":heartpulse:": { + "category": "symbols", + "name": "growing heart", + "unicode": "1f497" + }, + ":hearts:": { + "category": "symbols", + "name": "heart suit", + "unicode": "2665" + }, + ":heavy_check_mark:": { + "category": "symbols", + "name": "check mark", + "unicode": "2714" + }, + ":heavy_division_sign:": { + "category": "symbols", + "name": "division sign", + "unicode": "2797" + }, + ":heavy_dollar_sign:": { + "category": "symbols", + "name": "heavy dollar sign", + "unicode": "1f4b2" + }, + ":heavy_equals_sign:": { + "category": "symbols", + "name": "heavy equals sign", + "unicode": "1f7f0" + }, + ":heavy_minus_sign:": { + "category": "symbols", + "name": "minus sign", + "unicode": "2796" + }, + ":heavy_multiplication_x:": { + "category": "symbols", + "name": "multiplication sign", + "unicode": "2716" + }, + ":heavy_plus_sign:": { + "category": "symbols", + "name": "plus sign", + "unicode": "2795" + }, + ":hedgehog:": { + "category": "nature", + "name": "hedgehog", + "unicode": "1f994" + }, + ":helicopter:": { + "category": "travel", + "name": "helicopter", + "unicode": "1f681" + }, + ":helmet_with_cross:": { + "category": "people", + "name": "rescue worker\u2019s helmet", + "unicode": "26d1" + }, + ":herb:": { + "category": "nature", + "name": "herb", + "unicode": "1f33f" + }, + ":hibiscus:": { + "category": "nature", + "name": "hibiscus", + "unicode": "1f33a" + }, + ":high_brightness:": { + "category": "symbols", + "name": "bright button", + "unicode": "1f506" + }, + ":high_heel:": { + "category": "people", + "name": "high-heeled shoe", + "unicode": "1f460" + }, + ":hiking_boot:": { + "category": "people", + "name": "hiking boot", + "unicode": "1f97e" + }, + ":hindu_temple:": { + "category": "travel", + "name": "hindu temple", + "unicode": "1f6d5" + }, + ":hippopotamus:": { + "category": "nature", + "name": "hippopotamus", + "unicode": "1f99b" + }, + ":hockey:": { + "category": "activity", + "name": "ice hockey", + "unicode": "1f3d2" + }, + ":hole:": { + "category": "objects", + "name": "hole", + "unicode": "1f573" + }, + ":homes:": { + "category": "travel", + "name": "houses", + "unicode": "1f3d8" + }, + ":honey_pot:": { + "category": "food", + "name": "honey pot", + "unicode": "1f36f" + }, + ":hook:": { + "category": "travel", + "name": "hook", + "unicode": "1fa9d" + }, + ":horse:": { + "category": "nature", + "name": "horse face", + "unicode": "1f434" + }, + ":horse_racing:": { + "category": "activity", + "name": "horse racing", + "unicode": "1f3c7" + }, + ":horse_racing_tone1:": { + "category": "activity", + "name": "horse racing: light skin tone", + "unicode": "1f3c7-1f3fb" + }, + ":horse_racing_tone2:": { + "category": "activity", + "name": "horse racing: medium-light skin tone", + "unicode": "1f3c7-1f3fc" + }, + ":horse_racing_tone3:": { + "category": "activity", + "name": "horse racing: medium skin tone", + "unicode": "1f3c7-1f3fd" + }, + ":horse_racing_tone4:": { + "category": "activity", + "name": "horse racing: medium-dark skin tone", + "unicode": "1f3c7-1f3fe" + }, + ":horse_racing_tone5:": { + "category": "activity", + "name": "horse racing: dark skin tone", + "unicode": "1f3c7-1f3ff" + }, + ":hospital:": { + "category": "travel", + "name": "hospital", + "unicode": "1f3e5" + }, + ":hot_face:": { + "category": "people", + "name": "hot face", + "unicode": "1f975" + }, + ":hot_pepper:": { + "category": "food", + "name": "hot pepper", + "unicode": "1f336" + }, + ":hotdog:": { + "category": "food", + "name": "hot dog", + "unicode": "1f32d" + }, + ":hotel:": { + "category": "travel", + "name": "hotel", + "unicode": "1f3e8" + }, + ":hotsprings:": { + "category": "symbols", + "name": "hot springs", + "unicode": "2668" + }, + ":hourglass:": { + "category": "objects", + "name": "hourglass done", + "unicode": "231b" + }, + ":hourglass_flowing_sand:": { + "category": "objects", + "name": "hourglass not done", + "unicode": "23f3" + }, + ":house:": { + "category": "travel", + "name": "house", + "unicode": "1f3e0" + }, + ":house_abandoned:": { + "category": "travel", + "name": "derelict house", + "unicode": "1f3da" + }, + ":house_with_garden:": { + "category": "travel", + "name": "house with garden", + "unicode": "1f3e1" + }, + ":hugging:": { + "category": "people", + "name": "hugging face", + "unicode": "1f917" + }, + ":hushed:": { + "category": "people", + "name": "hushed face", + "unicode": "1f62f" + }, + ":hut:": { + "category": "travel", + "name": "hut", + "unicode": "1f6d6" + }, + ":hyacinth:": { + "category": "nature", + "name": "hyacinth", + "unicode": "1fabb" + }, + ":ice_cream:": { + "category": "food", + "name": "ice cream", + "unicode": "1f368" + }, + ":ice_cube:": { + "category": "food", + "name": "ice cube", + "unicode": "1f9ca" + }, + ":ice_skate:": { + "category": "activity", + "name": "ice skate", + "unicode": "26f8" + }, + ":icecream:": { + "category": "food", + "name": "soft ice cream", + "unicode": "1f366" + }, + ":id:": { + "category": "symbols", + "name": "ID button", + "unicode": "1f194" + }, + ":identification_card:": { + "category": "objects", + "name": "identification card", + "unicode": "1faaa" + }, + ":ideograph_advantage:": { + "category": "symbols", + "name": "Japanese \u201cbargain\u201d button", + "unicode": "1f250" + }, + ":imp:": { + "category": "people", + "name": "angry face with horns", + "unicode": "1f47f" + }, + ":inbox_tray:": { + "category": "objects", + "name": "inbox tray", + "unicode": "1f4e5" + }, + ":incoming_envelope:": { + "category": "objects", + "name": "incoming envelope", + "unicode": "1f4e8" + }, + ":index_pointing_at_the_viewer:": { + "category": "people", + "name": "index pointing at the viewer", + "unicode": "1faf5" + }, + ":index_pointing_at_the_viewer_tone1:": { + "category": "people", + "name": "index pointing at the viewer: light skin tone", + "unicode": "1faf5-1f3fb" + }, + ":index_pointing_at_the_viewer_tone2:": { + "category": "people", + "name": "index pointing at the viewer: medium-light skin tone", + "unicode": "1faf5-1f3fc" + }, + ":index_pointing_at_the_viewer_tone3:": { + "category": "people", + "name": "index pointing at the viewer: medium skin tone", + "unicode": "1faf5-1f3fd" + }, + ":index_pointing_at_the_viewer_tone4:": { + "category": "people", + "name": "index pointing at the viewer: medium-dark skin tone", + "unicode": "1faf5-1f3fe" + }, + ":index_pointing_at_the_viewer_tone5:": { + "category": "people", + "name": "index pointing at the viewer: dark skin tone", + "unicode": "1faf5-1f3ff" + }, + ":infinity:": { + "category": "symbols", + "name": "infinity", + "unicode": "267e" + }, + ":information_source:": { + "category": "symbols", + "name": "information", + "unicode": "2139" + }, + ":innocent:": { + "category": "people", + "name": "smiling face with halo", + "unicode": "1f607" + }, + ":interrobang:": { + "category": "symbols", + "name": "exclamation question mark", + "unicode": "2049" + }, + ":island:": { + "category": "travel", + "name": "desert island", + "unicode": "1f3dd" + }, + ":izakaya_lantern:": { + "category": "objects", + "name": "red paper lantern", + "unicode": "1f3ee" + }, + ":jack_o_lantern:": { + "category": "people", + "name": "jack-o-lantern", + "unicode": "1f383" + }, + ":japan:": { + "category": "travel", + "name": "map of Japan", + "unicode": "1f5fe" + }, + ":japanese_castle:": { + "category": "travel", + "name": "Japanese castle", + "unicode": "1f3ef" + }, + ":japanese_goblin:": { + "category": "people", + "name": "goblin", + "unicode": "1f47a" + }, + ":japanese_ogre:": { + "category": "people", + "name": "ogre", + "unicode": "1f479" + }, + ":jar:": { + "category": "food", + "name": "jar", + "unicode": "1fad9" + }, + ":jeans:": { + "category": "people", + "name": "jeans", + "unicode": "1f456" + }, + ":jellyfish:": { + "category": "nature", + "name": "jellyfish", + "unicode": "1fabc" + }, + ":jigsaw:": { + "category": "activity", + "name": "puzzle piece", + "unicode": "1f9e9" + }, + ":joy:": { + "category": "people", + "name": "face with tears of joy", + "unicode": "1f602" + }, + ":joy_cat:": { + "category": "people", + "name": "cat with tears of joy", + "unicode": "1f639" + }, + ":joystick:": { + "category": "objects", + "name": "joystick", + "unicode": "1f579" + }, + ":judge:": { + "category": "people", + "name": "judge", + "unicode": "1f9d1-200d-2696-fe0f" + }, + ":judge_tone1:": { + "category": "people", + "name": "judge: light skin tone", + "unicode": "1f9d1-1f3fb-200d-2696-fe0f" + }, + ":judge_tone2:": { + "category": "people", + "name": "judge: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-2696-fe0f" + }, + ":judge_tone3:": { + "category": "people", + "name": "judge: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-2696-fe0f" + }, + ":judge_tone4:": { + "category": "people", + "name": "judge: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-2696-fe0f" + }, + ":judge_tone5:": { + "category": "people", + "name": "judge: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-2696-fe0f" + }, + ":kaaba:": { + "category": "travel", + "name": "kaaba", + "unicode": "1f54b" + }, + ":kangaroo:": { + "category": "nature", + "name": "kangaroo", + "unicode": "1f998" + }, + ":key2:": { + "category": "objects", + "name": "old key", + "unicode": "1f5dd" + }, + ":key:": { + "category": "objects", + "name": "key", + "unicode": "1f511" + }, + ":keyboard:": { + "category": "objects", + "name": "keyboard", + "unicode": "2328" + }, + ":keycap_ten:": { + "category": "symbols", + "name": "keycap: 10", + "unicode": "1f51f" + }, + ":khanda:": { + "category": "symbols", + "name": "khanda", + "unicode": "1faaf" + }, + ":kimono:": { + "category": "people", + "name": "kimono", + "unicode": "1f458" + }, + ":kiss:": { + "category": "people", + "name": "kiss mark", + "unicode": "1f48b" + }, + ":kiss_man_man_tone1:": { + "category": "people", + "name": "kiss: man, man, light skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_man_man_tone1_tone2:": { + "category": "people", + "name": "kiss: man, man, light skin tone, medium-light skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_man_man_tone1_tone3:": { + "category": "people", + "name": "kiss: man, man, light skin tone, medium skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_man_man_tone1_tone4:": { + "category": "people", + "name": "kiss: man, man, light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_man_man_tone1_tone5:": { + "category": "people", + "name": "kiss: man, man, light skin tone, dark skin tone", + "unicode": "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_man_man_tone2:": { + "category": "people", + "name": "kiss: man, man, medium-light skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_man_man_tone2_tone1:": { + "category": "people", + "name": "kiss: man, man, medium-light skin tone, light skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_man_man_tone2_tone3:": { + "category": "people", + "name": "kiss: man, man, medium-light skin tone, medium skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_man_man_tone2_tone4:": { + "category": "people", + "name": "kiss: man, man, medium-light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_man_man_tone2_tone5:": { + "category": "people", + "name": "kiss: man, man, medium-light skin tone, dark skin tone", + "unicode": "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_man_man_tone3:": { + "category": "people", + "name": "kiss: man, man, medium skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_man_man_tone3_tone1:": { + "category": "people", + "name": "kiss: man, man, medium skin tone, light skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_man_man_tone3_tone2:": { + "category": "people", + "name": "kiss: man, man, medium skin tone, medium-light skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_man_man_tone3_tone4:": { + "category": "people", + "name": "kiss: man, man, medium skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_man_man_tone3_tone5:": { + "category": "people", + "name": "kiss: man, man, medium skin tone, dark skin tone", + "unicode": "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_man_man_tone4:": { + "category": "people", + "name": "kiss: man, man, medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_man_man_tone4_tone1:": { + "category": "people", + "name": "kiss: man, man, medium-dark skin tone, light skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_man_man_tone4_tone2:": { + "category": "people", + "name": "kiss: man, man, medium-dark skin tone, medium-light skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_man_man_tone4_tone3:": { + "category": "people", + "name": "kiss: man, man, medium-dark skin tone, medium skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_man_man_tone4_tone5:": { + "category": "people", + "name": "kiss: man, man, medium-dark skin tone, dark skin tone", + "unicode": "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_man_man_tone5:": { + "category": "people", + "name": "kiss: man, man, dark skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_man_man_tone5_tone1:": { + "category": "people", + "name": "kiss: man, man, dark skin tone, light skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_man_man_tone5_tone2:": { + "category": "people", + "name": "kiss: man, man, dark skin tone, medium-light skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_man_man_tone5_tone3:": { + "category": "people", + "name": "kiss: man, man, dark skin tone, medium skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_man_man_tone5_tone4:": { + "category": "people", + "name": "kiss: man, man, dark skin tone, medium-dark skin tone", + "unicode": "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_mm:": { + "category": "people", + "name": "kiss: man, man", + "unicode": "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468" + }, + ":kiss_person_person_tone1_tone2:": { + "category": "people", + "name": "kiss: person, person, light skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc" + }, + ":kiss_person_person_tone1_tone3:": { + "category": "people", + "name": "kiss: person, person, light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd" + }, + ":kiss_person_person_tone1_tone4:": { + "category": "people", + "name": "kiss: person, person, light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" + }, + ":kiss_person_person_tone1_tone5:": { + "category": "people", + "name": "kiss: person, person, light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff" + }, + ":kiss_person_person_tone2_tone1:": { + "category": "people", + "name": "kiss: person, person, medium-light skin tone, light skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb" + }, + ":kiss_person_person_tone2_tone3:": { + "category": "people", + "name": "kiss: person, person, medium-light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd" + }, + ":kiss_person_person_tone2_tone4:": { + "category": "people", + "name": "kiss: person, person, medium-light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" + }, + ":kiss_person_person_tone2_tone5:": { + "category": "people", + "name": "kiss: person, person, medium-light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff" + }, + ":kiss_person_person_tone3_tone1:": { + "category": "people", + "name": "kiss: person, person, medium skin tone, light skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb" + }, + ":kiss_person_person_tone3_tone2:": { + "category": "people", + "name": "kiss: person, person, medium skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc" + }, + ":kiss_person_person_tone3_tone4:": { + "category": "people", + "name": "kiss: person, person, medium skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" + }, + ":kiss_person_person_tone3_tone5:": { + "category": "people", + "name": "kiss: person, person, medium skin tone, dark skin tone", + "unicode": "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff" + }, + ":kiss_person_person_tone4_tone1:": { + "category": "people", + "name": "kiss: person, person, medium-dark skin tone, light skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb" + }, + ":kiss_person_person_tone4_tone2:": { + "category": "people", + "name": "kiss: person, person, medium-dark skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc" + }, + ":kiss_person_person_tone4_tone3:": { + "category": "people", + "name": "kiss: person, person, medium-dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd" + }, + ":kiss_person_person_tone4_tone5:": { + "category": "people", + "name": "kiss: person, person, medium-dark skin tone, dark skin tone", + "unicode": "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff" + }, + ":kiss_person_person_tone5_tone1:": { + "category": "people", + "name": "kiss: person, person, dark skin tone, light skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb" + }, + ":kiss_person_person_tone5_tone2:": { + "category": "people", + "name": "kiss: person, person, dark skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc" + }, + ":kiss_person_person_tone5_tone3:": { + "category": "people", + "name": "kiss: person, person, dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd" + }, + ":kiss_person_person_tone5_tone4:": { + "category": "people", + "name": "kiss: person, person, dark skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" + }, + ":kiss_tone1:": { + "category": "people", + "name": "kiss: light skin tone", + "unicode": "1f48f-1f3fb" + }, + ":kiss_tone2:": { + "category": "people", + "name": "kiss: medium-light skin tone", + "unicode": "1f48f-1f3fc" + }, + ":kiss_tone3:": { + "category": "people", + "name": "kiss: medium skin tone", + "unicode": "1f48f-1f3fd" + }, + ":kiss_tone4:": { + "category": "people", + "name": "kiss: medium-dark skin tone", + "unicode": "1f48f-1f3fe" + }, + ":kiss_tone5:": { + "category": "people", + "name": "kiss: dark skin tone", + "unicode": "1f48f-1f3ff" + }, + ":kiss_woman_man:": { + "category": "people", + "name": "kiss: woman, man", + "unicode": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f468" + }, + ":kiss_woman_man_tone1:": { + "category": "people", + "name": "kiss: woman, man, light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_woman_man_tone1_tone2:": { + "category": "people", + "name": "kiss: woman, man, light skin tone, medium-light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_woman_man_tone1_tone3:": { + "category": "people", + "name": "kiss: woman, man, light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_woman_man_tone1_tone4:": { + "category": "people", + "name": "kiss: woman, man, light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_woman_man_tone1_tone5:": { + "category": "people", + "name": "kiss: woman, man, light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_woman_man_tone2:": { + "category": "people", + "name": "kiss: woman, man, medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_woman_man_tone2_tone1:": { + "category": "people", + "name": "kiss: woman, man, medium-light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_woman_man_tone2_tone3:": { + "category": "people", + "name": "kiss: woman, man, medium-light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_woman_man_tone2_tone4:": { + "category": "people", + "name": "kiss: woman, man, medium-light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_woman_man_tone2_tone5:": { + "category": "people", + "name": "kiss: woman, man, medium-light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_woman_man_tone3:": { + "category": "people", + "name": "kiss: woman, man, medium skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_woman_man_tone3_tone1:": { + "category": "people", + "name": "kiss: woman, man, medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_woman_man_tone3_tone2:": { + "category": "people", + "name": "kiss: woman, man, medium skin tone, medium-light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_woman_man_tone3_tone4:": { + "category": "people", + "name": "kiss: woman, man, medium skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_woman_man_tone3_tone5:": { + "category": "people", + "name": "kiss: woman, man, medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_woman_man_tone4:": { + "category": "people", + "name": "kiss: woman, man, medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_woman_man_tone4_tone1:": { + "category": "people", + "name": "kiss: woman, man, medium-dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_woman_man_tone4_tone2:": { + "category": "people", + "name": "kiss: woman, man, medium-dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_woman_man_tone4_tone3:": { + "category": "people", + "name": "kiss: woman, man, medium-dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_woman_man_tone4_tone5:": { + "category": "people", + "name": "kiss: woman, man, medium-dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_woman_man_tone5:": { + "category": "people", + "name": "kiss: woman, man, dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + }, + ":kiss_woman_man_tone5_tone1:": { + "category": "people", + "name": "kiss: woman, man, dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb" + }, + ":kiss_woman_man_tone5_tone2:": { + "category": "people", + "name": "kiss: woman, man, dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc" + }, + ":kiss_woman_man_tone5_tone3:": { + "category": "people", + "name": "kiss: woman, man, dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd" + }, + ":kiss_woman_man_tone5_tone4:": { + "category": "people", + "name": "kiss: woman, man, dark skin tone, medium-dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe" + }, + ":kiss_woman_woman_tone1:": { + "category": "people", + "name": "kiss: woman, woman, light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb" + }, + ":kiss_woman_woman_tone1_tone2:": { + "category": "people", + "name": "kiss: woman, woman, light skin tone, medium-light skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc" + }, + ":kiss_woman_woman_tone1_tone3:": { + "category": "people", + "name": "kiss: woman, woman, light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd" + }, + ":kiss_woman_woman_tone1_tone4:": { + "category": "people", + "name": "kiss: woman, woman, light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe" + }, + ":kiss_woman_woman_tone1_tone5:": { + "category": "people", + "name": "kiss: woman, woman, light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + }, + ":kiss_woman_woman_tone2:": { + "category": "people", + "name": "kiss: woman, woman, medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc" + }, + ":kiss_woman_woman_tone2_tone1:": { + "category": "people", + "name": "kiss: woman, woman, medium-light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb" + }, + ":kiss_woman_woman_tone2_tone3:": { + "category": "people", + "name": "kiss: woman, woman, medium-light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd" + }, + ":kiss_woman_woman_tone2_tone4:": { + "category": "people", + "name": "kiss: woman, woman, medium-light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe" + }, + ":kiss_woman_woman_tone2_tone5:": { + "category": "people", + "name": "kiss: woman, woman, medium-light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + }, + ":kiss_woman_woman_tone3:": { + "category": "people", + "name": "kiss: woman, woman, medium skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd" + }, + ":kiss_woman_woman_tone3_tone1:": { + "category": "people", + "name": "kiss: woman, woman, medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb" + }, + ":kiss_woman_woman_tone3_tone2:": { + "category": "people", + "name": "kiss: woman, woman, medium skin tone, medium-light skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc" + }, + ":kiss_woman_woman_tone3_tone4:": { + "category": "people", + "name": "kiss: woman, woman, medium skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe" + }, + ":kiss_woman_woman_tone3_tone5:": { + "category": "people", + "name": "kiss: woman, woman, medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + }, + ":kiss_woman_woman_tone4:": { + "category": "people", + "name": "kiss: woman, woman, medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe" + }, + ":kiss_woman_woman_tone4_tone1:": { + "category": "people", + "name": "kiss: woman, woman, medium-dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb" + }, + ":kiss_woman_woman_tone4_tone2:": { + "category": "people", + "name": "kiss: woman, woman, medium-dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc" + }, + ":kiss_woman_woman_tone4_tone3:": { + "category": "people", + "name": "kiss: woman, woman, medium-dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd" + }, + ":kiss_woman_woman_tone4_tone5:": { + "category": "people", + "name": "kiss: woman, woman, medium-dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + }, + ":kiss_woman_woman_tone5:": { + "category": "people", + "name": "kiss: woman, woman, dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + }, + ":kiss_woman_woman_tone5_tone1:": { + "category": "people", + "name": "kiss: woman, woman, dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb" + }, + ":kiss_woman_woman_tone5_tone2:": { + "category": "people", + "name": "kiss: woman, woman, dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc" + }, + ":kiss_woman_woman_tone5_tone3:": { + "category": "people", + "name": "kiss: woman, woman, dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd" + }, + ":kiss_woman_woman_tone5_tone4:": { + "category": "people", + "name": "kiss: woman, woman, dark skin tone, medium-dark skin tone", + "unicode": "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe" + }, + ":kiss_ww:": { + "category": "people", + "name": "kiss: woman, woman", + "unicode": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469" + }, + ":kissing:": { + "category": "people", + "name": "kissing face", + "unicode": "1f617" + }, + ":kissing_cat:": { + "category": "people", + "name": "kissing cat", + "unicode": "1f63d" + }, + ":kissing_closed_eyes:": { + "category": "people", + "name": "kissing face with closed eyes", + "unicode": "1f61a" + }, + ":kissing_heart:": { + "category": "people", + "name": "face blowing a kiss", + "unicode": "1f618" + }, + ":kissing_smiling_eyes:": { + "category": "people", + "name": "kissing face with smiling eyes", + "unicode": "1f619" + }, + ":kite:": { + "category": "activity", + "name": "kite", + "unicode": "1fa81" + }, + ":kiwi:": { + "category": "food", + "name": "kiwi fruit", + "unicode": "1f95d" + }, + ":knife:": { + "category": "objects", + "name": "kitchen knife", + "unicode": "1f52a" + }, + ":knot:": { + "category": "people", + "name": "knot", + "unicode": "1faa2" + }, + ":koala:": { + "category": "nature", + "name": "koala", + "unicode": "1f428" + }, + ":koko:": { + "category": "symbols", + "name": "Japanese \u201chere\u201d button", + "unicode": "1f201" + }, + ":lab_coat:": { + "category": "people", + "name": "lab coat", + "unicode": "1f97c" + }, + ":label:": { + "category": "objects", + "name": "label", + "unicode": "1f3f7" + }, + ":lacrosse:": { + "category": "activity", + "name": "lacrosse", + "unicode": "1f94d" + }, + ":ladder:": { + "category": "objects", + "name": "ladder", + "unicode": "1fa9c" + }, + ":lady_beetle:": { + "category": "nature", + "name": "lady beetle", + "unicode": "1f41e" + }, + ":large_blue_diamond:": { + "category": "symbols", + "name": "large blue diamond", + "unicode": "1f537" + }, + ":large_orange_diamond:": { + "category": "symbols", + "name": "large orange diamond", + "unicode": "1f536" + }, + ":last_quarter_moon:": { + "category": "nature", + "name": "last quarter moon", + "unicode": "1f317" + }, + ":last_quarter_moon_with_face:": { + "category": "nature", + "name": "last quarter moon face", + "unicode": "1f31c" + }, + ":laughing:": { + "category": "people", + "name": "grinning squinting face", + "unicode": "1f606" + }, + ":leafless_tree:": { + "category": "nature", + "name": "leafless tree", + "unicode": "1fabe" + }, + ":leafy_green:": { + "category": "food", + "name": "leafy green", + "unicode": "1f96c" + }, + ":leaves:": { + "category": "nature", + "name": "leaf fluttering in wind", + "unicode": "1f343" + }, + ":ledger:": { + "category": "objects", + "name": "ledger", + "unicode": "1f4d2" + }, + ":left_facing_fist:": { + "category": "people", + "name": "left-facing fist", + "unicode": "1f91b" + }, + ":left_facing_fist_tone1:": { + "category": "people", + "name": "left-facing fist: light skin tone", + "unicode": "1f91b-1f3fb" + }, + ":left_facing_fist_tone2:": { + "category": "people", + "name": "left-facing fist: medium-light skin tone", + "unicode": "1f91b-1f3fc" + }, + ":left_facing_fist_tone3:": { + "category": "people", + "name": "left-facing fist: medium skin tone", + "unicode": "1f91b-1f3fd" + }, + ":left_facing_fist_tone4:": { + "category": "people", + "name": "left-facing fist: medium-dark skin tone", + "unicode": "1f91b-1f3fe" + }, + ":left_facing_fist_tone5:": { + "category": "people", + "name": "left-facing fist: dark skin tone", + "unicode": "1f91b-1f3ff" + }, + ":left_luggage:": { + "category": "symbols", + "name": "left luggage", + "unicode": "1f6c5" + }, + ":left_right_arrow:": { + "category": "symbols", + "name": "left-right arrow", + "unicode": "2194" + }, + ":leftwards_arrow_with_hook:": { + "category": "symbols", + "name": "right arrow curving left", + "unicode": "21a9" + }, + ":leftwards_hand:": { + "category": "people", + "name": "leftwards hand", + "unicode": "1faf2" + }, + ":leftwards_hand_tone1:": { + "category": "people", + "name": "leftwards hand: light skin tone", + "unicode": "1faf2-1f3fb" + }, + ":leftwards_hand_tone2:": { + "category": "people", + "name": "leftwards hand: medium-light skin tone", + "unicode": "1faf2-1f3fc" + }, + ":leftwards_hand_tone3:": { + "category": "people", + "name": "leftwards hand: medium skin tone", + "unicode": "1faf2-1f3fd" + }, + ":leftwards_hand_tone4:": { + "category": "people", + "name": "leftwards hand: medium-dark skin tone", + "unicode": "1faf2-1f3fe" + }, + ":leftwards_hand_tone5:": { + "category": "people", + "name": "leftwards hand: dark skin tone", + "unicode": "1faf2-1f3ff" + }, + ":leftwards_pushing_hand:": { + "category": "people", + "name": "leftwards pushing hand", + "unicode": "1faf7" + }, + ":leftwards_pushing_hand_tone1:": { + "category": "people", + "name": "leftwards pushing hand: light skin tone", + "unicode": "1faf7-1f3fb" + }, + ":leftwards_pushing_hand_tone2:": { + "category": "people", + "name": "leftwards pushing hand: medium-light skin tone", + "unicode": "1faf7-1f3fc" + }, + ":leftwards_pushing_hand_tone3:": { + "category": "people", + "name": "leftwards pushing hand: medium skin tone", + "unicode": "1faf7-1f3fd" + }, + ":leftwards_pushing_hand_tone4:": { + "category": "people", + "name": "leftwards pushing hand: medium-dark skin tone", + "unicode": "1faf7-1f3fe" + }, + ":leftwards_pushing_hand_tone5:": { + "category": "people", + "name": "leftwards pushing hand: dark skin tone", + "unicode": "1faf7-1f3ff" + }, + ":leg:": { + "category": "people", + "name": "leg", + "unicode": "1f9b5" + }, + ":leg_tone1:": { + "category": "people", + "name": "leg: light skin tone", + "unicode": "1f9b5-1f3fb" + }, + ":leg_tone2:": { + "category": "people", + "name": "leg: medium-light skin tone", + "unicode": "1f9b5-1f3fc" + }, + ":leg_tone3:": { + "category": "people", + "name": "leg: medium skin tone", + "unicode": "1f9b5-1f3fd" + }, + ":leg_tone4:": { + "category": "people", + "name": "leg: medium-dark skin tone", + "unicode": "1f9b5-1f3fe" + }, + ":leg_tone5:": { + "category": "people", + "name": "leg: dark skin tone", + "unicode": "1f9b5-1f3ff" + }, + ":lemon:": { + "category": "food", + "name": "lemon", + "unicode": "1f34b" + }, + ":leo:": { + "category": "symbols", + "name": "Leo", + "unicode": "264c" + }, + ":leopard:": { + "category": "nature", + "name": "leopard", + "unicode": "1f406" + }, + ":level_slider:": { + "category": "objects", + "name": "level slider", + "unicode": "1f39a" + }, + ":levitate:": { + "category": "people", + "name": "man in suit levitating", + "unicode": "1f574" + }, + ":levitate_tone1:": { + "category": "people", + "name": "man in suit levitating: light skin tone", + "unicode": "1f574-1f3fb" + }, + ":levitate_tone2:": { + "category": "people", + "name": "man in suit levitating: medium-light skin tone", + "unicode": "1f574-1f3fc" + }, + ":levitate_tone3:": { + "category": "people", + "name": "man in suit levitating: medium skin tone", + "unicode": "1f574-1f3fd" + }, + ":levitate_tone4:": { + "category": "people", + "name": "man in suit levitating: medium-dark skin tone", + "unicode": "1f574-1f3fe" + }, + ":levitate_tone5:": { + "category": "people", + "name": "man in suit levitating: dark skin tone", + "unicode": "1f574-1f3ff" + }, + ":libra:": { + "category": "symbols", + "name": "Libra", + "unicode": "264e" + }, + ":light_blue_heart:": { + "category": "symbols", + "name": "light blue heart", + "unicode": "1fa75" + }, + ":light_rail:": { + "category": "travel", + "name": "light rail", + "unicode": "1f688" + }, + ":lime:": { + "category": "food", + "name": "lime", + "unicode": "1f34b-200d-1f7e9" + }, + ":link:": { + "category": "objects", + "name": "link", + "unicode": "1f517" + }, + ":lion_face:": { + "category": "nature", + "name": "lion", + "unicode": "1f981" + }, + ":lips:": { + "category": "people", + "name": "mouth", + "unicode": "1f444" + }, + ":lipstick:": { + "category": "people", + "name": "lipstick", + "unicode": "1f484" + }, + ":lizard:": { + "category": "nature", + "name": "lizard", + "unicode": "1f98e" + }, + ":llama:": { + "category": "nature", + "name": "llama", + "unicode": "1f999" + }, + ":lobster:": { + "category": "nature", + "name": "lobster", + "unicode": "1f99e" + }, + ":lock:": { + "category": "objects", + "name": "locked", + "unicode": "1f512" + }, + ":lock_with_ink_pen:": { + "category": "objects", + "name": "locked with pen", + "unicode": "1f50f" + }, + ":lollipop:": { + "category": "food", + "name": "lollipop", + "unicode": "1f36d" + }, + ":long_drum:": { + "category": "activity", + "name": "long drum", + "unicode": "1fa98" + }, + ":loop:": { + "category": "symbols", + "name": "double curly loop", + "unicode": "27bf" + }, + ":lotus:": { + "category": "nature", + "name": "lotus", + "unicode": "1fab7" + }, + ":loud_sound:": { + "category": "symbols", + "name": "speaker high volume", + "unicode": "1f50a" + }, + ":loudspeaker:": { + "category": "symbols", + "name": "loudspeaker", + "unicode": "1f4e2" + }, + ":love_hotel:": { + "category": "travel", + "name": "love hotel", + "unicode": "1f3e9" + }, + ":love_letter:": { + "category": "objects", + "name": "love letter", + "unicode": "1f48c" + }, + ":love_you_gesture:": { + "category": "people", + "name": "love-you gesture", + "unicode": "1f91f" + }, + ":love_you_gesture_tone1:": { + "category": "people", + "name": "love-you gesture: light skin tone", + "unicode": "1f91f-1f3fb" + }, + ":love_you_gesture_tone2:": { + "category": "people", + "name": "love-you gesture: medium-light skin tone", + "unicode": "1f91f-1f3fc" + }, + ":love_you_gesture_tone3:": { + "category": "people", + "name": "love-you gesture: medium skin tone", + "unicode": "1f91f-1f3fd" + }, + ":love_you_gesture_tone4:": { + "category": "people", + "name": "love-you gesture: medium-dark skin tone", + "unicode": "1f91f-1f3fe" + }, + ":love_you_gesture_tone5:": { + "category": "people", + "name": "love-you gesture: dark skin tone", + "unicode": "1f91f-1f3ff" + }, + ":low_battery:": { + "category": "objects", + "name": "low battery", + "unicode": "1faab" + }, + ":low_brightness:": { + "category": "symbols", + "name": "dim button", + "unicode": "1f505" + }, + ":luggage:": { + "category": "people", + "name": "luggage", + "unicode": "1f9f3" + }, + ":lungs:": { + "category": "people", + "name": "lungs", + "unicode": "1fac1" + }, + ":lying_face:": { + "category": "people", + "name": "lying face", + "unicode": "1f925" + }, + ":m:": { + "category": "symbols", + "name": "circled M", + "unicode": "24c2" + }, + ":mag:": { + "category": "objects", + "name": "magnifying glass tilted left", + "unicode": "1f50d" + }, + ":mag_right:": { + "category": "objects", + "name": "magnifying glass tilted right", + "unicode": "1f50e" + }, + ":mage:": { + "category": "people", + "name": "mage", + "unicode": "1f9d9" + }, + ":mage_tone1:": { + "category": "people", + "name": "mage: light skin tone", + "unicode": "1f9d9-1f3fb" + }, + ":mage_tone2:": { + "category": "people", + "name": "mage: medium-light skin tone", + "unicode": "1f9d9-1f3fc" + }, + ":mage_tone3:": { + "category": "people", + "name": "mage: medium skin tone", + "unicode": "1f9d9-1f3fd" + }, + ":mage_tone4:": { + "category": "people", + "name": "mage: medium-dark skin tone", + "unicode": "1f9d9-1f3fe" + }, + ":mage_tone5:": { + "category": "people", + "name": "mage: dark skin tone", + "unicode": "1f9d9-1f3ff" + }, + ":magic_wand:": { + "category": "objects", + "name": "magic wand", + "unicode": "1fa84" + }, + ":magnet:": { + "category": "objects", + "name": "magnet", + "unicode": "1f9f2" + }, + ":mahjong:": { + "category": "symbols", + "name": "mahjong red dragon", + "unicode": "1f004" + }, + ":mailbox:": { + "category": "objects", + "name": "closed mailbox with raised flag", + "unicode": "1f4eb" + }, + ":mailbox_closed:": { + "category": "objects", + "name": "closed mailbox with lowered flag", + "unicode": "1f4ea" + }, + ":mailbox_with_mail:": { + "category": "objects", + "name": "open mailbox with raised flag", + "unicode": "1f4ec" + }, + ":mailbox_with_no_mail:": { + "category": "objects", + "name": "open mailbox with lowered flag", + "unicode": "1f4ed" + }, + ":male_sign:": { + "category": "symbols", + "name": "male sign", + "unicode": "2642" + }, + ":mammoth:": { + "category": "nature", + "name": "mammoth", + "unicode": "1f9a3" + }, + ":man:": { + "category": "people", + "name": "man", + "unicode": "1f468" + }, + ":man_artist:": { + "category": "people", + "name": "man artist", + "unicode": "1f468-200d-1f3a8" + }, + ":man_artist_tone1:": { + "category": "people", + "name": "man artist: light skin tone", + "unicode": "1f468-1f3fb-200d-1f3a8" + }, + ":man_artist_tone2:": { + "category": "people", + "name": "man artist: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f3a8" + }, + ":man_artist_tone3:": { + "category": "people", + "name": "man artist: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f3a8" + }, + ":man_artist_tone4:": { + "category": "people", + "name": "man artist: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f3a8" + }, + ":man_artist_tone5:": { + "category": "people", + "name": "man artist: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f3a8" + }, + ":man_astronaut:": { + "category": "people", + "name": "man astronaut", + "unicode": "1f468-200d-1f680" + }, + ":man_astronaut_tone1:": { + "category": "people", + "name": "man astronaut: light skin tone", + "unicode": "1f468-1f3fb-200d-1f680" + }, + ":man_astronaut_tone2:": { + "category": "people", + "name": "man astronaut: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f680" + }, + ":man_astronaut_tone3:": { + "category": "people", + "name": "man astronaut: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f680" + }, + ":man_astronaut_tone4:": { + "category": "people", + "name": "man astronaut: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f680" + }, + ":man_astronaut_tone5:": { + "category": "people", + "name": "man astronaut: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f680" + }, + ":man_bald:": { + "category": "people", + "name": "man: bald", + "unicode": "1f468-200d-1f9b2" + }, + ":man_bald_tone1:": { + "category": "people", + "name": "man, bald: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9b2" + }, + ":man_bald_tone2:": { + "category": "people", + "name": "man, bald: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9b2" + }, + ":man_bald_tone3:": { + "category": "people", + "name": "man, bald: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9b2" + }, + ":man_bald_tone4:": { + "category": "people", + "name": "man, bald: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9b2" + }, + ":man_bald_tone5:": { + "category": "people", + "name": "man, bald: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9b2" + }, + ":man_beard:": { + "category": "people", + "name": "man: beard", + "unicode": "1f9d4-200d-2642-fe0f" + }, + ":man_biking:": { + "category": "activity", + "name": "man biking", + "unicode": "1f6b4-200d-2642-fe0f" + }, + ":man_biking_tone1:": { + "category": "activity", + "name": "man biking: light skin tone", + "unicode": "1f6b4-1f3fb-200d-2642-fe0f" + }, + ":man_biking_tone2:": { + "category": "activity", + "name": "man biking: medium-light skin tone", + "unicode": "1f6b4-1f3fc-200d-2642-fe0f" + }, + ":man_biking_tone3:": { + "category": "activity", + "name": "man biking: medium skin tone", + "unicode": "1f6b4-1f3fd-200d-2642-fe0f" + }, + ":man_biking_tone4:": { + "category": "activity", + "name": "man biking: medium-dark skin tone", + "unicode": "1f6b4-1f3fe-200d-2642-fe0f" + }, + ":man_biking_tone5:": { + "category": "activity", + "name": "man biking: dark skin tone", + "unicode": "1f6b4-1f3ff-200d-2642-fe0f" + }, + ":man_bouncing_ball:": { + "category": "activity", + "name": "man bouncing ball", + "unicode": "26f9-fe0f-200d-2642-fe0f" + }, + ":man_bouncing_ball_tone1:": { + "category": "activity", + "name": "man bouncing ball: light skin tone", + "unicode": "26f9-1f3fb-200d-2642-fe0f" + }, + ":man_bouncing_ball_tone2:": { + "category": "activity", + "name": "man bouncing ball: medium-light skin tone", + "unicode": "26f9-1f3fc-200d-2642-fe0f" + }, + ":man_bouncing_ball_tone3:": { + "category": "activity", + "name": "man bouncing ball: medium skin tone", + "unicode": "26f9-1f3fd-200d-2642-fe0f" + }, + ":man_bouncing_ball_tone4:": { + "category": "activity", + "name": "man bouncing ball: medium-dark skin tone", + "unicode": "26f9-1f3fe-200d-2642-fe0f" + }, + ":man_bouncing_ball_tone5:": { + "category": "activity", + "name": "man bouncing ball: dark skin tone", + "unicode": "26f9-1f3ff-200d-2642-fe0f" + }, + ":man_bowing:": { + "category": "people", + "name": "man bowing", + "unicode": "1f647-200d-2642-fe0f" + }, + ":man_bowing_tone1:": { + "category": "people", + "name": "man bowing: light skin tone", + "unicode": "1f647-1f3fb-200d-2642-fe0f" + }, + ":man_bowing_tone2:": { + "category": "people", + "name": "man bowing: medium-light skin tone", + "unicode": "1f647-1f3fc-200d-2642-fe0f" + }, + ":man_bowing_tone3:": { + "category": "people", + "name": "man bowing: medium skin tone", + "unicode": "1f647-1f3fd-200d-2642-fe0f" + }, + ":man_bowing_tone4:": { + "category": "people", + "name": "man bowing: medium-dark skin tone", + "unicode": "1f647-1f3fe-200d-2642-fe0f" + }, + ":man_bowing_tone5:": { + "category": "people", + "name": "man bowing: dark skin tone", + "unicode": "1f647-1f3ff-200d-2642-fe0f" + }, + ":man_cartwheeling:": { + "category": "activity", + "name": "man cartwheeling", + "unicode": "1f938-200d-2642-fe0f" + }, + ":man_cartwheeling_tone1:": { + "category": "activity", + "name": "man cartwheeling: light skin tone", + "unicode": "1f938-1f3fb-200d-2642-fe0f" + }, + ":man_cartwheeling_tone2:": { + "category": "activity", + "name": "man cartwheeling: medium-light skin tone", + "unicode": "1f938-1f3fc-200d-2642-fe0f" + }, + ":man_cartwheeling_tone3:": { + "category": "activity", + "name": "man cartwheeling: medium skin tone", + "unicode": "1f938-1f3fd-200d-2642-fe0f" + }, + ":man_cartwheeling_tone4:": { + "category": "activity", + "name": "man cartwheeling: medium-dark skin tone", + "unicode": "1f938-1f3fe-200d-2642-fe0f" + }, + ":man_cartwheeling_tone5:": { + "category": "activity", + "name": "man cartwheeling: dark skin tone", + "unicode": "1f938-1f3ff-200d-2642-fe0f" + }, + ":man_climbing:": { + "category": "activity", + "name": "man climbing", + "unicode": "1f9d7-200d-2642-fe0f" + }, + ":man_climbing_tone1:": { + "category": "activity", + "name": "man climbing: light skin tone", + "unicode": "1f9d7-1f3fb-200d-2642-fe0f" + }, + ":man_climbing_tone2:": { + "category": "activity", + "name": "man climbing: medium-light skin tone", + "unicode": "1f9d7-1f3fc-200d-2642-fe0f" + }, + ":man_climbing_tone3:": { + "category": "activity", + "name": "man climbing: medium skin tone", + "unicode": "1f9d7-1f3fd-200d-2642-fe0f" + }, + ":man_climbing_tone4:": { + "category": "activity", + "name": "man climbing: medium-dark skin tone", + "unicode": "1f9d7-1f3fe-200d-2642-fe0f" + }, + ":man_climbing_tone5:": { + "category": "activity", + "name": "man climbing: dark skin tone", + "unicode": "1f9d7-1f3ff-200d-2642-fe0f" + }, + ":man_construction_worker:": { + "category": "people", + "name": "man construction worker", + "unicode": "1f477-200d-2642-fe0f" + }, + ":man_construction_worker_tone1:": { + "category": "people", + "name": "man construction worker: light skin tone", + "unicode": "1f477-1f3fb-200d-2642-fe0f" + }, + ":man_construction_worker_tone2:": { + "category": "people", + "name": "man construction worker: medium-light skin tone", + "unicode": "1f477-1f3fc-200d-2642-fe0f" + }, + ":man_construction_worker_tone3:": { + "category": "people", + "name": "man construction worker: medium skin tone", + "unicode": "1f477-1f3fd-200d-2642-fe0f" + }, + ":man_construction_worker_tone4:": { + "category": "people", + "name": "man construction worker: medium-dark skin tone", + "unicode": "1f477-1f3fe-200d-2642-fe0f" + }, + ":man_construction_worker_tone5:": { + "category": "people", + "name": "man construction worker: dark skin tone", + "unicode": "1f477-1f3ff-200d-2642-fe0f" + }, + ":man_cook:": { + "category": "people", + "name": "man cook", + "unicode": "1f468-200d-1f373" + }, + ":man_cook_tone1:": { + "category": "people", + "name": "man cook: light skin tone", + "unicode": "1f468-1f3fb-200d-1f373" + }, + ":man_cook_tone2:": { + "category": "people", + "name": "man cook: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f373" + }, + ":man_cook_tone3:": { + "category": "people", + "name": "man cook: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f373" + }, + ":man_cook_tone4:": { + "category": "people", + "name": "man cook: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f373" + }, + ":man_cook_tone5:": { + "category": "people", + "name": "man cook: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f373" + }, + ":man_curly_haired:": { + "category": "people", + "name": "man: curly hair", + "unicode": "1f468-200d-1f9b1" + }, + ":man_curly_haired_tone1:": { + "category": "people", + "name": "man, curly haired: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9b1" + }, + ":man_curly_haired_tone2:": { + "category": "people", + "name": "man, curly haired: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9b1" + }, + ":man_curly_haired_tone3:": { + "category": "people", + "name": "man, curly haired: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9b1" + }, + ":man_curly_haired_tone4:": { + "category": "people", + "name": "man, curly haired: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9b1" + }, + ":man_curly_haired_tone5:": { + "category": "people", + "name": "man, curly haired: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9b1" + }, + ":man_dancing:": { + "category": "people", + "name": "man dancing", + "unicode": "1f57a" + }, + ":man_dancing_tone1:": { + "category": "people", + "name": "man dancing: light skin tone", + "unicode": "1f57a-1f3fb" + }, + ":man_dancing_tone2:": { + "category": "people", + "name": "man dancing: medium-light skin tone", + "unicode": "1f57a-1f3fc" + }, + ":man_dancing_tone3:": { + "category": "people", + "name": "man dancing: medium skin tone", + "unicode": "1f57a-1f3fd" + }, + ":man_dancing_tone4:": { + "category": "people", + "name": "man dancing: medium-dark skin tone", + "unicode": "1f57a-1f3fe" + }, + ":man_dancing_tone5:": { + "category": "people", + "name": "man dancing: dark skin tone", + "unicode": "1f57a-1f3ff" + }, + ":man_detective:": { + "category": "people", + "name": "man detective", + "unicode": "1f575-fe0f-200d-2642-fe0f" + }, + ":man_detective_tone1:": { + "category": "people", + "name": "man detective: light skin tone", + "unicode": "1f575-1f3fb-200d-2642-fe0f" + }, + ":man_detective_tone2:": { + "category": "people", + "name": "man detective: medium-light skin tone", + "unicode": "1f575-1f3fc-200d-2642-fe0f" + }, + ":man_detective_tone3:": { + "category": "people", + "name": "man detective: medium skin tone", + "unicode": "1f575-1f3fd-200d-2642-fe0f" + }, + ":man_detective_tone4:": { + "category": "people", + "name": "man detective: medium-dark skin tone", + "unicode": "1f575-1f3fe-200d-2642-fe0f" + }, + ":man_detective_tone5:": { + "category": "people", + "name": "man detective: dark skin tone", + "unicode": "1f575-1f3ff-200d-2642-fe0f" + }, + ":man_elf:": { + "category": "people", + "name": "man elf", + "unicode": "1f9dd-200d-2642-fe0f" + }, + ":man_elf_tone1:": { + "category": "people", + "name": "man elf: light skin tone", + "unicode": "1f9dd-1f3fb-200d-2642-fe0f" + }, + ":man_elf_tone2:": { + "category": "people", + "name": "man elf: medium-light skin tone", + "unicode": "1f9dd-1f3fc-200d-2642-fe0f" + }, + ":man_elf_tone3:": { + "category": "people", + "name": "man elf: medium skin tone", + "unicode": "1f9dd-1f3fd-200d-2642-fe0f" + }, + ":man_elf_tone4:": { + "category": "people", + "name": "man elf: medium-dark skin tone", + "unicode": "1f9dd-1f3fe-200d-2642-fe0f" + }, + ":man_elf_tone5:": { + "category": "people", + "name": "man elf: dark skin tone", + "unicode": "1f9dd-1f3ff-200d-2642-fe0f" + }, + ":man_facepalming:": { + "category": "people", + "name": "man facepalming", + "unicode": "1f926-200d-2642-fe0f" + }, + ":man_facepalming_tone1:": { + "category": "people", + "name": "man facepalming: light skin tone", + "unicode": "1f926-1f3fb-200d-2642-fe0f" + }, + ":man_facepalming_tone2:": { + "category": "people", + "name": "man facepalming: medium-light skin tone", + "unicode": "1f926-1f3fc-200d-2642-fe0f" + }, + ":man_facepalming_tone3:": { + "category": "people", + "name": "man facepalming: medium skin tone", + "unicode": "1f926-1f3fd-200d-2642-fe0f" + }, + ":man_facepalming_tone4:": { + "category": "people", + "name": "man facepalming: medium-dark skin tone", + "unicode": "1f926-1f3fe-200d-2642-fe0f" + }, + ":man_facepalming_tone5:": { + "category": "people", + "name": "man facepalming: dark skin tone", + "unicode": "1f926-1f3ff-200d-2642-fe0f" + }, + ":man_factory_worker:": { + "category": "people", + "name": "man factory worker", + "unicode": "1f468-200d-1f3ed" + }, + ":man_factory_worker_tone1:": { + "category": "people", + "name": "man factory worker: light skin tone", + "unicode": "1f468-1f3fb-200d-1f3ed" + }, + ":man_factory_worker_tone2:": { + "category": "people", + "name": "man factory worker: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f3ed" + }, + ":man_factory_worker_tone3:": { + "category": "people", + "name": "man factory worker: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f3ed" + }, + ":man_factory_worker_tone4:": { + "category": "people", + "name": "man factory worker: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f3ed" + }, + ":man_factory_worker_tone5:": { + "category": "people", + "name": "man factory worker: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f3ed" + }, + ":man_fairy:": { + "category": "people", + "name": "man fairy", + "unicode": "1f9da-200d-2642-fe0f" + }, + ":man_fairy_tone1:": { + "category": "people", + "name": "man fairy: light skin tone", + "unicode": "1f9da-1f3fb-200d-2642-fe0f" + }, + ":man_fairy_tone2:": { + "category": "people", + "name": "man fairy: medium-light skin tone", + "unicode": "1f9da-1f3fc-200d-2642-fe0f" + }, + ":man_fairy_tone3:": { + "category": "people", + "name": "man fairy: medium skin tone", + "unicode": "1f9da-1f3fd-200d-2642-fe0f" + }, + ":man_fairy_tone4:": { + "category": "people", + "name": "man fairy: medium-dark skin tone", + "unicode": "1f9da-1f3fe-200d-2642-fe0f" + }, + ":man_fairy_tone5:": { + "category": "people", + "name": "man fairy: dark skin tone", + "unicode": "1f9da-1f3ff-200d-2642-fe0f" + }, + ":man_farmer:": { + "category": "people", + "name": "man farmer", + "unicode": "1f468-200d-1f33e" + }, + ":man_farmer_tone1:": { + "category": "people", + "name": "man farmer: light skin tone", + "unicode": "1f468-1f3fb-200d-1f33e" + }, + ":man_farmer_tone2:": { + "category": "people", + "name": "man farmer: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f33e" + }, + ":man_farmer_tone3:": { + "category": "people", + "name": "man farmer: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f33e" + }, + ":man_farmer_tone4:": { + "category": "people", + "name": "man farmer: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f33e" + }, + ":man_farmer_tone5:": { + "category": "people", + "name": "man farmer: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f33e" + }, + ":man_feeding_baby:": { + "category": "people", + "name": "man feeding baby", + "unicode": "1f468-200d-1f37c" + }, + ":man_feeding_baby_tone1:": { + "category": "people", + "name": "man feeding baby: light skin tone", + "unicode": "1f468-1f3fb-200d-1f37c" + }, + ":man_feeding_baby_tone2:": { + "category": "people", + "name": "man feeding baby: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f37c" + }, + ":man_feeding_baby_tone3:": { + "category": "people", + "name": "man feeding baby: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f37c" + }, + ":man_feeding_baby_tone4:": { + "category": "people", + "name": "man feeding baby: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f37c" + }, + ":man_feeding_baby_tone5:": { + "category": "people", + "name": "man feeding baby: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f37c" + }, + ":man_firefighter:": { + "category": "people", + "name": "man firefighter", + "unicode": "1f468-200d-1f692" + }, + ":man_firefighter_tone1:": { + "category": "people", + "name": "man firefighter: light skin tone", + "unicode": "1f468-1f3fb-200d-1f692" + }, + ":man_firefighter_tone2:": { + "category": "people", + "name": "man firefighter: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f692" + }, + ":man_firefighter_tone3:": { + "category": "people", + "name": "man firefighter: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f692" + }, + ":man_firefighter_tone4:": { + "category": "people", + "name": "man firefighter: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f692" + }, + ":man_firefighter_tone5:": { + "category": "people", + "name": "man firefighter: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f692" + }, + ":man_frowning:": { + "category": "people", + "name": "man frowning", + "unicode": "1f64d-200d-2642-fe0f" + }, + ":man_frowning_tone1:": { + "category": "people", + "name": "man frowning: light skin tone", + "unicode": "1f64d-1f3fb-200d-2642-fe0f" + }, + ":man_frowning_tone2:": { + "category": "people", + "name": "man frowning: medium-light skin tone", + "unicode": "1f64d-1f3fc-200d-2642-fe0f" + }, + ":man_frowning_tone3:": { + "category": "people", + "name": "man frowning: medium skin tone", + "unicode": "1f64d-1f3fd-200d-2642-fe0f" + }, + ":man_frowning_tone4:": { + "category": "people", + "name": "man frowning: medium-dark skin tone", + "unicode": "1f64d-1f3fe-200d-2642-fe0f" + }, + ":man_frowning_tone5:": { + "category": "people", + "name": "man frowning: dark skin tone", + "unicode": "1f64d-1f3ff-200d-2642-fe0f" + }, + ":man_genie:": { + "category": "people", + "name": "man genie", + "unicode": "1f9de-200d-2642-fe0f" + }, + ":man_gesturing_no:": { + "category": "people", + "name": "man gesturing NO", + "unicode": "1f645-200d-2642-fe0f" + }, + ":man_gesturing_no_tone1:": { + "category": "people", + "name": "man gesturing NO: light skin tone", + "unicode": "1f645-1f3fb-200d-2642-fe0f" + }, + ":man_gesturing_no_tone2:": { + "category": "people", + "name": "man gesturing NO: medium-light skin tone", + "unicode": "1f645-1f3fc-200d-2642-fe0f" + }, + ":man_gesturing_no_tone3:": { + "category": "people", + "name": "man gesturing NO: medium skin tone", + "unicode": "1f645-1f3fd-200d-2642-fe0f" + }, + ":man_gesturing_no_tone4:": { + "category": "people", + "name": "man gesturing NO: medium-dark skin tone", + "unicode": "1f645-1f3fe-200d-2642-fe0f" + }, + ":man_gesturing_no_tone5:": { + "category": "people", + "name": "man gesturing NO: dark skin tone", + "unicode": "1f645-1f3ff-200d-2642-fe0f" + }, + ":man_gesturing_ok:": { + "category": "people", + "name": "man gesturing OK", + "unicode": "1f646-200d-2642-fe0f" + }, + ":man_gesturing_ok_tone1:": { + "category": "people", + "name": "man gesturing OK: light skin tone", + "unicode": "1f646-1f3fb-200d-2642-fe0f" + }, + ":man_gesturing_ok_tone2:": { + "category": "people", + "name": "man gesturing OK: medium-light skin tone", + "unicode": "1f646-1f3fc-200d-2642-fe0f" + }, + ":man_gesturing_ok_tone3:": { + "category": "people", + "name": "man gesturing OK: medium skin tone", + "unicode": "1f646-1f3fd-200d-2642-fe0f" + }, + ":man_gesturing_ok_tone4:": { + "category": "people", + "name": "man gesturing OK: medium-dark skin tone", + "unicode": "1f646-1f3fe-200d-2642-fe0f" + }, + ":man_gesturing_ok_tone5:": { + "category": "people", + "name": "man gesturing OK: dark skin tone", + "unicode": "1f646-1f3ff-200d-2642-fe0f" + }, + ":man_getting_face_massage:": { + "category": "people", + "name": "man getting massage", + "unicode": "1f486-200d-2642-fe0f" + }, + ":man_getting_face_massage_tone1:": { + "category": "people", + "name": "man getting massage: light skin tone", + "unicode": "1f486-1f3fb-200d-2642-fe0f" + }, + ":man_getting_face_massage_tone2:": { + "category": "people", + "name": "man getting massage: medium-light skin tone", + "unicode": "1f486-1f3fc-200d-2642-fe0f" + }, + ":man_getting_face_massage_tone3:": { + "category": "people", + "name": "man getting massage: medium skin tone", + "unicode": "1f486-1f3fd-200d-2642-fe0f" + }, + ":man_getting_face_massage_tone4:": { + "category": "people", + "name": "man getting massage: medium-dark skin tone", + "unicode": "1f486-1f3fe-200d-2642-fe0f" + }, + ":man_getting_face_massage_tone5:": { + "category": "people", + "name": "man getting massage: dark skin tone", + "unicode": "1f486-1f3ff-200d-2642-fe0f" + }, + ":man_getting_haircut:": { + "category": "people", + "name": "man getting haircut", + "unicode": "1f487-200d-2642-fe0f" + }, + ":man_getting_haircut_tone1:": { + "category": "people", + "name": "man getting haircut: light skin tone", + "unicode": "1f487-1f3fb-200d-2642-fe0f" + }, + ":man_getting_haircut_tone2:": { + "category": "people", + "name": "man getting haircut: medium-light skin tone", + "unicode": "1f487-1f3fc-200d-2642-fe0f" + }, + ":man_getting_haircut_tone3:": { + "category": "people", + "name": "man getting haircut: medium skin tone", + "unicode": "1f487-1f3fd-200d-2642-fe0f" + }, + ":man_getting_haircut_tone4:": { + "category": "people", + "name": "man getting haircut: medium-dark skin tone", + "unicode": "1f487-1f3fe-200d-2642-fe0f" + }, + ":man_getting_haircut_tone5:": { + "category": "people", + "name": "man getting haircut: dark skin tone", + "unicode": "1f487-1f3ff-200d-2642-fe0f" + }, + ":man_golfing:": { + "category": "activity", + "name": "man golfing", + "unicode": "1f3cc-fe0f-200d-2642-fe0f" + }, + ":man_golfing_tone1:": { + "category": "activity", + "name": "man golfing: light skin tone", + "unicode": "1f3cc-1f3fb-200d-2642-fe0f" + }, + ":man_golfing_tone2:": { + "category": "activity", + "name": "man golfing: medium-light skin tone", + "unicode": "1f3cc-1f3fc-200d-2642-fe0f" + }, + ":man_golfing_tone3:": { + "category": "activity", + "name": "man golfing: medium skin tone", + "unicode": "1f3cc-1f3fd-200d-2642-fe0f" + }, + ":man_golfing_tone4:": { + "category": "activity", + "name": "man golfing: medium-dark skin tone", + "unicode": "1f3cc-1f3fe-200d-2642-fe0f" + }, + ":man_golfing_tone5:": { + "category": "activity", + "name": "man golfing: dark skin tone", + "unicode": "1f3cc-1f3ff-200d-2642-fe0f" + }, + ":man_guard:": { + "category": "people", + "name": "man guard", + "unicode": "1f482-200d-2642-fe0f" + }, + ":man_guard_tone1:": { + "category": "people", + "name": "man guard: light skin tone", + "unicode": "1f482-1f3fb-200d-2642-fe0f" + }, + ":man_guard_tone2:": { + "category": "people", + "name": "man guard: medium-light skin tone", + "unicode": "1f482-1f3fc-200d-2642-fe0f" + }, + ":man_guard_tone3:": { + "category": "people", + "name": "man guard: medium skin tone", + "unicode": "1f482-1f3fd-200d-2642-fe0f" + }, + ":man_guard_tone4:": { + "category": "people", + "name": "man guard: medium-dark skin tone", + "unicode": "1f482-1f3fe-200d-2642-fe0f" + }, + ":man_guard_tone5:": { + "category": "people", + "name": "man guard: dark skin tone", + "unicode": "1f482-1f3ff-200d-2642-fe0f" + }, + ":man_health_worker:": { + "category": "people", + "name": "man health worker", + "unicode": "1f468-200d-2695-fe0f" + }, + ":man_health_worker_tone1:": { + "category": "people", + "name": "man health worker: light skin tone", + "unicode": "1f468-1f3fb-200d-2695-fe0f" + }, + ":man_health_worker_tone2:": { + "category": "people", + "name": "man health worker: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-2695-fe0f" + }, + ":man_health_worker_tone3:": { + "category": "people", + "name": "man health worker: medium skin tone", + "unicode": "1f468-1f3fd-200d-2695-fe0f" + }, + ":man_health_worker_tone4:": { + "category": "people", + "name": "man health worker: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-2695-fe0f" + }, + ":man_health_worker_tone5:": { + "category": "people", + "name": "man health worker: dark skin tone", + "unicode": "1f468-1f3ff-200d-2695-fe0f" + }, + ":man_in_lotus_position:": { + "category": "activity", + "name": "man in lotus position", + "unicode": "1f9d8-200d-2642-fe0f" + }, + ":man_in_lotus_position_tone1:": { + "category": "activity", + "name": "man in lotus position: light skin tone", + "unicode": "1f9d8-1f3fb-200d-2642-fe0f" + }, + ":man_in_lotus_position_tone2:": { + "category": "activity", + "name": "man in lotus position: medium-light skin tone", + "unicode": "1f9d8-1f3fc-200d-2642-fe0f" + }, + ":man_in_lotus_position_tone3:": { + "category": "activity", + "name": "man in lotus position: medium skin tone", + "unicode": "1f9d8-1f3fd-200d-2642-fe0f" + }, + ":man_in_lotus_position_tone4:": { + "category": "activity", + "name": "man in lotus position: medium-dark skin tone", + "unicode": "1f9d8-1f3fe-200d-2642-fe0f" + }, + ":man_in_lotus_position_tone5:": { + "category": "activity", + "name": "man in lotus position: dark skin tone", + "unicode": "1f9d8-1f3ff-200d-2642-fe0f" + }, + ":man_in_manual_wheelchair:": { + "category": "people", + "name": "man in manual wheelchair", + "unicode": "1f468-200d-1f9bd" + }, + ":man_in_manual_wheelchair_facing_right:": { + "category": "people", + "name": "man in manual wheelchair facing right", + "unicode": "1f468-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "man in manual wheelchair facing right: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "man in manual wheelchair facing right: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "man in manual wheelchair facing right: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "man in manual wheelchair facing right: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "man in manual wheelchair facing right: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9bd-200d-27a1-fe0f" + }, + ":man_in_manual_wheelchair_tone1:": { + "category": "people", + "name": "man in manual wheelchair: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9bd" + }, + ":man_in_manual_wheelchair_tone2:": { + "category": "people", + "name": "man in manual wheelchair: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9bd" + }, + ":man_in_manual_wheelchair_tone3:": { + "category": "people", + "name": "man in manual wheelchair: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9bd" + }, + ":man_in_manual_wheelchair_tone4:": { + "category": "people", + "name": "man in manual wheelchair: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9bd" + }, + ":man_in_manual_wheelchair_tone5:": { + "category": "people", + "name": "man in manual wheelchair: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9bd" + }, + ":man_in_motorized_wheelchair:": { + "category": "people", + "name": "man in motorized wheelchair", + "unicode": "1f468-200d-1f9bc" + }, + ":man_in_motorized_wheelchair_facing_right:": { + "category": "people", + "name": "man in motorized wheelchair facing right", + "unicode": "1f468-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "man in motorized wheelchair facing right: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "man in motorized wheelchair facing right: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "man in motorized wheelchair facing right: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "man in motorized wheelchair facing right: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "man in motorized wheelchair facing right: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9bc-200d-27a1-fe0f" + }, + ":man_in_motorized_wheelchair_tone1:": { + "category": "people", + "name": "man in motorized wheelchair: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9bc" + }, + ":man_in_motorized_wheelchair_tone2:": { + "category": "people", + "name": "man in motorized wheelchair: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9bc" + }, + ":man_in_motorized_wheelchair_tone3:": { + "category": "people", + "name": "man in motorized wheelchair: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9bc" + }, + ":man_in_motorized_wheelchair_tone4:": { + "category": "people", + "name": "man in motorized wheelchair: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9bc" + }, + ":man_in_motorized_wheelchair_tone5:": { + "category": "people", + "name": "man in motorized wheelchair: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9bc" + }, + ":man_in_santa_hat:": { + "category": "people", + "name": "man in santa hat", + "unicode": "1f468-200d-1f384" + }, + ":man_in_santa_hat_tone1:": { + "category": "people", + "name": "man in santa hat: light skin tone", + "unicode": "1f468-1f3fb-200d-1f384" + }, + ":man_in_santa_hat_tone2:": { + "category": "people", + "name": "man in santa hat: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f384" + }, + ":man_in_santa_hat_tone3:": { + "category": "people", + "name": "man in santa hat: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f384" + }, + ":man_in_santa_hat_tone4:": { + "category": "people", + "name": "man in santa hat: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f384" + }, + ":man_in_santa_hat_tone5:": { + "category": "people", + "name": "man in santa hat: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f384" + }, + ":man_in_steamy_room:": { + "category": "people", + "name": "man in steamy room", + "unicode": "1f9d6-200d-2642-fe0f" + }, + ":man_in_steamy_room_tone1:": { + "category": "people", + "name": "man in steamy room: light skin tone", + "unicode": "1f9d6-1f3fb-200d-2642-fe0f" + }, + ":man_in_steamy_room_tone2:": { + "category": "people", + "name": "man in steamy room: medium-light skin tone", + "unicode": "1f9d6-1f3fc-200d-2642-fe0f" + }, + ":man_in_steamy_room_tone3:": { + "category": "people", + "name": "man in steamy room: medium skin tone", + "unicode": "1f9d6-1f3fd-200d-2642-fe0f" + }, + ":man_in_steamy_room_tone4:": { + "category": "people", + "name": "man in steamy room: medium-dark skin tone", + "unicode": "1f9d6-1f3fe-200d-2642-fe0f" + }, + ":man_in_steamy_room_tone5:": { + "category": "people", + "name": "man in steamy room: dark skin tone", + "unicode": "1f9d6-1f3ff-200d-2642-fe0f" + }, + ":man_in_tuxedo:": { + "category": "people", + "name": "man in tuxedo", + "unicode": "1f935-200d-2642-fe0f" + }, + ":man_in_tuxedo_tone1:": { + "category": "people", + "name": "man in tuxedo: light skin tone", + "unicode": "1f935-1f3fb-200d-2642-fe0f" + }, + ":man_in_tuxedo_tone2:": { + "category": "people", + "name": "man in tuxedo: medium-light skin tone", + "unicode": "1f935-1f3fc-200d-2642-fe0f" + }, + ":man_in_tuxedo_tone3:": { + "category": "people", + "name": "man in tuxedo: medium skin tone", + "unicode": "1f935-1f3fd-200d-2642-fe0f" + }, + ":man_in_tuxedo_tone4:": { + "category": "people", + "name": "man in tuxedo: medium-dark skin tone", + "unicode": "1f935-1f3fe-200d-2642-fe0f" + }, + ":man_in_tuxedo_tone5:": { + "category": "people", + "name": "man in tuxedo: dark skin tone", + "unicode": "1f935-1f3ff-200d-2642-fe0f" + }, + ":man_judge:": { + "category": "people", + "name": "man judge", + "unicode": "1f468-200d-2696-fe0f" + }, + ":man_judge_tone1:": { + "category": "people", + "name": "man judge: light skin tone", + "unicode": "1f468-1f3fb-200d-2696-fe0f" + }, + ":man_judge_tone2:": { + "category": "people", + "name": "man judge: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-2696-fe0f" + }, + ":man_judge_tone3:": { + "category": "people", + "name": "man judge: medium skin tone", + "unicode": "1f468-1f3fd-200d-2696-fe0f" + }, + ":man_judge_tone4:": { + "category": "people", + "name": "man judge: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-2696-fe0f" + }, + ":man_judge_tone5:": { + "category": "people", + "name": "man judge: dark skin tone", + "unicode": "1f468-1f3ff-200d-2696-fe0f" + }, + ":man_juggling:": { + "category": "activity", + "name": "man juggling", + "unicode": "1f939-200d-2642-fe0f" + }, + ":man_juggling_tone1:": { + "category": "activity", + "name": "man juggling: light skin tone", + "unicode": "1f939-1f3fb-200d-2642-fe0f" + }, + ":man_juggling_tone2:": { + "category": "activity", + "name": "man juggling: medium-light skin tone", + "unicode": "1f939-1f3fc-200d-2642-fe0f" + }, + ":man_juggling_tone3:": { + "category": "activity", + "name": "man juggling: medium skin tone", + "unicode": "1f939-1f3fd-200d-2642-fe0f" + }, + ":man_juggling_tone4:": { + "category": "activity", + "name": "man juggling: medium-dark skin tone", + "unicode": "1f939-1f3fe-200d-2642-fe0f" + }, + ":man_juggling_tone5:": { + "category": "activity", + "name": "man juggling: dark skin tone", + "unicode": "1f939-1f3ff-200d-2642-fe0f" + }, + ":man_kneeling:": { + "category": "people", + "name": "man kneeling", + "unicode": "1f9ce-200d-2642-fe0f" + }, + ":man_kneeling_facing_right:": { + "category": "people", + "name": "man kneeling facing right", + "unicode": "1f9ce-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_facing_right_tone1:": { + "category": "people", + "name": "man kneeling facing right: light skin tone", + "unicode": "1f9ce-1f3fb-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_facing_right_tone2:": { + "category": "people", + "name": "man kneeling facing right: medium-light skin tone", + "unicode": "1f9ce-1f3fc-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_facing_right_tone3:": { + "category": "people", + "name": "man kneeling facing right: medium skin tone", + "unicode": "1f9ce-1f3fd-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_facing_right_tone4:": { + "category": "people", + "name": "man kneeling facing right: medium-dark skin tone", + "unicode": "1f9ce-1f3fe-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_facing_right_tone5:": { + "category": "people", + "name": "man kneeling facing right: dark skin tone", + "unicode": "1f9ce-1f3ff-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_kneeling_tone1:": { + "category": "people", + "name": "man kneeling: light skin tone", + "unicode": "1f9ce-1f3fb-200d-2642-fe0f" + }, + ":man_kneeling_tone2:": { + "category": "people", + "name": "man kneeling: medium-light skin tone", + "unicode": "1f9ce-1f3fc-200d-2642-fe0f" + }, + ":man_kneeling_tone3:": { + "category": "people", + "name": "man kneeling: medium skin tone", + "unicode": "1f9ce-1f3fd-200d-2642-fe0f" + }, + ":man_kneeling_tone4:": { + "category": "people", + "name": "man kneeling: medium-dark skin tone", + "unicode": "1f9ce-1f3fe-200d-2642-fe0f" + }, + ":man_kneeling_tone5:": { + "category": "people", + "name": "man kneeling: dark skin tone", + "unicode": "1f9ce-1f3ff-200d-2642-fe0f" + }, + ":man_lifting_weights:": { + "category": "activity", + "name": "man lifting weights", + "unicode": "1f3cb-fe0f-200d-2642-fe0f" + }, + ":man_lifting_weights_tone1:": { + "category": "activity", + "name": "man lifting weights: light skin tone", + "unicode": "1f3cb-1f3fb-200d-2642-fe0f" + }, + ":man_lifting_weights_tone2:": { + "category": "activity", + "name": "man lifting weights: medium-light skin tone", + "unicode": "1f3cb-1f3fc-200d-2642-fe0f" + }, + ":man_lifting_weights_tone3:": { + "category": "activity", + "name": "man lifting weights: medium skin tone", + "unicode": "1f3cb-1f3fd-200d-2642-fe0f" + }, + ":man_lifting_weights_tone4:": { + "category": "activity", + "name": "man lifting weights: medium-dark skin tone", + "unicode": "1f3cb-1f3fe-200d-2642-fe0f" + }, + ":man_lifting_weights_tone5:": { + "category": "activity", + "name": "man lifting weights: dark skin tone", + "unicode": "1f3cb-1f3ff-200d-2642-fe0f" + }, + ":man_mage:": { + "category": "people", + "name": "man mage", + "unicode": "1f9d9-200d-2642-fe0f" + }, + ":man_mage_tone1:": { + "category": "people", + "name": "man mage: light skin tone", + "unicode": "1f9d9-1f3fb-200d-2642-fe0f" + }, + ":man_mage_tone2:": { + "category": "people", + "name": "man mage: medium-light skin tone", + "unicode": "1f9d9-1f3fc-200d-2642-fe0f" + }, + ":man_mage_tone3:": { + "category": "people", + "name": "man mage: medium skin tone", + "unicode": "1f9d9-1f3fd-200d-2642-fe0f" + }, + ":man_mage_tone4:": { + "category": "people", + "name": "man mage: medium-dark skin tone", + "unicode": "1f9d9-1f3fe-200d-2642-fe0f" + }, + ":man_mage_tone5:": { + "category": "people", + "name": "man mage: dark skin tone", + "unicode": "1f9d9-1f3ff-200d-2642-fe0f" + }, + ":man_mechanic:": { + "category": "people", + "name": "man mechanic", + "unicode": "1f468-200d-1f527" + }, + ":man_mechanic_tone1:": { + "category": "people", + "name": "man mechanic: light skin tone", + "unicode": "1f468-1f3fb-200d-1f527" + }, + ":man_mechanic_tone2:": { + "category": "people", + "name": "man mechanic: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f527" + }, + ":man_mechanic_tone3:": { + "category": "people", + "name": "man mechanic: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f527" + }, + ":man_mechanic_tone4:": { + "category": "people", + "name": "man mechanic: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f527" + }, + ":man_mechanic_tone5:": { + "category": "people", + "name": "man mechanic: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f527" + }, + ":man_mountain_biking:": { + "category": "activity", + "name": "man mountain biking", + "unicode": "1f6b5-200d-2642-fe0f" + }, + ":man_mountain_biking_tone1:": { + "category": "activity", + "name": "man mountain biking: light skin tone", + "unicode": "1f6b5-1f3fb-200d-2642-fe0f" + }, + ":man_mountain_biking_tone2:": { + "category": "activity", + "name": "man mountain biking: medium-light skin tone", + "unicode": "1f6b5-1f3fc-200d-2642-fe0f" + }, + ":man_mountain_biking_tone3:": { + "category": "activity", + "name": "man mountain biking: medium skin tone", + "unicode": "1f6b5-1f3fd-200d-2642-fe0f" + }, + ":man_mountain_biking_tone4:": { + "category": "activity", + "name": "man mountain biking: medium-dark skin tone", + "unicode": "1f6b5-1f3fe-200d-2642-fe0f" + }, + ":man_mountain_biking_tone5:": { + "category": "activity", + "name": "man mountain biking: dark skin tone", + "unicode": "1f6b5-1f3ff-200d-2642-fe0f" + }, + ":man_office_worker:": { + "category": "people", + "name": "man office worker", + "unicode": "1f468-200d-1f4bc" + }, + ":man_office_worker_tone1:": { + "category": "people", + "name": "man office worker: light skin tone", + "unicode": "1f468-1f3fb-200d-1f4bc" + }, + ":man_office_worker_tone2:": { + "category": "people", + "name": "man office worker: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f4bc" + }, + ":man_office_worker_tone3:": { + "category": "people", + "name": "man office worker: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f4bc" + }, + ":man_office_worker_tone4:": { + "category": "people", + "name": "man office worker: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f4bc" + }, + ":man_office_worker_tone5:": { + "category": "people", + "name": "man office worker: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f4bc" + }, + ":man_pilot:": { + "category": "people", + "name": "man pilot", + "unicode": "1f468-200d-2708-fe0f" + }, + ":man_pilot_tone1:": { + "category": "people", + "name": "man pilot: light skin tone", + "unicode": "1f468-1f3fb-200d-2708-fe0f" + }, + ":man_pilot_tone2:": { + "category": "people", + "name": "man pilot: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-2708-fe0f" + }, + ":man_pilot_tone3:": { + "category": "people", + "name": "man pilot: medium skin tone", + "unicode": "1f468-1f3fd-200d-2708-fe0f" + }, + ":man_pilot_tone4:": { + "category": "people", + "name": "man pilot: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-2708-fe0f" + }, + ":man_pilot_tone5:": { + "category": "people", + "name": "man pilot: dark skin tone", + "unicode": "1f468-1f3ff-200d-2708-fe0f" + }, + ":man_playing_handball:": { + "category": "activity", + "name": "man playing handball", + "unicode": "1f93e-200d-2642-fe0f" + }, + ":man_playing_handball_tone1:": { + "category": "activity", + "name": "man playing handball: light skin tone", + "unicode": "1f93e-1f3fb-200d-2642-fe0f" + }, + ":man_playing_handball_tone2:": { + "category": "activity", + "name": "man playing handball: medium-light skin tone", + "unicode": "1f93e-1f3fc-200d-2642-fe0f" + }, + ":man_playing_handball_tone3:": { + "category": "activity", + "name": "man playing handball: medium skin tone", + "unicode": "1f93e-1f3fd-200d-2642-fe0f" + }, + ":man_playing_handball_tone4:": { + "category": "activity", + "name": "man playing handball: medium-dark skin tone", + "unicode": "1f93e-1f3fe-200d-2642-fe0f" + }, + ":man_playing_handball_tone5:": { + "category": "activity", + "name": "man playing handball: dark skin tone", + "unicode": "1f93e-1f3ff-200d-2642-fe0f" + }, + ":man_playing_water_polo:": { + "category": "activity", + "name": "man playing water polo", + "unicode": "1f93d-200d-2642-fe0f" + }, + ":man_playing_water_polo_tone1:": { + "category": "activity", + "name": "man playing water polo: light skin tone", + "unicode": "1f93d-1f3fb-200d-2642-fe0f" + }, + ":man_playing_water_polo_tone2:": { + "category": "activity", + "name": "man playing water polo: medium-light skin tone", + "unicode": "1f93d-1f3fc-200d-2642-fe0f" + }, + ":man_playing_water_polo_tone3:": { + "category": "activity", + "name": "man playing water polo: medium skin tone", + "unicode": "1f93d-1f3fd-200d-2642-fe0f" + }, + ":man_playing_water_polo_tone4:": { + "category": "activity", + "name": "man playing water polo: medium-dark skin tone", + "unicode": "1f93d-1f3fe-200d-2642-fe0f" + }, + ":man_playing_water_polo_tone5:": { + "category": "activity", + "name": "man playing water polo: dark skin tone", + "unicode": "1f93d-1f3ff-200d-2642-fe0f" + }, + ":man_police_officer:": { + "category": "people", + "name": "man police officer", + "unicode": "1f46e-200d-2642-fe0f" + }, + ":man_police_officer_tone1:": { + "category": "people", + "name": "man police officer: light skin tone", + "unicode": "1f46e-1f3fb-200d-2642-fe0f" + }, + ":man_police_officer_tone2:": { + "category": "people", + "name": "man police officer: medium-light skin tone", + "unicode": "1f46e-1f3fc-200d-2642-fe0f" + }, + ":man_police_officer_tone3:": { + "category": "people", + "name": "man police officer: medium skin tone", + "unicode": "1f46e-1f3fd-200d-2642-fe0f" + }, + ":man_police_officer_tone4:": { + "category": "people", + "name": "man police officer: medium-dark skin tone", + "unicode": "1f46e-1f3fe-200d-2642-fe0f" + }, + ":man_police_officer_tone5:": { + "category": "people", + "name": "man police officer: dark skin tone", + "unicode": "1f46e-1f3ff-200d-2642-fe0f" + }, + ":man_pouting:": { + "category": "people", + "name": "man pouting", + "unicode": "1f64e-200d-2642-fe0f" + }, + ":man_pouting_tone1:": { + "category": "people", + "name": "man pouting: light skin tone", + "unicode": "1f64e-1f3fb-200d-2642-fe0f" + }, + ":man_pouting_tone2:": { + "category": "people", + "name": "man pouting: medium-light skin tone", + "unicode": "1f64e-1f3fc-200d-2642-fe0f" + }, + ":man_pouting_tone3:": { + "category": "people", + "name": "man pouting: medium skin tone", + "unicode": "1f64e-1f3fd-200d-2642-fe0f" + }, + ":man_pouting_tone4:": { + "category": "people", + "name": "man pouting: medium-dark skin tone", + "unicode": "1f64e-1f3fe-200d-2642-fe0f" + }, + ":man_pouting_tone5:": { + "category": "people", + "name": "man pouting: dark skin tone", + "unicode": "1f64e-1f3ff-200d-2642-fe0f" + }, + ":man_raising_hand:": { + "category": "people", + "name": "man raising hand", + "unicode": "1f64b-200d-2642-fe0f" + }, + ":man_raising_hand_tone1:": { + "category": "people", + "name": "man raising hand: light skin tone", + "unicode": "1f64b-1f3fb-200d-2642-fe0f" + }, + ":man_raising_hand_tone2:": { + "category": "people", + "name": "man raising hand: medium-light skin tone", + "unicode": "1f64b-1f3fc-200d-2642-fe0f" + }, + ":man_raising_hand_tone3:": { + "category": "people", + "name": "man raising hand: medium skin tone", + "unicode": "1f64b-1f3fd-200d-2642-fe0f" + }, + ":man_raising_hand_tone4:": { + "category": "people", + "name": "man raising hand: medium-dark skin tone", + "unicode": "1f64b-1f3fe-200d-2642-fe0f" + }, + ":man_raising_hand_tone5:": { + "category": "people", + "name": "man raising hand: dark skin tone", + "unicode": "1f64b-1f3ff-200d-2642-fe0f" + }, + ":man_red_haired:": { + "category": "people", + "name": "man: red hair", + "unicode": "1f468-200d-1f9b0" + }, + ":man_red_haired_tone1:": { + "category": "people", + "name": "man, red haired: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9b0" + }, + ":man_red_haired_tone2:": { + "category": "people", + "name": "man, red haired: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9b0" + }, + ":man_red_haired_tone3:": { + "category": "people", + "name": "man, red haired: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9b0" + }, + ":man_red_haired_tone4:": { + "category": "people", + "name": "man, red haired: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9b0" + }, + ":man_red_haired_tone5:": { + "category": "people", + "name": "man, red haired: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9b0" + }, + ":man_rowing_boat:": { + "category": "activity", + "name": "man rowing boat", + "unicode": "1f6a3-200d-2642-fe0f" + }, + ":man_rowing_boat_tone1:": { + "category": "activity", + "name": "man rowing boat: light skin tone", + "unicode": "1f6a3-1f3fb-200d-2642-fe0f" + }, + ":man_rowing_boat_tone2:": { + "category": "activity", + "name": "man rowing boat: medium-light skin tone", + "unicode": "1f6a3-1f3fc-200d-2642-fe0f" + }, + ":man_rowing_boat_tone3:": { + "category": "activity", + "name": "man rowing boat: medium skin tone", + "unicode": "1f6a3-1f3fd-200d-2642-fe0f" + }, + ":man_rowing_boat_tone4:": { + "category": "activity", + "name": "man rowing boat: medium-dark skin tone", + "unicode": "1f6a3-1f3fe-200d-2642-fe0f" + }, + ":man_rowing_boat_tone5:": { + "category": "activity", + "name": "man rowing boat: dark skin tone", + "unicode": "1f6a3-1f3ff-200d-2642-fe0f" + }, + ":man_running:": { + "category": "people", + "name": "man running", + "unicode": "1f3c3-200d-2642-fe0f" + }, + ":man_running_facing_right:": { + "category": "people", + "name": "man running facing right", + "unicode": "1f3c3-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_facing_right_tone1:": { + "category": "people", + "name": "man running facing right: light skin tone", + "unicode": "1f3c3-1f3fb-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_facing_right_tone2:": { + "category": "people", + "name": "man running facing right: medium-light skin tone", + "unicode": "1f3c3-1f3fc-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_facing_right_tone3:": { + "category": "people", + "name": "man running facing right: medium skin tone", + "unicode": "1f3c3-1f3fd-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_facing_right_tone4:": { + "category": "people", + "name": "man running facing right: medium-dark skin tone", + "unicode": "1f3c3-1f3fe-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_facing_right_tone5:": { + "category": "people", + "name": "man running facing right: dark skin tone", + "unicode": "1f3c3-1f3ff-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_running_tone1:": { + "category": "people", + "name": "man running: light skin tone", + "unicode": "1f3c3-1f3fb-200d-2642-fe0f" + }, + ":man_running_tone2:": { + "category": "people", + "name": "man running: medium-light skin tone", + "unicode": "1f3c3-1f3fc-200d-2642-fe0f" + }, + ":man_running_tone3:": { + "category": "people", + "name": "man running: medium skin tone", + "unicode": "1f3c3-1f3fd-200d-2642-fe0f" + }, + ":man_running_tone4:": { + "category": "people", + "name": "man running: medium-dark skin tone", + "unicode": "1f3c3-1f3fe-200d-2642-fe0f" + }, + ":man_running_tone5:": { + "category": "people", + "name": "man running: dark skin tone", + "unicode": "1f3c3-1f3ff-200d-2642-fe0f" + }, + ":man_scientist:": { + "category": "people", + "name": "man scientist", + "unicode": "1f468-200d-1f52c" + }, + ":man_scientist_tone1:": { + "category": "people", + "name": "man scientist: light skin tone", + "unicode": "1f468-1f3fb-200d-1f52c" + }, + ":man_scientist_tone2:": { + "category": "people", + "name": "man scientist: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f52c" + }, + ":man_scientist_tone3:": { + "category": "people", + "name": "man scientist: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f52c" + }, + ":man_scientist_tone4:": { + "category": "people", + "name": "man scientist: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f52c" + }, + ":man_scientist_tone5:": { + "category": "people", + "name": "man scientist: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f52c" + }, + ":man_shrugging:": { + "category": "people", + "name": "man shrugging", + "unicode": "1f937-200d-2642-fe0f" + }, + ":man_shrugging_tone1:": { + "category": "people", + "name": "man shrugging: light skin tone", + "unicode": "1f937-1f3fb-200d-2642-fe0f" + }, + ":man_shrugging_tone2:": { + "category": "people", + "name": "man shrugging: medium-light skin tone", + "unicode": "1f937-1f3fc-200d-2642-fe0f" + }, + ":man_shrugging_tone3:": { + "category": "people", + "name": "man shrugging: medium skin tone", + "unicode": "1f937-1f3fd-200d-2642-fe0f" + }, + ":man_shrugging_tone4:": { + "category": "people", + "name": "man shrugging: medium-dark skin tone", + "unicode": "1f937-1f3fe-200d-2642-fe0f" + }, + ":man_shrugging_tone5:": { + "category": "people", + "name": "man shrugging: dark skin tone", + "unicode": "1f937-1f3ff-200d-2642-fe0f" + }, + ":man_singer:": { + "category": "people", + "name": "man singer", + "unicode": "1f468-200d-1f3a4" + }, + ":man_singer_tone1:": { + "category": "people", + "name": "man singer: light skin tone", + "unicode": "1f468-1f3fb-200d-1f3a4" + }, + ":man_singer_tone2:": { + "category": "people", + "name": "man singer: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f3a4" + }, + ":man_singer_tone3:": { + "category": "people", + "name": "man singer: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f3a4" + }, + ":man_singer_tone4:": { + "category": "people", + "name": "man singer: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f3a4" + }, + ":man_singer_tone5:": { + "category": "people", + "name": "man singer: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f3a4" + }, + ":man_standing:": { + "category": "people", + "name": "man standing", + "unicode": "1f9cd-200d-2642-fe0f" + }, + ":man_standing_tone1:": { + "category": "people", + "name": "man standing: light skin tone", + "unicode": "1f9cd-1f3fb-200d-2642-fe0f" + }, + ":man_standing_tone2:": { + "category": "people", + "name": "man standing: medium-light skin tone", + "unicode": "1f9cd-1f3fc-200d-2642-fe0f" + }, + ":man_standing_tone3:": { + "category": "people", + "name": "man standing: medium skin tone", + "unicode": "1f9cd-1f3fd-200d-2642-fe0f" + }, + ":man_standing_tone4:": { + "category": "people", + "name": "man standing: medium-dark skin tone", + "unicode": "1f9cd-1f3fe-200d-2642-fe0f" + }, + ":man_standing_tone5:": { + "category": "people", + "name": "man standing: dark skin tone", + "unicode": "1f9cd-1f3ff-200d-2642-fe0f" + }, + ":man_student:": { + "category": "people", + "name": "man student", + "unicode": "1f468-200d-1f393" + }, + ":man_student_tone1:": { + "category": "people", + "name": "man student: light skin tone", + "unicode": "1f468-1f3fb-200d-1f393" + }, + ":man_student_tone2:": { + "category": "people", + "name": "man student: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f393" + }, + ":man_student_tone3:": { + "category": "people", + "name": "man student: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f393" + }, + ":man_student_tone4:": { + "category": "people", + "name": "man student: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f393" + }, + ":man_student_tone5:": { + "category": "people", + "name": "man student: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f393" + }, + ":man_superhero:": { + "category": "people", + "name": "man superhero", + "unicode": "1f9b8-200d-2642-fe0f" + }, + ":man_superhero_tone1:": { + "category": "people", + "name": "man superhero: light skin tone", + "unicode": "1f9b8-1f3fb-200d-2642-fe0f" + }, + ":man_superhero_tone2:": { + "category": "people", + "name": "man superhero: medium-light skin tone", + "unicode": "1f9b8-1f3fc-200d-2642-fe0f" + }, + ":man_superhero_tone3:": { + "category": "people", + "name": "man superhero: medium skin tone", + "unicode": "1f9b8-1f3fd-200d-2642-fe0f" + }, + ":man_superhero_tone4:": { + "category": "people", + "name": "man superhero: medium-dark skin tone", + "unicode": "1f9b8-1f3fe-200d-2642-fe0f" + }, + ":man_superhero_tone5:": { + "category": "people", + "name": "man superhero: dark skin tone", + "unicode": "1f9b8-1f3ff-200d-2642-fe0f" + }, + ":man_supervillain:": { + "category": "people", + "name": "man supervillain", + "unicode": "1f9b9-200d-2642-fe0f" + }, + ":man_supervillain_tone1:": { + "category": "people", + "name": "man supervillain: light skin tone", + "unicode": "1f9b9-1f3fb-200d-2642-fe0f" + }, + ":man_supervillain_tone2:": { + "category": "people", + "name": "man supervillain: medium-light skin tone", + "unicode": "1f9b9-1f3fc-200d-2642-fe0f" + }, + ":man_supervillain_tone3:": { + "category": "people", + "name": "man supervillain: medium skin tone", + "unicode": "1f9b9-1f3fd-200d-2642-fe0f" + }, + ":man_supervillain_tone4:": { + "category": "people", + "name": "man supervillain: medium-dark skin tone", + "unicode": "1f9b9-1f3fe-200d-2642-fe0f" + }, + ":man_supervillain_tone5:": { + "category": "people", + "name": "man supervillain: dark skin tone", + "unicode": "1f9b9-1f3ff-200d-2642-fe0f" + }, + ":man_surfing:": { + "category": "activity", + "name": "man surfing", + "unicode": "1f3c4-200d-2642-fe0f" + }, + ":man_surfing_tone1:": { + "category": "activity", + "name": "man surfing: light skin tone", + "unicode": "1f3c4-1f3fb-200d-2642-fe0f" + }, + ":man_surfing_tone2:": { + "category": "activity", + "name": "man surfing: medium-light skin tone", + "unicode": "1f3c4-1f3fc-200d-2642-fe0f" + }, + ":man_surfing_tone3:": { + "category": "activity", + "name": "man surfing: medium skin tone", + "unicode": "1f3c4-1f3fd-200d-2642-fe0f" + }, + ":man_surfing_tone4:": { + "category": "activity", + "name": "man surfing: medium-dark skin tone", + "unicode": "1f3c4-1f3fe-200d-2642-fe0f" + }, + ":man_surfing_tone5:": { + "category": "activity", + "name": "man surfing: dark skin tone", + "unicode": "1f3c4-1f3ff-200d-2642-fe0f" + }, + ":man_swimming:": { + "category": "activity", + "name": "man swimming", + "unicode": "1f3ca-200d-2642-fe0f" + }, + ":man_swimming_tone1:": { + "category": "activity", + "name": "man swimming: light skin tone", + "unicode": "1f3ca-1f3fb-200d-2642-fe0f" + }, + ":man_swimming_tone2:": { + "category": "activity", + "name": "man swimming: medium-light skin tone", + "unicode": "1f3ca-1f3fc-200d-2642-fe0f" + }, + ":man_swimming_tone3:": { + "category": "activity", + "name": "man swimming: medium skin tone", + "unicode": "1f3ca-1f3fd-200d-2642-fe0f" + }, + ":man_swimming_tone4:": { + "category": "activity", + "name": "man swimming: medium-dark skin tone", + "unicode": "1f3ca-1f3fe-200d-2642-fe0f" + }, + ":man_swimming_tone5:": { + "category": "activity", + "name": "man swimming: dark skin tone", + "unicode": "1f3ca-1f3ff-200d-2642-fe0f" + }, + ":man_teacher:": { + "category": "people", + "name": "man teacher", + "unicode": "1f468-200d-1f3eb" + }, + ":man_teacher_tone1:": { + "category": "people", + "name": "man teacher: light skin tone", + "unicode": "1f468-1f3fb-200d-1f3eb" + }, + ":man_teacher_tone2:": { + "category": "people", + "name": "man teacher: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f3eb" + }, + ":man_teacher_tone3:": { + "category": "people", + "name": "man teacher: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f3eb" + }, + ":man_teacher_tone4:": { + "category": "people", + "name": "man teacher: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f3eb" + }, + ":man_teacher_tone5:": { + "category": "people", + "name": "man teacher: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f3eb" + }, + ":man_technologist:": { + "category": "people", + "name": "man technologist", + "unicode": "1f468-200d-1f4bb" + }, + ":man_technologist_tone1:": { + "category": "people", + "name": "man technologist: light skin tone", + "unicode": "1f468-1f3fb-200d-1f4bb" + }, + ":man_technologist_tone2:": { + "category": "people", + "name": "man technologist: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f4bb" + }, + ":man_technologist_tone3:": { + "category": "people", + "name": "man technologist: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f4bb" + }, + ":man_technologist_tone4:": { + "category": "people", + "name": "man technologist: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f4bb" + }, + ":man_technologist_tone5:": { + "category": "people", + "name": "man technologist: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f4bb" + }, + ":man_tipping_hand:": { + "category": "people", + "name": "man tipping hand", + "unicode": "1f481-200d-2642-fe0f" + }, + ":man_tipping_hand_tone1:": { + "category": "people", + "name": "man tipping hand: light skin tone", + "unicode": "1f481-1f3fb-200d-2642-fe0f" + }, + ":man_tipping_hand_tone2:": { + "category": "people", + "name": "man tipping hand: medium-light skin tone", + "unicode": "1f481-1f3fc-200d-2642-fe0f" + }, + ":man_tipping_hand_tone3:": { + "category": "people", + "name": "man tipping hand: medium skin tone", + "unicode": "1f481-1f3fd-200d-2642-fe0f" + }, + ":man_tipping_hand_tone4:": { + "category": "people", + "name": "man tipping hand: medium-dark skin tone", + "unicode": "1f481-1f3fe-200d-2642-fe0f" + }, + ":man_tipping_hand_tone5:": { + "category": "people", + "name": "man tipping hand: dark skin tone", + "unicode": "1f481-1f3ff-200d-2642-fe0f" + }, + ":man_tone1:": { + "category": "people", + "name": "man: light skin tone", + "unicode": "1f468-1f3fb" + }, + ":man_tone1_beard:": { + "category": "people", + "name": "man: light skin tone, beard", + "unicode": "1f9d4-1f3fb-200d-2642-fe0f" + }, + ":man_tone2:": { + "category": "people", + "name": "man: medium-light skin tone", + "unicode": "1f468-1f3fc" + }, + ":man_tone2_beard:": { + "category": "people", + "name": "man: medium-light skin tone, beard", + "unicode": "1f9d4-1f3fc-200d-2642-fe0f" + }, + ":man_tone3:": { + "category": "people", + "name": "man: medium skin tone", + "unicode": "1f468-1f3fd" + }, + ":man_tone3_beard:": { + "category": "people", + "name": "man: medium skin tone, beard", + "unicode": "1f9d4-1f3fd-200d-2642-fe0f" + }, + ":man_tone4:": { + "category": "people", + "name": "man: medium-dark skin tone", + "unicode": "1f468-1f3fe" + }, + ":man_tone4_beard:": { + "category": "people", + "name": "man: medium-dark skin tone, beard", + "unicode": "1f9d4-1f3fe-200d-2642-fe0f" + }, + ":man_tone5:": { + "category": "people", + "name": "man: dark skin tone", + "unicode": "1f468-1f3ff" + }, + ":man_tone5_beard:": { + "category": "people", + "name": "man: dark skin tone, beard", + "unicode": "1f9d4-1f3ff-200d-2642-fe0f" + }, + ":man_vampire:": { + "category": "people", + "name": "man vampire", + "unicode": "1f9db-200d-2642-fe0f" + }, + ":man_vampire_tone1:": { + "category": "people", + "name": "man vampire: light skin tone", + "unicode": "1f9db-1f3fb-200d-2642-fe0f" + }, + ":man_vampire_tone2:": { + "category": "people", + "name": "man vampire: medium-light skin tone", + "unicode": "1f9db-1f3fc-200d-2642-fe0f" + }, + ":man_vampire_tone3:": { + "category": "people", + "name": "man vampire: medium skin tone", + "unicode": "1f9db-1f3fd-200d-2642-fe0f" + }, + ":man_vampire_tone4:": { + "category": "people", + "name": "man vampire: medium-dark skin tone", + "unicode": "1f9db-1f3fe-200d-2642-fe0f" + }, + ":man_vampire_tone5:": { + "category": "people", + "name": "man vampire: dark skin tone", + "unicode": "1f9db-1f3ff-200d-2642-fe0f" + }, + ":man_walking:": { + "category": "people", + "name": "man walking", + "unicode": "1f6b6-200d-2642-fe0f" + }, + ":man_walking_facing_right:": { + "category": "people", + "name": "man walking facing right", + "unicode": "1f6b6-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_facing_right_tone1:": { + "category": "people", + "name": "man walking facing right: light skin tone", + "unicode": "1f6b6-1f3fb-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_facing_right_tone2:": { + "category": "people", + "name": "man walking facing right: medium-light skin tone", + "unicode": "1f6b6-1f3fc-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_facing_right_tone3:": { + "category": "people", + "name": "man walking facing right: medium skin tone", + "unicode": "1f6b6-1f3fd-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_facing_right_tone4:": { + "category": "people", + "name": "man walking facing right: medium-dark skin tone", + "unicode": "1f6b6-1f3fe-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_facing_right_tone5:": { + "category": "people", + "name": "man walking facing right: dark skin tone", + "unicode": "1f6b6-1f3ff-200d-2642-fe0f-200d-27a1-fe0f" + }, + ":man_walking_tone1:": { + "category": "people", + "name": "man walking: light skin tone", + "unicode": "1f6b6-1f3fb-200d-2642-fe0f" + }, + ":man_walking_tone2:": { + "category": "people", + "name": "man walking: medium-light skin tone", + "unicode": "1f6b6-1f3fc-200d-2642-fe0f" + }, + ":man_walking_tone3:": { + "category": "people", + "name": "man walking: medium skin tone", + "unicode": "1f6b6-1f3fd-200d-2642-fe0f" + }, + ":man_walking_tone4:": { + "category": "people", + "name": "man walking: medium-dark skin tone", + "unicode": "1f6b6-1f3fe-200d-2642-fe0f" + }, + ":man_walking_tone5:": { + "category": "people", + "name": "man walking: dark skin tone", + "unicode": "1f6b6-1f3ff-200d-2642-fe0f" + }, + ":man_wearing_turban:": { + "category": "people", + "name": "man wearing turban", + "unicode": "1f473-200d-2642-fe0f" + }, + ":man_wearing_turban_tone1:": { + "category": "people", + "name": "man wearing turban: light skin tone", + "unicode": "1f473-1f3fb-200d-2642-fe0f" + }, + ":man_wearing_turban_tone2:": { + "category": "people", + "name": "man wearing turban: medium-light skin tone", + "unicode": "1f473-1f3fc-200d-2642-fe0f" + }, + ":man_wearing_turban_tone3:": { + "category": "people", + "name": "man wearing turban: medium skin tone", + "unicode": "1f473-1f3fd-200d-2642-fe0f" + }, + ":man_wearing_turban_tone4:": { + "category": "people", + "name": "man wearing turban: medium-dark skin tone", + "unicode": "1f473-1f3fe-200d-2642-fe0f" + }, + ":man_wearing_turban_tone5:": { + "category": "people", + "name": "man wearing turban: dark skin tone", + "unicode": "1f473-1f3ff-200d-2642-fe0f" + }, + ":man_white_haired:": { + "category": "people", + "name": "man: white hair", + "unicode": "1f468-200d-1f9b3" + }, + ":man_white_haired_tone1:": { + "category": "people", + "name": "man, white haired: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9b3" + }, + ":man_white_haired_tone2:": { + "category": "people", + "name": "man, white haired: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9b3" + }, + ":man_white_haired_tone3:": { + "category": "people", + "name": "man, white haired: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9b3" + }, + ":man_white_haired_tone4:": { + "category": "people", + "name": "man, white haired: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9b3" + }, + ":man_white_haired_tone5:": { + "category": "people", + "name": "man, white haired: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9b3" + }, + ":man_with_chinese_cap:": { + "category": "people", + "name": "man with Chinese cap", + "unicode": "1f472" + }, + ":man_with_chinese_cap_tone1:": { + "category": "people", + "name": "man with Chinese cap: light skin tone", + "unicode": "1f472-1f3fb" + }, + ":man_with_chinese_cap_tone2:": { + "category": "people", + "name": "man with Chinese cap: medium-light skin tone", + "unicode": "1f472-1f3fc" + }, + ":man_with_chinese_cap_tone3:": { + "category": "people", + "name": "man with Chinese cap: medium skin tone", + "unicode": "1f472-1f3fd" + }, + ":man_with_chinese_cap_tone4:": { + "category": "people", + "name": "man with Chinese cap: medium-dark skin tone", + "unicode": "1f472-1f3fe" + }, + ":man_with_chinese_cap_tone5:": { + "category": "people", + "name": "man with Chinese cap: dark skin tone", + "unicode": "1f472-1f3ff" + }, + ":man_with_probing_cane:": { + "category": "people", + "name": "man with probing cane", + "unicode": "1f468-200d-1f9af" + }, + ":man_with_probing_cane_tone1:": { + "category": "people", + "name": "man with probing cane: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9af" + }, + ":man_with_probing_cane_tone2:": { + "category": "people", + "name": "man with probing cane: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9af" + }, + ":man_with_probing_cane_tone3:": { + "category": "people", + "name": "man with probing cane: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9af" + }, + ":man_with_probing_cane_tone4:": { + "category": "people", + "name": "man with probing cane: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9af" + }, + ":man_with_probing_cane_tone5:": { + "category": "people", + "name": "man with probing cane: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9af" + }, + ":man_with_veil:": { + "category": "people", + "name": "man with veil", + "unicode": "1f470-200d-2642-fe0f" + }, + ":man_with_veil_tone1:": { + "category": "people", + "name": "man with veil: light skin tone", + "unicode": "1f470-1f3fb-200d-2642-fe0f" + }, + ":man_with_veil_tone2:": { + "category": "people", + "name": "man with veil: medium-light skin tone", + "unicode": "1f470-1f3fc-200d-2642-fe0f" + }, + ":man_with_veil_tone3:": { + "category": "people", + "name": "man with veil: medium skin tone", + "unicode": "1f470-1f3fd-200d-2642-fe0f" + }, + ":man_with_veil_tone4:": { + "category": "people", + "name": "man with veil: medium-dark skin tone", + "unicode": "1f470-1f3fe-200d-2642-fe0f" + }, + ":man_with_veil_tone5:": { + "category": "people", + "name": "man with veil: dark skin tone", + "unicode": "1f470-1f3ff-200d-2642-fe0f" + }, + ":man_with_white_cane_facing_right:": { + "category": "people", + "name": "man with white cane facing right", + "unicode": "1f468-200d-1f9af-200d-27a1-fe0f" + }, + ":man_with_white_cane_facing_right_tone1:": { + "category": "people", + "name": "man with white cane facing right: light skin tone", + "unicode": "1f468-1f3fb-200d-1f9af-200d-27a1-fe0f" + }, + ":man_with_white_cane_facing_right_tone2:": { + "category": "people", + "name": "man with white cane facing right: medium-light skin tone", + "unicode": "1f468-1f3fc-200d-1f9af-200d-27a1-fe0f" + }, + ":man_with_white_cane_facing_right_tone3:": { + "category": "people", + "name": "man with white cane facing right: medium skin tone", + "unicode": "1f468-1f3fd-200d-1f9af-200d-27a1-fe0f" + }, + ":man_with_white_cane_facing_right_tone4:": { + "category": "people", + "name": "man with white cane facing right: medium-dark skin tone", + "unicode": "1f468-1f3fe-200d-1f9af-200d-27a1-fe0f" + }, + ":man_with_white_cane_facing_right_tone5:": { + "category": "people", + "name": "man with white cane facing right: dark skin tone", + "unicode": "1f468-1f3ff-200d-1f9af-200d-27a1-fe0f" + }, + ":man_zombie:": { + "category": "people", + "name": "man zombie", + "unicode": "1f9df-200d-2642-fe0f" + }, + ":mango:": { + "category": "food", + "name": "mango", + "unicode": "1f96d" + }, + ":mans_shoe:": { + "category": "people", + "name": "man\u2019s shoe", + "unicode": "1f45e" + }, + ":manual_wheelchair:": { + "category": "travel", + "name": "manual wheelchair", + "unicode": "1f9bd" + }, + ":map:": { + "category": "travel", + "name": "world map", + "unicode": "1f5fa" + }, + ":maple_leaf:": { + "category": "nature", + "name": "maple leaf", + "unicode": "1f341" + }, + ":maracas:": { + "category": "activity", + "name": "maracas", + "unicode": "1fa87" + }, + ":martial_arts_uniform:": { + "category": "activity", + "name": "martial arts uniform", + "unicode": "1f94b" + }, + ":mask:": { + "category": "people", + "name": "face with medical mask", + "unicode": "1f637" + }, + ":mate:": { + "category": "food", + "name": "mate", + "unicode": "1f9c9" + }, + ":meat_on_bone:": { + "category": "food", + "name": "meat on bone", + "unicode": "1f356" + }, + ":mechanic:": { + "category": "people", + "name": "mechanic", + "unicode": "1f9d1-200d-1f527" + }, + ":mechanic_tone1:": { + "category": "people", + "name": "mechanic: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f527" + }, + ":mechanic_tone2:": { + "category": "people", + "name": "mechanic: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f527" + }, + ":mechanic_tone3:": { + "category": "people", + "name": "mechanic: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f527" + }, + ":mechanic_tone4:": { + "category": "people", + "name": "mechanic: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f527" + }, + ":mechanic_tone5:": { + "category": "people", + "name": "mechanic: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f527" + }, + ":mechanical_arm:": { + "category": "people", + "name": "mechanical arm", + "unicode": "1f9be" + }, + ":mechanical_leg:": { + "category": "people", + "name": "mechanical leg", + "unicode": "1f9bf" + }, + ":medal:": { + "category": "activity", + "name": "sports medal", + "unicode": "1f3c5" + }, + ":medical_symbol:": { + "category": "symbols", + "name": "medical symbol", + "unicode": "2695" + }, + ":mega:": { + "category": "symbols", + "name": "megaphone", + "unicode": "1f4e3" + }, + ":melon:": { + "category": "food", + "name": "melon", + "unicode": "1f348" + }, + ":melting_face:": { + "category": "people", + "name": "melting face", + "unicode": "1fae0" + }, + ":men_holding_hands_tone1:": { + "category": "people", + "name": "men holding hands: light skin tone", + "unicode": "1f46c-1f3fb" + }, + ":men_holding_hands_tone1_tone2:": { + "category": "people", + "name": "men holding hands: light skin tone, medium-light skin tone", + "unicode": "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc" + }, + ":men_holding_hands_tone1_tone3:": { + "category": "people", + "name": "men holding hands: light skin tone, medium skin tone", + "unicode": "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd" + }, + ":men_holding_hands_tone1_tone4:": { + "category": "people", + "name": "men holding hands: light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe" + }, + ":men_holding_hands_tone1_tone5:": { + "category": "people", + "name": "men holding hands: light skin tone, dark skin tone", + "unicode": "1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff" + }, + ":men_holding_hands_tone2:": { + "category": "people", + "name": "men holding hands: medium-light skin tone", + "unicode": "1f46c-1f3fc" + }, + ":men_holding_hands_tone2_tone1:": { + "category": "people", + "name": "men holding hands: medium-light skin tone, light skin tone", + "unicode": "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb" + }, + ":men_holding_hands_tone2_tone3:": { + "category": "people", + "name": "men holding hands: medium-light skin tone, medium skin tone", + "unicode": "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd" + }, + ":men_holding_hands_tone2_tone4:": { + "category": "people", + "name": "men holding hands: medium-light skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe" + }, + ":men_holding_hands_tone2_tone5:": { + "category": "people", + "name": "men holding hands: medium-light skin tone, dark skin tone", + "unicode": "1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff" + }, + ":men_holding_hands_tone3:": { + "category": "people", + "name": "men holding hands: medium skin tone", + "unicode": "1f46c-1f3fd" + }, + ":men_holding_hands_tone3_tone1:": { + "category": "people", + "name": "men holding hands: medium skin tone, light skin tone", + "unicode": "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb" + }, + ":men_holding_hands_tone3_tone2:": { + "category": "people", + "name": "men holding hands: medium skin tone, medium-light skin tone", + "unicode": "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc" + }, + ":men_holding_hands_tone3_tone4:": { + "category": "people", + "name": "men holding hands: medium skin tone, medium-dark skin tone", + "unicode": "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe" + }, + ":men_holding_hands_tone3_tone5:": { + "category": "people", + "name": "men holding hands: medium skin tone, dark skin tone", + "unicode": "1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff" + }, + ":men_holding_hands_tone4:": { + "category": "people", + "name": "men holding hands: medium-dark skin tone", + "unicode": "1f46c-1f3fe" + }, + ":men_holding_hands_tone4_tone1:": { + "category": "people", + "name": "men holding hands: medium-dark skin tone, light skin tone", + "unicode": "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb" + }, + ":men_holding_hands_tone4_tone2:": { + "category": "people", + "name": "men holding hands: medium dark skin tone, medium light skin tone", + "unicode": "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc" + }, + ":men_holding_hands_tone4_tone3:": { + "category": "people", + "name": "men holding hands: medium-dark skin tone, medium skin tone", + "unicode": "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd" + }, + ":men_holding_hands_tone4_tone5:": { + "category": "people", + "name": "men holding hands: medium-dark skin tone, dark skin tone", + "unicode": "1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff" + }, + ":men_holding_hands_tone5:": { + "category": "people", + "name": "men holding hands: dark skin tone", + "unicode": "1f46c-1f3ff" + }, + ":men_holding_hands_tone5_tone1:": { + "category": "people", + "name": "men holding hands: dark skin tone, light skin tone", + "unicode": "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb" + }, + ":men_holding_hands_tone5_tone2:": { + "category": "people", + "name": "men holding hands: dark skin tone, medium-light skin tone", + "unicode": "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc" + }, + ":men_holding_hands_tone5_tone3:": { + "category": "people", + "name": "men holding hands: dark skin tone, medium skin tone", + "unicode": "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd" + }, + ":men_holding_hands_tone5_tone4:": { + "category": "people", + "name": "men holding hands: dark skin tone, medium-dark skin tone", + "unicode": "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe" + }, + ":men_with_bunny_ears_partying:": { + "category": "people", + "name": "men with bunny ears", + "unicode": "1f46f-200d-2642-fe0f" + }, + ":men_wrestling:": { + "category": "activity", + "name": "men wrestling", + "unicode": "1f93c-200d-2642-fe0f" + }, + ":mending_heart:": { + "category": "symbols", + "name": "mending heart", + "unicode": "2764-fe0f-200d-1fa79" + }, + ":menorah:": { + "category": "symbols", + "name": "menorah", + "unicode": "1f54e" + }, + ":mens:": { + "category": "symbols", + "name": "men\u2019s room", + "unicode": "1f6b9" + }, + ":mermaid:": { + "category": "people", + "name": "mermaid", + "unicode": "1f9dc-200d-2640-fe0f" + }, + ":mermaid_tone1:": { + "category": "people", + "name": "mermaid: light skin tone", + "unicode": "1f9dc-1f3fb-200d-2640-fe0f" + }, + ":mermaid_tone2:": { + "category": "people", + "name": "mermaid: medium-light skin tone", + "unicode": "1f9dc-1f3fc-200d-2640-fe0f" + }, + ":mermaid_tone3:": { + "category": "people", + "name": "mermaid: medium skin tone", + "unicode": "1f9dc-1f3fd-200d-2640-fe0f" + }, + ":mermaid_tone4:": { + "category": "people", + "name": "mermaid: medium-dark skin tone", + "unicode": "1f9dc-1f3fe-200d-2640-fe0f" + }, + ":mermaid_tone5:": { + "category": "people", + "name": "mermaid: dark skin tone", + "unicode": "1f9dc-1f3ff-200d-2640-fe0f" + }, + ":merman:": { + "category": "people", + "name": "merman", + "unicode": "1f9dc-200d-2642-fe0f" + }, + ":merman_tone1:": { + "category": "people", + "name": "merman: light skin tone", + "unicode": "1f9dc-1f3fb-200d-2642-fe0f" + }, + ":merman_tone2:": { + "category": "people", + "name": "merman: medium-light skin tone", + "unicode": "1f9dc-1f3fc-200d-2642-fe0f" + }, + ":merman_tone3:": { + "category": "people", + "name": "merman: medium skin tone", + "unicode": "1f9dc-1f3fd-200d-2642-fe0f" + }, + ":merman_tone4:": { + "category": "people", + "name": "merman: medium-dark skin tone", + "unicode": "1f9dc-1f3fe-200d-2642-fe0f" + }, + ":merman_tone5:": { + "category": "people", + "name": "merman: dark skin tone", + "unicode": "1f9dc-1f3ff-200d-2642-fe0f" + }, + ":merperson:": { + "category": "people", + "name": "merperson", + "unicode": "1f9dc" + }, + ":merperson_tone1:": { + "category": "people", + "name": "merperson: light skin tone", + "unicode": "1f9dc-1f3fb" + }, + ":merperson_tone2:": { + "category": "people", + "name": "merperson: medium-light skin tone", + "unicode": "1f9dc-1f3fc" + }, + ":merperson_tone3:": { + "category": "people", + "name": "merperson: medium skin tone", + "unicode": "1f9dc-1f3fd" + }, + ":merperson_tone4:": { + "category": "people", + "name": "merperson: medium-dark skin tone", + "unicode": "1f9dc-1f3fe" + }, + ":merperson_tone5:": { + "category": "people", + "name": "merperson: dark skin tone", + "unicode": "1f9dc-1f3ff" + }, + ":metal:": { + "category": "people", + "name": "sign of the horns", + "unicode": "1f918" + }, + ":metal_tone1:": { + "category": "people", + "name": "sign of the horns: light skin tone", + "unicode": "1f918-1f3fb" + }, + ":metal_tone2:": { + "category": "people", + "name": "sign of the horns: medium-light skin tone", + "unicode": "1f918-1f3fc" + }, + ":metal_tone3:": { + "category": "people", + "name": "sign of the horns: medium skin tone", + "unicode": "1f918-1f3fd" + }, + ":metal_tone4:": { + "category": "people", + "name": "sign of the horns: medium-dark skin tone", + "unicode": "1f918-1f3fe" + }, + ":metal_tone5:": { + "category": "people", + "name": "sign of the horns: dark skin tone", + "unicode": "1f918-1f3ff" + }, + ":metro:": { + "category": "travel", + "name": "metro", + "unicode": "1f687" + }, + ":microbe:": { + "category": "objects", + "name": "microbe", + "unicode": "1f9a0" + }, + ":microphone2:": { + "category": "objects", + "name": "studio microphone", + "unicode": "1f399" + }, + ":microphone:": { + "category": "activity", + "name": "microphone", + "unicode": "1f3a4" + }, + ":microscope:": { + "category": "objects", + "name": "microscope", + "unicode": "1f52c" + }, + ":middle_finger:": { + "category": "people", + "name": "middle finger", + "unicode": "1f595" + }, + ":middle_finger_tone1:": { + "category": "people", + "name": "middle finger: light skin tone", + "unicode": "1f595-1f3fb" + }, + ":middle_finger_tone2:": { + "category": "people", + "name": "middle finger: medium-light skin tone", + "unicode": "1f595-1f3fc" + }, + ":middle_finger_tone3:": { + "category": "people", + "name": "middle finger: medium skin tone", + "unicode": "1f595-1f3fd" + }, + ":middle_finger_tone4:": { + "category": "people", + "name": "middle finger: medium-dark skin tone", + "unicode": "1f595-1f3fe" + }, + ":middle_finger_tone5:": { + "category": "people", + "name": "middle finger: dark skin tone", + "unicode": "1f595-1f3ff" + }, + ":military_helmet:": { + "category": "people", + "name": "military helmet", + "unicode": "1fa96" + }, + ":military_medal:": { + "category": "activity", + "name": "military medal", + "unicode": "1f396" + }, + ":milk:": { + "category": "food", + "name": "glass of milk", + "unicode": "1f95b" + }, + ":milky_way:": { + "category": "travel", + "name": "milky way", + "unicode": "1f30c" + }, + ":minibus:": { + "category": "travel", + "name": "minibus", + "unicode": "1f690" + }, + ":minidisc:": { + "category": "objects", + "name": "computer disk", + "unicode": "1f4bd" + }, + ":mirror:": { + "category": "objects", + "name": "mirror", + "unicode": "1fa9e" + }, + ":mirror_ball:": { + "category": "objects", + "name": "mirror ball", + "unicode": "1faa9" + }, + ":mobile_phone:": { + "category": "objects", + "name": "mobile phone", + "unicode": "1f4f1" + }, + ":mobile_phone_off:": { + "category": "symbols", + "name": "mobile phone off", + "unicode": "1f4f4" + }, + ":money_mouth:": { + "category": "people", + "name": "money-mouth face", + "unicode": "1f911" + }, + ":money_with_wings:": { + "category": "objects", + "name": "money with wings", + "unicode": "1f4b8" + }, + ":moneybag:": { + "category": "objects", + "name": "money bag", + "unicode": "1f4b0" + }, + ":monkey:": { + "category": "nature", + "name": "monkey", + "unicode": "1f412" + }, + ":monkey_face:": { + "category": "nature", + "name": "monkey face", + "unicode": "1f435" + }, + ":monorail:": { + "category": "travel", + "name": "monorail", + "unicode": "1f69d" + }, + ":moon_cake:": { + "category": "food", + "name": "moon cake", + "unicode": "1f96e" + }, + ":moose:": { + "category": "nature", + "name": "moose", + "unicode": "1face" + }, + ":mortar_board:": { + "category": "people", + "name": "graduation cap", + "unicode": "1f393" + }, + ":mosque:": { + "category": "travel", + "name": "mosque", + "unicode": "1f54c" + }, + ":mosquito:": { + "category": "nature", + "name": "mosquito", + "unicode": "1f99f" + }, + ":motor_scooter:": { + "category": "travel", + "name": "motor scooter", + "unicode": "1f6f5" + }, + ":motorboat:": { + "category": "travel", + "name": "motor boat", + "unicode": "1f6e5" + }, + ":motorcycle:": { + "category": "travel", + "name": "motorcycle", + "unicode": "1f3cd" + }, + ":motorized_wheelchair:": { + "category": "travel", + "name": "motorized wheelchair", + "unicode": "1f9bc" + }, + ":motorway:": { + "category": "travel", + "name": "motorway", + "unicode": "1f6e3" + }, + ":mount_fuji:": { + "category": "travel", + "name": "mount fuji", + "unicode": "1f5fb" + }, + ":mountain:": { + "category": "travel", + "name": "mountain", + "unicode": "26f0" + }, + ":mountain_cableway:": { + "category": "travel", + "name": "mountain cableway", + "unicode": "1f6a0" + }, + ":mountain_railway:": { + "category": "travel", + "name": "mountain railway", + "unicode": "1f69e" + }, + ":mountain_snow:": { + "category": "travel", + "name": "snow-capped mountain", + "unicode": "1f3d4" + }, + ":mouse2:": { + "category": "nature", + "name": "mouse", + "unicode": "1f401" + }, + ":mouse:": { + "category": "nature", + "name": "mouse face", + "unicode": "1f42d" + }, + ":mouse_three_button:": { + "category": "objects", + "name": "computer mouse", + "unicode": "1f5b1" + }, + ":mouse_trap:": { + "category": "objects", + "name": "mouse trap", + "unicode": "1faa4" + }, + ":movie_camera:": { + "category": "objects", + "name": "movie camera", + "unicode": "1f3a5" + }, + ":moyai:": { + "category": "travel", + "name": "moai", + "unicode": "1f5ff" + }, + ":mrs_claus:": { + "category": "people", + "name": "Mrs. Claus", + "unicode": "1f936" + }, + ":mrs_claus_tone1:": { + "category": "people", + "name": "Mrs. Claus: light skin tone", + "unicode": "1f936-1f3fb" + }, + ":mrs_claus_tone2:": { + "category": "people", + "name": "Mrs. Claus: medium-light skin tone", + "unicode": "1f936-1f3fc" + }, + ":mrs_claus_tone3:": { + "category": "people", + "name": "Mrs. Claus: medium skin tone", + "unicode": "1f936-1f3fd" + }, + ":mrs_claus_tone4:": { + "category": "people", + "name": "Mrs. Claus: medium-dark skin tone", + "unicode": "1f936-1f3fe" + }, + ":mrs_claus_tone5:": { + "category": "people", + "name": "Mrs. Claus: dark skin tone", + "unicode": "1f936-1f3ff" + }, + ":muscle:": { + "category": "people", + "name": "flexed biceps", + "unicode": "1f4aa" + }, + ":muscle_tone1:": { + "category": "people", + "name": "flexed biceps: light skin tone", + "unicode": "1f4aa-1f3fb" + }, + ":muscle_tone2:": { + "category": "people", + "name": "flexed biceps: medium-light skin tone", + "unicode": "1f4aa-1f3fc" + }, + ":muscle_tone3:": { + "category": "people", + "name": "flexed biceps: medium skin tone", + "unicode": "1f4aa-1f3fd" + }, + ":muscle_tone4:": { + "category": "people", + "name": "flexed biceps: medium-dark skin tone", + "unicode": "1f4aa-1f3fe" + }, + ":muscle_tone5:": { + "category": "people", + "name": "flexed biceps: dark skin tone", + "unicode": "1f4aa-1f3ff" + }, + ":mushroom:": { + "category": "nature", + "name": "mushroom", + "unicode": "1f344" + }, + ":musical_keyboard:": { + "category": "activity", + "name": "musical keyboard", + "unicode": "1f3b9" + }, + ":musical_note:": { + "category": "symbols", + "name": "musical note", + "unicode": "1f3b5" + }, + ":musical_score:": { + "category": "activity", + "name": "musical score", + "unicode": "1f3bc" + }, + ":mute:": { + "category": "symbols", + "name": "muted speaker", + "unicode": "1f507" + }, + ":mx_claus:": { + "category": "people", + "name": "mx claus", + "unicode": "1f9d1-200d-1f384" + }, + ":mx_claus_tone1:": { + "category": "people", + "name": "mx claus: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f384" + }, + ":mx_claus_tone2:": { + "category": "people", + "name": "mx claus: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f384" + }, + ":mx_claus_tone3:": { + "category": "people", + "name": "mx claus: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f384" + }, + ":mx_claus_tone4:": { + "category": "people", + "name": "mx claus: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f384" + }, + ":mx_claus_tone5:": { + "category": "people", + "name": "mx claus: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f384" + }, + ":nail_care:": { + "category": "people", + "name": "nail polish", + "unicode": "1f485" + }, + ":nail_care_tone1:": { + "category": "people", + "name": "nail polish: light skin tone", + "unicode": "1f485-1f3fb" + }, + ":nail_care_tone2:": { + "category": "people", + "name": "nail polish: medium-light skin tone", + "unicode": "1f485-1f3fc" + }, + ":nail_care_tone3:": { + "category": "people", + "name": "nail polish: medium skin tone", + "unicode": "1f485-1f3fd" + }, + ":nail_care_tone4:": { + "category": "people", + "name": "nail polish: medium-dark skin tone", + "unicode": "1f485-1f3fe" + }, + ":nail_care_tone5:": { + "category": "people", + "name": "nail polish: dark skin tone", + "unicode": "1f485-1f3ff" + }, + ":name_badge:": { + "category": "symbols", + "name": "name badge", + "unicode": "1f4db" + }, + ":nauseated_face:": { + "category": "people", + "name": "nauseated face", + "unicode": "1f922" + }, + ":nazar_amulet:": { + "category": "objects", + "name": "nazar amulet", + "unicode": "1f9ff" + }, + ":necktie:": { + "category": "people", + "name": "necktie", + "unicode": "1f454" + }, + ":negative_squared_cross_mark:": { + "category": "symbols", + "name": "cross mark button", + "unicode": "274e" + }, + ":nerd:": { + "category": "people", + "name": "nerd face", + "unicode": "1f913" + }, + ":nest_with_eggs:": { + "category": "nature", + "name": "nest with eggs", + "unicode": "1faba" + }, + ":nesting_dolls:": { + "category": "objects", + "name": "nesting dolls", + "unicode": "1fa86" + }, + ":neutral_face:": { + "category": "people", + "name": "neutral face", + "unicode": "1f610" + }, + ":new:": { + "category": "symbols", + "name": "NEW button", + "unicode": "1f195" + }, + ":new_moon:": { + "category": "nature", + "name": "new moon", + "unicode": "1f311" + }, + ":new_moon_with_face:": { + "category": "nature", + "name": "new moon face", + "unicode": "1f31a" + }, + ":newspaper2:": { + "category": "objects", + "name": "rolled-up newspaper", + "unicode": "1f5de" + }, + ":newspaper:": { + "category": "objects", + "name": "newspaper", + "unicode": "1f4f0" + }, + ":ng:": { + "category": "symbols", + "name": "NG button", + "unicode": "1f196" + }, + ":night_with_stars:": { + "category": "travel", + "name": "night with stars", + "unicode": "1f303" + }, + ":nine:": { + "category": "symbols", + "name": "keycap: 9", + "unicode": "39-20e3", + "unicode_alt": "0039-20e3" + }, + ":ninja:": { + "category": "people", + "name": "ninja", + "unicode": "1f977" + }, + ":ninja_tone1:": { + "category": "people", + "name": "ninja: light skin tone", + "unicode": "1f977-1f3fb" + }, + ":ninja_tone2:": { + "category": "people", + "name": "ninja: medium-light skin tone", + "unicode": "1f977-1f3fc" + }, + ":ninja_tone3:": { + "category": "people", + "name": "ninja: medium skin tone", + "unicode": "1f977-1f3fd" + }, + ":ninja_tone4:": { + "category": "people", + "name": "ninja: medium-dark skin tone", + "unicode": "1f977-1f3fe" + }, + ":ninja_tone5:": { + "category": "people", + "name": "ninja: dark skin tone", + "unicode": "1f977-1f3ff" + }, + ":no_bell:": { + "category": "symbols", + "name": "bell with slash", + "unicode": "1f515" + }, + ":no_bicycles:": { + "category": "symbols", + "name": "no bicycles", + "unicode": "1f6b3" + }, + ":no_entry:": { + "category": "symbols", + "name": "no entry", + "unicode": "26d4" + }, + ":no_entry_sign:": { + "category": "symbols", + "name": "prohibited", + "unicode": "1f6ab" + }, + ":no_mobile_phones:": { + "category": "symbols", + "name": "no mobile phones", + "unicode": "1f4f5" + }, + ":no_mouth:": { + "category": "people", + "name": "face without mouth", + "unicode": "1f636" + }, + ":no_pedestrians:": { + "category": "symbols", + "name": "no pedestrians", + "unicode": "1f6b7" + }, + ":no_smoking:": { + "category": "symbols", + "name": "no smoking", + "unicode": "1f6ad" + }, + ":non-potable_water:": { + "category": "symbols", + "name": "non-potable water", + "unicode": "1f6b1" + }, + ":nose:": { + "category": "people", + "name": "nose", + "unicode": "1f443" + }, + ":nose_tone1:": { + "category": "people", + "name": "nose: light skin tone", + "unicode": "1f443-1f3fb" + }, + ":nose_tone2:": { + "category": "people", + "name": "nose: medium-light skin tone", + "unicode": "1f443-1f3fc" + }, + ":nose_tone3:": { + "category": "people", + "name": "nose: medium skin tone", + "unicode": "1f443-1f3fd" + }, + ":nose_tone4:": { + "category": "people", + "name": "nose: medium-dark skin tone", + "unicode": "1f443-1f3fe" + }, + ":nose_tone5:": { + "category": "people", + "name": "nose: dark skin tone", + "unicode": "1f443-1f3ff" + }, + ":notebook:": { + "category": "objects", + "name": "notebook", + "unicode": "1f4d3" + }, + ":notebook_with_decorative_cover:": { + "category": "objects", + "name": "notebook with decorative cover", + "unicode": "1f4d4" + }, + ":notepad_spiral:": { + "category": "objects", + "name": "spiral notepad", + "unicode": "1f5d2" + }, + ":notes:": { + "category": "symbols", + "name": "musical notes", + "unicode": "1f3b6" + }, + ":nut_and_bolt:": { + "category": "objects", + "name": "nut and bolt", + "unicode": "1f529" + }, + ":o2:": { + "category": "symbols", + "name": "O button (blood type)", + "unicode": "1f17e" + }, + ":o:": { + "category": "symbols", + "name": "hollow red circle", + "unicode": "2b55" + }, + ":ocean:": { + "category": "nature", + "name": "water wave", + "unicode": "1f30a" + }, + ":octagonal_sign:": { + "category": "symbols", + "name": "stop sign", + "unicode": "1f6d1" + }, + ":octopus:": { + "category": "nature", + "name": "octopus", + "unicode": "1f419" + }, + ":oden:": { + "category": "food", + "name": "oden", + "unicode": "1f362" + }, + ":office:": { + "category": "travel", + "name": "office building", + "unicode": "1f3e2" + }, + ":office_worker:": { + "category": "people", + "name": "office worker", + "unicode": "1f9d1-200d-1f4bc" + }, + ":office_worker_tone1:": { + "category": "people", + "name": "office worker: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f4bc" + }, + ":office_worker_tone2:": { + "category": "people", + "name": "office worker: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f4bc" + }, + ":office_worker_tone3:": { + "category": "people", + "name": "office worker: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f4bc" + }, + ":office_worker_tone4:": { + "category": "people", + "name": "office worker: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f4bc" + }, + ":office_worker_tone5:": { + "category": "people", + "name": "office worker: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f4bc" + }, + ":oil:": { + "category": "objects", + "name": "oil drum", + "unicode": "1f6e2" + }, + ":ok:": { + "category": "symbols", + "name": "OK button", + "unicode": "1f197" + }, + ":ok_hand:": { + "category": "people", + "name": "OK hand", + "unicode": "1f44c" + }, + ":ok_hand_tone1:": { + "category": "people", + "name": "OK hand: light skin tone", + "unicode": "1f44c-1f3fb" + }, + ":ok_hand_tone2:": { + "category": "people", + "name": "OK hand: medium-light skin tone", + "unicode": "1f44c-1f3fc" + }, + ":ok_hand_tone3:": { + "category": "people", + "name": "OK hand: medium skin tone", + "unicode": "1f44c-1f3fd" + }, + ":ok_hand_tone4:": { + "category": "people", + "name": "OK hand: medium-dark skin tone", + "unicode": "1f44c-1f3fe" + }, + ":ok_hand_tone5:": { + "category": "people", + "name": "OK hand: dark skin tone", + "unicode": "1f44c-1f3ff" + }, + ":older_adult:": { + "category": "people", + "name": "older person", + "unicode": "1f9d3" + }, + ":older_adult_tone1:": { + "category": "people", + "name": "older person: light skin tone", + "unicode": "1f9d3-1f3fb" + }, + ":older_adult_tone2:": { + "category": "people", + "name": "older person: medium-light skin tone", + "unicode": "1f9d3-1f3fc" + }, + ":older_adult_tone3:": { + "category": "people", + "name": "older person: medium skin tone", + "unicode": "1f9d3-1f3fd" + }, + ":older_adult_tone4:": { + "category": "people", + "name": "older person: medium-dark skin tone", + "unicode": "1f9d3-1f3fe" + }, + ":older_adult_tone5:": { + "category": "people", + "name": "older person: dark skin tone", + "unicode": "1f9d3-1f3ff" + }, + ":older_man:": { + "category": "people", + "name": "old man", + "unicode": "1f474" + }, + ":older_man_tone1:": { + "category": "people", + "name": "old man: light skin tone", + "unicode": "1f474-1f3fb" + }, + ":older_man_tone2:": { + "category": "people", + "name": "old man: medium-light skin tone", + "unicode": "1f474-1f3fc" + }, + ":older_man_tone3:": { + "category": "people", + "name": "old man: medium skin tone", + "unicode": "1f474-1f3fd" + }, + ":older_man_tone4:": { + "category": "people", + "name": "old man: medium-dark skin tone", + "unicode": "1f474-1f3fe" + }, + ":older_man_tone5:": { + "category": "people", + "name": "old man: dark skin tone", + "unicode": "1f474-1f3ff" + }, + ":older_woman:": { + "category": "people", + "name": "old woman", + "unicode": "1f475" + }, + ":older_woman_tone1:": { + "category": "people", + "name": "old woman: light skin tone", + "unicode": "1f475-1f3fb" + }, + ":older_woman_tone2:": { + "category": "people", + "name": "old woman: medium-light skin tone", + "unicode": "1f475-1f3fc" + }, + ":older_woman_tone3:": { + "category": "people", + "name": "old woman: medium skin tone", + "unicode": "1f475-1f3fd" + }, + ":older_woman_tone4:": { + "category": "people", + "name": "old woman: medium-dark skin tone", + "unicode": "1f475-1f3fe" + }, + ":older_woman_tone5:": { + "category": "people", + "name": "old woman: dark skin tone", + "unicode": "1f475-1f3ff" + }, + ":olive:": { + "category": "food", + "name": "olive", + "unicode": "1fad2" + }, + ":om_symbol:": { + "category": "symbols", + "name": "om", + "unicode": "1f549" + }, + ":on:": { + "category": "symbols", + "name": "ON! arrow", + "unicode": "1f51b" + }, + ":oncoming_automobile:": { + "category": "travel", + "name": "oncoming automobile", + "unicode": "1f698" + }, + ":oncoming_bus:": { + "category": "travel", + "name": "oncoming bus", + "unicode": "1f68d" + }, + ":oncoming_police_car:": { + "category": "travel", + "name": "oncoming police car", + "unicode": "1f694" + }, + ":oncoming_taxi:": { + "category": "travel", + "name": "oncoming taxi", + "unicode": "1f696" + }, + ":one:": { + "category": "symbols", + "name": "keycap: 1", + "unicode": "31-20e3", + "unicode_alt": "0031-20e3" + }, + ":one_piece_swimsuit:": { + "category": "people", + "name": "one-piece swimsuit", + "unicode": "1fa71" + }, + ":onion:": { + "category": "food", + "name": "onion", + "unicode": "1f9c5" + }, + ":open_file_folder:": { + "category": "objects", + "name": "open file folder", + "unicode": "1f4c2" + }, + ":open_hands:": { + "category": "people", + "name": "open hands", + "unicode": "1f450" + }, + ":open_hands_tone1:": { + "category": "people", + "name": "open hands: light skin tone", + "unicode": "1f450-1f3fb" + }, + ":open_hands_tone2:": { + "category": "people", + "name": "open hands: medium-light skin tone", + "unicode": "1f450-1f3fc" + }, + ":open_hands_tone3:": { + "category": "people", + "name": "open hands: medium skin tone", + "unicode": "1f450-1f3fd" + }, + ":open_hands_tone4:": { + "category": "people", + "name": "open hands: medium-dark skin tone", + "unicode": "1f450-1f3fe" + }, + ":open_hands_tone5:": { + "category": "people", + "name": "open hands: dark skin tone", + "unicode": "1f450-1f3ff" + }, + ":open_mouth:": { + "category": "people", + "name": "face with open mouth", + "unicode": "1f62e" + }, + ":ophiuchus:": { + "category": "symbols", + "name": "Ophiuchus", + "unicode": "26ce" + }, + ":orange_book:": { + "category": "objects", + "name": "orange book", + "unicode": "1f4d9" + }, + ":orange_circle:": { + "category": "symbols", + "name": "orange circle", + "unicode": "1f7e0" + }, + ":orange_heart:": { + "category": "symbols", + "name": "orange heart", + "unicode": "1f9e1" + }, + ":orange_square:": { + "category": "symbols", + "name": "orange square", + "unicode": "1f7e7" + }, + ":orangutan:": { + "category": "nature", + "name": "orangutan", + "unicode": "1f9a7" + }, + ":orthodox_cross:": { + "category": "symbols", + "name": "orthodox cross", + "unicode": "2626" + }, + ":otter:": { + "category": "nature", + "name": "otter", + "unicode": "1f9a6" + }, + ":outbox_tray:": { + "category": "objects", + "name": "outbox tray", + "unicode": "1f4e4" + }, + ":owl:": { + "category": "nature", + "name": "owl", + "unicode": "1f989" + }, + ":ox:": { + "category": "nature", + "name": "ox", + "unicode": "1f402" + }, + ":oyster:": { + "category": "food", + "name": "oyster", + "unicode": "1f9aa" + }, + ":package:": { + "category": "objects", + "name": "package", + "unicode": "1f4e6" + }, + ":page_facing_up:": { + "category": "objects", + "name": "page facing up", + "unicode": "1f4c4" + }, + ":page_with_curl:": { + "category": "objects", + "name": "page with curl", + "unicode": "1f4c3" + }, + ":pager:": { + "category": "objects", + "name": "pager", + "unicode": "1f4df" + }, + ":paintbrush:": { + "category": "objects", + "name": "paintbrush", + "unicode": "1f58c" + }, + ":palm_down_hand:": { + "category": "people", + "name": "palm down hand", + "unicode": "1faf3" + }, + ":palm_down_hand_tone1:": { + "category": "people", + "name": "palm down hand: light skin tone", + "unicode": "1faf3-1f3fb" + }, + ":palm_down_hand_tone2:": { + "category": "people", + "name": "palm down hand: medium-light skin tone", + "unicode": "1faf3-1f3fc" + }, + ":palm_down_hand_tone3:": { + "category": "people", + "name": "palm down hand: medium skin tone", + "unicode": "1faf3-1f3fd" + }, + ":palm_down_hand_tone4:": { + "category": "people", + "name": "palm down hand: medium-dark skin tone", + "unicode": "1faf3-1f3fe" + }, + ":palm_down_hand_tone5:": { + "category": "people", + "name": "palm down hand: dark skin tone", + "unicode": "1faf3-1f3ff" + }, + ":palm_tree:": { + "category": "nature", + "name": "palm tree", + "unicode": "1f334" + }, + ":palm_up_hand:": { + "category": "people", + "name": "palm up hand", + "unicode": "1faf4" + }, + ":palm_up_hand_tone1:": { + "category": "people", + "name": "palm up hand: light skin tone", + "unicode": "1faf4-1f3fb" + }, + ":palm_up_hand_tone2:": { + "category": "people", + "name": "palm up hand: medium-light skin tone", + "unicode": "1faf4-1f3fc" + }, + ":palm_up_hand_tone3:": { + "category": "people", + "name": "palm up hand: medium skin tone", + "unicode": "1faf4-1f3fd" + }, + ":palm_up_hand_tone4:": { + "category": "people", + "name": "palm up hand: medium-dark skin tone", + "unicode": "1faf4-1f3fe" + }, + ":palm_up_hand_tone5:": { + "category": "people", + "name": "palm up hand: dark skin tone", + "unicode": "1faf4-1f3ff" + }, + ":palms_up_together:": { + "category": "people", + "name": "palms up together", + "unicode": "1f932" + }, + ":palms_up_together_tone1:": { + "category": "people", + "name": "palms up together: light skin tone", + "unicode": "1f932-1f3fb" + }, + ":palms_up_together_tone2:": { + "category": "people", + "name": "palms up together: medium-light skin tone", + "unicode": "1f932-1f3fc" + }, + ":palms_up_together_tone3:": { + "category": "people", + "name": "palms up together: medium skin tone", + "unicode": "1f932-1f3fd" + }, + ":palms_up_together_tone4:": { + "category": "people", + "name": "palms up together: medium-dark skin tone", + "unicode": "1f932-1f3fe" + }, + ":palms_up_together_tone5:": { + "category": "people", + "name": "palms up together: dark skin tone", + "unicode": "1f932-1f3ff" + }, + ":pancakes:": { + "category": "food", + "name": "pancakes", + "unicode": "1f95e" + }, + ":panda_face:": { + "category": "nature", + "name": "panda", + "unicode": "1f43c" + }, + ":paperclip:": { + "category": "objects", + "name": "paperclip", + "unicode": "1f4ce" + }, + ":paperclips:": { + "category": "objects", + "name": "linked paperclips", + "unicode": "1f587" + }, + ":parachute:": { + "category": "activity", + "name": "parachute", + "unicode": "1fa82" + }, + ":park:": { + "category": "travel", + "name": "national park", + "unicode": "1f3de" + }, + ":parking:": { + "category": "symbols", + "name": "P button", + "unicode": "1f17f" + }, + ":parrot:": { + "category": "nature", + "name": "parrot", + "unicode": "1f99c" + }, + ":part_alternation_mark:": { + "category": "symbols", + "name": "part alternation mark", + "unicode": "303d" + }, + ":partly_sunny:": { + "category": "nature", + "name": "sun behind cloud", + "unicode": "26c5" + }, + ":partying_face:": { + "category": "people", + "name": "partying face", + "unicode": "1f973" + }, + ":passport_control:": { + "category": "symbols", + "name": "passport control", + "unicode": "1f6c2" + }, + ":pause_button:": { + "category": "symbols", + "name": "pause button", + "unicode": "23f8" + }, + ":pea_pod:": { + "category": "food", + "name": "pea pod", + "unicode": "1fadb" + }, + ":peace:": { + "category": "symbols", + "name": "peace symbol", + "unicode": "262e" + }, + ":peach:": { + "category": "food", + "name": "peach", + "unicode": "1f351" + }, + ":peacock:": { + "category": "nature", + "name": "peacock", + "unicode": "1f99a" + }, + ":peanuts:": { + "category": "food", + "name": "peanuts", + "unicode": "1f95c" + }, + ":pear:": { + "category": "food", + "name": "pear", + "unicode": "1f350" + }, + ":pen_ballpoint:": { + "category": "objects", + "name": "pen", + "unicode": "1f58a" + }, + ":pen_fountain:": { + "category": "objects", + "name": "fountain pen", + "unicode": "1f58b" + }, + ":pencil2:": { + "category": "objects", + "name": "pencil", + "unicode": "270f" + }, + ":pencil:": { + "category": "objects", + "name": "memo", + "unicode": "1f4dd" + }, + ":penguin:": { + "category": "nature", + "name": "penguin", + "unicode": "1f427" + }, + ":pensive:": { + "category": "people", + "name": "pensive face", + "unicode": "1f614" + }, + ":people_holding_hands:": { + "category": "people", + "name": "people holding hands", + "unicode": "1f9d1-200d-1f91d-200d-1f9d1" + }, + ":people_holding_hands_tone1:": { + "category": "people", + "name": "people holding hands: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb" + }, + ":people_holding_hands_tone1_tone2:": { + "category": "people", + "name": "people holding hands: light skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc" + }, + ":people_holding_hands_tone1_tone3:": { + "category": "people", + "name": "people holding hands: light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd" + }, + ":people_holding_hands_tone1_tone4:": { + "category": "people", + "name": "people holding hands: light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe" + }, + ":people_holding_hands_tone1_tone5:": { + "category": "people", + "name": "people holding hands: light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff" + }, + ":people_holding_hands_tone2:": { + "category": "people", + "name": "people holding hands: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc" + }, + ":people_holding_hands_tone2_tone1:": { + "category": "people", + "name": "people holding hands: medium-light skin tone, light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb" + }, + ":people_holding_hands_tone2_tone3:": { + "category": "people", + "name": "people holding hands: medium-light skin tone, medium skin tone", + "unicode": "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd" + }, + ":people_holding_hands_tone2_tone4:": { + "category": "people", + "name": "people holding hands: medium-light skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe" + }, + ":people_holding_hands_tone2_tone5:": { + "category": "people", + "name": "people holding hands: medium-light skin tone, dark skin tone", + "unicode": "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff" + }, + ":people_holding_hands_tone3:": { + "category": "people", + "name": "people holding hands: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd" + }, + ":people_holding_hands_tone3_tone1:": { + "category": "people", + "name": "people holding hands: medium skin tone, light skin tone", + "unicode": "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb" + }, + ":people_holding_hands_tone3_tone2:": { + "category": "people", + "name": "people holding hands: medium skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc" + }, + ":people_holding_hands_tone3_tone4:": { + "category": "people", + "name": "people holding hands: medium skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe" + }, + ":people_holding_hands_tone3_tone5:": { + "category": "people", + "name": "people holding hands: medium skin tone, dark skin tone", + "unicode": "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff" + }, + ":people_holding_hands_tone4:": { + "category": "people", + "name": "people holding hands: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe" + }, + ":people_holding_hands_tone4_tone1:": { + "category": "people", + "name": "people holding hands: medium-dark skin tone, light skin tone", + "unicode": "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb" + }, + ":people_holding_hands_tone4_tone2:": { + "category": "people", + "name": "people holding hands: medium dark skin tone, medium light skin tone", + "unicode": "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc" + }, + ":people_holding_hands_tone4_tone3:": { + "category": "people", + "name": "people holding hands: medium-dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd" + }, + ":people_holding_hands_tone4_tone5:": { + "category": "people", + "name": "people holding hands: medium-dark skin tone, dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff" + }, + ":people_holding_hands_tone5:": { + "category": "people", + "name": "people holding hands: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff" + }, + ":people_holding_hands_tone5_tone1:": { + "category": "people", + "name": "people holding hands: dark skin tone, light skin tone", + "unicode": "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb" + }, + ":people_holding_hands_tone5_tone2:": { + "category": "people", + "name": "people holding hands: dark skin tone, medium-light skin tone", + "unicode": "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc" + }, + ":people_holding_hands_tone5_tone3:": { + "category": "people", + "name": "people holding hands: dark skin tone, medium skin tone", + "unicode": "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd" + }, + ":people_holding_hands_tone5_tone4:": { + "category": "people", + "name": "people holding hands: dark skin tone, medium-dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe" + }, + ":people_hugging:": { + "category": "people", + "name": "people hugging", + "unicode": "1fac2" + }, + ":people_with_bunny_ears_partying:": { + "category": "people", + "name": "people with bunny ears", + "unicode": "1f46f" + }, + ":people_wrestling:": { + "category": "activity", + "name": "people wrestling", + "unicode": "1f93c" + }, + ":performing_arts:": { + "category": "activity", + "name": "performing arts", + "unicode": "1f3ad" + }, + ":persevere:": { + "category": "people", + "name": "persevering face", + "unicode": "1f623" + }, + ":person_bald:": { + "category": "people", + "name": "person: bald", + "unicode": "1f9d1-200d-1f9b2" + }, + ":person_biking:": { + "category": "activity", + "name": "person biking", + "unicode": "1f6b4" + }, + ":person_biking_tone1:": { + "category": "activity", + "name": "person biking: light skin tone", + "unicode": "1f6b4-1f3fb" + }, + ":person_biking_tone2:": { + "category": "activity", + "name": "person biking: medium-light skin tone", + "unicode": "1f6b4-1f3fc" + }, + ":person_biking_tone3:": { + "category": "activity", + "name": "person biking: medium skin tone", + "unicode": "1f6b4-1f3fd" + }, + ":person_biking_tone4:": { + "category": "activity", + "name": "person biking: medium-dark skin tone", + "unicode": "1f6b4-1f3fe" + }, + ":person_biking_tone5:": { + "category": "activity", + "name": "person biking: dark skin tone", + "unicode": "1f6b4-1f3ff" + }, + ":person_bouncing_ball:": { + "category": "activity", + "name": "person bouncing ball", + "unicode": "26f9" + }, + ":person_bouncing_ball_tone1:": { + "category": "activity", + "name": "person bouncing ball: light skin tone", + "unicode": "26f9-1f3fb" + }, + ":person_bouncing_ball_tone2:": { + "category": "activity", + "name": "person bouncing ball: medium-light skin tone", + "unicode": "26f9-1f3fc" + }, + ":person_bouncing_ball_tone3:": { + "category": "activity", + "name": "person bouncing ball: medium skin tone", + "unicode": "26f9-1f3fd" + }, + ":person_bouncing_ball_tone4:": { + "category": "activity", + "name": "person bouncing ball: medium-dark skin tone", + "unicode": "26f9-1f3fe" + }, + ":person_bouncing_ball_tone5:": { + "category": "activity", + "name": "person bouncing ball: dark skin tone", + "unicode": "26f9-1f3ff" + }, + ":person_bowing:": { + "category": "people", + "name": "person bowing", + "unicode": "1f647" + }, + ":person_bowing_tone1:": { + "category": "people", + "name": "person bowing: light skin tone", + "unicode": "1f647-1f3fb" + }, + ":person_bowing_tone2:": { + "category": "people", + "name": "person bowing: medium-light skin tone", + "unicode": "1f647-1f3fc" + }, + ":person_bowing_tone3:": { + "category": "people", + "name": "person bowing: medium skin tone", + "unicode": "1f647-1f3fd" + }, + ":person_bowing_tone4:": { + "category": "people", + "name": "person bowing: medium-dark skin tone", + "unicode": "1f647-1f3fe" + }, + ":person_bowing_tone5:": { + "category": "people", + "name": "person bowing: dark skin tone", + "unicode": "1f647-1f3ff" + }, + ":person_climbing:": { + "category": "activity", + "name": "person climbing", + "unicode": "1f9d7" + }, + ":person_climbing_tone1:": { + "category": "activity", + "name": "person climbing: light skin tone", + "unicode": "1f9d7-1f3fb" + }, + ":person_climbing_tone2:": { + "category": "activity", + "name": "person climbing: medium-light skin tone", + "unicode": "1f9d7-1f3fc" + }, + ":person_climbing_tone3:": { + "category": "activity", + "name": "person climbing: medium skin tone", + "unicode": "1f9d7-1f3fd" + }, + ":person_climbing_tone4:": { + "category": "activity", + "name": "person climbing: medium-dark skin tone", + "unicode": "1f9d7-1f3fe" + }, + ":person_climbing_tone5:": { + "category": "activity", + "name": "person climbing: dark skin tone", + "unicode": "1f9d7-1f3ff" + }, + ":person_curly_hair:": { + "category": "people", + "name": "person: curly hair", + "unicode": "1f9d1-200d-1f9b1" + }, + ":person_doing_cartwheel:": { + "category": "activity", + "name": "person cartwheeling", + "unicode": "1f938" + }, + ":person_doing_cartwheel_tone1:": { + "category": "activity", + "name": "person cartwheeling: light skin tone", + "unicode": "1f938-1f3fb" + }, + ":person_doing_cartwheel_tone2:": { + "category": "activity", + "name": "person cartwheeling: medium-light skin tone", + "unicode": "1f938-1f3fc" + }, + ":person_doing_cartwheel_tone3:": { + "category": "activity", + "name": "person cartwheeling: medium skin tone", + "unicode": "1f938-1f3fd" + }, + ":person_doing_cartwheel_tone4:": { + "category": "activity", + "name": "person cartwheeling: medium-dark skin tone", + "unicode": "1f938-1f3fe" + }, + ":person_doing_cartwheel_tone5:": { + "category": "activity", + "name": "person cartwheeling: dark skin tone", + "unicode": "1f938-1f3ff" + }, + ":person_facepalming:": { + "category": "people", + "name": "person facepalming", + "unicode": "1f926" + }, + ":person_facepalming_tone1:": { + "category": "people", + "name": "person facepalming: light skin tone", + "unicode": "1f926-1f3fb" + }, + ":person_facepalming_tone2:": { + "category": "people", + "name": "person facepalming: medium-light skin tone", + "unicode": "1f926-1f3fc" + }, + ":person_facepalming_tone3:": { + "category": "people", + "name": "person facepalming: medium skin tone", + "unicode": "1f926-1f3fd" + }, + ":person_facepalming_tone4:": { + "category": "people", + "name": "person facepalming: medium-dark skin tone", + "unicode": "1f926-1f3fe" + }, + ":person_facepalming_tone5:": { + "category": "people", + "name": "person facepalming: dark skin tone", + "unicode": "1f926-1f3ff" + }, + ":person_feeding_baby:": { + "category": "people", + "name": "person feeding baby", + "unicode": "1f9d1-200d-1f37c" + }, + ":person_feeding_baby_tone1:": { + "category": "people", + "name": "person feeding baby: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f37c" + }, + ":person_feeding_baby_tone2:": { + "category": "people", + "name": "person feeding baby: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f37c" + }, + ":person_feeding_baby_tone3:": { + "category": "people", + "name": "person feeding baby: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f37c" + }, + ":person_feeding_baby_tone4:": { + "category": "people", + "name": "person feeding baby: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f37c" + }, + ":person_feeding_baby_tone5:": { + "category": "people", + "name": "person feeding baby: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f37c" + }, + ":person_fencing:": { + "category": "activity", + "name": "person fencing", + "unicode": "1f93a" + }, + ":person_frowning:": { + "category": "people", + "name": "person frowning", + "unicode": "1f64d" + }, + ":person_frowning_tone1:": { + "category": "people", + "name": "person frowning: light skin tone", + "unicode": "1f64d-1f3fb" + }, + ":person_frowning_tone2:": { + "category": "people", + "name": "person frowning: medium-light skin tone", + "unicode": "1f64d-1f3fc" + }, + ":person_frowning_tone3:": { + "category": "people", + "name": "person frowning: medium skin tone", + "unicode": "1f64d-1f3fd" + }, + ":person_frowning_tone4:": { + "category": "people", + "name": "person frowning: medium-dark skin tone", + "unicode": "1f64d-1f3fe" + }, + ":person_frowning_tone5:": { + "category": "people", + "name": "person frowning: dark skin tone", + "unicode": "1f64d-1f3ff" + }, + ":person_gesturing_no:": { + "category": "people", + "name": "person gesturing NO", + "unicode": "1f645" + }, + ":person_gesturing_no_tone1:": { + "category": "people", + "name": "person gesturing NO: light skin tone", + "unicode": "1f645-1f3fb" + }, + ":person_gesturing_no_tone2:": { + "category": "people", + "name": "person gesturing NO: medium-light skin tone", + "unicode": "1f645-1f3fc" + }, + ":person_gesturing_no_tone3:": { + "category": "people", + "name": "person gesturing NO: medium skin tone", + "unicode": "1f645-1f3fd" + }, + ":person_gesturing_no_tone4:": { + "category": "people", + "name": "person gesturing NO: medium-dark skin tone", + "unicode": "1f645-1f3fe" + }, + ":person_gesturing_no_tone5:": { + "category": "people", + "name": "person gesturing NO: dark skin tone", + "unicode": "1f645-1f3ff" + }, + ":person_gesturing_ok:": { + "category": "people", + "name": "person gesturing OK", + "unicode": "1f646" + }, + ":person_gesturing_ok_tone1:": { + "category": "people", + "name": "person gesturing OK: light skin tone", + "unicode": "1f646-1f3fb" + }, + ":person_gesturing_ok_tone2:": { + "category": "people", + "name": "person gesturing OK: medium-light skin tone", + "unicode": "1f646-1f3fc" + }, + ":person_gesturing_ok_tone3:": { + "category": "people", + "name": "person gesturing OK: medium skin tone", + "unicode": "1f646-1f3fd" + }, + ":person_gesturing_ok_tone4:": { + "category": "people", + "name": "person gesturing OK: medium-dark skin tone", + "unicode": "1f646-1f3fe" + }, + ":person_gesturing_ok_tone5:": { + "category": "people", + "name": "person gesturing OK: dark skin tone", + "unicode": "1f646-1f3ff" + }, + ":person_getting_haircut:": { + "category": "people", + "name": "person getting haircut", + "unicode": "1f487" + }, + ":person_getting_haircut_tone1:": { + "category": "people", + "name": "person getting haircut: light skin tone", + "unicode": "1f487-1f3fb" + }, + ":person_getting_haircut_tone2:": { + "category": "people", + "name": "person getting haircut: medium-light skin tone", + "unicode": "1f487-1f3fc" + }, + ":person_getting_haircut_tone3:": { + "category": "people", + "name": "person getting haircut: medium skin tone", + "unicode": "1f487-1f3fd" + }, + ":person_getting_haircut_tone4:": { + "category": "people", + "name": "person getting haircut: medium-dark skin tone", + "unicode": "1f487-1f3fe" + }, + ":person_getting_haircut_tone5:": { + "category": "people", + "name": "person getting haircut: dark skin tone", + "unicode": "1f487-1f3ff" + }, + ":person_getting_massage:": { + "category": "people", + "name": "person getting massage", + "unicode": "1f486" + }, + ":person_getting_massage_tone1:": { + "category": "people", + "name": "person getting massage: light skin tone", + "unicode": "1f486-1f3fb" + }, + ":person_getting_massage_tone2:": { + "category": "people", + "name": "person getting massage: medium-light skin tone", + "unicode": "1f486-1f3fc" + }, + ":person_getting_massage_tone3:": { + "category": "people", + "name": "person getting massage: medium skin tone", + "unicode": "1f486-1f3fd" + }, + ":person_getting_massage_tone4:": { + "category": "people", + "name": "person getting massage: medium-dark skin tone", + "unicode": "1f486-1f3fe" + }, + ":person_getting_massage_tone5:": { + "category": "people", + "name": "person getting massage: dark skin tone", + "unicode": "1f486-1f3ff" + }, + ":person_golfing:": { + "category": "activity", + "name": "person golfing", + "unicode": "1f3cc" + }, + ":person_golfing_tone1:": { + "category": "activity", + "name": "person golfing: light skin tone", + "unicode": "1f3cc-1f3fb" + }, + ":person_golfing_tone2:": { + "category": "activity", + "name": "person golfing: medium-light skin tone", + "unicode": "1f3cc-1f3fc" + }, + ":person_golfing_tone3:": { + "category": "activity", + "name": "person golfing: medium skin tone", + "unicode": "1f3cc-1f3fd" + }, + ":person_golfing_tone4:": { + "category": "activity", + "name": "person golfing: medium-dark skin tone", + "unicode": "1f3cc-1f3fe" + }, + ":person_golfing_tone5:": { + "category": "activity", + "name": "person golfing: dark skin tone", + "unicode": "1f3cc-1f3ff" + }, + ":person_in_bed_tone1:": { + "category": "objects", + "name": "person in bed: light skin tone", + "unicode": "1f6cc-1f3fb" + }, + ":person_in_bed_tone2:": { + "category": "objects", + "name": "person in bed: medium-light skin tone", + "unicode": "1f6cc-1f3fc" + }, + ":person_in_bed_tone3:": { + "category": "objects", + "name": "person in bed: medium skin tone", + "unicode": "1f6cc-1f3fd" + }, + ":person_in_bed_tone4:": { + "category": "objects", + "name": "person in bed: medium-dark skin tone", + "unicode": "1f6cc-1f3fe" + }, + ":person_in_bed_tone5:": { + "category": "objects", + "name": "person in bed: dark skin tone", + "unicode": "1f6cc-1f3ff" + }, + ":person_in_lotus_position:": { + "category": "activity", + "name": "person in lotus position", + "unicode": "1f9d8" + }, + ":person_in_lotus_position_tone1:": { + "category": "activity", + "name": "person in lotus position: light skin tone", + "unicode": "1f9d8-1f3fb" + }, + ":person_in_lotus_position_tone2:": { + "category": "activity", + "name": "person in lotus position: medium-light skin tone", + "unicode": "1f9d8-1f3fc" + }, + ":person_in_lotus_position_tone3:": { + "category": "activity", + "name": "person in lotus position: medium skin tone", + "unicode": "1f9d8-1f3fd" + }, + ":person_in_lotus_position_tone4:": { + "category": "activity", + "name": "person in lotus position: medium-dark skin tone", + "unicode": "1f9d8-1f3fe" + }, + ":person_in_lotus_position_tone5:": { + "category": "activity", + "name": "person in lotus position: dark skin tone", + "unicode": "1f9d8-1f3ff" + }, + ":person_in_manual_wheelchair:": { + "category": "people", + "name": "person in manual wheelchair", + "unicode": "1f9d1-200d-1f9bd" + }, + ":person_in_manual_wheelchair_facing_right:": { + "category": "people", + "name": "person in manual wheelchair facing right", + "unicode": "1f9d1-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "person in manual wheelchair facing right: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "person in manual wheelchair facing right: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "person in manual wheelchair facing right: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "person in manual wheelchair facing right: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "person in manual wheelchair facing right: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9bd-200d-27a1-fe0f" + }, + ":person_in_manual_wheelchair_tone1:": { + "category": "people", + "name": "person in manual wheelchair: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9bd" + }, + ":person_in_manual_wheelchair_tone2:": { + "category": "people", + "name": "person in manual wheelchair: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9bd" + }, + ":person_in_manual_wheelchair_tone3:": { + "category": "people", + "name": "person in manual wheelchair: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9bd" + }, + ":person_in_manual_wheelchair_tone4:": { + "category": "people", + "name": "person in manual wheelchair: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9bd" + }, + ":person_in_manual_wheelchair_tone5:": { + "category": "people", + "name": "person in manual wheelchair: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9bd" + }, + ":person_in_motorized_wheelchair:": { + "category": "people", + "name": "person in motorized wheelchair", + "unicode": "1f9d1-200d-1f9bc" + }, + ":person_in_motorized_wheelchair_facing_right:": { + "category": "people", + "name": "person in motorized wheelchair facing right", + "unicode": "1f9d1-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "person in motorized wheelchair facing right: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "person in motorized wheelchair facing right: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "person in motorized wheelchair facing right: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "person in motorized wheelchair facing right: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "person in motorized wheelchair facing right: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9bc-200d-27a1-fe0f" + }, + ":person_in_motorized_wheelchair_tone1:": { + "category": "people", + "name": "person in motorized wheelchair: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9bc" + }, + ":person_in_motorized_wheelchair_tone2:": { + "category": "people", + "name": "person in motorized wheelchair: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9bc" + }, + ":person_in_motorized_wheelchair_tone3:": { + "category": "people", + "name": "person in motorized wheelchair: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9bc" + }, + ":person_in_motorized_wheelchair_tone4:": { + "category": "people", + "name": "person in motorized wheelchair: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9bc" + }, + ":person_in_motorized_wheelchair_tone5:": { + "category": "people", + "name": "person in motorized wheelchair: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9bc" + }, + ":person_in_steamy_room:": { + "category": "people", + "name": "person in steamy room", + "unicode": "1f9d6" + }, + ":person_in_steamy_room_tone1:": { + "category": "people", + "name": "person in steamy room: light skin tone", + "unicode": "1f9d6-1f3fb" + }, + ":person_in_steamy_room_tone2:": { + "category": "people", + "name": "person in steamy room: medium-light skin tone", + "unicode": "1f9d6-1f3fc" + }, + ":person_in_steamy_room_tone3:": { + "category": "people", + "name": "person in steamy room: medium skin tone", + "unicode": "1f9d6-1f3fd" + }, + ":person_in_steamy_room_tone4:": { + "category": "people", + "name": "person in steamy room: medium-dark skin tone", + "unicode": "1f9d6-1f3fe" + }, + ":person_in_steamy_room_tone5:": { + "category": "people", + "name": "person in steamy room: dark skin tone", + "unicode": "1f9d6-1f3ff" + }, + ":person_in_tuxedo:": { + "category": "people", + "name": "person in tuxedo", + "unicode": "1f935" + }, + ":person_in_tuxedo_tone1:": { + "category": "people", + "name": "person in tuxedo: light skin tone", + "unicode": "1f935-1f3fb" + }, + ":person_in_tuxedo_tone2:": { + "category": "people", + "name": "person in tuxedo: medium-light skin tone", + "unicode": "1f935-1f3fc" + }, + ":person_in_tuxedo_tone3:": { + "category": "people", + "name": "person in tuxedo: medium skin tone", + "unicode": "1f935-1f3fd" + }, + ":person_in_tuxedo_tone4:": { + "category": "people", + "name": "person in tuxedo: medium-dark skin tone", + "unicode": "1f935-1f3fe" + }, + ":person_in_tuxedo_tone5:": { + "category": "people", + "name": "person in tuxedo: dark skin tone", + "unicode": "1f935-1f3ff" + }, + ":person_juggling:": { + "category": "activity", + "name": "person juggling", + "unicode": "1f939" + }, + ":person_juggling_tone1:": { + "category": "activity", + "name": "person juggling: light skin tone", + "unicode": "1f939-1f3fb" + }, + ":person_juggling_tone2:": { + "category": "activity", + "name": "person juggling: medium-light skin tone", + "unicode": "1f939-1f3fc" + }, + ":person_juggling_tone3:": { + "category": "activity", + "name": "person juggling: medium skin tone", + "unicode": "1f939-1f3fd" + }, + ":person_juggling_tone4:": { + "category": "activity", + "name": "person juggling: medium-dark skin tone", + "unicode": "1f939-1f3fe" + }, + ":person_juggling_tone5:": { + "category": "activity", + "name": "person juggling: dark skin tone", + "unicode": "1f939-1f3ff" + }, + ":person_kneeling:": { + "category": "people", + "name": "person kneeling", + "unicode": "1f9ce" + }, + ":person_kneeling_facing_right:": { + "category": "people", + "name": "person kneeling facing right", + "unicode": "1f9ce-200d-27a1-fe0f" + }, + ":person_kneeling_facing_right_tone1:": { + "category": "people", + "name": "person kneeling facing right: light skin tone", + "unicode": "1f9ce-1f3fb-200d-27a1-fe0f" + }, + ":person_kneeling_facing_right_tone2:": { + "category": "people", + "name": "person kneeling facing right: medium-light skin tone", + "unicode": "1f9ce-1f3fc-200d-27a1-fe0f" + }, + ":person_kneeling_facing_right_tone3:": { + "category": "people", + "name": "person kneeling facing right: medium skin tone", + "unicode": "1f9ce-1f3fd-200d-27a1-fe0f" + }, + ":person_kneeling_facing_right_tone4:": { + "category": "people", + "name": "person kneeling facing right: medium-dark skin tone", + "unicode": "1f9ce-1f3fe-200d-27a1-fe0f" + }, + ":person_kneeling_facing_right_tone5:": { + "category": "people", + "name": "person kneeling facing right: dark skin tone", + "unicode": "1f9ce-1f3ff-200d-27a1-fe0f" + }, + ":person_kneeling_tone1:": { + "category": "people", + "name": "person kneeling: light skin tone", + "unicode": "1f9ce-1f3fb" + }, + ":person_kneeling_tone2:": { + "category": "people", + "name": "person kneeling: medium-light skin tone", + "unicode": "1f9ce-1f3fc" + }, + ":person_kneeling_tone3:": { + "category": "people", + "name": "person kneeling: medium skin tone", + "unicode": "1f9ce-1f3fd" + }, + ":person_kneeling_tone4:": { + "category": "people", + "name": "person kneeling: medium-dark skin tone", + "unicode": "1f9ce-1f3fe" + }, + ":person_kneeling_tone5:": { + "category": "people", + "name": "person kneeling: dark skin tone", + "unicode": "1f9ce-1f3ff" + }, + ":person_lifting_weights:": { + "category": "activity", + "name": "person lifting weights", + "unicode": "1f3cb" + }, + ":person_lifting_weights_tone1:": { + "category": "activity", + "name": "person lifting weights: light skin tone", + "unicode": "1f3cb-1f3fb" + }, + ":person_lifting_weights_tone2:": { + "category": "activity", + "name": "person lifting weights: medium-light skin tone", + "unicode": "1f3cb-1f3fc" + }, + ":person_lifting_weights_tone3:": { + "category": "activity", + "name": "person lifting weights: medium skin tone", + "unicode": "1f3cb-1f3fd" + }, + ":person_lifting_weights_tone4:": { + "category": "activity", + "name": "person lifting weights: medium-dark skin tone", + "unicode": "1f3cb-1f3fe" + }, + ":person_lifting_weights_tone5:": { + "category": "activity", + "name": "person lifting weights: dark skin tone", + "unicode": "1f3cb-1f3ff" + }, + ":person_mountain_biking:": { + "category": "activity", + "name": "person mountain biking", + "unicode": "1f6b5" + }, + ":person_mountain_biking_tone1:": { + "category": "activity", + "name": "person mountain biking: light skin tone", + "unicode": "1f6b5-1f3fb" + }, + ":person_mountain_biking_tone2:": { + "category": "activity", + "name": "person mountain biking: medium-light skin tone", + "unicode": "1f6b5-1f3fc" + }, + ":person_mountain_biking_tone3:": { + "category": "activity", + "name": "person mountain biking: medium skin tone", + "unicode": "1f6b5-1f3fd" + }, + ":person_mountain_biking_tone4:": { + "category": "activity", + "name": "person mountain biking: medium-dark skin tone", + "unicode": "1f6b5-1f3fe" + }, + ":person_mountain_biking_tone5:": { + "category": "activity", + "name": "person mountain biking: dark skin tone", + "unicode": "1f6b5-1f3ff" + }, + ":person_playing_handball:": { + "category": "activity", + "name": "person playing handball", + "unicode": "1f93e" + }, + ":person_playing_handball_tone1:": { + "category": "activity", + "name": "person playing handball: light skin tone", + "unicode": "1f93e-1f3fb" + }, + ":person_playing_handball_tone2:": { + "category": "activity", + "name": "person playing handball: medium-light skin tone", + "unicode": "1f93e-1f3fc" + }, + ":person_playing_handball_tone3:": { + "category": "activity", + "name": "person playing handball: medium skin tone", + "unicode": "1f93e-1f3fd" + }, + ":person_playing_handball_tone4:": { + "category": "activity", + "name": "person playing handball: medium-dark skin tone", + "unicode": "1f93e-1f3fe" + }, + ":person_playing_handball_tone5:": { + "category": "activity", + "name": "person playing handball: dark skin tone", + "unicode": "1f93e-1f3ff" + }, + ":person_playing_water_polo:": { + "category": "activity", + "name": "person playing water polo", + "unicode": "1f93d" + }, + ":person_playing_water_polo_tone1:": { + "category": "activity", + "name": "person playing water polo: light skin tone", + "unicode": "1f93d-1f3fb" + }, + ":person_playing_water_polo_tone2:": { + "category": "activity", + "name": "person playing water polo: medium-light skin tone", + "unicode": "1f93d-1f3fc" + }, + ":person_playing_water_polo_tone3:": { + "category": "activity", + "name": "person playing water polo: medium skin tone", + "unicode": "1f93d-1f3fd" + }, + ":person_playing_water_polo_tone4:": { + "category": "activity", + "name": "person playing water polo: medium-dark skin tone", + "unicode": "1f93d-1f3fe" + }, + ":person_playing_water_polo_tone5:": { + "category": "activity", + "name": "person playing water polo: dark skin tone", + "unicode": "1f93d-1f3ff" + }, + ":person_pouting:": { + "category": "people", + "name": "person pouting", + "unicode": "1f64e" + }, + ":person_pouting_tone1:": { + "category": "people", + "name": "person pouting: light skin tone", + "unicode": "1f64e-1f3fb" + }, + ":person_pouting_tone2:": { + "category": "people", + "name": "person pouting: medium-light skin tone", + "unicode": "1f64e-1f3fc" + }, + ":person_pouting_tone3:": { + "category": "people", + "name": "person pouting: medium skin tone", + "unicode": "1f64e-1f3fd" + }, + ":person_pouting_tone4:": { + "category": "people", + "name": "person pouting: medium-dark skin tone", + "unicode": "1f64e-1f3fe" + }, + ":person_pouting_tone5:": { + "category": "people", + "name": "person pouting: dark skin tone", + "unicode": "1f64e-1f3ff" + }, + ":person_raising_hand:": { + "category": "people", + "name": "person raising hand", + "unicode": "1f64b" + }, + ":person_raising_hand_tone1:": { + "category": "people", + "name": "person raising hand: light skin tone", + "unicode": "1f64b-1f3fb" + }, + ":person_raising_hand_tone2:": { + "category": "people", + "name": "person raising hand: medium-light skin tone", + "unicode": "1f64b-1f3fc" + }, + ":person_raising_hand_tone3:": { + "category": "people", + "name": "person raising hand: medium skin tone", + "unicode": "1f64b-1f3fd" + }, + ":person_raising_hand_tone4:": { + "category": "people", + "name": "person raising hand: medium-dark skin tone", + "unicode": "1f64b-1f3fe" + }, + ":person_raising_hand_tone5:": { + "category": "people", + "name": "person raising hand: dark skin tone", + "unicode": "1f64b-1f3ff" + }, + ":person_red_hair:": { + "category": "people", + "name": "person: red hair", + "unicode": "1f9d1-200d-1f9b0" + }, + ":person_rowing_boat:": { + "category": "activity", + "name": "person rowing boat", + "unicode": "1f6a3" + }, + ":person_rowing_boat_tone1:": { + "category": "activity", + "name": "person rowing boat: light skin tone", + "unicode": "1f6a3-1f3fb" + }, + ":person_rowing_boat_tone2:": { + "category": "activity", + "name": "person rowing boat: medium-light skin tone", + "unicode": "1f6a3-1f3fc" + }, + ":person_rowing_boat_tone3:": { + "category": "activity", + "name": "person rowing boat: medium skin tone", + "unicode": "1f6a3-1f3fd" + }, + ":person_rowing_boat_tone4:": { + "category": "activity", + "name": "person rowing boat: medium-dark skin tone", + "unicode": "1f6a3-1f3fe" + }, + ":person_rowing_boat_tone5:": { + "category": "activity", + "name": "person rowing boat: dark skin tone", + "unicode": "1f6a3-1f3ff" + }, + ":person_running:": { + "category": "people", + "name": "person running", + "unicode": "1f3c3" + }, + ":person_running_facing_right:": { + "category": "people", + "name": "person running facing right", + "unicode": "1f3c3-200d-27a1-fe0f" + }, + ":person_running_facing_right_tone1:": { + "category": "people", + "name": "person running facing right: light skin tone", + "unicode": "1f3c3-1f3fb-200d-27a1-fe0f" + }, + ":person_running_facing_right_tone2:": { + "category": "people", + "name": "person running facing right: medium-light skin tone", + "unicode": "1f3c3-1f3fc-200d-27a1-fe0f" + }, + ":person_running_facing_right_tone3:": { + "category": "people", + "name": "person running facing right: medium skin tone", + "unicode": "1f3c3-1f3fd-200d-27a1-fe0f" + }, + ":person_running_facing_right_tone4:": { + "category": "people", + "name": "person running facing right: medium-dark skin tone", + "unicode": "1f3c3-1f3fe-200d-27a1-fe0f" + }, + ":person_running_facing_right_tone5:": { + "category": "people", + "name": "person running facing right: dark skin tone", + "unicode": "1f3c3-1f3ff-200d-27a1-fe0f" + }, + ":person_running_tone1:": { + "category": "people", + "name": "person running: light skin tone", + "unicode": "1f3c3-1f3fb" + }, + ":person_running_tone2:": { + "category": "people", + "name": "person running: medium-light skin tone", + "unicode": "1f3c3-1f3fc" + }, + ":person_running_tone3:": { + "category": "people", + "name": "person running: medium skin tone", + "unicode": "1f3c3-1f3fd" + }, + ":person_running_tone4:": { + "category": "people", + "name": "person running: medium-dark skin tone", + "unicode": "1f3c3-1f3fe" + }, + ":person_running_tone5:": { + "category": "people", + "name": "person running: dark skin tone", + "unicode": "1f3c3-1f3ff" + }, + ":person_shrugging:": { + "category": "people", + "name": "person shrugging", + "unicode": "1f937" + }, + ":person_shrugging_tone1:": { + "category": "people", + "name": "person shrugging: light skin tone", + "unicode": "1f937-1f3fb" + }, + ":person_shrugging_tone2:": { + "category": "people", + "name": "person shrugging: medium-light skin tone", + "unicode": "1f937-1f3fc" + }, + ":person_shrugging_tone3:": { + "category": "people", + "name": "person shrugging: medium skin tone", + "unicode": "1f937-1f3fd" + }, + ":person_shrugging_tone4:": { + "category": "people", + "name": "person shrugging: medium-dark skin tone", + "unicode": "1f937-1f3fe" + }, + ":person_shrugging_tone5:": { + "category": "people", + "name": "person shrugging: dark skin tone", + "unicode": "1f937-1f3ff" + }, + ":person_standing:": { + "category": "people", + "name": "person standing", + "unicode": "1f9cd" + }, + ":person_standing_tone1:": { + "category": "people", + "name": "person standing: light skin tone", + "unicode": "1f9cd-1f3fb" + }, + ":person_standing_tone2:": { + "category": "people", + "name": "person standing: medium-light skin tone", + "unicode": "1f9cd-1f3fc" + }, + ":person_standing_tone3:": { + "category": "people", + "name": "person standing: medium skin tone", + "unicode": "1f9cd-1f3fd" + }, + ":person_standing_tone4:": { + "category": "people", + "name": "person standing: medium-dark skin tone", + "unicode": "1f9cd-1f3fe" + }, + ":person_standing_tone5:": { + "category": "people", + "name": "person standing: dark skin tone", + "unicode": "1f9cd-1f3ff" + }, + ":person_surfing:": { + "category": "activity", + "name": "person surfing", + "unicode": "1f3c4" + }, + ":person_surfing_tone1:": { + "category": "activity", + "name": "person surfing: light skin tone", + "unicode": "1f3c4-1f3fb" + }, + ":person_surfing_tone2:": { + "category": "activity", + "name": "person surfing: medium-light skin tone", + "unicode": "1f3c4-1f3fc" + }, + ":person_surfing_tone3:": { + "category": "activity", + "name": "person surfing: medium skin tone", + "unicode": "1f3c4-1f3fd" + }, + ":person_surfing_tone4:": { + "category": "activity", + "name": "person surfing: medium-dark skin tone", + "unicode": "1f3c4-1f3fe" + }, + ":person_surfing_tone5:": { + "category": "activity", + "name": "person surfing: dark skin tone", + "unicode": "1f3c4-1f3ff" + }, + ":person_swimming:": { + "category": "activity", + "name": "person swimming", + "unicode": "1f3ca" + }, + ":person_swimming_tone1:": { + "category": "activity", + "name": "person swimming: light skin tone", + "unicode": "1f3ca-1f3fb" + }, + ":person_swimming_tone2:": { + "category": "activity", + "name": "person swimming: medium-light skin tone", + "unicode": "1f3ca-1f3fc" + }, + ":person_swimming_tone3:": { + "category": "activity", + "name": "person swimming: medium skin tone", + "unicode": "1f3ca-1f3fd" + }, + ":person_swimming_tone4:": { + "category": "activity", + "name": "person swimming: medium-dark skin tone", + "unicode": "1f3ca-1f3fe" + }, + ":person_swimming_tone5:": { + "category": "activity", + "name": "person swimming: dark skin tone", + "unicode": "1f3ca-1f3ff" + }, + ":person_tipping_hand:": { + "category": "people", + "name": "person tipping hand", + "unicode": "1f481" + }, + ":person_tipping_hand_tone1:": { + "category": "people", + "name": "person tipping hand: light skin tone", + "unicode": "1f481-1f3fb" + }, + ":person_tipping_hand_tone2:": { + "category": "people", + "name": "person tipping hand: medium-light skin tone", + "unicode": "1f481-1f3fc" + }, + ":person_tipping_hand_tone3:": { + "category": "people", + "name": "person tipping hand: medium skin tone", + "unicode": "1f481-1f3fd" + }, + ":person_tipping_hand_tone4:": { + "category": "people", + "name": "person tipping hand: medium-dark skin tone", + "unicode": "1f481-1f3fe" + }, + ":person_tipping_hand_tone5:": { + "category": "people", + "name": "person tipping hand: dark skin tone", + "unicode": "1f481-1f3ff" + }, + ":person_tone1_bald:": { + "category": "people", + "name": "person: light skin tone, bald", + "unicode": "1f9d1-1f3fb-200d-1f9b2" + }, + ":person_tone1_curly_hair:": { + "category": "people", + "name": "person: light skin tone, curly hair", + "unicode": "1f9d1-1f3fb-200d-1f9b1" + }, + ":person_tone1_red_hair:": { + "category": "people", + "name": "person: light skin tone, red hair", + "unicode": "1f9d1-1f3fb-200d-1f9b0" + }, + ":person_tone1_white_hair:": { + "category": "people", + "name": "person: light skin tone, white hair", + "unicode": "1f9d1-1f3fb-200d-1f9b3" + }, + ":person_tone2_bald:": { + "category": "people", + "name": "person: medium-light skin tone, bald", + "unicode": "1f9d1-1f3fc-200d-1f9b2" + }, + ":person_tone2_curly_hair:": { + "category": "people", + "name": "person: medium-light skin tone, curly hair", + "unicode": "1f9d1-1f3fc-200d-1f9b1" + }, + ":person_tone2_red_hair:": { + "category": "people", + "name": "person: medium-light skin tone, red hair", + "unicode": "1f9d1-1f3fc-200d-1f9b0" + }, + ":person_tone2_white_hair:": { + "category": "people", + "name": "person: medium-light skin tone, white hair", + "unicode": "1f9d1-1f3fc-200d-1f9b3" + }, + ":person_tone3_bald:": { + "category": "people", + "name": "person: medium skin tone, bald", + "unicode": "1f9d1-1f3fd-200d-1f9b2" + }, + ":person_tone3_curly_hair:": { + "category": "people", + "name": "person: medium skin tone, curly hair", + "unicode": "1f9d1-1f3fd-200d-1f9b1" + }, + ":person_tone3_red_hair:": { + "category": "people", + "name": "person: medium skin tone, red hair", + "unicode": "1f9d1-1f3fd-200d-1f9b0" + }, + ":person_tone3_white_hair:": { + "category": "people", + "name": "person: medium skin tone, white hair", + "unicode": "1f9d1-1f3fd-200d-1f9b3" + }, + ":person_tone4_bald:": { + "category": "people", + "name": "person: medium-dark skin tone, bald", + "unicode": "1f9d1-1f3fe-200d-1f9b2" + }, + ":person_tone4_curly_hair:": { + "category": "people", + "name": "person: medium-dark skin tone, curly hair", + "unicode": "1f9d1-1f3fe-200d-1f9b1" + }, + ":person_tone4_red_hair:": { + "category": "people", + "name": "person: medium-dark skin tone, red hair", + "unicode": "1f9d1-1f3fe-200d-1f9b0" + }, + ":person_tone4_white_hair:": { + "category": "people", + "name": "person: medium-dark skin tone, white hair", + "unicode": "1f9d1-1f3fe-200d-1f9b3" + }, + ":person_tone5_bald:": { + "category": "people", + "name": "person: dark skin tone, bald", + "unicode": "1f9d1-1f3ff-200d-1f9b2" + }, + ":person_tone5_curly_hair:": { + "category": "people", + "name": "person: dark skin tone, curly hair", + "unicode": "1f9d1-1f3ff-200d-1f9b1" + }, + ":person_tone5_red_hair:": { + "category": "people", + "name": "person: dark skin tone, red hair", + "unicode": "1f9d1-1f3ff-200d-1f9b0" + }, + ":person_tone5_white_hair:": { + "category": "people", + "name": "person: dark skin tone, white hair", + "unicode": "1f9d1-1f3ff-200d-1f9b3" + }, + ":person_walking:": { + "category": "people", + "name": "person walking", + "unicode": "1f6b6" + }, + ":person_walking_facing_right:": { + "category": "people", + "name": "person walking facing right", + "unicode": "1f6b6-200d-27a1-fe0f" + }, + ":person_walking_facing_right_tone1:": { + "category": "people", + "name": "person walking facing right: light skin tone", + "unicode": "1f6b6-1f3fb-200d-27a1-fe0f" + }, + ":person_walking_facing_right_tone2:": { + "category": "people", + "name": "person walking facing right: medium-light skin tone", + "unicode": "1f6b6-1f3fc-200d-27a1-fe0f" + }, + ":person_walking_facing_right_tone3:": { + "category": "people", + "name": "person walking facing right: medium skin tone", + "unicode": "1f6b6-1f3fd-200d-27a1-fe0f" + }, + ":person_walking_facing_right_tone4:": { + "category": "people", + "name": "person walking facing right: medium-dark skin tone", + "unicode": "1f6b6-1f3fe-200d-27a1-fe0f" + }, + ":person_walking_facing_right_tone5:": { + "category": "people", + "name": "person walking facing right: dark skin tone", + "unicode": "1f6b6-1f3ff-200d-27a1-fe0f" + }, + ":person_walking_tone1:": { + "category": "people", + "name": "person walking: light skin tone", + "unicode": "1f6b6-1f3fb" + }, + ":person_walking_tone2:": { + "category": "people", + "name": "person walking: medium-light skin tone", + "unicode": "1f6b6-1f3fc" + }, + ":person_walking_tone3:": { + "category": "people", + "name": "person walking: medium skin tone", + "unicode": "1f6b6-1f3fd" + }, + ":person_walking_tone4:": { + "category": "people", + "name": "person walking: medium-dark skin tone", + "unicode": "1f6b6-1f3fe" + }, + ":person_walking_tone5:": { + "category": "people", + "name": "person walking: dark skin tone", + "unicode": "1f6b6-1f3ff" + }, + ":person_wearing_turban:": { + "category": "people", + "name": "person wearing turban", + "unicode": "1f473" + }, + ":person_wearing_turban_tone1:": { + "category": "people", + "name": "person wearing turban: light skin tone", + "unicode": "1f473-1f3fb" + }, + ":person_wearing_turban_tone2:": { + "category": "people", + "name": "person wearing turban: medium-light skin tone", + "unicode": "1f473-1f3fc" + }, + ":person_wearing_turban_tone3:": { + "category": "people", + "name": "person wearing turban: medium skin tone", + "unicode": "1f473-1f3fd" + }, + ":person_wearing_turban_tone4:": { + "category": "people", + "name": "person wearing turban: medium-dark skin tone", + "unicode": "1f473-1f3fe" + }, + ":person_wearing_turban_tone5:": { + "category": "people", + "name": "person wearing turban: dark skin tone", + "unicode": "1f473-1f3ff" + }, + ":person_white_hair:": { + "category": "people", + "name": "person: white hair", + "unicode": "1f9d1-200d-1f9b3" + }, + ":person_with_crown:": { + "category": "people", + "name": "person with crown", + "unicode": "1fac5" + }, + ":person_with_crown_tone1:": { + "category": "people", + "name": "person with crown: light skin tone", + "unicode": "1fac5-1f3fb" + }, + ":person_with_crown_tone2:": { + "category": "people", + "name": "person with crown: medium-light skin tone", + "unicode": "1fac5-1f3fc" + }, + ":person_with_crown_tone3:": { + "category": "people", + "name": "person with crown: medium skin tone", + "unicode": "1fac5-1f3fd" + }, + ":person_with_crown_tone4:": { + "category": "people", + "name": "person with crown: medium-dark skin tone", + "unicode": "1fac5-1f3fe" + }, + ":person_with_crown_tone5:": { + "category": "people", + "name": "person with crown: dark skin tone", + "unicode": "1fac5-1f3ff" + }, + ":person_with_probing_cane:": { + "category": "people", + "name": "person with probing cane", + "unicode": "1f9d1-200d-1f9af" + }, + ":person_with_probing_cane_tone1:": { + "category": "people", + "name": "person with probing cane: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9af" + }, + ":person_with_probing_cane_tone2:": { + "category": "people", + "name": "person with probing cane: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9af" + }, + ":person_with_probing_cane_tone3:": { + "category": "people", + "name": "person with probing cane: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9af" + }, + ":person_with_probing_cane_tone4:": { + "category": "people", + "name": "person with probing cane: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9af" + }, + ":person_with_probing_cane_tone5:": { + "category": "people", + "name": "person with probing cane: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9af" + }, + ":person_with_veil:": { + "category": "people", + "name": "person with veil", + "unicode": "1f470" + }, + ":person_with_veil_tone1:": { + "category": "people", + "name": "person with veil: light skin tone", + "unicode": "1f470-1f3fb" + }, + ":person_with_veil_tone2:": { + "category": "people", + "name": "person with veil: medium-light skin tone", + "unicode": "1f470-1f3fc" + }, + ":person_with_veil_tone3:": { + "category": "people", + "name": "person with veil: medium skin tone", + "unicode": "1f470-1f3fd" + }, + ":person_with_veil_tone4:": { + "category": "people", + "name": "person with veil: medium-dark skin tone", + "unicode": "1f470-1f3fe" + }, + ":person_with_veil_tone5:": { + "category": "people", + "name": "person with veil: dark skin tone", + "unicode": "1f470-1f3ff" + }, + ":person_with_white_cane_facing_right:": { + "category": "people", + "name": "person with white cane facing right", + "unicode": "1f9d1-200d-1f9af-200d-27a1-fe0f" + }, + ":person_with_white_cane_facing_right_tone1:": { + "category": "people", + "name": "person with white cane facing right: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f9af-200d-27a1-fe0f" + }, + ":person_with_white_cane_facing_right_tone2:": { + "category": "people", + "name": "person with white cane facing right: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f9af-200d-27a1-fe0f" + }, + ":person_with_white_cane_facing_right_tone3:": { + "category": "people", + "name": "person with white cane facing right: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f9af-200d-27a1-fe0f" + }, + ":person_with_white_cane_facing_right_tone4:": { + "category": "people", + "name": "person with white cane facing right: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f9af-200d-27a1-fe0f" + }, + ":person_with_white_cane_facing_right_tone5:": { + "category": "people", + "name": "person with white cane facing right: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f9af-200d-27a1-fe0f" + }, + ":petri_dish:": { + "category": "objects", + "name": "petri dish", + "unicode": "1f9eb" + }, + ":phoenix:": { + "category": "nature", + "name": "phoenix", + "unicode": "1f426-200d-1f525" + }, + ":pick:": { + "category": "objects", + "name": "pick", + "unicode": "26cf" + }, + ":pickup_truck:": { + "category": "travel", + "name": "pickup truck", + "unicode": "1f6fb" + }, + ":pie:": { + "category": "food", + "name": "pie", + "unicode": "1f967" + }, + ":pig2:": { + "category": "nature", + "name": "pig", + "unicode": "1f416" + }, + ":pig:": { + "category": "nature", + "name": "pig face", + "unicode": "1f437" + }, + ":pig_nose:": { + "category": "nature", + "name": "pig nose", + "unicode": "1f43d" + }, + ":pill:": { + "category": "objects", + "name": "pill", + "unicode": "1f48a" + }, + ":pilot:": { + "category": "people", + "name": "pilot", + "unicode": "1f9d1-200d-2708-fe0f" + }, + ":pilot_tone1:": { + "category": "people", + "name": "pilot: light skin tone", + "unicode": "1f9d1-1f3fb-200d-2708-fe0f" + }, + ":pilot_tone2:": { + "category": "people", + "name": "pilot: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-2708-fe0f" + }, + ":pilot_tone3:": { + "category": "people", + "name": "pilot: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-2708-fe0f" + }, + ":pilot_tone4:": { + "category": "people", + "name": "pilot: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-2708-fe0f" + }, + ":pilot_tone5:": { + "category": "people", + "name": "pilot: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-2708-fe0f" + }, + ":pinched_fingers:": { + "category": "people", + "name": "pinched fingers", + "unicode": "1f90c" + }, + ":pinched_fingers_tone1:": { + "category": "people", + "name": "pinched fingers: light skin tone", + "unicode": "1f90c-1f3fb" + }, + ":pinched_fingers_tone2:": { + "category": "people", + "name": "pinched fingers: medium-light skin tone", + "unicode": "1f90c-1f3fc" + }, + ":pinched_fingers_tone3:": { + "category": "people", + "name": "pinched fingers: medium skin tone", + "unicode": "1f90c-1f3fd" + }, + ":pinched_fingers_tone4:": { + "category": "people", + "name": "pinched fingers: medium-dark skin tone", + "unicode": "1f90c-1f3fe" + }, + ":pinched_fingers_tone5:": { + "category": "people", + "name": "pinched fingers: dark skin tone", + "unicode": "1f90c-1f3ff" + }, + ":pinching_hand:": { + "category": "people", + "name": "pinching hand", + "unicode": "1f90f" + }, + ":pinching_hand_tone1:": { + "category": "people", + "name": "pinching hand: light skin tone", + "unicode": "1f90f-1f3fb" + }, + ":pinching_hand_tone2:": { + "category": "people", + "name": "pinching hand: medium-light skin tone", + "unicode": "1f90f-1f3fc" + }, + ":pinching_hand_tone3:": { + "category": "people", + "name": "pinching hand: medium skin tone", + "unicode": "1f90f-1f3fd" + }, + ":pinching_hand_tone4:": { + "category": "people", + "name": "pinching hand: medium-dark skin tone", + "unicode": "1f90f-1f3fe" + }, + ":pinching_hand_tone5:": { + "category": "people", + "name": "pinching hand: dark skin tone", + "unicode": "1f90f-1f3ff" + }, + ":pineapple:": { + "category": "food", + "name": "pineapple", + "unicode": "1f34d" + }, + ":ping_pong:": { + "category": "activity", + "name": "ping pong", + "unicode": "1f3d3" + }, + ":pink_heart:": { + "category": "symbols", + "name": "pink heart", + "unicode": "1fa77" + }, + ":pirate_flag:": { + "category": "flags", + "name": "pirate flag", + "unicode": "1f3f4-200d-2620-fe0f" + }, + ":pisces:": { + "category": "symbols", + "name": "Pisces", + "unicode": "2653" + }, + ":pizza:": { + "category": "food", + "name": "pizza", + "unicode": "1f355" + }, + ":pi\u00f1ata:": { + "category": "objects", + "name": "pi\u00f1ata", + "unicode": "1fa85" + }, + ":placard:": { + "category": "objects", + "name": "placard", + "unicode": "1faa7" + }, + ":place_of_worship:": { + "category": "symbols", + "name": "place of worship", + "unicode": "1f6d0" + }, + ":play_pause:": { + "category": "symbols", + "name": "play or pause button", + "unicode": "23ef" + }, + ":playground_slide:": { + "category": "activity", + "name": "playground slide", + "unicode": "1f6dd" + }, + ":pleading_face:": { + "category": "people", + "name": "pleading face", + "unicode": "1f97a" + }, + ":plunger:": { + "category": "objects", + "name": "plunger", + "unicode": "1faa0" + }, + ":point_down:": { + "category": "people", + "name": "backhand index pointing down", + "unicode": "1f447" + }, + ":point_down_tone1:": { + "category": "people", + "name": "backhand index pointing down: light skin tone", + "unicode": "1f447-1f3fb" + }, + ":point_down_tone2:": { + "category": "people", + "name": "backhand index pointing down: medium-light skin tone", + "unicode": "1f447-1f3fc" + }, + ":point_down_tone3:": { + "category": "people", + "name": "backhand index pointing down: medium skin tone", + "unicode": "1f447-1f3fd" + }, + ":point_down_tone4:": { + "category": "people", + "name": "backhand index pointing down: medium-dark skin tone", + "unicode": "1f447-1f3fe" + }, + ":point_down_tone5:": { + "category": "people", + "name": "backhand index pointing down: dark skin tone", + "unicode": "1f447-1f3ff" + }, + ":point_left:": { + "category": "people", + "name": "backhand index pointing left", + "unicode": "1f448" + }, + ":point_left_tone1:": { + "category": "people", + "name": "backhand index pointing left: light skin tone", + "unicode": "1f448-1f3fb" + }, + ":point_left_tone2:": { + "category": "people", + "name": "backhand index pointing left: medium-light skin tone", + "unicode": "1f448-1f3fc" + }, + ":point_left_tone3:": { + "category": "people", + "name": "backhand index pointing left: medium skin tone", + "unicode": "1f448-1f3fd" + }, + ":point_left_tone4:": { + "category": "people", + "name": "backhand index pointing left: medium-dark skin tone", + "unicode": "1f448-1f3fe" + }, + ":point_left_tone5:": { + "category": "people", + "name": "backhand index pointing left: dark skin tone", + "unicode": "1f448-1f3ff" + }, + ":point_right:": { + "category": "people", + "name": "backhand index pointing right", + "unicode": "1f449" + }, + ":point_right_tone1:": { + "category": "people", + "name": "backhand index pointing right: light skin tone", + "unicode": "1f449-1f3fb" + }, + ":point_right_tone2:": { + "category": "people", + "name": "backhand index pointing right: medium-light skin tone", + "unicode": "1f449-1f3fc" + }, + ":point_right_tone3:": { + "category": "people", + "name": "backhand index pointing right: medium skin tone", + "unicode": "1f449-1f3fd" + }, + ":point_right_tone4:": { + "category": "people", + "name": "backhand index pointing right: medium-dark skin tone", + "unicode": "1f449-1f3fe" + }, + ":point_right_tone5:": { + "category": "people", + "name": "backhand index pointing right: dark skin tone", + "unicode": "1f449-1f3ff" + }, + ":point_up:": { + "category": "people", + "name": "index pointing up", + "unicode": "261d" + }, + ":point_up_2:": { + "category": "people", + "name": "backhand index pointing up", + "unicode": "1f446" + }, + ":point_up_2_tone1:": { + "category": "people", + "name": "backhand index pointing up: light skin tone", + "unicode": "1f446-1f3fb" + }, + ":point_up_2_tone2:": { + "category": "people", + "name": "backhand index pointing up: medium-light skin tone", + "unicode": "1f446-1f3fc" + }, + ":point_up_2_tone3:": { + "category": "people", + "name": "backhand index pointing up: medium skin tone", + "unicode": "1f446-1f3fd" + }, + ":point_up_2_tone4:": { + "category": "people", + "name": "backhand index pointing up: medium-dark skin tone", + "unicode": "1f446-1f3fe" + }, + ":point_up_2_tone5:": { + "category": "people", + "name": "backhand index pointing up: dark skin tone", + "unicode": "1f446-1f3ff" + }, + ":point_up_tone1:": { + "category": "people", + "name": "index pointing up: light skin tone", + "unicode": "261d-1f3fb" + }, + ":point_up_tone2:": { + "category": "people", + "name": "index pointing up: medium-light skin tone", + "unicode": "261d-1f3fc" + }, + ":point_up_tone3:": { + "category": "people", + "name": "index pointing up: medium skin tone", + "unicode": "261d-1f3fd" + }, + ":point_up_tone4:": { + "category": "people", + "name": "index pointing up: medium-dark skin tone", + "unicode": "261d-1f3fe" + }, + ":point_up_tone5:": { + "category": "people", + "name": "index pointing up: dark skin tone", + "unicode": "261d-1f3ff" + }, + ":polar_bear:": { + "category": "nature", + "name": "polar bear", + "unicode": "1f43b-200d-2744-fe0f" + }, + ":police_car:": { + "category": "travel", + "name": "police car", + "unicode": "1f693" + }, + ":police_officer:": { + "category": "people", + "name": "police officer", + "unicode": "1f46e" + }, + ":police_officer_tone1:": { + "category": "people", + "name": "police officer: light skin tone", + "unicode": "1f46e-1f3fb" + }, + ":police_officer_tone2:": { + "category": "people", + "name": "police officer: medium-light skin tone", + "unicode": "1f46e-1f3fc" + }, + ":police_officer_tone3:": { + "category": "people", + "name": "police officer: medium skin tone", + "unicode": "1f46e-1f3fd" + }, + ":police_officer_tone4:": { + "category": "people", + "name": "police officer: medium-dark skin tone", + "unicode": "1f46e-1f3fe" + }, + ":police_officer_tone5:": { + "category": "people", + "name": "police officer: dark skin tone", + "unicode": "1f46e-1f3ff" + }, + ":poodle:": { + "category": "nature", + "name": "poodle", + "unicode": "1f429" + }, + ":poop:": { + "category": "people", + "name": "pile of poo", + "unicode": "1f4a9" + }, + ":popcorn:": { + "category": "food", + "name": "popcorn", + "unicode": "1f37f" + }, + ":post_office:": { + "category": "travel", + "name": "Japanese post office", + "unicode": "1f3e3" + }, + ":postal_horn:": { + "category": "objects", + "name": "postal horn", + "unicode": "1f4ef" + }, + ":postbox:": { + "category": "objects", + "name": "postbox", + "unicode": "1f4ee" + }, + ":potable_water:": { + "category": "objects", + "name": "potable water", + "unicode": "1f6b0" + }, + ":potato:": { + "category": "food", + "name": "potato", + "unicode": "1f954" + }, + ":potted_plant:": { + "category": "nature", + "name": "potted plant", + "unicode": "1fab4" + }, + ":pouch:": { + "category": "people", + "name": "clutch bag", + "unicode": "1f45d" + }, + ":poultry_leg:": { + "category": "food", + "name": "poultry leg", + "unicode": "1f357" + }, + ":pound:": { + "category": "objects", + "name": "pound banknote", + "unicode": "1f4b7" + }, + ":pouring_liquid:": { + "category": "food", + "name": "pouring liquid", + "unicode": "1fad7" + }, + ":pouting_cat:": { + "category": "people", + "name": "pouting cat", + "unicode": "1f63e" + }, + ":pray:": { + "category": "people", + "name": "folded hands", + "unicode": "1f64f" + }, + ":pray_tone1:": { + "category": "people", + "name": "folded hands: light skin tone", + "unicode": "1f64f-1f3fb" + }, + ":pray_tone2:": { + "category": "people", + "name": "folded hands: medium-light skin tone", + "unicode": "1f64f-1f3fc" + }, + ":pray_tone3:": { + "category": "people", + "name": "folded hands: medium skin tone", + "unicode": "1f64f-1f3fd" + }, + ":pray_tone4:": { + "category": "people", + "name": "folded hands: medium-dark skin tone", + "unicode": "1f64f-1f3fe" + }, + ":pray_tone5:": { + "category": "people", + "name": "folded hands: dark skin tone", + "unicode": "1f64f-1f3ff" + }, + ":prayer_beads:": { + "category": "objects", + "name": "prayer beads", + "unicode": "1f4ff" + }, + ":pregnant_man:": { + "category": "people", + "name": "pregnant man", + "unicode": "1fac3" + }, + ":pregnant_man_tone1:": { + "category": "people", + "name": "pregnant man: light skin tone", + "unicode": "1fac3-1f3fb" + }, + ":pregnant_man_tone2:": { + "category": "people", + "name": "pregnant man: medium-light skin tone", + "unicode": "1fac3-1f3fc" + }, + ":pregnant_man_tone3:": { + "category": "people", + "name": "pregnant man: medium skin tone", + "unicode": "1fac3-1f3fd" + }, + ":pregnant_man_tone4:": { + "category": "people", + "name": "pregnant man: medium-dark skin tone", + "unicode": "1fac3-1f3fe" + }, + ":pregnant_man_tone5:": { + "category": "people", + "name": "pregnant man: dark skin tone", + "unicode": "1fac3-1f3ff" + }, + ":pregnant_person:": { + "category": "people", + "name": "pregnant person", + "unicode": "1fac4" + }, + ":pregnant_person_tone1:": { + "category": "people", + "name": "pregnant person: light skin tone", + "unicode": "1fac4-1f3fb" + }, + ":pregnant_person_tone2:": { + "category": "people", + "name": "pregnant person: medium-light skin tone", + "unicode": "1fac4-1f3fc" + }, + ":pregnant_person_tone3:": { + "category": "people", + "name": "pregnant person: medium skin tone", + "unicode": "1fac4-1f3fd" + }, + ":pregnant_person_tone4:": { + "category": "people", + "name": "pregnant person: medium-dark skin tone", + "unicode": "1fac4-1f3fe" + }, + ":pregnant_person_tone5:": { + "category": "people", + "name": "pregnant person: dark skin tone", + "unicode": "1fac4-1f3ff" + }, + ":pregnant_woman:": { + "category": "people", + "name": "pregnant woman", + "unicode": "1f930" + }, + ":pregnant_woman_tone1:": { + "category": "people", + "name": "pregnant woman: light skin tone", + "unicode": "1f930-1f3fb" + }, + ":pregnant_woman_tone2:": { + "category": "people", + "name": "pregnant woman: medium-light skin tone", + "unicode": "1f930-1f3fc" + }, + ":pregnant_woman_tone3:": { + "category": "people", + "name": "pregnant woman: medium skin tone", + "unicode": "1f930-1f3fd" + }, + ":pregnant_woman_tone4:": { + "category": "people", + "name": "pregnant woman: medium-dark skin tone", + "unicode": "1f930-1f3fe" + }, + ":pregnant_woman_tone5:": { + "category": "people", + "name": "pregnant woman: dark skin tone", + "unicode": "1f930-1f3ff" + }, + ":pretzel:": { + "category": "food", + "name": "pretzel", + "unicode": "1f968" + }, + ":prince:": { + "category": "people", + "name": "prince", + "unicode": "1f934" + }, + ":prince_tone1:": { + "category": "people", + "name": "prince: light skin tone", + "unicode": "1f934-1f3fb" + }, + ":prince_tone2:": { + "category": "people", + "name": "prince: medium-light skin tone", + "unicode": "1f934-1f3fc" + }, + ":prince_tone3:": { + "category": "people", + "name": "prince: medium skin tone", + "unicode": "1f934-1f3fd" + }, + ":prince_tone4:": { + "category": "people", + "name": "prince: medium-dark skin tone", + "unicode": "1f934-1f3fe" + }, + ":prince_tone5:": { + "category": "people", + "name": "prince: dark skin tone", + "unicode": "1f934-1f3ff" + }, + ":princess:": { + "category": "people", + "name": "princess", + "unicode": "1f478" + }, + ":princess_tone1:": { + "category": "people", + "name": "princess: light skin tone", + "unicode": "1f478-1f3fb" + }, + ":princess_tone2:": { + "category": "people", + "name": "princess: medium-light skin tone", + "unicode": "1f478-1f3fc" + }, + ":princess_tone3:": { + "category": "people", + "name": "princess: medium skin tone", + "unicode": "1f478-1f3fd" + }, + ":princess_tone4:": { + "category": "people", + "name": "princess: medium-dark skin tone", + "unicode": "1f478-1f3fe" + }, + ":princess_tone5:": { + "category": "people", + "name": "princess: dark skin tone", + "unicode": "1f478-1f3ff" + }, + ":printer:": { + "category": "objects", + "name": "printer", + "unicode": "1f5a8" + }, + ":probing_cane:": { + "category": "travel", + "name": "probing cane", + "unicode": "1f9af" + }, + ":projector:": { + "category": "objects", + "name": "film projector", + "unicode": "1f4fd" + }, + ":punch:": { + "category": "people", + "name": "oncoming fist", + "unicode": "1f44a" + }, + ":punch_tone1:": { + "category": "people", + "name": "oncoming fist: light skin tone", + "unicode": "1f44a-1f3fb" + }, + ":punch_tone2:": { + "category": "people", + "name": "oncoming fist: medium-light skin tone", + "unicode": "1f44a-1f3fc" + }, + ":punch_tone3:": { + "category": "people", + "name": "oncoming fist: medium skin tone", + "unicode": "1f44a-1f3fd" + }, + ":punch_tone4:": { + "category": "people", + "name": "oncoming fist: medium-dark skin tone", + "unicode": "1f44a-1f3fe" + }, + ":punch_tone5:": { + "category": "people", + "name": "oncoming fist: dark skin tone", + "unicode": "1f44a-1f3ff" + }, + ":purple_circle:": { + "category": "symbols", + "name": "purple circle", + "unicode": "1f7e3" + }, + ":purple_heart:": { + "category": "symbols", + "name": "purple heart", + "unicode": "1f49c" + }, + ":purple_square:": { + "category": "symbols", + "name": "purple square", + "unicode": "1f7ea" + }, + ":purse:": { + "category": "people", + "name": "purse", + "unicode": "1f45b" + }, + ":pushpin:": { + "category": "objects", + "name": "pushpin", + "unicode": "1f4cc" + }, + ":put_litter_in_its_place:": { + "category": "symbols", + "name": "litter in bin sign", + "unicode": "1f6ae" + }, + ":question:": { + "category": "symbols", + "name": "question mark", + "unicode": "2753" + }, + ":rabbit2:": { + "category": "nature", + "name": "rabbit", + "unicode": "1f407" + }, + ":rabbit:": { + "category": "nature", + "name": "rabbit face", + "unicode": "1f430" + }, + ":raccoon:": { + "category": "nature", + "name": "raccoon", + "unicode": "1f99d" + }, + ":race_car:": { + "category": "travel", + "name": "racing car", + "unicode": "1f3ce" + }, + ":racehorse:": { + "category": "nature", + "name": "horse", + "unicode": "1f40e" + }, + ":radio:": { + "category": "objects", + "name": "radio", + "unicode": "1f4fb" + }, + ":radio_button:": { + "category": "symbols", + "name": "radio button", + "unicode": "1f518" + }, + ":radioactive:": { + "category": "symbols", + "name": "radioactive", + "unicode": "2622" + }, + ":rage:": { + "category": "people", + "name": "pouting face", + "unicode": "1f621" + }, + ":railway_car:": { + "category": "travel", + "name": "railway car", + "unicode": "1f683" + }, + ":railway_track:": { + "category": "travel", + "name": "railway track", + "unicode": "1f6e4" + }, + ":rainbow:": { + "category": "nature", + "name": "rainbow", + "unicode": "1f308" + }, + ":rainbow_flag:": { + "category": "flags", + "name": "rainbow flag", + "unicode": "1f3f3-fe0f-200d-1f308" + }, + ":raised_back_of_hand:": { + "category": "people", + "name": "raised back of hand", + "unicode": "1f91a" + }, + ":raised_back_of_hand_tone1:": { + "category": "people", + "name": "raised back of hand: light skin tone", + "unicode": "1f91a-1f3fb" + }, + ":raised_back_of_hand_tone2:": { + "category": "people", + "name": "raised back of hand: medium-light skin tone", + "unicode": "1f91a-1f3fc" + }, + ":raised_back_of_hand_tone3:": { + "category": "people", + "name": "raised back of hand: medium skin tone", + "unicode": "1f91a-1f3fd" + }, + ":raised_back_of_hand_tone4:": { + "category": "people", + "name": "raised back of hand: medium-dark skin tone", + "unicode": "1f91a-1f3fe" + }, + ":raised_back_of_hand_tone5:": { + "category": "people", + "name": "raised back of hand: dark skin tone", + "unicode": "1f91a-1f3ff" + }, + ":raised_hand:": { + "category": "people", + "name": "raised hand", + "unicode": "270b" + }, + ":raised_hand_tone1:": { + "category": "people", + "name": "raised hand: light skin tone", + "unicode": "270b-1f3fb" + }, + ":raised_hand_tone2:": { + "category": "people", + "name": "raised hand: medium-light skin tone", + "unicode": "270b-1f3fc" + }, + ":raised_hand_tone3:": { + "category": "people", + "name": "raised hand: medium skin tone", + "unicode": "270b-1f3fd" + }, + ":raised_hand_tone4:": { + "category": "people", + "name": "raised hand: medium-dark skin tone", + "unicode": "270b-1f3fe" + }, + ":raised_hand_tone5:": { + "category": "people", + "name": "raised hand: dark skin tone", + "unicode": "270b-1f3ff" + }, + ":raised_hands:": { + "category": "people", + "name": "raising hands", + "unicode": "1f64c" + }, + ":raised_hands_tone1:": { + "category": "people", + "name": "raising hands: light skin tone", + "unicode": "1f64c-1f3fb" + }, + ":raised_hands_tone2:": { + "category": "people", + "name": "raising hands: medium-light skin tone", + "unicode": "1f64c-1f3fc" + }, + ":raised_hands_tone3:": { + "category": "people", + "name": "raising hands: medium skin tone", + "unicode": "1f64c-1f3fd" + }, + ":raised_hands_tone4:": { + "category": "people", + "name": "raising hands: medium-dark skin tone", + "unicode": "1f64c-1f3fe" + }, + ":raised_hands_tone5:": { + "category": "people", + "name": "raising hands: dark skin tone", + "unicode": "1f64c-1f3ff" + }, + ":ram:": { + "category": "nature", + "name": "ram", + "unicode": "1f40f" + }, + ":ramen:": { + "category": "food", + "name": "steaming bowl", + "unicode": "1f35c" + }, + ":rat:": { + "category": "nature", + "name": "rat", + "unicode": "1f400" + }, + ":razor:": { + "category": "objects", + "name": "razor", + "unicode": "1fa92" + }, + ":receipt:": { + "category": "objects", + "name": "receipt", + "unicode": "1f9fe" + }, + ":record_button:": { + "category": "symbols", + "name": "record button", + "unicode": "23fa" + }, + ":recycle:": { + "category": "symbols", + "name": "recycling symbol", + "unicode": "267b" + }, + ":red_car:": { + "category": "travel", + "name": "automobile", + "unicode": "1f697" + }, + ":red_circle:": { + "category": "symbols", + "name": "red circle", + "unicode": "1f534" + }, + ":red_envelope:": { + "category": "objects", + "name": "red envelope", + "unicode": "1f9e7" + }, + ":red_haired:": { + "category": "people", + "name": "red hair", + "unicode": "1f9b0" + }, + ":red_square:": { + "category": "symbols", + "name": "red square", + "unicode": "1f7e5" + }, + ":regional_indicator_a:": { + "category": "regional", + "name": "regional indicator symbol letter a", + "unicode": "1f1e6" + }, + ":regional_indicator_b:": { + "category": "regional", + "name": "regional indicator symbol letter b", + "unicode": "1f1e7" + }, + ":regional_indicator_c:": { + "category": "regional", + "name": "regional indicator symbol letter c", + "unicode": "1f1e8" + }, + ":regional_indicator_d:": { + "category": "regional", + "name": "regional indicator symbol letter d", + "unicode": "1f1e9" + }, + ":regional_indicator_e:": { + "category": "regional", + "name": "regional indicator symbol letter e", + "unicode": "1f1ea" + }, + ":regional_indicator_f:": { + "category": "regional", + "name": "regional indicator symbol letter f", + "unicode": "1f1eb" + }, + ":regional_indicator_g:": { + "category": "regional", + "name": "regional indicator symbol letter g", + "unicode": "1f1ec" + }, + ":regional_indicator_h:": { + "category": "regional", + "name": "regional indicator symbol letter h", + "unicode": "1f1ed" + }, + ":regional_indicator_i:": { + "category": "regional", + "name": "regional indicator symbol letter i", + "unicode": "1f1ee" + }, + ":regional_indicator_j:": { + "category": "regional", + "name": "regional indicator symbol letter j", + "unicode": "1f1ef" + }, + ":regional_indicator_k:": { + "category": "regional", + "name": "regional indicator symbol letter k", + "unicode": "1f1f0" + }, + ":regional_indicator_l:": { + "category": "regional", + "name": "regional indicator symbol letter l", + "unicode": "1f1f1" + }, + ":regional_indicator_m:": { + "category": "regional", + "name": "regional indicator symbol letter m", + "unicode": "1f1f2" + }, + ":regional_indicator_n:": { + "category": "regional", + "name": "regional indicator symbol letter n", + "unicode": "1f1f3" + }, + ":regional_indicator_o:": { + "category": "regional", + "name": "regional indicator symbol letter o", + "unicode": "1f1f4" + }, + ":regional_indicator_p:": { + "category": "regional", + "name": "regional indicator symbol letter p", + "unicode": "1f1f5" + }, + ":regional_indicator_q:": { + "category": "regional", + "name": "regional indicator symbol letter q", + "unicode": "1f1f6" + }, + ":regional_indicator_r:": { + "category": "regional", + "name": "regional indicator symbol letter r", + "unicode": "1f1f7" + }, + ":regional_indicator_s:": { + "category": "regional", + "name": "regional indicator symbol letter s", + "unicode": "1f1f8" + }, + ":regional_indicator_t:": { + "category": "regional", + "name": "regional indicator symbol letter t", + "unicode": "1f1f9" + }, + ":regional_indicator_u:": { + "category": "regional", + "name": "regional indicator symbol letter u", + "unicode": "1f1fa" + }, + ":regional_indicator_v:": { + "category": "regional", + "name": "regional indicator symbol letter v", + "unicode": "1f1fb" + }, + ":regional_indicator_w:": { + "category": "regional", + "name": "regional indicator symbol letter w", + "unicode": "1f1fc" + }, + ":regional_indicator_x:": { + "category": "regional", + "name": "regional indicator symbol letter x", + "unicode": "1f1fd" + }, + ":regional_indicator_y:": { + "category": "regional", + "name": "regional indicator symbol letter y", + "unicode": "1f1fe" + }, + ":regional_indicator_z:": { + "category": "regional", + "name": "regional indicator symbol letter z", + "unicode": "1f1ff" + }, + ":registered:": { + "category": "symbols", + "name": "registered", + "unicode": "ae", + "unicode_alt": "00ae" + }, + ":relaxed:": { + "category": "people", + "name": "smiling face", + "unicode": "263a" + }, + ":relieved:": { + "category": "people", + "name": "relieved face", + "unicode": "1f60c" + }, + ":reminder_ribbon:": { + "category": "activity", + "name": "reminder ribbon", + "unicode": "1f397" + }, + ":repeat:": { + "category": "symbols", + "name": "repeat button", + "unicode": "1f501" + }, + ":repeat_one:": { + "category": "symbols", + "name": "repeat single button", + "unicode": "1f502" + }, + ":restroom:": { + "category": "symbols", + "name": "restroom", + "unicode": "1f6bb" + }, + ":revolving_hearts:": { + "category": "symbols", + "name": "revolving hearts", + "unicode": "1f49e" + }, + ":rewind:": { + "category": "symbols", + "name": "fast reverse button", + "unicode": "23ea" + }, + ":rhino:": { + "category": "nature", + "name": "rhinoceros", + "unicode": "1f98f" + }, + ":ribbon:": { + "category": "objects", + "name": "ribbon", + "unicode": "1f380" + }, + ":rice:": { + "category": "food", + "name": "cooked rice", + "unicode": "1f35a" + }, + ":rice_ball:": { + "category": "food", + "name": "rice ball", + "unicode": "1f359" + }, + ":rice_cracker:": { + "category": "food", + "name": "rice cracker", + "unicode": "1f358" + }, + ":rice_scene:": { + "category": "travel", + "name": "moon viewing ceremony", + "unicode": "1f391" + }, + ":right_facing_fist:": { + "category": "people", + "name": "right-facing fist", + "unicode": "1f91c" + }, + ":right_facing_fist_tone1:": { + "category": "people", + "name": "right-facing fist: light skin tone", + "unicode": "1f91c-1f3fb" + }, + ":right_facing_fist_tone2:": { + "category": "people", + "name": "right-facing fist: medium-light skin tone", + "unicode": "1f91c-1f3fc" + }, + ":right_facing_fist_tone3:": { + "category": "people", + "name": "right-facing fist: medium skin tone", + "unicode": "1f91c-1f3fd" + }, + ":right_facing_fist_tone4:": { + "category": "people", + "name": "right-facing fist: medium-dark skin tone", + "unicode": "1f91c-1f3fe" + }, + ":right_facing_fist_tone5:": { + "category": "people", + "name": "right-facing fist: dark skin tone", + "unicode": "1f91c-1f3ff" + }, + ":rightwards_hand:": { + "category": "people", + "name": "rightwards hand", + "unicode": "1faf1" + }, + ":rightwards_hand_tone1:": { + "category": "people", + "name": "rightwards hand: light skin tone", + "unicode": "1faf1-1f3fb" + }, + ":rightwards_hand_tone2:": { + "category": "people", + "name": "rightwards hand: medium-light skin tone", + "unicode": "1faf1-1f3fc" + }, + ":rightwards_hand_tone3:": { + "category": "people", + "name": "rightwards hand: medium skin tone", + "unicode": "1faf1-1f3fd" + }, + ":rightwards_hand_tone4:": { + "category": "people", + "name": "rightwards hand: medium-dark skin tone", + "unicode": "1faf1-1f3fe" + }, + ":rightwards_hand_tone5:": { + "category": "people", + "name": "rightwards hand: dark skin tone", + "unicode": "1faf1-1f3ff" + }, + ":rightwards_pushing_hand:": { + "category": "people", + "name": "rightwards pushing hand", + "unicode": "1faf8" + }, + ":rightwards_pushing_hand_tone1:": { + "category": "people", + "name": "rightwards pushing hand: light skin tone", + "unicode": "1faf8-1f3fb" + }, + ":rightwards_pushing_hand_tone2:": { + "category": "people", + "name": "rightwards pushing hand: medium-light skin tone", + "unicode": "1faf8-1f3fc" + }, + ":rightwards_pushing_hand_tone3:": { + "category": "people", + "name": "rightwards pushing hand: medium skin tone", + "unicode": "1faf8-1f3fd" + }, + ":rightwards_pushing_hand_tone4:": { + "category": "people", + "name": "rightwards pushing hand: medium-dark skin tone", + "unicode": "1faf8-1f3fe" + }, + ":rightwards_pushing_hand_tone5:": { + "category": "people", + "name": "rightwards pushing hand: dark skin tone", + "unicode": "1faf8-1f3ff" + }, + ":ring:": { + "category": "people", + "name": "ring", + "unicode": "1f48d" + }, + ":ring_buoy:": { + "category": "travel", + "name": "ring buoy", + "unicode": "1f6df" + }, + ":ringed_planet:": { + "category": "nature", + "name": "ringed planet", + "unicode": "1fa90" + }, + ":robot:": { + "category": "people", + "name": "robot", + "unicode": "1f916" + }, + ":rock:": { + "category": "nature", + "name": "rock", + "unicode": "1faa8" + }, + ":rocket:": { + "category": "travel", + "name": "rocket", + "unicode": "1f680" + }, + ":rofl:": { + "category": "people", + "name": "rolling on the floor laughing", + "unicode": "1f923" + }, + ":roll_of_paper:": { + "category": "objects", + "name": "roll of paper", + "unicode": "1f9fb" + }, + ":roller_coaster:": { + "category": "travel", + "name": "roller coaster", + "unicode": "1f3a2" + }, + ":roller_skate:": { + "category": "activity", + "name": "roller skate", + "unicode": "1f6fc" + }, + ":rolling_eyes:": { + "category": "people", + "name": "face with rolling eyes", + "unicode": "1f644" + }, + ":rooster:": { + "category": "nature", + "name": "rooster", + "unicode": "1f413" + }, + ":root_vegetable:": { + "category": "food", + "name": "root vegetable", + "unicode": "1fadc" + }, + ":rose:": { + "category": "nature", + "name": "rose", + "unicode": "1f339" + }, + ":rosette:": { + "category": "activity", + "name": "rosette", + "unicode": "1f3f5" + }, + ":rotating_light:": { + "category": "travel", + "name": "police car light", + "unicode": "1f6a8" + }, + ":round_pushpin:": { + "category": "objects", + "name": "round pushpin", + "unicode": "1f4cd" + }, + ":rugby_football:": { + "category": "activity", + "name": "rugby football", + "unicode": "1f3c9" + }, + ":running_shirt_with_sash:": { + "category": "activity", + "name": "running shirt", + "unicode": "1f3bd" + }, + ":sa:": { + "category": "symbols", + "name": "Japanese \u201cservice charge\u201d button", + "unicode": "1f202" + }, + ":safety_pin:": { + "category": "objects", + "name": "safety pin", + "unicode": "1f9f7" + }, + ":safety_vest:": { + "category": "people", + "name": "safety vest", + "unicode": "1f9ba" + }, + ":sagittarius:": { + "category": "symbols", + "name": "Sagittarius", + "unicode": "2650" + }, + ":sailboat:": { + "category": "travel", + "name": "sailboat", + "unicode": "26f5" + }, + ":sake:": { + "category": "food", + "name": "sake", + "unicode": "1f376" + }, + ":salad:": { + "category": "food", + "name": "green salad", + "unicode": "1f957" + }, + ":salt:": { + "category": "food", + "name": "salt", + "unicode": "1f9c2" + }, + ":saluting_face:": { + "category": "people", + "name": "saluting face", + "unicode": "1fae1" + }, + ":sandal:": { + "category": "people", + "name": "woman\u2019s sandal", + "unicode": "1f461" + }, + ":sandwich:": { + "category": "food", + "name": "sandwich", + "unicode": "1f96a" + }, + ":santa:": { + "category": "people", + "name": "Santa Claus", + "unicode": "1f385" + }, + ":santa_tone1:": { + "category": "people", + "name": "Santa Claus: light skin tone", + "unicode": "1f385-1f3fb" + }, + ":santa_tone2:": { + "category": "people", + "name": "Santa Claus: medium-light skin tone", + "unicode": "1f385-1f3fc" + }, + ":santa_tone3:": { + "category": "people", + "name": "Santa Claus: medium skin tone", + "unicode": "1f385-1f3fd" + }, + ":santa_tone4:": { + "category": "people", + "name": "Santa Claus: medium-dark skin tone", + "unicode": "1f385-1f3fe" + }, + ":santa_tone5:": { + "category": "people", + "name": "Santa Claus: dark skin tone", + "unicode": "1f385-1f3ff" + }, + ":sari:": { + "category": "people", + "name": "sari", + "unicode": "1f97b" + }, + ":satellite:": { + "category": "objects", + "name": "satellite antenna", + "unicode": "1f4e1" + }, + ":satellite_orbital:": { + "category": "travel", + "name": "satellite", + "unicode": "1f6f0" + }, + ":sauropod:": { + "category": "nature", + "name": "sauropod", + "unicode": "1f995" + }, + ":saxophone:": { + "category": "activity", + "name": "saxophone", + "unicode": "1f3b7" + }, + ":scales:": { + "category": "objects", + "name": "balance scale", + "unicode": "2696" + }, + ":scarf:": { + "category": "people", + "name": "scarf", + "unicode": "1f9e3" + }, + ":school:": { + "category": "travel", + "name": "school", + "unicode": "1f3eb" + }, + ":school_satchel:": { + "category": "people", + "name": "backpack", + "unicode": "1f392" + }, + ":scientist:": { + "category": "people", + "name": "scientist", + "unicode": "1f9d1-200d-1f52c" + }, + ":scientist_tone1:": { + "category": "people", + "name": "scientist: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f52c" + }, + ":scientist_tone2:": { + "category": "people", + "name": "scientist: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f52c" + }, + ":scientist_tone3:": { + "category": "people", + "name": "scientist: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f52c" + }, + ":scientist_tone4:": { + "category": "people", + "name": "scientist: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f52c" + }, + ":scientist_tone5:": { + "category": "people", + "name": "scientist: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f52c" + }, + ":scissors:": { + "category": "objects", + "name": "scissors", + "unicode": "2702" + }, + ":scooter:": { + "category": "travel", + "name": "kick scooter", + "unicode": "1f6f4" + }, + ":scorpion:": { + "category": "nature", + "name": "scorpion", + "unicode": "1f982" + }, + ":scorpius:": { + "category": "symbols", + "name": "Scorpio", + "unicode": "264f" + }, + ":scotland:": { + "category": "flags", + "name": "flag: Scotland", + "unicode": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f" + }, + ":scream:": { + "category": "people", + "name": "face screaming in fear", + "unicode": "1f631" + }, + ":scream_cat:": { + "category": "people", + "name": "weary cat", + "unicode": "1f640" + }, + ":screwdriver:": { + "category": "objects", + "name": "screwdriver", + "unicode": "1fa9b" + }, + ":scroll:": { + "category": "objects", + "name": "scroll", + "unicode": "1f4dc" + }, + ":seal:": { + "category": "nature", + "name": "seal", + "unicode": "1f9ad" + }, + ":seat:": { + "category": "travel", + "name": "seat", + "unicode": "1f4ba" + }, + ":second_place:": { + "category": "activity", + "name": "2nd place medal", + "unicode": "1f948" + }, + ":secret:": { + "category": "symbols", + "name": "Japanese \u201csecret\u201d button", + "unicode": "3299" + }, + ":see_no_evil:": { + "category": "nature", + "name": "see-no-evil monkey", + "unicode": "1f648" + }, + ":seedling:": { + "category": "nature", + "name": "seedling", + "unicode": "1f331" + }, + ":selfie:": { + "category": "people", + "name": "selfie", + "unicode": "1f933" + }, + ":selfie_tone1:": { + "category": "people", + "name": "selfie: light skin tone", + "unicode": "1f933-1f3fb" + }, + ":selfie_tone2:": { + "category": "people", + "name": "selfie: medium-light skin tone", + "unicode": "1f933-1f3fc" + }, + ":selfie_tone3:": { + "category": "people", + "name": "selfie: medium skin tone", + "unicode": "1f933-1f3fd" + }, + ":selfie_tone4:": { + "category": "people", + "name": "selfie: medium-dark skin tone", + "unicode": "1f933-1f3fe" + }, + ":selfie_tone5:": { + "category": "people", + "name": "selfie: dark skin tone", + "unicode": "1f933-1f3ff" + }, + ":service_dog:": { + "category": "nature", + "name": "service dog", + "unicode": "1f415-200d-1f9ba" + }, + ":seven:": { + "category": "symbols", + "name": "keycap: 7", + "unicode": "37-20e3", + "unicode_alt": "0037-20e3" + }, + ":sewing_needle:": { + "category": "people", + "name": "sewing needle", + "unicode": "1faa1" + }, + ":shaking_face:": { + "category": "people", + "name": "shaking face", + "unicode": "1fae8" + }, + ":shallow_pan_of_food:": { + "category": "food", + "name": "shallow pan of food", + "unicode": "1f958" + }, + ":shamrock:": { + "category": "nature", + "name": "shamrock", + "unicode": "2618" + }, + ":shark:": { + "category": "nature", + "name": "shark", + "unicode": "1f988" + }, + ":shaved_ice:": { + "category": "food", + "name": "shaved ice", + "unicode": "1f367" + }, + ":sheep:": { + "category": "nature", + "name": "ewe", + "unicode": "1f411" + }, + ":shell:": { + "category": "nature", + "name": "spiral shell", + "unicode": "1f41a" + }, + ":shibuya:": { + "category": "travel", + "name": "Shibuya 109", + "unicode": "e50a" + }, + ":shield:": { + "category": "objects", + "name": "shield", + "unicode": "1f6e1" + }, + ":shinto_shrine:": { + "category": "travel", + "name": "shinto shrine", + "unicode": "26e9" + }, + ":ship:": { + "category": "travel", + "name": "ship", + "unicode": "1f6a2" + }, + ":shirt:": { + "category": "people", + "name": "t-shirt", + "unicode": "1f455" + }, + ":shopping_bags:": { + "category": "objects", + "name": "shopping bags", + "unicode": "1f6cd" + }, + ":shopping_cart:": { + "category": "objects", + "name": "shopping cart", + "unicode": "1f6d2" + }, + ":shorts:": { + "category": "people", + "name": "shorts", + "unicode": "1fa73" + }, + ":shovel:": { + "category": "objects", + "name": "shovel", + "unicode": "1fa8f" + }, + ":shower:": { + "category": "objects", + "name": "shower", + "unicode": "1f6bf" + }, + ":shrimp:": { + "category": "nature", + "name": "shrimp", + "unicode": "1f990" + }, + ":shushing_face:": { + "category": "people", + "name": "shushing face", + "unicode": "1f92b" + }, + ":signal_strength:": { + "category": "symbols", + "name": "antenna bars", + "unicode": "1f4f6" + }, + ":singer:": { + "category": "people", + "name": "singer", + "unicode": "1f9d1-200d-1f3a4" + }, + ":singer_tone1:": { + "category": "people", + "name": "singer: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f3a4" + }, + ":singer_tone2:": { + "category": "people", + "name": "singer: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f3a4" + }, + ":singer_tone3:": { + "category": "people", + "name": "singer: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f3a4" + }, + ":singer_tone4:": { + "category": "people", + "name": "singer: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f3a4" + }, + ":singer_tone5:": { + "category": "people", + "name": "singer: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f3a4" + }, + ":six:": { + "category": "symbols", + "name": "keycap: 6", + "unicode": "36-20e3", + "unicode_alt": "0036-20e3" + }, + ":six_pointed_star:": { + "category": "symbols", + "name": "dotted six-pointed star", + "unicode": "1f52f" + }, + ":skateboard:": { + "category": "activity", + "name": "skateboard", + "unicode": "1f6f9" + }, + ":ski:": { + "category": "activity", + "name": "skis", + "unicode": "1f3bf" + }, + ":skier:": { + "category": "activity", + "name": "skier", + "unicode": "26f7" + }, + ":skier_tone1:": { + "category": "activity", + "name": "skier: light skin tone", + "unicode": "26f7-1f3fb" + }, + ":skier_tone2:": { + "category": "activity", + "name": "skier: medium-light skin tone", + "unicode": "26f7-1f3fc" + }, + ":skier_tone3:": { + "category": "activity", + "name": "skier: medium skin tone", + "unicode": "26f7-1f3fd" + }, + ":skier_tone4:": { + "category": "activity", + "name": "skier: medium-dark skin tone", + "unicode": "26f7-1f3fe" + }, + ":skier_tone5:": { + "category": "activity", + "name": "skier: dark skin tone", + "unicode": "26f7-1f3ff" + }, + ":skull:": { + "category": "people", + "name": "skull", + "unicode": "1f480" + }, + ":skull_crossbones:": { + "category": "people", + "name": "skull and crossbones", + "unicode": "2620" + }, + ":skunk:": { + "category": "nature", + "name": "skunk", + "unicode": "1f9a8" + }, + ":sled:": { + "category": "activity", + "name": "sled", + "unicode": "1f6f7" + }, + ":sleeping:": { + "category": "people", + "name": "sleeping face", + "unicode": "1f634" + }, + ":sleeping_accommodation:": { + "category": "objects", + "name": "person in bed", + "unicode": "1f6cc" + }, + ":sleepy:": { + "category": "people", + "name": "sleepy face", + "unicode": "1f62a" + }, + ":slight_frown:": { + "category": "people", + "name": "slightly frowning face", + "unicode": "1f641" + }, + ":slight_smile:": { + "category": "people", + "name": "slightly smiling face", + "unicode": "1f642" + }, + ":slot_machine:": { + "category": "activity", + "name": "slot machine", + "unicode": "1f3b0" + }, + ":sloth:": { + "category": "nature", + "name": "sloth", + "unicode": "1f9a5" + }, + ":small_blue_diamond:": { + "category": "symbols", + "name": "small blue diamond", + "unicode": "1f539" + }, + ":small_orange_diamond:": { + "category": "symbols", + "name": "small orange diamond", + "unicode": "1f538" + }, + ":small_red_triangle:": { + "category": "symbols", + "name": "red triangle pointed up", + "unicode": "1f53a" + }, + ":small_red_triangle_down:": { + "category": "symbols", + "name": "red triangle pointed down", + "unicode": "1f53b" + }, + ":smile:": { + "category": "people", + "name": "grinning face with smiling eyes", + "unicode": "1f604" + }, + ":smile_cat:": { + "category": "people", + "name": "grinning cat with smiling eyes", + "unicode": "1f638" + }, + ":smiley:": { + "category": "people", + "name": "grinning face with big eyes", + "unicode": "1f603" + }, + ":smiley_cat:": { + "category": "people", + "name": "grinning cat", + "unicode": "1f63a" + }, + ":smiling_face_with_3_hearts:": { + "category": "people", + "name": "smiling face with hearts", + "unicode": "1f970" + }, + ":smiling_face_with_tear:": { + "category": "people", + "name": "smiling face with tear", + "unicode": "1f972" + }, + ":smiling_imp:": { + "category": "people", + "name": "smiling face with horns", + "unicode": "1f608" + }, + ":smirk:": { + "category": "people", + "name": "smirking face", + "unicode": "1f60f" + }, + ":smirk_cat:": { + "category": "people", + "name": "cat with wry smile", + "unicode": "1f63c" + }, + ":smoking:": { + "category": "objects", + "name": "cigarette", + "unicode": "1f6ac" + }, + ":snail:": { + "category": "nature", + "name": "snail", + "unicode": "1f40c" + }, + ":snake:": { + "category": "nature", + "name": "snake", + "unicode": "1f40d" + }, + ":sneezing_face:": { + "category": "people", + "name": "sneezing face", + "unicode": "1f927" + }, + ":snowboarder:": { + "category": "activity", + "name": "snowboarder", + "unicode": "1f3c2" + }, + ":snowboarder_tone1:": { + "category": "activity", + "name": "snowboarder: light skin tone", + "unicode": "1f3c2-1f3fb" + }, + ":snowboarder_tone2:": { + "category": "activity", + "name": "snowboarder: medium-light skin tone", + "unicode": "1f3c2-1f3fc" + }, + ":snowboarder_tone3:": { + "category": "activity", + "name": "snowboarder: medium skin tone", + "unicode": "1f3c2-1f3fd" + }, + ":snowboarder_tone4:": { + "category": "activity", + "name": "snowboarder: medium-dark skin tone", + "unicode": "1f3c2-1f3fe" + }, + ":snowboarder_tone5:": { + "category": "activity", + "name": "snowboarder: dark skin tone", + "unicode": "1f3c2-1f3ff" + }, + ":snowflake:": { + "category": "nature", + "name": "snowflake", + "unicode": "2744" + }, + ":snowman2:": { + "category": "nature", + "name": "snowman", + "unicode": "2603" + }, + ":snowman:": { + "category": "nature", + "name": "snowman without snow", + "unicode": "26c4" + }, + ":soap:": { + "category": "objects", + "name": "soap", + "unicode": "1f9fc" + }, + ":sob:": { + "category": "people", + "name": "loudly crying face", + "unicode": "1f62d" + }, + ":soccer:": { + "category": "activity", + "name": "soccer ball", + "unicode": "26bd" + }, + ":socks:": { + "category": "people", + "name": "socks", + "unicode": "1f9e6" + }, + ":softball:": { + "category": "activity", + "name": "softball", + "unicode": "1f94e" + }, + ":soon:": { + "category": "symbols", + "name": "SOON arrow", + "unicode": "1f51c" + }, + ":sos:": { + "category": "symbols", + "name": "SOS button", + "unicode": "1f198" + }, + ":sound:": { + "category": "symbols", + "name": "speaker medium volume", + "unicode": "1f509" + }, + ":space_invader:": { + "category": "people", + "name": "alien monster", + "unicode": "1f47e" + }, + ":spades:": { + "category": "symbols", + "name": "spade suit", + "unicode": "2660" + }, + ":spaghetti:": { + "category": "food", + "name": "spaghetti", + "unicode": "1f35d" + }, + ":sparkle:": { + "category": "symbols", + "name": "sparkle", + "unicode": "2747" + }, + ":sparkler:": { + "category": "travel", + "name": "sparkler", + "unicode": "1f387" + }, + ":sparkles:": { + "category": "nature", + "name": "sparkles", + "unicode": "2728" + }, + ":sparkling_heart:": { + "category": "symbols", + "name": "sparkling heart", + "unicode": "1f496" + }, + ":speak_no_evil:": { + "category": "nature", + "name": "speak-no-evil monkey", + "unicode": "1f64a" + }, + ":speaker:": { + "category": "symbols", + "name": "speaker low volume", + "unicode": "1f508" + }, + ":speaking_head:": { + "category": "people", + "name": "speaking head", + "unicode": "1f5e3" + }, + ":speech_balloon:": { + "category": "symbols", + "name": "speech balloon", + "unicode": "1f4ac" + }, + ":speech_left:": { + "category": "symbols", + "name": "left speech bubble", + "unicode": "1f5e8" + }, + ":speedboat:": { + "category": "travel", + "name": "speedboat", + "unicode": "1f6a4" + }, + ":spider:": { + "category": "nature", + "name": "spider", + "unicode": "1f577" + }, + ":spider_web:": { + "category": "nature", + "name": "spider web", + "unicode": "1f578" + }, + ":splatter:": { + "category": "activity", + "name": "splatter", + "unicode": "1fadf" + }, + ":sponge:": { + "category": "objects", + "name": "sponge", + "unicode": "1f9fd" + }, + ":spoon:": { + "category": "food", + "name": "spoon", + "unicode": "1f944" + }, + ":squeeze_bottle:": { + "category": "objects", + "name": "lotion bottle", + "unicode": "1f9f4" + }, + ":squid:": { + "category": "nature", + "name": "squid", + "unicode": "1f991" + }, + ":stadium:": { + "category": "travel", + "name": "stadium", + "unicode": "1f3df" + }, + ":star2:": { + "category": "nature", + "name": "glowing star", + "unicode": "1f31f" + }, + ":star:": { + "category": "nature", + "name": "star", + "unicode": "2b50" + }, + ":star_and_crescent:": { + "category": "symbols", + "name": "star and crescent", + "unicode": "262a" + }, + ":star_of_david:": { + "category": "symbols", + "name": "star of David", + "unicode": "2721" + }, + ":star_struck:": { + "category": "people", + "name": "star-struck", + "unicode": "1f929" + }, + ":stars:": { + "category": "travel", + "name": "shooting star", + "unicode": "1f320" + }, + ":station:": { + "category": "travel", + "name": "station", + "unicode": "1f689" + }, + ":statue_of_liberty:": { + "category": "travel", + "name": "Statue of Liberty", + "unicode": "1f5fd" + }, + ":steam_locomotive:": { + "category": "travel", + "name": "locomotive", + "unicode": "1f682" + }, + ":stethoscope:": { + "category": "objects", + "name": "stethoscope", + "unicode": "1fa7a" + }, + ":stew:": { + "category": "food", + "name": "pot of food", + "unicode": "1f372" + }, + ":stop_button:": { + "category": "symbols", + "name": "stop button", + "unicode": "23f9" + }, + ":stopwatch:": { + "category": "objects", + "name": "stopwatch", + "unicode": "23f1" + }, + ":straight_ruler:": { + "category": "objects", + "name": "straight ruler", + "unicode": "1f4cf" + }, + ":strawberry:": { + "category": "food", + "name": "strawberry", + "unicode": "1f353" + }, + ":stuck_out_tongue:": { + "category": "people", + "name": "face with tongue", + "unicode": "1f61b" + }, + ":stuck_out_tongue_closed_eyes:": { + "category": "people", + "name": "squinting face with tongue", + "unicode": "1f61d" + }, + ":stuck_out_tongue_winking_eye:": { + "category": "people", + "name": "winking face with tongue", + "unicode": "1f61c" + }, + ":student:": { + "category": "people", + "name": "student", + "unicode": "1f9d1-200d-1f393" + }, + ":student_tone1:": { + "category": "people", + "name": "student: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f393" + }, + ":student_tone2:": { + "category": "people", + "name": "student: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f393" + }, + ":student_tone3:": { + "category": "people", + "name": "student: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f393" + }, + ":student_tone4:": { + "category": "people", + "name": "student: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f393" + }, + ":student_tone5:": { + "category": "people", + "name": "student: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f393" + }, + ":stuffed_flatbread:": { + "category": "food", + "name": "stuffed flatbread", + "unicode": "1f959" + }, + ":sun_with_face:": { + "category": "nature", + "name": "sun with face", + "unicode": "1f31e" + }, + ":sunflower:": { + "category": "nature", + "name": "sunflower", + "unicode": "1f33b" + }, + ":sunglasses:": { + "category": "people", + "name": "smiling face with sunglasses", + "unicode": "1f60e" + }, + ":sunny:": { + "category": "nature", + "name": "sun", + "unicode": "2600" + }, + ":sunrise:": { + "category": "travel", + "name": "sunrise", + "unicode": "1f305" + }, + ":sunrise_over_mountains:": { + "category": "travel", + "name": "sunrise over mountains", + "unicode": "1f304" + }, + ":superhero:": { + "category": "people", + "name": "superhero", + "unicode": "1f9b8" + }, + ":superhero_tone1:": { + "category": "people", + "name": "superhero: light skin tone", + "unicode": "1f9b8-1f3fb" + }, + ":superhero_tone2:": { + "category": "people", + "name": "superhero: medium-light skin tone", + "unicode": "1f9b8-1f3fc" + }, + ":superhero_tone3:": { + "category": "people", + "name": "superhero: medium skin tone", + "unicode": "1f9b8-1f3fd" + }, + ":superhero_tone4:": { + "category": "people", + "name": "superhero: medium-dark skin tone", + "unicode": "1f9b8-1f3fe" + }, + ":superhero_tone5:": { + "category": "people", + "name": "superhero: dark skin tone", + "unicode": "1f9b8-1f3ff" + }, + ":supervillain:": { + "category": "people", + "name": "supervillain", + "unicode": "1f9b9" + }, + ":supervillain_tone1:": { + "category": "people", + "name": "supervillain: light skin tone", + "unicode": "1f9b9-1f3fb" + }, + ":supervillain_tone2:": { + "category": "people", + "name": "supervillain: medium-light skin tone", + "unicode": "1f9b9-1f3fc" + }, + ":supervillain_tone3:": { + "category": "people", + "name": "supervillain: medium skin tone", + "unicode": "1f9b9-1f3fd" + }, + ":supervillain_tone4:": { + "category": "people", + "name": "supervillain: medium-dark skin tone", + "unicode": "1f9b9-1f3fe" + }, + ":supervillain_tone5:": { + "category": "people", + "name": "supervillain: dark skin tone", + "unicode": "1f9b9-1f3ff" + }, + ":sushi:": { + "category": "food", + "name": "sushi", + "unicode": "1f363" + }, + ":suspension_railway:": { + "category": "travel", + "name": "suspension railway", + "unicode": "1f69f" + }, + ":swan:": { + "category": "nature", + "name": "swan", + "unicode": "1f9a2" + }, + ":sweat:": { + "category": "people", + "name": "downcast face with sweat", + "unicode": "1f613" + }, + ":sweat_drops:": { + "category": "nature", + "name": "sweat droplets", + "unicode": "1f4a6" + }, + ":sweat_smile:": { + "category": "people", + "name": "grinning face with sweat", + "unicode": "1f605" + }, + ":sweet_potato:": { + "category": "food", + "name": "roasted sweet potato", + "unicode": "1f360" + }, + ":symbols:": { + "category": "symbols", + "name": "input symbols", + "unicode": "1f523" + }, + ":synagogue:": { + "category": "travel", + "name": "synagogue", + "unicode": "1f54d" + }, + ":syringe:": { + "category": "objects", + "name": "syringe", + "unicode": "1f489" + }, + ":t_rex:": { + "category": "nature", + "name": "T-Rex", + "unicode": "1f996" + }, + ":taco:": { + "category": "food", + "name": "taco", + "unicode": "1f32e" + }, + ":tada:": { + "category": "objects", + "name": "party popper", + "unicode": "1f389" + }, + ":takeout_box:": { + "category": "food", + "name": "takeout box", + "unicode": "1f961" + }, + ":tamale:": { + "category": "food", + "name": "tamale", + "unicode": "1fad4" + }, + ":tanabata_tree:": { + "category": "nature", + "name": "tanabata tree", + "unicode": "1f38b" + }, + ":tangerine:": { + "category": "food", + "name": "tangerine", + "unicode": "1f34a" + }, + ":taurus:": { + "category": "symbols", + "name": "Taurus", + "unicode": "2649" + }, + ":taxi:": { + "category": "travel", + "name": "taxi", + "unicode": "1f695" + }, + ":tea:": { + "category": "food", + "name": "teacup without handle", + "unicode": "1f375" + }, + ":teacher:": { + "category": "people", + "name": "teacher", + "unicode": "1f9d1-200d-1f3eb" + }, + ":teacher_tone1:": { + "category": "people", + "name": "teacher: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f3eb" + }, + ":teacher_tone2:": { + "category": "people", + "name": "teacher: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f3eb" + }, + ":teacher_tone3:": { + "category": "people", + "name": "teacher: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f3eb" + }, + ":teacher_tone4:": { + "category": "people", + "name": "teacher: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f3eb" + }, + ":teacher_tone5:": { + "category": "people", + "name": "teacher: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f3eb" + }, + ":teapot:": { + "category": "food", + "name": "teapot", + "unicode": "1fad6" + }, + ":technologist:": { + "category": "people", + "name": "technologist", + "unicode": "1f9d1-200d-1f4bb" + }, + ":technologist_tone1:": { + "category": "people", + "name": "technologist: light skin tone", + "unicode": "1f9d1-1f3fb-200d-1f4bb" + }, + ":technologist_tone2:": { + "category": "people", + "name": "technologist: medium-light skin tone", + "unicode": "1f9d1-1f3fc-200d-1f4bb" + }, + ":technologist_tone3:": { + "category": "people", + "name": "technologist: medium skin tone", + "unicode": "1f9d1-1f3fd-200d-1f4bb" + }, + ":technologist_tone4:": { + "category": "people", + "name": "technologist: medium-dark skin tone", + "unicode": "1f9d1-1f3fe-200d-1f4bb" + }, + ":technologist_tone5:": { + "category": "people", + "name": "technologist: dark skin tone", + "unicode": "1f9d1-1f3ff-200d-1f4bb" + }, + ":teddy_bear:": { + "category": "objects", + "name": "teddy bear", + "unicode": "1f9f8" + }, + ":telephone:": { + "category": "objects", + "name": "telephone", + "unicode": "260e" + }, + ":telephone_receiver:": { + "category": "objects", + "name": "telephone receiver", + "unicode": "1f4de" + }, + ":telescope:": { + "category": "objects", + "name": "telescope", + "unicode": "1f52d" + }, + ":tennis:": { + "category": "activity", + "name": "tennis", + "unicode": "1f3be" + }, + ":tent:": { + "category": "travel", + "name": "tent", + "unicode": "26fa" + }, + ":test_tube:": { + "category": "objects", + "name": "test tube", + "unicode": "1f9ea" + }, + ":thermometer:": { + "category": "objects", + "name": "thermometer", + "unicode": "1f321" + }, + ":thermometer_face:": { + "category": "people", + "name": "face with thermometer", + "unicode": "1f912" + }, + ":thinking:": { + "category": "people", + "name": "thinking face", + "unicode": "1f914" + }, + ":third_place:": { + "category": "activity", + "name": "3rd place medal", + "unicode": "1f949" + }, + ":thong_sandal:": { + "category": "people", + "name": "thong sandal", + "unicode": "1fa74" + }, + ":thought_balloon:": { + "category": "symbols", + "name": "thought balloon", + "unicode": "1f4ad" + }, + ":thread:": { + "category": "people", + "name": "thread", + "unicode": "1f9f5" + }, + ":three:": { + "category": "symbols", + "name": "keycap: 3", + "unicode": "33-20e3", + "unicode_alt": "0033-20e3" + }, + ":thumbsdown:": { + "category": "people", + "name": "thumbs down", + "unicode": "1f44e" + }, + ":thumbsdown_tone1:": { + "category": "people", + "name": "thumbs down: light skin tone", + "unicode": "1f44e-1f3fb" + }, + ":thumbsdown_tone2:": { + "category": "people", + "name": "thumbs down: medium-light skin tone", + "unicode": "1f44e-1f3fc" + }, + ":thumbsdown_tone3:": { + "category": "people", + "name": "thumbs down: medium skin tone", + "unicode": "1f44e-1f3fd" + }, + ":thumbsdown_tone4:": { + "category": "people", + "name": "thumbs down: medium-dark skin tone", + "unicode": "1f44e-1f3fe" + }, + ":thumbsdown_tone5:": { + "category": "people", + "name": "thumbs down: dark skin tone", + "unicode": "1f44e-1f3ff" + }, + ":thumbsup:": { + "category": "people", + "name": "thumbs up", + "unicode": "1f44d" + }, + ":thumbsup_tone1:": { + "category": "people", + "name": "thumbs up: light skin tone", + "unicode": "1f44d-1f3fb" + }, + ":thumbsup_tone2:": { + "category": "people", + "name": "thumbs up: medium-light skin tone", + "unicode": "1f44d-1f3fc" + }, + ":thumbsup_tone3:": { + "category": "people", + "name": "thumbs up: medium skin tone", + "unicode": "1f44d-1f3fd" + }, + ":thumbsup_tone4:": { + "category": "people", + "name": "thumbs up: medium-dark skin tone", + "unicode": "1f44d-1f3fe" + }, + ":thumbsup_tone5:": { + "category": "people", + "name": "thumbs up: dark skin tone", + "unicode": "1f44d-1f3ff" + }, + ":thunder_cloud_rain:": { + "category": "nature", + "name": "cloud with lightning and rain", + "unicode": "26c8" + }, + ":ticket:": { + "category": "activity", + "name": "ticket", + "unicode": "1f3ab" + }, + ":tickets:": { + "category": "activity", + "name": "admission tickets", + "unicode": "1f39f" + }, + ":tiger2:": { + "category": "nature", + "name": "tiger", + "unicode": "1f405" + }, + ":tiger:": { + "category": "nature", + "name": "tiger face", + "unicode": "1f42f" + }, + ":timer:": { + "category": "objects", + "name": "timer clock", + "unicode": "23f2" + }, + ":tired_face:": { + "category": "people", + "name": "tired face", + "unicode": "1f62b" + }, + ":tm:": { + "category": "symbols", + "name": "trade mark", + "unicode": "2122" + }, + ":toilet:": { + "category": "objects", + "name": "toilet", + "unicode": "1f6bd" + }, + ":tokyo_tower:": { + "category": "travel", + "name": "Tokyo tower", + "unicode": "1f5fc" + }, + ":tomato:": { + "category": "food", + "name": "tomato", + "unicode": "1f345" + }, + ":tone1:": { + "category": "modifier", + "name": "light skin tone", + "unicode": "1f3fb" + }, + ":tone2:": { + "category": "modifier", + "name": "medium-light skin tone", + "unicode": "1f3fc" + }, + ":tone3:": { + "category": "modifier", + "name": "medium skin tone", + "unicode": "1f3fd" + }, + ":tone4:": { + "category": "modifier", + "name": "medium-dark skin tone", + "unicode": "1f3fe" + }, + ":tone5:": { + "category": "modifier", + "name": "dark skin tone", + "unicode": "1f3ff" + }, + ":tongue:": { + "category": "people", + "name": "tongue", + "unicode": "1f445" + }, + ":toolbox:": { + "category": "objects", + "name": "toolbox", + "unicode": "1f9f0" + }, + ":tools:": { + "category": "objects", + "name": "hammer and wrench", + "unicode": "1f6e0" + }, + ":tooth:": { + "category": "people", + "name": "tooth", + "unicode": "1f9b7" + }, + ":toothbrush:": { + "category": "objects", + "name": "toothbrush", + "unicode": "1faa5" + }, + ":top:": { + "category": "symbols", + "name": "TOP arrow", + "unicode": "1f51d" + }, + ":tophat:": { + "category": "people", + "name": "top hat", + "unicode": "1f3a9" + }, + ":track_next:": { + "category": "symbols", + "name": "next track button", + "unicode": "23ed" + }, + ":track_previous:": { + "category": "symbols", + "name": "last track button", + "unicode": "23ee" + }, + ":trackball:": { + "category": "objects", + "name": "trackball", + "unicode": "1f5b2" + }, + ":tractor:": { + "category": "travel", + "name": "tractor", + "unicode": "1f69c" + }, + ":traffic_light:": { + "category": "travel", + "name": "horizontal traffic light", + "unicode": "1f6a5" + }, + ":train2:": { + "category": "travel", + "name": "train", + "unicode": "1f686" + }, + ":train:": { + "category": "travel", + "name": "tram car", + "unicode": "1f68b" + }, + ":tram:": { + "category": "travel", + "name": "tram", + "unicode": "1f68a" + }, + ":transgender_flag:": { + "category": "flags", + "name": "transgender flag", + "unicode": "1f3f3-fe0f-200d-26a7-fe0f" + }, + ":transgender_symbol:": { + "category": "symbols", + "name": "transgender symbol", + "unicode": "26a7" + }, + ":triangular_flag_on_post:": { + "category": "flags", + "name": "triangular flag", + "unicode": "1f6a9" + }, + ":triangular_ruler:": { + "category": "objects", + "name": "triangular ruler", + "unicode": "1f4d0" + }, + ":trident:": { + "category": "symbols", + "name": "trident emblem", + "unicode": "1f531" + }, + ":triumph:": { + "category": "people", + "name": "face with steam from nose", + "unicode": "1f624" + }, + ":troll:": { + "category": "people", + "name": "troll", + "unicode": "1f9cc" + }, + ":trolleybus:": { + "category": "travel", + "name": "trolleybus", + "unicode": "1f68e" + }, + ":trophy:": { + "category": "activity", + "name": "trophy", + "unicode": "1f3c6" + }, + ":tropical_drink:": { + "category": "food", + "name": "tropical drink", + "unicode": "1f379" + }, + ":tropical_fish:": { + "category": "nature", + "name": "tropical fish", + "unicode": "1f420" + }, + ":truck:": { + "category": "travel", + "name": "delivery truck", + "unicode": "1f69a" + }, + ":trumpet:": { + "category": "activity", + "name": "trumpet", + "unicode": "1f3ba" + }, + ":tulip:": { + "category": "nature", + "name": "tulip", + "unicode": "1f337" + }, + ":tumbler_glass:": { + "category": "food", + "name": "tumbler glass", + "unicode": "1f943" + }, + ":turkey:": { + "category": "nature", + "name": "turkey", + "unicode": "1f983" + }, + ":turtle:": { + "category": "nature", + "name": "turtle", + "unicode": "1f422" + }, + ":tv:": { + "category": "objects", + "name": "television", + "unicode": "1f4fa" + }, + ":twisted_rightwards_arrows:": { + "category": "symbols", + "name": "shuffle tracks button", + "unicode": "1f500" + }, + ":two:": { + "category": "symbols", + "name": "keycap: 2", + "unicode": "32-20e3", + "unicode_alt": "0032-20e3" + }, + ":two_hearts:": { + "category": "symbols", + "name": "two hearts", + "unicode": "1f495" + }, + ":two_men_holding_hands:": { + "category": "people", + "name": "men holding hands", + "unicode": "1f46c" + }, + ":two_women_holding_hands:": { + "category": "people", + "name": "women holding hands", + "unicode": "1f46d" + }, + ":u5272:": { + "category": "symbols", + "name": "Japanese \u201cdiscount\u201d button", + "unicode": "1f239" + }, + ":u5408:": { + "category": "symbols", + "name": "Japanese \u201cpassing grade\u201d button", + "unicode": "1f234" + }, + ":u55b6:": { + "category": "symbols", + "name": "Japanese \u201copen for business\u201d button", + "unicode": "1f23a" + }, + ":u6307:": { + "category": "symbols", + "name": "Japanese \u201creserved\u201d button", + "unicode": "1f22f" + }, + ":u6708:": { + "category": "symbols", + "name": "Japanese \u201cmonthly amount\u201d button", + "unicode": "1f237" + }, + ":u6709:": { + "category": "symbols", + "name": "Japanese \u201cnot free of charge\u201d button", + "unicode": "1f236" + }, + ":u6e80:": { + "category": "symbols", + "name": "Japanese \u201cno vacancy\u201d button", + "unicode": "1f235" + }, + ":u7121:": { + "category": "symbols", + "name": "Japanese \u201cfree of charge\u201d button", + "unicode": "1f21a" + }, + ":u7533:": { + "category": "symbols", + "name": "Japanese \u201capplication\u201d button", + "unicode": "1f238" + }, + ":u7981:": { + "category": "symbols", + "name": "Japanese \u201cprohibited\u201d button", + "unicode": "1f232" + }, + ":u7a7a:": { + "category": "symbols", + "name": "Japanese \u201cvacancy\u201d button", + "unicode": "1f233" + }, + ":umbrella2:": { + "category": "nature", + "name": "umbrella", + "unicode": "2602" + }, + ":umbrella:": { + "category": "nature", + "name": "umbrella with rain drops", + "unicode": "2614" + }, + ":unamused:": { + "category": "people", + "name": "unamused face", + "unicode": "1f612" + }, + ":underage:": { + "category": "symbols", + "name": "no one under eighteen", + "unicode": "1f51e" + }, + ":unicorn:": { + "category": "nature", + "name": "unicorn", + "unicode": "1f984" + }, + ":united_nations:": { + "category": "flags", + "name": "flag: United Nations", + "unicode": "1f1fa-1f1f3" + }, + ":unlock:": { + "category": "objects", + "name": "unlocked", + "unicode": "1f513" + }, + ":up:": { + "category": "symbols", + "name": "UP! button", + "unicode": "1f199" + }, + ":upside_down:": { + "category": "people", + "name": "upside-down face", + "unicode": "1f643" + }, + ":urn:": { + "category": "objects", + "name": "funeral urn", + "unicode": "26b1" + }, + ":v:": { + "category": "people", + "name": "victory hand", + "unicode": "270c" + }, + ":v_tone1:": { + "category": "people", + "name": "victory hand: light skin tone", + "unicode": "270c-1f3fb" + }, + ":v_tone2:": { + "category": "people", + "name": "victory hand: medium-light skin tone", + "unicode": "270c-1f3fc" + }, + ":v_tone3:": { + "category": "people", + "name": "victory hand: medium skin tone", + "unicode": "270c-1f3fd" + }, + ":v_tone4:": { + "category": "people", + "name": "victory hand: medium-dark skin tone", + "unicode": "270c-1f3fe" + }, + ":v_tone5:": { + "category": "people", + "name": "victory hand: dark skin tone", + "unicode": "270c-1f3ff" + }, + ":vampire:": { + "category": "people", + "name": "vampire", + "unicode": "1f9db" + }, + ":vampire_tone1:": { + "category": "people", + "name": "vampire: light skin tone", + "unicode": "1f9db-1f3fb" + }, + ":vampire_tone2:": { + "category": "people", + "name": "vampire: medium-light skin tone", + "unicode": "1f9db-1f3fc" + }, + ":vampire_tone3:": { + "category": "people", + "name": "vampire: medium skin tone", + "unicode": "1f9db-1f3fd" + }, + ":vampire_tone4:": { + "category": "people", + "name": "vampire: medium-dark skin tone", + "unicode": "1f9db-1f3fe" + }, + ":vampire_tone5:": { + "category": "people", + "name": "vampire: dark skin tone", + "unicode": "1f9db-1f3ff" + }, + ":vertical_traffic_light:": { + "category": "travel", + "name": "vertical traffic light", + "unicode": "1f6a6" + }, + ":vhs:": { + "category": "objects", + "name": "videocassette", + "unicode": "1f4fc" + }, + ":vibration_mode:": { + "category": "symbols", + "name": "vibration mode", + "unicode": "1f4f3" + }, + ":video_camera:": { + "category": "objects", + "name": "video camera", + "unicode": "1f4f9" + }, + ":video_game:": { + "category": "activity", + "name": "video game", + "unicode": "1f3ae" + }, + ":violin:": { + "category": "activity", + "name": "violin", + "unicode": "1f3bb" + }, + ":virgo:": { + "category": "symbols", + "name": "Virgo", + "unicode": "264d" + }, + ":volcano:": { + "category": "travel", + "name": "volcano", + "unicode": "1f30b" + }, + ":volleyball:": { + "category": "activity", + "name": "volleyball", + "unicode": "1f3d0" + }, + ":vs:": { + "category": "symbols", + "name": "VS button", + "unicode": "1f19a" + }, + ":vulcan:": { + "category": "people", + "name": "vulcan salute", + "unicode": "1f596" + }, + ":vulcan_tone1:": { + "category": "people", + "name": "vulcan salute: light skin tone", + "unicode": "1f596-1f3fb" + }, + ":vulcan_tone2:": { + "category": "people", + "name": "vulcan salute: medium-light skin tone", + "unicode": "1f596-1f3fc" + }, + ":vulcan_tone3:": { + "category": "people", + "name": "vulcan salute: medium skin tone", + "unicode": "1f596-1f3fd" + }, + ":vulcan_tone4:": { + "category": "people", + "name": "vulcan salute: medium-dark skin tone", + "unicode": "1f596-1f3fe" + }, + ":vulcan_tone5:": { + "category": "people", + "name": "vulcan salute: dark skin tone", + "unicode": "1f596-1f3ff" + }, + ":waffle:": { + "category": "food", + "name": "waffle", + "unicode": "1f9c7" + }, + ":wales:": { + "category": "flags", + "name": "flag: Wales", + "unicode": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f" + }, + ":waning_crescent_moon:": { + "category": "nature", + "name": "waning crescent moon", + "unicode": "1f318" + }, + ":waning_gibbous_moon:": { + "category": "nature", + "name": "waning gibbous moon", + "unicode": "1f316" + }, + ":warning:": { + "category": "symbols", + "name": "warning", + "unicode": "26a0" + }, + ":wastebasket:": { + "category": "objects", + "name": "wastebasket", + "unicode": "1f5d1" + }, + ":watch:": { + "category": "objects", + "name": "watch", + "unicode": "231a" + }, + ":water_buffalo:": { + "category": "nature", + "name": "water buffalo", + "unicode": "1f403" + }, + ":watermelon:": { + "category": "food", + "name": "watermelon", + "unicode": "1f349" + }, + ":wave:": { + "category": "people", + "name": "waving hand", + "unicode": "1f44b" + }, + ":wave_tone1:": { + "category": "people", + "name": "waving hand: light skin tone", + "unicode": "1f44b-1f3fb" + }, + ":wave_tone2:": { + "category": "people", + "name": "waving hand: medium-light skin tone", + "unicode": "1f44b-1f3fc" + }, + ":wave_tone3:": { + "category": "people", + "name": "waving hand: medium skin tone", + "unicode": "1f44b-1f3fd" + }, + ":wave_tone4:": { + "category": "people", + "name": "waving hand: medium-dark skin tone", + "unicode": "1f44b-1f3fe" + }, + ":wave_tone5:": { + "category": "people", + "name": "waving hand: dark skin tone", + "unicode": "1f44b-1f3ff" + }, + ":wavy_dash:": { + "category": "symbols", + "name": "wavy dash", + "unicode": "3030" + }, + ":waxing_crescent_moon:": { + "category": "nature", + "name": "waxing crescent moon", + "unicode": "1f312" + }, + ":waxing_gibbous_moon:": { + "category": "nature", + "name": "waxing gibbous moon", + "unicode": "1f314" + }, + ":wc:": { + "category": "symbols", + "name": "water closet", + "unicode": "1f6be" + }, + ":weary:": { + "category": "people", + "name": "weary face", + "unicode": "1f629" + }, + ":wedding:": { + "category": "travel", + "name": "wedding", + "unicode": "1f492" + }, + ":whale2:": { + "category": "nature", + "name": "whale", + "unicode": "1f40b" + }, + ":whale:": { + "category": "nature", + "name": "spouting whale", + "unicode": "1f433" + }, + ":wheel:": { + "category": "travel", + "name": "wheel", + "unicode": "1f6de" + }, + ":wheel_of_dharma:": { + "category": "symbols", + "name": "wheel of dharma", + "unicode": "2638" + }, + ":wheelchair:": { + "category": "symbols", + "name": "wheelchair symbol", + "unicode": "267f" + }, + ":white_check_mark:": { + "category": "symbols", + "name": "check mark button", + "unicode": "2705" + }, + ":white_circle:": { + "category": "symbols", + "name": "white circle", + "unicode": "26aa" + }, + ":white_flower:": { + "category": "symbols", + "name": "white flower", + "unicode": "1f4ae" + }, + ":white_haired:": { + "category": "people", + "name": "white hair", + "unicode": "1f9b3" + }, + ":white_heart:": { + "category": "symbols", + "name": "white heart", + "unicode": "1f90d" + }, + ":white_large_square:": { + "category": "symbols", + "name": "white large square", + "unicode": "2b1c" + }, + ":white_medium_small_square:": { + "category": "symbols", + "name": "white medium-small square", + "unicode": "25fd" + }, + ":white_medium_square:": { + "category": "symbols", + "name": "white medium square", + "unicode": "25fb" + }, + ":white_small_square:": { + "category": "symbols", + "name": "white small square", + "unicode": "25ab" + }, + ":white_square_button:": { + "category": "symbols", + "name": "white square button", + "unicode": "1f533" + }, + ":white_sun_cloud:": { + "category": "nature", + "name": "sun behind large cloud", + "unicode": "1f325" + }, + ":white_sun_rain_cloud:": { + "category": "nature", + "name": "sun behind rain cloud", + "unicode": "1f326" + }, + ":white_sun_small_cloud:": { + "category": "nature", + "name": "sun behind small cloud", + "unicode": "1f324" + }, + ":wilted_rose:": { + "category": "nature", + "name": "wilted flower", + "unicode": "1f940" + }, + ":wind_blowing_face:": { + "category": "nature", + "name": "wind face", + "unicode": "1f32c" + }, + ":wind_chime:": { + "category": "objects", + "name": "wind chime", + "unicode": "1f390" + }, + ":window:": { + "category": "objects", + "name": "window", + "unicode": "1fa9f" + }, + ":wine_glass:": { + "category": "food", + "name": "wine glass", + "unicode": "1f377" + }, + ":wing:": { + "category": "nature", + "name": "wing", + "unicode": "1fabd" + }, + ":wink:": { + "category": "people", + "name": "winking face", + "unicode": "1f609" + }, + ":wireless:": { + "category": "symbols", + "name": "wireless", + "unicode": "1f6dc" + }, + ":wolf:": { + "category": "nature", + "name": "wolf", + "unicode": "1f43a" + }, + ":woman:": { + "category": "people", + "name": "woman", + "unicode": "1f469" + }, + ":woman_and_man_holding_hands_tone1:": { + "category": "people", + "name": "woman and man holding hands: light skin tone", + "unicode": "1f46b-1f3fb" + }, + ":woman_and_man_holding_hands_tone1_tone2:": { + "category": "people", + "name": "woman and man holding hands: light skin tone, medium light skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc" + }, + ":woman_and_man_holding_hands_tone1_tone3:": { + "category": "people", + "name": "woman and man holding hands: light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd" + }, + ":woman_and_man_holding_hands_tone1_tone4:": { + "category": "people", + "name": "woman and man holding hands: light skin tone, medium dark skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe" + }, + ":woman_and_man_holding_hands_tone1_tone5:": { + "category": "people", + "name": "woman and man holding hands: light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff" + }, + ":woman_and_man_holding_hands_tone2:": { + "category": "people", + "name": "woman and man holding hands: medium-light skin tone", + "unicode": "1f46b-1f3fc" + }, + ":woman_and_man_holding_hands_tone2_tone1:": { + "category": "people", + "name": "woman and man holding hands: medium light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb" + }, + ":woman_and_man_holding_hands_tone2_tone3:": { + "category": "people", + "name": "woman and man holding hands: medium light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd" + }, + ":woman_and_man_holding_hands_tone2_tone4:": { + "category": "people", + "name": "woman and man holding hands: medium light skin tone, medium dark skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe" + }, + ":woman_and_man_holding_hands_tone2_tone5:": { + "category": "people", + "name": "woman and man holding hands: medium light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff" + }, + ":woman_and_man_holding_hands_tone3:": { + "category": "people", + "name": "woman and man holding hands: medium skin tone", + "unicode": "1f46b-1f3fd" + }, + ":woman_and_man_holding_hands_tone3_tone1:": { + "category": "people", + "name": "woman and man holding hands: medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb" + }, + ":woman_and_man_holding_hands_tone3_tone2:": { + "category": "people", + "name": "woman and man holding hands: medium skin tone, medium light skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc" + }, + ":woman_and_man_holding_hands_tone3_tone4:": { + "category": "people", + "name": "woman and man holding hands: medium skin tone, medium dark skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe" + }, + ":woman_and_man_holding_hands_tone3_tone5:": { + "category": "people", + "name": "woman and man holding hands: medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff" + }, + ":woman_and_man_holding_hands_tone4:": { + "category": "people", + "name": "woman and man holding hands: medium-dark skin tone", + "unicode": "1f46b-1f3fe" + }, + ":woman_and_man_holding_hands_tone4_tone1:": { + "category": "people", + "name": "woman and man holding hands: medium dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb" + }, + ":woman_and_man_holding_hands_tone4_tone2:": { + "category": "people", + "name": "woman and man holding hands: medium dark skin tone, medium light skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc" + }, + ":woman_and_man_holding_hands_tone4_tone3:": { + "category": "people", + "name": "woman and man holding hands: medium dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd" + }, + ":woman_and_man_holding_hands_tone4_tone5:": { + "category": "people", + "name": "woman and man holding hands: medium dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff" + }, + ":woman_and_man_holding_hands_tone5:": { + "category": "people", + "name": "woman and man holding hands: dark skin tone", + "unicode": "1f46b-1f3ff" + }, + ":woman_and_man_holding_hands_tone5_tone1:": { + "category": "people", + "name": "woman and man holding hands: dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb" + }, + ":woman_and_man_holding_hands_tone5_tone2:": { + "category": "people", + "name": "woman and man holding hands: dark skin tone, medium light skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc" + }, + ":woman_and_man_holding_hands_tone5_tone3:": { + "category": "people", + "name": "woman and man holding hands: dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd" + }, + ":woman_and_man_holding_hands_tone5_tone4:": { + "category": "people", + "name": "woman and man holding hands: dark skin tone, medium dark skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe" + }, + ":woman_artist:": { + "category": "people", + "name": "woman artist", + "unicode": "1f469-200d-1f3a8" + }, + ":woman_artist_tone1:": { + "category": "people", + "name": "woman artist: light skin tone", + "unicode": "1f469-1f3fb-200d-1f3a8" + }, + ":woman_artist_tone2:": { + "category": "people", + "name": "woman artist: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f3a8" + }, + ":woman_artist_tone3:": { + "category": "people", + "name": "woman artist: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f3a8" + }, + ":woman_artist_tone4:": { + "category": "people", + "name": "woman artist: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f3a8" + }, + ":woman_artist_tone5:": { + "category": "people", + "name": "woman artist: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f3a8" + }, + ":woman_astronaut:": { + "category": "people", + "name": "woman astronaut", + "unicode": "1f469-200d-1f680" + }, + ":woman_astronaut_tone1:": { + "category": "people", + "name": "woman astronaut: light skin tone", + "unicode": "1f469-1f3fb-200d-1f680" + }, + ":woman_astronaut_tone2:": { + "category": "people", + "name": "woman astronaut: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f680" + }, + ":woman_astronaut_tone3:": { + "category": "people", + "name": "woman astronaut: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f680" + }, + ":woman_astronaut_tone4:": { + "category": "people", + "name": "woman astronaut: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f680" + }, + ":woman_astronaut_tone5:": { + "category": "people", + "name": "woman astronaut: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f680" + }, + ":woman_bald:": { + "category": "people", + "name": "woman: bald", + "unicode": "1f469-200d-1f9b2" + }, + ":woman_bald_tone1:": { + "category": "people", + "name": "woman, bald: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9b2" + }, + ":woman_bald_tone2:": { + "category": "people", + "name": "woman, bald: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9b2" + }, + ":woman_bald_tone3:": { + "category": "people", + "name": "woman, bald: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9b2" + }, + ":woman_bald_tone4:": { + "category": "people", + "name": "woman, bald: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9b2" + }, + ":woman_bald_tone5:": { + "category": "people", + "name": "woman, bald: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9b2" + }, + ":woman_beard:": { + "category": "people", + "name": "woman: beard", + "unicode": "1f9d4-200d-2640-fe0f" + }, + ":woman_biking:": { + "category": "activity", + "name": "woman biking", + "unicode": "1f6b4-200d-2640-fe0f" + }, + ":woman_biking_tone1:": { + "category": "activity", + "name": "woman biking: light skin tone", + "unicode": "1f6b4-1f3fb-200d-2640-fe0f" + }, + ":woman_biking_tone2:": { + "category": "activity", + "name": "woman biking: medium-light skin tone", + "unicode": "1f6b4-1f3fc-200d-2640-fe0f" + }, + ":woman_biking_tone3:": { + "category": "activity", + "name": "woman biking: medium skin tone", + "unicode": "1f6b4-1f3fd-200d-2640-fe0f" + }, + ":woman_biking_tone4:": { + "category": "activity", + "name": "woman biking: medium-dark skin tone", + "unicode": "1f6b4-1f3fe-200d-2640-fe0f" + }, + ":woman_biking_tone5:": { + "category": "activity", + "name": "woman biking: dark skin tone", + "unicode": "1f6b4-1f3ff-200d-2640-fe0f" + }, + ":woman_bouncing_ball:": { + "category": "activity", + "name": "woman bouncing ball", + "unicode": "26f9-fe0f-200d-2640-fe0f" + }, + ":woman_bouncing_ball_tone1:": { + "category": "activity", + "name": "woman bouncing ball: light skin tone", + "unicode": "26f9-1f3fb-200d-2640-fe0f" + }, + ":woman_bouncing_ball_tone2:": { + "category": "activity", + "name": "woman bouncing ball: medium-light skin tone", + "unicode": "26f9-1f3fc-200d-2640-fe0f" + }, + ":woman_bouncing_ball_tone3:": { + "category": "activity", + "name": "woman bouncing ball: medium skin tone", + "unicode": "26f9-1f3fd-200d-2640-fe0f" + }, + ":woman_bouncing_ball_tone4:": { + "category": "activity", + "name": "woman bouncing ball: medium-dark skin tone", + "unicode": "26f9-1f3fe-200d-2640-fe0f" + }, + ":woman_bouncing_ball_tone5:": { + "category": "activity", + "name": "woman bouncing ball: dark skin tone", + "unicode": "26f9-1f3ff-200d-2640-fe0f" + }, + ":woman_bowing:": { + "category": "people", + "name": "woman bowing", + "unicode": "1f647-200d-2640-fe0f" + }, + ":woman_bowing_tone1:": { + "category": "people", + "name": "woman bowing: light skin tone", + "unicode": "1f647-1f3fb-200d-2640-fe0f" + }, + ":woman_bowing_tone2:": { + "category": "people", + "name": "woman bowing: medium-light skin tone", + "unicode": "1f647-1f3fc-200d-2640-fe0f" + }, + ":woman_bowing_tone3:": { + "category": "people", + "name": "woman bowing: medium skin tone", + "unicode": "1f647-1f3fd-200d-2640-fe0f" + }, + ":woman_bowing_tone4:": { + "category": "people", + "name": "woman bowing: medium-dark skin tone", + "unicode": "1f647-1f3fe-200d-2640-fe0f" + }, + ":woman_bowing_tone5:": { + "category": "people", + "name": "woman bowing: dark skin tone", + "unicode": "1f647-1f3ff-200d-2640-fe0f" + }, + ":woman_cartwheeling:": { + "category": "activity", + "name": "woman cartwheeling", + "unicode": "1f938-200d-2640-fe0f" + }, + ":woman_cartwheeling_tone1:": { + "category": "activity", + "name": "woman cartwheeling: light skin tone", + "unicode": "1f938-1f3fb-200d-2640-fe0f" + }, + ":woman_cartwheeling_tone2:": { + "category": "activity", + "name": "woman cartwheeling: medium-light skin tone", + "unicode": "1f938-1f3fc-200d-2640-fe0f" + }, + ":woman_cartwheeling_tone3:": { + "category": "activity", + "name": "woman cartwheeling: medium skin tone", + "unicode": "1f938-1f3fd-200d-2640-fe0f" + }, + ":woman_cartwheeling_tone4:": { + "category": "activity", + "name": "woman cartwheeling: medium-dark skin tone", + "unicode": "1f938-1f3fe-200d-2640-fe0f" + }, + ":woman_cartwheeling_tone5:": { + "category": "activity", + "name": "woman cartwheeling: dark skin tone", + "unicode": "1f938-1f3ff-200d-2640-fe0f" + }, + ":woman_climbing:": { + "category": "activity", + "name": "woman climbing", + "unicode": "1f9d7-200d-2640-fe0f" + }, + ":woman_climbing_tone1:": { + "category": "activity", + "name": "woman climbing: light skin tone", + "unicode": "1f9d7-1f3fb-200d-2640-fe0f" + }, + ":woman_climbing_tone2:": { + "category": "activity", + "name": "woman climbing: medium-light skin tone", + "unicode": "1f9d7-1f3fc-200d-2640-fe0f" + }, + ":woman_climbing_tone3:": { + "category": "activity", + "name": "woman climbing: medium skin tone", + "unicode": "1f9d7-1f3fd-200d-2640-fe0f" + }, + ":woman_climbing_tone4:": { + "category": "activity", + "name": "woman climbing: medium-dark skin tone", + "unicode": "1f9d7-1f3fe-200d-2640-fe0f" + }, + ":woman_climbing_tone5:": { + "category": "activity", + "name": "woman climbing: dark skin tone", + "unicode": "1f9d7-1f3ff-200d-2640-fe0f" + }, + ":woman_construction_worker:": { + "category": "people", + "name": "woman construction worker", + "unicode": "1f477-200d-2640-fe0f" + }, + ":woman_construction_worker_tone1:": { + "category": "people", + "name": "woman construction worker: light skin tone", + "unicode": "1f477-1f3fb-200d-2640-fe0f" + }, + ":woman_construction_worker_tone2:": { + "category": "people", + "name": "woman construction worker: medium-light skin tone", + "unicode": "1f477-1f3fc-200d-2640-fe0f" + }, + ":woman_construction_worker_tone3:": { + "category": "people", + "name": "woman construction worker: medium skin tone", + "unicode": "1f477-1f3fd-200d-2640-fe0f" + }, + ":woman_construction_worker_tone4:": { + "category": "people", + "name": "woman construction worker: medium-dark skin tone", + "unicode": "1f477-1f3fe-200d-2640-fe0f" + }, + ":woman_construction_worker_tone5:": { + "category": "people", + "name": "woman construction worker: dark skin tone", + "unicode": "1f477-1f3ff-200d-2640-fe0f" + }, + ":woman_cook:": { + "category": "people", + "name": "woman cook", + "unicode": "1f469-200d-1f373" + }, + ":woman_cook_tone1:": { + "category": "people", + "name": "woman cook: light skin tone", + "unicode": "1f469-1f3fb-200d-1f373" + }, + ":woman_cook_tone2:": { + "category": "people", + "name": "woman cook: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f373" + }, + ":woman_cook_tone3:": { + "category": "people", + "name": "woman cook: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f373" + }, + ":woman_cook_tone4:": { + "category": "people", + "name": "woman cook: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f373" + }, + ":woman_cook_tone5:": { + "category": "people", + "name": "woman cook: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f373" + }, + ":woman_curly_haired:": { + "category": "people", + "name": "woman: curly hair", + "unicode": "1f469-200d-1f9b1" + }, + ":woman_curly_haired_tone1:": { + "category": "people", + "name": "woman, curly haired: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9b1" + }, + ":woman_curly_haired_tone2:": { + "category": "people", + "name": "woman, curly haired: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9b1" + }, + ":woman_curly_haired_tone3:": { + "category": "people", + "name": "woman, curly haired: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9b1" + }, + ":woman_curly_haired_tone4:": { + "category": "people", + "name": "woman, curly haired: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9b1" + }, + ":woman_curly_haired_tone5:": { + "category": "people", + "name": "woman, curly haired: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9b1" + }, + ":woman_detective:": { + "category": "people", + "name": "woman detective", + "unicode": "1f575-fe0f-200d-2640-fe0f" + }, + ":woman_detective_tone1:": { + "category": "people", + "name": "woman detective: light skin tone", + "unicode": "1f575-1f3fb-200d-2640-fe0f" + }, + ":woman_detective_tone2:": { + "category": "people", + "name": "woman detective: medium-light skin tone", + "unicode": "1f575-1f3fc-200d-2640-fe0f" + }, + ":woman_detective_tone3:": { + "category": "people", + "name": "woman detective: medium skin tone", + "unicode": "1f575-1f3fd-200d-2640-fe0f" + }, + ":woman_detective_tone4:": { + "category": "people", + "name": "woman detective: medium-dark skin tone", + "unicode": "1f575-1f3fe-200d-2640-fe0f" + }, + ":woman_detective_tone5:": { + "category": "people", + "name": "woman detective: dark skin tone", + "unicode": "1f575-1f3ff-200d-2640-fe0f" + }, + ":woman_elf:": { + "category": "people", + "name": "woman elf", + "unicode": "1f9dd-200d-2640-fe0f" + }, + ":woman_elf_tone1:": { + "category": "people", + "name": "woman elf: light skin tone", + "unicode": "1f9dd-1f3fb-200d-2640-fe0f" + }, + ":woman_elf_tone2:": { + "category": "people", + "name": "woman elf: medium-light skin tone", + "unicode": "1f9dd-1f3fc-200d-2640-fe0f" + }, + ":woman_elf_tone3:": { + "category": "people", + "name": "woman elf: medium skin tone", + "unicode": "1f9dd-1f3fd-200d-2640-fe0f" + }, + ":woman_elf_tone4:": { + "category": "people", + "name": "woman elf: medium-dark skin tone", + "unicode": "1f9dd-1f3fe-200d-2640-fe0f" + }, + ":woman_elf_tone5:": { + "category": "people", + "name": "woman elf: dark skin tone", + "unicode": "1f9dd-1f3ff-200d-2640-fe0f" + }, + ":woman_facepalming:": { + "category": "people", + "name": "woman facepalming", + "unicode": "1f926-200d-2640-fe0f" + }, + ":woman_facepalming_tone1:": { + "category": "people", + "name": "woman facepalming: light skin tone", + "unicode": "1f926-1f3fb-200d-2640-fe0f" + }, + ":woman_facepalming_tone2:": { + "category": "people", + "name": "woman facepalming: medium-light skin tone", + "unicode": "1f926-1f3fc-200d-2640-fe0f" + }, + ":woman_facepalming_tone3:": { + "category": "people", + "name": "woman facepalming: medium skin tone", + "unicode": "1f926-1f3fd-200d-2640-fe0f" + }, + ":woman_facepalming_tone4:": { + "category": "people", + "name": "woman facepalming: medium-dark skin tone", + "unicode": "1f926-1f3fe-200d-2640-fe0f" + }, + ":woman_facepalming_tone5:": { + "category": "people", + "name": "woman facepalming: dark skin tone", + "unicode": "1f926-1f3ff-200d-2640-fe0f" + }, + ":woman_factory_worker:": { + "category": "people", + "name": "woman factory worker", + "unicode": "1f469-200d-1f3ed" + }, + ":woman_factory_worker_tone1:": { + "category": "people", + "name": "woman factory worker: light skin tone", + "unicode": "1f469-1f3fb-200d-1f3ed" + }, + ":woman_factory_worker_tone2:": { + "category": "people", + "name": "woman factory worker: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f3ed" + }, + ":woman_factory_worker_tone3:": { + "category": "people", + "name": "woman factory worker: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f3ed" + }, + ":woman_factory_worker_tone4:": { + "category": "people", + "name": "woman factory worker: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f3ed" + }, + ":woman_factory_worker_tone5:": { + "category": "people", + "name": "woman factory worker: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f3ed" + }, + ":woman_fairy:": { + "category": "people", + "name": "woman fairy", + "unicode": "1f9da-200d-2640-fe0f" + }, + ":woman_fairy_tone1:": { + "category": "people", + "name": "woman fairy: light skin tone", + "unicode": "1f9da-1f3fb-200d-2640-fe0f" + }, + ":woman_fairy_tone2:": { + "category": "people", + "name": "woman fairy: medium-light skin tone", + "unicode": "1f9da-1f3fc-200d-2640-fe0f" + }, + ":woman_fairy_tone3:": { + "category": "people", + "name": "woman fairy: medium skin tone", + "unicode": "1f9da-1f3fd-200d-2640-fe0f" + }, + ":woman_fairy_tone4:": { + "category": "people", + "name": "woman fairy: medium-dark skin tone", + "unicode": "1f9da-1f3fe-200d-2640-fe0f" + }, + ":woman_fairy_tone5:": { + "category": "people", + "name": "woman fairy: dark skin tone", + "unicode": "1f9da-1f3ff-200d-2640-fe0f" + }, + ":woman_farmer:": { + "category": "people", + "name": "woman farmer", + "unicode": "1f469-200d-1f33e" + }, + ":woman_farmer_tone1:": { + "category": "people", + "name": "woman farmer: light skin tone", + "unicode": "1f469-1f3fb-200d-1f33e" + }, + ":woman_farmer_tone2:": { + "category": "people", + "name": "woman farmer: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f33e" + }, + ":woman_farmer_tone3:": { + "category": "people", + "name": "woman farmer: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f33e" + }, + ":woman_farmer_tone4:": { + "category": "people", + "name": "woman farmer: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f33e" + }, + ":woman_farmer_tone5:": { + "category": "people", + "name": "woman farmer: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f33e" + }, + ":woman_feeding_baby:": { + "category": "people", + "name": "woman feeding baby", + "unicode": "1f469-200d-1f37c" + }, + ":woman_feeding_baby_tone1:": { + "category": "people", + "name": "woman feeding baby: light skin tone", + "unicode": "1f469-1f3fb-200d-1f37c" + }, + ":woman_feeding_baby_tone2:": { + "category": "people", + "name": "woman feeding baby: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f37c" + }, + ":woman_feeding_baby_tone3:": { + "category": "people", + "name": "woman feeding baby: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f37c" + }, + ":woman_feeding_baby_tone4:": { + "category": "people", + "name": "woman feeding baby: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f37c" + }, + ":woman_feeding_baby_tone5:": { + "category": "people", + "name": "woman feeding baby: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f37c" + }, + ":woman_firefighter:": { + "category": "people", + "name": "woman firefighter", + "unicode": "1f469-200d-1f692" + }, + ":woman_firefighter_tone1:": { + "category": "people", + "name": "woman firefighter: light skin tone", + "unicode": "1f469-1f3fb-200d-1f692" + }, + ":woman_firefighter_tone2:": { + "category": "people", + "name": "woman firefighter: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f692" + }, + ":woman_firefighter_tone3:": { + "category": "people", + "name": "woman firefighter: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f692" + }, + ":woman_firefighter_tone4:": { + "category": "people", + "name": "woman firefighter: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f692" + }, + ":woman_firefighter_tone5:": { + "category": "people", + "name": "woman firefighter: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f692" + }, + ":woman_frowning:": { + "category": "people", + "name": "woman frowning", + "unicode": "1f64d-200d-2640-fe0f" + }, + ":woman_frowning_tone1:": { + "category": "people", + "name": "woman frowning: light skin tone", + "unicode": "1f64d-1f3fb-200d-2640-fe0f" + }, + ":woman_frowning_tone2:": { + "category": "people", + "name": "woman frowning: medium-light skin tone", + "unicode": "1f64d-1f3fc-200d-2640-fe0f" + }, + ":woman_frowning_tone3:": { + "category": "people", + "name": "woman frowning: medium skin tone", + "unicode": "1f64d-1f3fd-200d-2640-fe0f" + }, + ":woman_frowning_tone4:": { + "category": "people", + "name": "woman frowning: medium-dark skin tone", + "unicode": "1f64d-1f3fe-200d-2640-fe0f" + }, + ":woman_frowning_tone5:": { + "category": "people", + "name": "woman frowning: dark skin tone", + "unicode": "1f64d-1f3ff-200d-2640-fe0f" + }, + ":woman_genie:": { + "category": "people", + "name": "woman genie", + "unicode": "1f9de-200d-2640-fe0f" + }, + ":woman_gesturing_no:": { + "category": "people", + "name": "woman gesturing NO", + "unicode": "1f645-200d-2640-fe0f" + }, + ":woman_gesturing_no_tone1:": { + "category": "people", + "name": "woman gesturing NO: light skin tone", + "unicode": "1f645-1f3fb-200d-2640-fe0f" + }, + ":woman_gesturing_no_tone2:": { + "category": "people", + "name": "woman gesturing NO: medium-light skin tone", + "unicode": "1f645-1f3fc-200d-2640-fe0f" + }, + ":woman_gesturing_no_tone3:": { + "category": "people", + "name": "woman gesturing NO: medium skin tone", + "unicode": "1f645-1f3fd-200d-2640-fe0f" + }, + ":woman_gesturing_no_tone4:": { + "category": "people", + "name": "woman gesturing NO: medium-dark skin tone", + "unicode": "1f645-1f3fe-200d-2640-fe0f" + }, + ":woman_gesturing_no_tone5:": { + "category": "people", + "name": "woman gesturing NO: dark skin tone", + "unicode": "1f645-1f3ff-200d-2640-fe0f" + }, + ":woman_gesturing_ok:": { + "category": "people", + "name": "woman gesturing OK", + "unicode": "1f646-200d-2640-fe0f" + }, + ":woman_gesturing_ok_tone1:": { + "category": "people", + "name": "woman gesturing OK: light skin tone", + "unicode": "1f646-1f3fb-200d-2640-fe0f" + }, + ":woman_gesturing_ok_tone2:": { + "category": "people", + "name": "woman gesturing OK: medium-light skin tone", + "unicode": "1f646-1f3fc-200d-2640-fe0f" + }, + ":woman_gesturing_ok_tone3:": { + "category": "people", + "name": "woman gesturing OK: medium skin tone", + "unicode": "1f646-1f3fd-200d-2640-fe0f" + }, + ":woman_gesturing_ok_tone4:": { + "category": "people", + "name": "woman gesturing OK: medium-dark skin tone", + "unicode": "1f646-1f3fe-200d-2640-fe0f" + }, + ":woman_gesturing_ok_tone5:": { + "category": "people", + "name": "woman gesturing OK: dark skin tone", + "unicode": "1f646-1f3ff-200d-2640-fe0f" + }, + ":woman_getting_face_massage:": { + "category": "people", + "name": "woman getting massage", + "unicode": "1f486-200d-2640-fe0f" + }, + ":woman_getting_face_massage_tone1:": { + "category": "people", + "name": "woman getting massage: light skin tone", + "unicode": "1f486-1f3fb-200d-2640-fe0f" + }, + ":woman_getting_face_massage_tone2:": { + "category": "people", + "name": "woman getting massage: medium-light skin tone", + "unicode": "1f486-1f3fc-200d-2640-fe0f" + }, + ":woman_getting_face_massage_tone3:": { + "category": "people", + "name": "woman getting massage: medium skin tone", + "unicode": "1f486-1f3fd-200d-2640-fe0f" + }, + ":woman_getting_face_massage_tone4:": { + "category": "people", + "name": "woman getting massage: medium-dark skin tone", + "unicode": "1f486-1f3fe-200d-2640-fe0f" + }, + ":woman_getting_face_massage_tone5:": { + "category": "people", + "name": "woman getting massage: dark skin tone", + "unicode": "1f486-1f3ff-200d-2640-fe0f" + }, + ":woman_getting_haircut:": { + "category": "people", + "name": "woman getting haircut", + "unicode": "1f487-200d-2640-fe0f" + }, + ":woman_getting_haircut_tone1:": { + "category": "people", + "name": "woman getting haircut: light skin tone", + "unicode": "1f487-1f3fb-200d-2640-fe0f" + }, + ":woman_getting_haircut_tone2:": { + "category": "people", + "name": "woman getting haircut: medium-light skin tone", + "unicode": "1f487-1f3fc-200d-2640-fe0f" + }, + ":woman_getting_haircut_tone3:": { + "category": "people", + "name": "woman getting haircut: medium skin tone", + "unicode": "1f487-1f3fd-200d-2640-fe0f" + }, + ":woman_getting_haircut_tone4:": { + "category": "people", + "name": "woman getting haircut: medium-dark skin tone", + "unicode": "1f487-1f3fe-200d-2640-fe0f" + }, + ":woman_getting_haircut_tone5:": { + "category": "people", + "name": "woman getting haircut: dark skin tone", + "unicode": "1f487-1f3ff-200d-2640-fe0f" + }, + ":woman_golfing:": { + "category": "activity", + "name": "woman golfing", + "unicode": "1f3cc-fe0f-200d-2640-fe0f" + }, + ":woman_golfing_tone1:": { + "category": "activity", + "name": "woman golfing: light skin tone", + "unicode": "1f3cc-1f3fb-200d-2640-fe0f" + }, + ":woman_golfing_tone2:": { + "category": "activity", + "name": "woman golfing: medium-light skin tone", + "unicode": "1f3cc-1f3fc-200d-2640-fe0f" + }, + ":woman_golfing_tone3:": { + "category": "activity", + "name": "woman golfing: medium skin tone", + "unicode": "1f3cc-1f3fd-200d-2640-fe0f" + }, + ":woman_golfing_tone4:": { + "category": "activity", + "name": "woman golfing: medium-dark skin tone", + "unicode": "1f3cc-1f3fe-200d-2640-fe0f" + }, + ":woman_golfing_tone5:": { + "category": "activity", + "name": "woman golfing: dark skin tone", + "unicode": "1f3cc-1f3ff-200d-2640-fe0f" + }, + ":woman_guard:": { + "category": "people", + "name": "woman guard", + "unicode": "1f482-200d-2640-fe0f" + }, + ":woman_guard_tone1:": { + "category": "people", + "name": "woman guard: light skin tone", + "unicode": "1f482-1f3fb-200d-2640-fe0f" + }, + ":woman_guard_tone2:": { + "category": "people", + "name": "woman guard: medium-light skin tone", + "unicode": "1f482-1f3fc-200d-2640-fe0f" + }, + ":woman_guard_tone3:": { + "category": "people", + "name": "woman guard: medium skin tone", + "unicode": "1f482-1f3fd-200d-2640-fe0f" + }, + ":woman_guard_tone4:": { + "category": "people", + "name": "woman guard: medium-dark skin tone", + "unicode": "1f482-1f3fe-200d-2640-fe0f" + }, + ":woman_guard_tone5:": { + "category": "people", + "name": "woman guard: dark skin tone", + "unicode": "1f482-1f3ff-200d-2640-fe0f" + }, + ":woman_health_worker:": { + "category": "people", + "name": "woman health worker", + "unicode": "1f469-200d-2695-fe0f" + }, + ":woman_health_worker_tone1:": { + "category": "people", + "name": "woman health worker: light skin tone", + "unicode": "1f469-1f3fb-200d-2695-fe0f" + }, + ":woman_health_worker_tone2:": { + "category": "people", + "name": "woman health worker: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2695-fe0f" + }, + ":woman_health_worker_tone3:": { + "category": "people", + "name": "woman health worker: medium skin tone", + "unicode": "1f469-1f3fd-200d-2695-fe0f" + }, + ":woman_health_worker_tone4:": { + "category": "people", + "name": "woman health worker: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2695-fe0f" + }, + ":woman_health_worker_tone5:": { + "category": "people", + "name": "woman health worker: dark skin tone", + "unicode": "1f469-1f3ff-200d-2695-fe0f" + }, + ":woman_in_lotus_position:": { + "category": "activity", + "name": "woman in lotus position", + "unicode": "1f9d8-200d-2640-fe0f" + }, + ":woman_in_lotus_position_tone1:": { + "category": "activity", + "name": "woman in lotus position: light skin tone", + "unicode": "1f9d8-1f3fb-200d-2640-fe0f" + }, + ":woman_in_lotus_position_tone2:": { + "category": "activity", + "name": "woman in lotus position: medium-light skin tone", + "unicode": "1f9d8-1f3fc-200d-2640-fe0f" + }, + ":woman_in_lotus_position_tone3:": { + "category": "activity", + "name": "woman in lotus position: medium skin tone", + "unicode": "1f9d8-1f3fd-200d-2640-fe0f" + }, + ":woman_in_lotus_position_tone4:": { + "category": "activity", + "name": "woman in lotus position: medium-dark skin tone", + "unicode": "1f9d8-1f3fe-200d-2640-fe0f" + }, + ":woman_in_lotus_position_tone5:": { + "category": "activity", + "name": "woman in lotus position: dark skin tone", + "unicode": "1f9d8-1f3ff-200d-2640-fe0f" + }, + ":woman_in_manual_wheelchair:": { + "category": "people", + "name": "woman in manual wheelchair", + "unicode": "1f469-200d-1f9bd" + }, + ":woman_in_manual_wheelchair_facing_right:": { + "category": "people", + "name": "woman in manual wheelchair facing right", + "unicode": "1f469-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "woman in manual wheelchair facing right: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "woman in manual wheelchair facing right: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "woman in manual wheelchair facing right: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "woman in manual wheelchair facing right: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "woman in manual wheelchair facing right: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9bd-200d-27a1-fe0f" + }, + ":woman_in_manual_wheelchair_tone1:": { + "category": "people", + "name": "woman in manual wheelchair: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9bd" + }, + ":woman_in_manual_wheelchair_tone2:": { + "category": "people", + "name": "woman in manual wheelchair: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9bd" + }, + ":woman_in_manual_wheelchair_tone3:": { + "category": "people", + "name": "woman in manual wheelchair: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9bd" + }, + ":woman_in_manual_wheelchair_tone4:": { + "category": "people", + "name": "woman in manual wheelchair: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9bd" + }, + ":woman_in_manual_wheelchair_tone5:": { + "category": "people", + "name": "woman in manual wheelchair: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9bd" + }, + ":woman_in_motorized_wheelchair:": { + "category": "people", + "name": "woman in motorized wheelchair", + "unicode": "1f469-200d-1f9bc" + }, + ":woman_in_motorized_wheelchair_facing_right:": { + "category": "people", + "name": "woman in motorized wheelchair facing right", + "unicode": "1f469-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_facing_right_tone1:": { + "category": "people", + "name": "woman in motorized wheelchair facing right: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_facing_right_tone2:": { + "category": "people", + "name": "woman in motorized wheelchair facing right: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_facing_right_tone3:": { + "category": "people", + "name": "woman in motorized wheelchair facing right: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_facing_right_tone4:": { + "category": "people", + "name": "woman in motorized wheelchair facing right: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_facing_right_tone5:": { + "category": "people", + "name": "woman in motorized wheelchair facing right: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9bc-200d-27a1-fe0f" + }, + ":woman_in_motorized_wheelchair_tone1:": { + "category": "people", + "name": "woman in motorized wheelchair: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9bc" + }, + ":woman_in_motorized_wheelchair_tone2:": { + "category": "people", + "name": "woman in motorized wheelchair: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9bc" + }, + ":woman_in_motorized_wheelchair_tone3:": { + "category": "people", + "name": "woman in motorized wheelchair: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9bc" + }, + ":woman_in_motorized_wheelchair_tone4:": { + "category": "people", + "name": "woman in motorized wheelchair: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9bc" + }, + ":woman_in_motorized_wheelchair_tone5:": { + "category": "people", + "name": "woman in motorized wheelchair: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9bc" + }, + ":woman_in_santa_hat:": { + "category": "people", + "name": "woman in santa hat", + "unicode": "1f469-200d-1f384" + }, + ":woman_in_santa_hat_tone1:": { + "category": "people", + "name": "woman in santa hat: light skin tone", + "unicode": "1f469-1f3fb-200d-1f384" + }, + ":woman_in_santa_hat_tone2:": { + "category": "people", + "name": "woman in santa hat: medium-light skin tone", + "unicode": "1f468-1f3ff-200d-1f384" + }, + ":woman_in_santa_hat_tone3:": { + "category": "people", + "name": "woman in santa hat: medium skin tone", + "unicode": "1f469-1f3fe-200d-1f384" + }, + ":woman_in_santa_hat_tone4:": { + "category": "people", + "name": "woman in santa hat: medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-1f384" + }, + ":woman_in_santa_hat_tone5:": { + "category": "people", + "name": "woman in santa hat: dark skin tone", + "unicode": "1f469-1f3fc-200d-1f384" + }, + ":woman_in_steamy_room:": { + "category": "people", + "name": "woman in steamy room", + "unicode": "1f9d6-200d-2640-fe0f" + }, + ":woman_in_steamy_room_tone1:": { + "category": "people", + "name": "woman in steamy room: light skin tone", + "unicode": "1f9d6-1f3fb-200d-2640-fe0f" + }, + ":woman_in_steamy_room_tone2:": { + "category": "people", + "name": "woman in steamy room: medium-light skin tone", + "unicode": "1f9d6-1f3fc-200d-2640-fe0f" + }, + ":woman_in_steamy_room_tone3:": { + "category": "people", + "name": "woman in steamy room: medium skin tone", + "unicode": "1f9d6-1f3fd-200d-2640-fe0f" + }, + ":woman_in_steamy_room_tone4:": { + "category": "people", + "name": "woman in steamy room: medium-dark skin tone", + "unicode": "1f9d6-1f3fe-200d-2640-fe0f" + }, + ":woman_in_steamy_room_tone5:": { + "category": "people", + "name": "woman in steamy room: dark skin tone", + "unicode": "1f9d6-1f3ff-200d-2640-fe0f" + }, + ":woman_in_tuxedo:": { + "category": "people", + "name": "woman in tuxedo", + "unicode": "1f935-200d-2640-fe0f" + }, + ":woman_in_tuxedo_tone1:": { + "category": "people", + "name": "woman in tuxedo: light skin tone", + "unicode": "1f935-1f3fb-200d-2640-fe0f" + }, + ":woman_in_tuxedo_tone2:": { + "category": "people", + "name": "woman in tuxedo: medium-light skin tone", + "unicode": "1f935-1f3fc-200d-2640-fe0f" + }, + ":woman_in_tuxedo_tone3:": { + "category": "people", + "name": "woman in tuxedo: medium skin tone", + "unicode": "1f935-1f3fd-200d-2640-fe0f" + }, + ":woman_in_tuxedo_tone4:": { + "category": "people", + "name": "woman in tuxedo: medium-dark skin tone", + "unicode": "1f935-1f3fe-200d-2640-fe0f" + }, + ":woman_in_tuxedo_tone5:": { + "category": "people", + "name": "woman in tuxedo: dark skin tone", + "unicode": "1f935-1f3ff-200d-2640-fe0f" + }, + ":woman_judge:": { + "category": "people", + "name": "woman judge", + "unicode": "1f469-200d-2696-fe0f" + }, + ":woman_judge_tone1:": { + "category": "people", + "name": "woman judge: light skin tone", + "unicode": "1f469-1f3fb-200d-2696-fe0f" + }, + ":woman_judge_tone2:": { + "category": "people", + "name": "woman judge: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2696-fe0f" + }, + ":woman_judge_tone3:": { + "category": "people", + "name": "woman judge: medium skin tone", + "unicode": "1f469-1f3fd-200d-2696-fe0f" + }, + ":woman_judge_tone4:": { + "category": "people", + "name": "woman judge: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2696-fe0f" + }, + ":woman_judge_tone5:": { + "category": "people", + "name": "woman judge: dark skin tone", + "unicode": "1f469-1f3ff-200d-2696-fe0f" + }, + ":woman_juggling:": { + "category": "activity", + "name": "woman juggling", + "unicode": "1f939-200d-2640-fe0f" + }, + ":woman_juggling_tone1:": { + "category": "activity", + "name": "woman juggling: light skin tone", + "unicode": "1f939-1f3fb-200d-2640-fe0f" + }, + ":woman_juggling_tone2:": { + "category": "activity", + "name": "woman juggling: medium-light skin tone", + "unicode": "1f939-1f3fc-200d-2640-fe0f" + }, + ":woman_juggling_tone3:": { + "category": "activity", + "name": "woman juggling: medium skin tone", + "unicode": "1f939-1f3fd-200d-2640-fe0f" + }, + ":woman_juggling_tone4:": { + "category": "activity", + "name": "woman juggling: medium-dark skin tone", + "unicode": "1f939-1f3fe-200d-2640-fe0f" + }, + ":woman_juggling_tone5:": { + "category": "activity", + "name": "woman juggling: dark skin tone", + "unicode": "1f939-1f3ff-200d-2640-fe0f" + }, + ":woman_kneeling:": { + "category": "people", + "name": "woman kneeling", + "unicode": "1f9ce-200d-2640-fe0f" + }, + ":woman_kneeling_facing_right:": { + "category": "people", + "name": "woman kneeling facing right", + "unicode": "1f9ce-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_facing_right_tone1:": { + "category": "people", + "name": "woman kneeling facing right: light skin tone", + "unicode": "1f9ce-1f3fb-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_facing_right_tone2:": { + "category": "people", + "name": "woman kneeling facing right: medium-light skin tone", + "unicode": "1f9ce-1f3fc-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_facing_right_tone3:": { + "category": "people", + "name": "woman kneeling facing right: medium skin tone", + "unicode": "1f9ce-1f3fd-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_facing_right_tone4:": { + "category": "people", + "name": "woman kneeling facing right: medium-dark skin tone", + "unicode": "1f9ce-1f3fe-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_facing_right_tone5:": { + "category": "people", + "name": "woman kneeling facing right: dark skin tone", + "unicode": "1f9ce-1f3ff-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_kneeling_tone1:": { + "category": "people", + "name": "woman kneeling: light skin tone", + "unicode": "1f9ce-1f3fb-200d-2640-fe0f" + }, + ":woman_kneeling_tone2:": { + "category": "people", + "name": "woman kneeling: medium-light skin tone", + "unicode": "1f9ce-1f3fc-200d-2640-fe0f" + }, + ":woman_kneeling_tone3:": { + "category": "people", + "name": "woman kneeling: medium skin tone", + "unicode": "1f9ce-1f3fd-200d-2640-fe0f" + }, + ":woman_kneeling_tone4:": { + "category": "people", + "name": "woman kneeling: medium-dark skin tone", + "unicode": "1f9ce-1f3fe-200d-2640-fe0f" + }, + ":woman_kneeling_tone5:": { + "category": "people", + "name": "woman kneeling: dark skin tone", + "unicode": "1f9ce-1f3ff-200d-2640-fe0f" + }, + ":woman_leviate_tone2:": { + "category": "people", + "name": "woman in business suit levitating: medium-light skin tone", + "unicode": "1f574-1f3fc-200d-2640-fe0f" + }, + ":woman_leviate_tone3:": { + "category": "people", + "name": "woman in business suit levitating: medium skin tone", + "unicode": "1f574-1f3fd-200d-2640-fe0f" + }, + ":woman_leviate_tone4:": { + "category": "people", + "name": "woman in business suit levitating: medium-dark skin tone", + "unicode": "1f574-1f3fe-200d-2640-fe0f" + }, + ":woman_leviate_tone5:": { + "category": "people", + "name": "woman in business suit levitating: dark skin tone", + "unicode": "1f574-1f3ff-200d-2640-fe0f" + }, + ":woman_levitate:": { + "category": "people", + "name": "woman in business suit levitating", + "unicode": "1f574-fe0f-200d-2640-fe0f" + }, + ":woman_levitate_tone1:": { + "category": "people", + "name": "woman in business suit levitating: light skin tone", + "unicode": "1f574-1f3fb-200d-2640-fe0f" + }, + ":woman_lifting_weights:": { + "category": "activity", + "name": "woman lifting weights", + "unicode": "1f3cb-fe0f-200d-2640-fe0f" + }, + ":woman_lifting_weights_tone1:": { + "category": "activity", + "name": "woman lifting weights: light skin tone", + "unicode": "1f3cb-1f3fb-200d-2640-fe0f" + }, + ":woman_lifting_weights_tone2:": { + "category": "activity", + "name": "woman lifting weights: medium-light skin tone", + "unicode": "1f3cb-1f3fc-200d-2640-fe0f" + }, + ":woman_lifting_weights_tone3:": { + "category": "activity", + "name": "woman lifting weights: medium skin tone", + "unicode": "1f3cb-1f3fd-200d-2640-fe0f" + }, + ":woman_lifting_weights_tone4:": { + "category": "activity", + "name": "woman lifting weights: medium-dark skin tone", + "unicode": "1f3cb-1f3fe-200d-2640-fe0f" + }, + ":woman_lifting_weights_tone5:": { + "category": "activity", + "name": "woman lifting weights: dark skin tone", + "unicode": "1f3cb-1f3ff-200d-2640-fe0f" + }, + ":woman_mage:": { + "category": "people", + "name": "woman mage", + "unicode": "1f9d9-200d-2640-fe0f" + }, + ":woman_mage_tone1:": { + "category": "people", + "name": "woman mage: light skin tone", + "unicode": "1f9d9-1f3fb-200d-2640-fe0f" + }, + ":woman_mage_tone2:": { + "category": "people", + "name": "woman mage: medium-light skin tone", + "unicode": "1f9d9-1f3fc-200d-2640-fe0f" + }, + ":woman_mage_tone3:": { + "category": "people", + "name": "woman mage: medium skin tone", + "unicode": "1f9d9-1f3fd-200d-2640-fe0f" + }, + ":woman_mage_tone4:": { + "category": "people", + "name": "woman mage: medium-dark skin tone", + "unicode": "1f9d9-1f3fe-200d-2640-fe0f" + }, + ":woman_mage_tone5:": { + "category": "people", + "name": "woman mage: dark skin tone", + "unicode": "1f9d9-1f3ff-200d-2640-fe0f" + }, + ":woman_mechanic:": { + "category": "people", + "name": "woman mechanic", + "unicode": "1f469-200d-1f527" + }, + ":woman_mechanic_tone1:": { + "category": "people", + "name": "woman mechanic: light skin tone", + "unicode": "1f469-1f3fb-200d-1f527" + }, + ":woman_mechanic_tone2:": { + "category": "people", + "name": "woman mechanic: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f527" + }, + ":woman_mechanic_tone3:": { + "category": "people", + "name": "woman mechanic: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f527" + }, + ":woman_mechanic_tone4:": { + "category": "people", + "name": "woman mechanic: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f527" + }, + ":woman_mechanic_tone5:": { + "category": "people", + "name": "woman mechanic: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f527" + }, + ":woman_mountain_biking:": { + "category": "activity", + "name": "woman mountain biking", + "unicode": "1f6b5-200d-2640-fe0f" + }, + ":woman_mountain_biking_tone1:": { + "category": "activity", + "name": "woman mountain biking: light skin tone", + "unicode": "1f6b5-1f3fb-200d-2640-fe0f" + }, + ":woman_mountain_biking_tone2:": { + "category": "activity", + "name": "woman mountain biking: medium-light skin tone", + "unicode": "1f6b5-1f3fc-200d-2640-fe0f" + }, + ":woman_mountain_biking_tone3:": { + "category": "activity", + "name": "woman mountain biking: medium skin tone", + "unicode": "1f6b5-1f3fd-200d-2640-fe0f" + }, + ":woman_mountain_biking_tone4:": { + "category": "activity", + "name": "woman mountain biking: medium-dark skin tone", + "unicode": "1f6b5-1f3fe-200d-2640-fe0f" + }, + ":woman_mountain_biking_tone5:": { + "category": "activity", + "name": "woman mountain biking: dark skin tone", + "unicode": "1f6b5-1f3ff-200d-2640-fe0f" + }, + ":woman_office_worker:": { + "category": "people", + "name": "woman office worker", + "unicode": "1f469-200d-1f4bc" + }, + ":woman_office_worker_tone1:": { + "category": "people", + "name": "woman office worker: light skin tone", + "unicode": "1f469-1f3fb-200d-1f4bc" + }, + ":woman_office_worker_tone2:": { + "category": "people", + "name": "woman office worker: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f4bc" + }, + ":woman_office_worker_tone3:": { + "category": "people", + "name": "woman office worker: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f4bc" + }, + ":woman_office_worker_tone4:": { + "category": "people", + "name": "woman office worker: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f4bc" + }, + ":woman_office_worker_tone5:": { + "category": "people", + "name": "woman office worker: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f4bc" + }, + ":woman_pilot:": { + "category": "people", + "name": "woman pilot", + "unicode": "1f469-200d-2708-fe0f" + }, + ":woman_pilot_tone1:": { + "category": "people", + "name": "woman pilot: light skin tone", + "unicode": "1f469-1f3fb-200d-2708-fe0f" + }, + ":woman_pilot_tone2:": { + "category": "people", + "name": "woman pilot: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-2708-fe0f" + }, + ":woman_pilot_tone3:": { + "category": "people", + "name": "woman pilot: medium skin tone", + "unicode": "1f469-1f3fd-200d-2708-fe0f" + }, + ":woman_pilot_tone4:": { + "category": "people", + "name": "woman pilot: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-2708-fe0f" + }, + ":woman_pilot_tone5:": { + "category": "people", + "name": "woman pilot: dark skin tone", + "unicode": "1f469-1f3ff-200d-2708-fe0f" + }, + ":woman_playing_handball:": { + "category": "activity", + "name": "woman playing handball", + "unicode": "1f93e-200d-2640-fe0f" + }, + ":woman_playing_handball_tone1:": { + "category": "activity", + "name": "woman playing handball: light skin tone", + "unicode": "1f93e-1f3fb-200d-2640-fe0f" + }, + ":woman_playing_handball_tone2:": { + "category": "activity", + "name": "woman playing handball: medium-light skin tone", + "unicode": "1f93e-1f3fc-200d-2640-fe0f" + }, + ":woman_playing_handball_tone3:": { + "category": "activity", + "name": "woman playing handball: medium skin tone", + "unicode": "1f93e-1f3fd-200d-2640-fe0f" + }, + ":woman_playing_handball_tone4:": { + "category": "activity", + "name": "woman playing handball: medium-dark skin tone", + "unicode": "1f93e-1f3fe-200d-2640-fe0f" + }, + ":woman_playing_handball_tone5:": { + "category": "activity", + "name": "woman playing handball: dark skin tone", + "unicode": "1f93e-1f3ff-200d-2640-fe0f" + }, + ":woman_playing_water_polo:": { + "category": "activity", + "name": "woman playing water polo", + "unicode": "1f93d-200d-2640-fe0f" + }, + ":woman_playing_water_polo_tone1:": { + "category": "activity", + "name": "woman playing water polo: light skin tone", + "unicode": "1f93d-1f3fb-200d-2640-fe0f" + }, + ":woman_playing_water_polo_tone2:": { + "category": "activity", + "name": "woman playing water polo: medium-light skin tone", + "unicode": "1f93d-1f3fc-200d-2640-fe0f" + }, + ":woman_playing_water_polo_tone3:": { + "category": "activity", + "name": "woman playing water polo: medium skin tone", + "unicode": "1f93d-1f3fd-200d-2640-fe0f" + }, + ":woman_playing_water_polo_tone4:": { + "category": "activity", + "name": "woman playing water polo: medium-dark skin tone", + "unicode": "1f93d-1f3fe-200d-2640-fe0f" + }, + ":woman_playing_water_polo_tone5:": { + "category": "activity", + "name": "woman playing water polo: dark skin tone", + "unicode": "1f93d-1f3ff-200d-2640-fe0f" + }, + ":woman_police_officer:": { + "category": "people", + "name": "woman police officer", + "unicode": "1f46e-200d-2640-fe0f" + }, + ":woman_police_officer_tone1:": { + "category": "people", + "name": "woman police officer: light skin tone", + "unicode": "1f46e-1f3fb-200d-2640-fe0f" + }, + ":woman_police_officer_tone2:": { + "category": "people", + "name": "woman police officer: medium-light skin tone", + "unicode": "1f46e-1f3fc-200d-2640-fe0f" + }, + ":woman_police_officer_tone3:": { + "category": "people", + "name": "woman police officer: medium skin tone", + "unicode": "1f46e-1f3fd-200d-2640-fe0f" + }, + ":woman_police_officer_tone4:": { + "category": "people", + "name": "woman police officer: medium-dark skin tone", + "unicode": "1f46e-1f3fe-200d-2640-fe0f" + }, + ":woman_police_officer_tone5:": { + "category": "people", + "name": "woman police officer: dark skin tone", + "unicode": "1f46e-1f3ff-200d-2640-fe0f" + }, + ":woman_pouting:": { + "category": "people", + "name": "woman pouting", + "unicode": "1f64e-200d-2640-fe0f" + }, + ":woman_pouting_tone1:": { + "category": "people", + "name": "woman pouting: light skin tone", + "unicode": "1f64e-1f3fb-200d-2640-fe0f" + }, + ":woman_pouting_tone2:": { + "category": "people", + "name": "woman pouting: medium-light skin tone", + "unicode": "1f64e-1f3fc-200d-2640-fe0f" + }, + ":woman_pouting_tone3:": { + "category": "people", + "name": "woman pouting: medium skin tone", + "unicode": "1f64e-1f3fd-200d-2640-fe0f" + }, + ":woman_pouting_tone4:": { + "category": "people", + "name": "woman pouting: medium-dark skin tone", + "unicode": "1f64e-1f3fe-200d-2640-fe0f" + }, + ":woman_pouting_tone5:": { + "category": "people", + "name": "woman pouting: dark skin tone", + "unicode": "1f64e-1f3ff-200d-2640-fe0f" + }, + ":woman_raising_hand:": { + "category": "people", + "name": "woman raising hand", + "unicode": "1f64b-200d-2640-fe0f" + }, + ":woman_raising_hand_tone1:": { + "category": "people", + "name": "woman raising hand: light skin tone", + "unicode": "1f64b-1f3fb-200d-2640-fe0f" + }, + ":woman_raising_hand_tone2:": { + "category": "people", + "name": "woman raising hand: medium-light skin tone", + "unicode": "1f64b-1f3fc-200d-2640-fe0f" + }, + ":woman_raising_hand_tone3:": { + "category": "people", + "name": "woman raising hand: medium skin tone", + "unicode": "1f64b-1f3fd-200d-2640-fe0f" + }, + ":woman_raising_hand_tone4:": { + "category": "people", + "name": "woman raising hand: medium-dark skin tone", + "unicode": "1f64b-1f3fe-200d-2640-fe0f" + }, + ":woman_raising_hand_tone5:": { + "category": "people", + "name": "woman raising hand: dark skin tone", + "unicode": "1f64b-1f3ff-200d-2640-fe0f" + }, + ":woman_red_haired:": { + "category": "people", + "name": "woman: red hair", + "unicode": "1f469-200d-1f9b0" + }, + ":woman_red_haired_tone1:": { + "category": "people", + "name": "woman, red haired: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9b0" + }, + ":woman_red_haired_tone2:": { + "category": "people", + "name": "woman, red haired: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9b0" + }, + ":woman_red_haired_tone3:": { + "category": "people", + "name": "woman, red haired: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9b0" + }, + ":woman_red_haired_tone4:": { + "category": "people", + "name": "woman, red haired: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9b0" + }, + ":woman_red_haired_tone5:": { + "category": "people", + "name": "woman, red haired: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9b0" + }, + ":woman_rowing_boat:": { + "category": "activity", + "name": "woman rowing boat", + "unicode": "1f6a3-200d-2640-fe0f" + }, + ":woman_rowing_boat_tone1:": { + "category": "activity", + "name": "woman rowing boat: light skin tone", + "unicode": "1f6a3-1f3fb-200d-2640-fe0f" + }, + ":woman_rowing_boat_tone2:": { + "category": "activity", + "name": "woman rowing boat: medium-light skin tone", + "unicode": "1f6a3-1f3fc-200d-2640-fe0f" + }, + ":woman_rowing_boat_tone3:": { + "category": "activity", + "name": "woman rowing boat: medium skin tone", + "unicode": "1f6a3-1f3fd-200d-2640-fe0f" + }, + ":woman_rowing_boat_tone4:": { + "category": "activity", + "name": "woman rowing boat: medium-dark skin tone", + "unicode": "1f6a3-1f3fe-200d-2640-fe0f" + }, + ":woman_rowing_boat_tone5:": { + "category": "activity", + "name": "woman rowing boat: dark skin tone", + "unicode": "1f6a3-1f3ff-200d-2640-fe0f" + }, + ":woman_running:": { + "category": "people", + "name": "woman running", + "unicode": "1f3c3-200d-2640-fe0f" + }, + ":woman_running_facing_right:": { + "category": "people", + "name": "woman running facing right", + "unicode": "1f3c3-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_facing_right_tone1:": { + "category": "people", + "name": "woman running facing right: light skin tone", + "unicode": "1f3c3-1f3fb-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_facing_right_tone2:": { + "category": "people", + "name": "woman running facing right: medium-light skin tone", + "unicode": "1f3c3-1f3fc-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_facing_right_tone3:": { + "category": "people", + "name": "woman running facing right: medium skin tone", + "unicode": "1f3c3-1f3fd-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_facing_right_tone4:": { + "category": "people", + "name": "woman running facing right: medium-dark skin tone", + "unicode": "1f3c3-1f3fe-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_facing_right_tone5:": { + "category": "people", + "name": "woman running facing right: dark skin tone", + "unicode": "1f3c3-1f3ff-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_running_tone1:": { + "category": "people", + "name": "woman running: light skin tone", + "unicode": "1f3c3-1f3fb-200d-2640-fe0f" + }, + ":woman_running_tone2:": { + "category": "people", + "name": "woman running: medium-light skin tone", + "unicode": "1f3c3-1f3fc-200d-2640-fe0f" + }, + ":woman_running_tone3:": { + "category": "people", + "name": "woman running: medium skin tone", + "unicode": "1f3c3-1f3fd-200d-2640-fe0f" + }, + ":woman_running_tone4:": { + "category": "people", + "name": "woman running: medium-dark skin tone", + "unicode": "1f3c3-1f3fe-200d-2640-fe0f" + }, + ":woman_running_tone5:": { + "category": "people", + "name": "woman running: dark skin tone", + "unicode": "1f3c3-1f3ff-200d-2640-fe0f" + }, + ":woman_scientist:": { + "category": "people", + "name": "woman scientist", + "unicode": "1f469-200d-1f52c" + }, + ":woman_scientist_tone1:": { + "category": "people", + "name": "woman scientist: light skin tone", + "unicode": "1f469-1f3fb-200d-1f52c" + }, + ":woman_scientist_tone2:": { + "category": "people", + "name": "woman scientist: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f52c" + }, + ":woman_scientist_tone3:": { + "category": "people", + "name": "woman scientist: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f52c" + }, + ":woman_scientist_tone4:": { + "category": "people", + "name": "woman scientist: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f52c" + }, + ":woman_scientist_tone5:": { + "category": "people", + "name": "woman scientist: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f52c" + }, + ":woman_shrugging:": { + "category": "people", + "name": "woman shrugging", + "unicode": "1f937-200d-2640-fe0f" + }, + ":woman_shrugging_tone1:": { + "category": "people", + "name": "woman shrugging: light skin tone", + "unicode": "1f937-1f3fb-200d-2640-fe0f" + }, + ":woman_shrugging_tone2:": { + "category": "people", + "name": "woman shrugging: medium-light skin tone", + "unicode": "1f937-1f3fc-200d-2640-fe0f" + }, + ":woman_shrugging_tone3:": { + "category": "people", + "name": "woman shrugging: medium skin tone", + "unicode": "1f937-1f3fd-200d-2640-fe0f" + }, + ":woman_shrugging_tone4:": { + "category": "people", + "name": "woman shrugging: medium-dark skin tone", + "unicode": "1f937-1f3fe-200d-2640-fe0f" + }, + ":woman_shrugging_tone5:": { + "category": "people", + "name": "woman shrugging: dark skin tone", + "unicode": "1f937-1f3ff-200d-2640-fe0f" + }, + ":woman_singer:": { + "category": "people", + "name": "woman singer", + "unicode": "1f469-200d-1f3a4" + }, + ":woman_singer_tone1:": { + "category": "people", + "name": "woman singer: light skin tone", + "unicode": "1f469-1f3fb-200d-1f3a4" + }, + ":woman_singer_tone2:": { + "category": "people", + "name": "woman singer: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f3a4" + }, + ":woman_singer_tone3:": { + "category": "people", + "name": "woman singer: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f3a4" + }, + ":woman_singer_tone4:": { + "category": "people", + "name": "woman singer: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f3a4" + }, + ":woman_singer_tone5:": { + "category": "people", + "name": "woman singer: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f3a4" + }, + ":woman_standing:": { + "category": "people", + "name": "woman standing", + "unicode": "1f9cd-200d-2640-fe0f" + }, + ":woman_standing_tone1:": { + "category": "people", + "name": "woman standing: light skin tone", + "unicode": "1f9cd-1f3fb-200d-2640-fe0f" + }, + ":woman_standing_tone2:": { + "category": "people", + "name": "woman standing: medium-light skin tone", + "unicode": "1f9cd-1f3fc-200d-2640-fe0f" + }, + ":woman_standing_tone3:": { + "category": "people", + "name": "woman standing: medium skin tone", + "unicode": "1f9cd-1f3fd-200d-2640-fe0f" + }, + ":woman_standing_tone4:": { + "category": "people", + "name": "woman standing: medium-dark skin tone", + "unicode": "1f9cd-1f3fe-200d-2640-fe0f" + }, + ":woman_standing_tone5:": { + "category": "people", + "name": "woman standing: dark skin tone", + "unicode": "1f9cd-1f3ff-200d-2640-fe0f" + }, + ":woman_student:": { + "category": "people", + "name": "woman student", + "unicode": "1f469-200d-1f393" + }, + ":woman_student_tone1:": { + "category": "people", + "name": "woman student: light skin tone", + "unicode": "1f469-1f3fb-200d-1f393" + }, + ":woman_student_tone2:": { + "category": "people", + "name": "woman student: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f393" + }, + ":woman_student_tone3:": { + "category": "people", + "name": "woman student: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f393" + }, + ":woman_student_tone4:": { + "category": "people", + "name": "woman student: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f393" + }, + ":woman_student_tone5:": { + "category": "people", + "name": "woman student: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f393" + }, + ":woman_superhero:": { + "category": "people", + "name": "woman superhero", + "unicode": "1f9b8-200d-2640-fe0f" + }, + ":woman_superhero_tone1:": { + "category": "people", + "name": "woman superhero: light skin tone", + "unicode": "1f9b8-1f3fb-200d-2640-fe0f" + }, + ":woman_superhero_tone2:": { + "category": "people", + "name": "woman superhero: medium-light skin tone", + "unicode": "1f9b8-1f3fc-200d-2640-fe0f" + }, + ":woman_superhero_tone3:": { + "category": "people", + "name": "woman superhero: medium skin tone", + "unicode": "1f9b8-1f3fd-200d-2640-fe0f" + }, + ":woman_superhero_tone4:": { + "category": "people", + "name": "woman superhero: medium-dark skin tone", + "unicode": "1f9b8-1f3fe-200d-2640-fe0f" + }, + ":woman_superhero_tone5:": { + "category": "people", + "name": "woman superhero: dark skin tone", + "unicode": "1f9b8-1f3ff-200d-2640-fe0f" + }, + ":woman_supervillain:": { + "category": "people", + "name": "woman supervillain", + "unicode": "1f9b9-200d-2640-fe0f" + }, + ":woman_supervillain_tone1:": { + "category": "people", + "name": "woman supervillain: light skin tone", + "unicode": "1f9b9-1f3fb-200d-2640-fe0f" + }, + ":woman_supervillain_tone2:": { + "category": "people", + "name": "woman supervillain: medium-light skin tone", + "unicode": "1f9b9-1f3fc-200d-2640-fe0f" + }, + ":woman_supervillain_tone3:": { + "category": "people", + "name": "woman supervillain: medium skin tone", + "unicode": "1f9b9-1f3fd-200d-2640-fe0f" + }, + ":woman_supervillain_tone4:": { + "category": "people", + "name": "woman supervillain: medium-dark skin tone", + "unicode": "1f9b9-1f3fe-200d-2640-fe0f" + }, + ":woman_supervillain_tone5:": { + "category": "people", + "name": "woman supervillain: dark skin tone", + "unicode": "1f9b9-1f3ff-200d-2640-fe0f" + }, + ":woman_surfing:": { + "category": "activity", + "name": "woman surfing", + "unicode": "1f3c4-200d-2640-fe0f" + }, + ":woman_surfing_tone1:": { + "category": "activity", + "name": "woman surfing: light skin tone", + "unicode": "1f3c4-1f3fb-200d-2640-fe0f" + }, + ":woman_surfing_tone2:": { + "category": "activity", + "name": "woman surfing: medium-light skin tone", + "unicode": "1f3c4-1f3fc-200d-2640-fe0f" + }, + ":woman_surfing_tone3:": { + "category": "activity", + "name": "woman surfing: medium skin tone", + "unicode": "1f3c4-1f3fd-200d-2640-fe0f" + }, + ":woman_surfing_tone4:": { + "category": "activity", + "name": "woman surfing: medium-dark skin tone", + "unicode": "1f3c4-1f3fe-200d-2640-fe0f" + }, + ":woman_surfing_tone5:": { + "category": "activity", + "name": "woman surfing: dark skin tone", + "unicode": "1f3c4-1f3ff-200d-2640-fe0f" + }, + ":woman_swimming:": { + "category": "activity", + "name": "woman swimming", + "unicode": "1f3ca-200d-2640-fe0f" + }, + ":woman_swimming_tone1:": { + "category": "activity", + "name": "woman swimming: light skin tone", + "unicode": "1f3ca-1f3fb-200d-2640-fe0f" + }, + ":woman_swimming_tone2:": { + "category": "activity", + "name": "woman swimming: medium-light skin tone", + "unicode": "1f3ca-1f3fc-200d-2640-fe0f" + }, + ":woman_swimming_tone3:": { + "category": "activity", + "name": "woman swimming: medium skin tone", + "unicode": "1f3ca-1f3fd-200d-2640-fe0f" + }, + ":woman_swimming_tone4:": { + "category": "activity", + "name": "woman swimming: medium-dark skin tone", + "unicode": "1f3ca-1f3fe-200d-2640-fe0f" + }, + ":woman_swimming_tone5:": { + "category": "activity", + "name": "woman swimming: dark skin tone", + "unicode": "1f3ca-1f3ff-200d-2640-fe0f" + }, + ":woman_teacher:": { + "category": "people", + "name": "woman teacher", + "unicode": "1f469-200d-1f3eb" + }, + ":woman_teacher_tone1:": { + "category": "people", + "name": "woman teacher: light skin tone", + "unicode": "1f469-1f3fb-200d-1f3eb" + }, + ":woman_teacher_tone2:": { + "category": "people", + "name": "woman teacher: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f3eb" + }, + ":woman_teacher_tone3:": { + "category": "people", + "name": "woman teacher: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f3eb" + }, + ":woman_teacher_tone4:": { + "category": "people", + "name": "woman teacher: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f3eb" + }, + ":woman_teacher_tone5:": { + "category": "people", + "name": "woman teacher: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f3eb" + }, + ":woman_technologist:": { + "category": "people", + "name": "woman technologist", + "unicode": "1f469-200d-1f4bb" + }, + ":woman_technologist_tone1:": { + "category": "people", + "name": "woman technologist: light skin tone", + "unicode": "1f469-1f3fb-200d-1f4bb" + }, + ":woman_technologist_tone2:": { + "category": "people", + "name": "woman technologist: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f4bb" + }, + ":woman_technologist_tone3:": { + "category": "people", + "name": "woman technologist: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f4bb" + }, + ":woman_technologist_tone4:": { + "category": "people", + "name": "woman technologist: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f4bb" + }, + ":woman_technologist_tone5:": { + "category": "people", + "name": "woman technologist: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f4bb" + }, + ":woman_tipping_hand:": { + "category": "people", + "name": "woman tipping hand", + "unicode": "1f481-200d-2640-fe0f" + }, + ":woman_tipping_hand_tone1:": { + "category": "people", + "name": "woman tipping hand: light skin tone", + "unicode": "1f481-1f3fb-200d-2640-fe0f" + }, + ":woman_tipping_hand_tone2:": { + "category": "people", + "name": "woman tipping hand: medium-light skin tone", + "unicode": "1f481-1f3fc-200d-2640-fe0f" + }, + ":woman_tipping_hand_tone3:": { + "category": "people", + "name": "woman tipping hand: medium skin tone", + "unicode": "1f481-1f3fd-200d-2640-fe0f" + }, + ":woman_tipping_hand_tone4:": { + "category": "people", + "name": "woman tipping hand: medium-dark skin tone", + "unicode": "1f481-1f3fe-200d-2640-fe0f" + }, + ":woman_tipping_hand_tone5:": { + "category": "people", + "name": "woman tipping hand: dark skin tone", + "unicode": "1f481-1f3ff-200d-2640-fe0f" + }, + ":woman_tone1:": { + "category": "people", + "name": "woman: light skin tone", + "unicode": "1f469-1f3fb" + }, + ":woman_tone1_beard:": { + "category": "people", + "name": "woman: light skin tone, beard", + "unicode": "1f9d4-1f3fb-200d-2640-fe0f" + }, + ":woman_tone2:": { + "category": "people", + "name": "woman: medium-light skin tone", + "unicode": "1f469-1f3fc" + }, + ":woman_tone2_beard:": { + "category": "people", + "name": "woman: medium-light skin tone, beard", + "unicode": "1f9d4-1f3fc-200d-2640-fe0f" + }, + ":woman_tone3:": { + "category": "people", + "name": "woman: medium skin tone", + "unicode": "1f469-1f3fd" + }, + ":woman_tone3_beard:": { + "category": "people", + "name": "woman: medium skin tone, beard", + "unicode": "1f9d4-1f3fd-200d-2640-fe0f" + }, + ":woman_tone4:": { + "category": "people", + "name": "woman: medium-dark skin tone", + "unicode": "1f469-1f3fe" + }, + ":woman_tone4_beard:": { + "category": "people", + "name": "woman: medium-dark skin tone, beard", + "unicode": "1f9d4-1f3fe-200d-2640-fe0f" + }, + ":woman_tone5:": { + "category": "people", + "name": "woman: dark skin tone", + "unicode": "1f469-1f3ff" + }, + ":woman_tone5_beard:": { + "category": "people", + "name": "woman: dark skin tone, beard", + "unicode": "1f9d4-1f3ff-200d-2640-fe0f" + }, + ":woman_vampire:": { + "category": "people", + "name": "woman vampire", + "unicode": "1f9db-200d-2640-fe0f" + }, + ":woman_vampire_tone1:": { + "category": "people", + "name": "woman vampire: light skin tone", + "unicode": "1f9db-1f3fb-200d-2640-fe0f" + }, + ":woman_vampire_tone2:": { + "category": "people", + "name": "woman vampire: medium-light skin tone", + "unicode": "1f9db-1f3fc-200d-2640-fe0f" + }, + ":woman_vampire_tone3:": { + "category": "people", + "name": "woman vampire: medium skin tone", + "unicode": "1f9db-1f3fd-200d-2640-fe0f" + }, + ":woman_vampire_tone4:": { + "category": "people", + "name": "woman vampire: medium-dark skin tone", + "unicode": "1f9db-1f3fe-200d-2640-fe0f" + }, + ":woman_vampire_tone5:": { + "category": "people", + "name": "woman vampire: dark skin tone", + "unicode": "1f9db-1f3ff-200d-2640-fe0f" + }, + ":woman_walking:": { + "category": "people", + "name": "woman walking", + "unicode": "1f6b6-200d-2640-fe0f" + }, + ":woman_walking_facing_right:": { + "category": "people", + "name": "woman walking facing right", + "unicode": "1f6b6-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_facing_right_tone1:": { + "category": "people", + "name": "woman walking facing right: light skin tone", + "unicode": "1f6b6-1f3fb-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_facing_right_tone2:": { + "category": "people", + "name": "woman walking facing right: medium-light skin tone", + "unicode": "1f6b6-1f3fc-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_facing_right_tone3:": { + "category": "people", + "name": "woman walking facing right: medium skin tone", + "unicode": "1f6b6-1f3fd-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_facing_right_tone4:": { + "category": "people", + "name": "woman walking facing right: medium-dark skin tone", + "unicode": "1f6b6-1f3fe-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_facing_right_tone5:": { + "category": "people", + "name": "woman walking facing right: dark skin tone", + "unicode": "1f6b6-1f3ff-200d-2640-fe0f-200d-27a1-fe0f" + }, + ":woman_walking_tone1:": { + "category": "people", + "name": "woman walking: light skin tone", + "unicode": "1f6b6-1f3fb-200d-2640-fe0f" + }, + ":woman_walking_tone2:": { + "category": "people", + "name": "woman walking: medium-light skin tone", + "unicode": "1f6b6-1f3fc-200d-2640-fe0f" + }, + ":woman_walking_tone3:": { + "category": "people", + "name": "woman walking: medium skin tone", + "unicode": "1f6b6-1f3fd-200d-2640-fe0f" + }, + ":woman_walking_tone4:": { + "category": "people", + "name": "woman walking: medium-dark skin tone", + "unicode": "1f6b6-1f3fe-200d-2640-fe0f" + }, + ":woman_walking_tone5:": { + "category": "people", + "name": "woman walking: dark skin tone", + "unicode": "1f6b6-1f3ff-200d-2640-fe0f" + }, + ":woman_wearing_turban:": { + "category": "people", + "name": "woman wearing turban", + "unicode": "1f473-200d-2640-fe0f" + }, + ":woman_wearing_turban_tone1:": { + "category": "people", + "name": "woman wearing turban: light skin tone", + "unicode": "1f473-1f3fb-200d-2640-fe0f" + }, + ":woman_wearing_turban_tone2:": { + "category": "people", + "name": "woman wearing turban: medium-light skin tone", + "unicode": "1f473-1f3fc-200d-2640-fe0f" + }, + ":woman_wearing_turban_tone3:": { + "category": "people", + "name": "woman wearing turban: medium skin tone", + "unicode": "1f473-1f3fd-200d-2640-fe0f" + }, + ":woman_wearing_turban_tone4:": { + "category": "people", + "name": "woman wearing turban: medium-dark skin tone", + "unicode": "1f473-1f3fe-200d-2640-fe0f" + }, + ":woman_wearing_turban_tone5:": { + "category": "people", + "name": "woman wearing turban: dark skin tone", + "unicode": "1f473-1f3ff-200d-2640-fe0f" + }, + ":woman_white_haired:": { + "category": "people", + "name": "woman: white hair", + "unicode": "1f469-200d-1f9b3" + }, + ":woman_white_haired_tone1:": { + "category": "people", + "name": "woman, white haired: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9b3" + }, + ":woman_white_haired_tone2:": { + "category": "people", + "name": "woman, white haired: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9b3" + }, + ":woman_white_haired_tone3:": { + "category": "people", + "name": "woman, white haired: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9b3" + }, + ":woman_white_haired_tone4:": { + "category": "people", + "name": "woman, white haired: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9b3" + }, + ":woman_white_haired_tone5:": { + "category": "people", + "name": "woman, white haired: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9b3" + }, + ":woman_with_headscarf:": { + "category": "people", + "name": "woman with headscarf", + "unicode": "1f9d5" + }, + ":woman_with_headscarf_tone1:": { + "category": "people", + "name": "woman with headscarf: light skin tone", + "unicode": "1f9d5-1f3fb" + }, + ":woman_with_headscarf_tone2:": { + "category": "people", + "name": "woman with headscarf: medium-light skin tone", + "unicode": "1f9d5-1f3fc" + }, + ":woman_with_headscarf_tone3:": { + "category": "people", + "name": "woman with headscarf: medium skin tone", + "unicode": "1f9d5-1f3fd" + }, + ":woman_with_headscarf_tone4:": { + "category": "people", + "name": "woman with headscarf: medium-dark skin tone", + "unicode": "1f9d5-1f3fe" + }, + ":woman_with_headscarf_tone5:": { + "category": "people", + "name": "woman with headscarf: dark skin tone", + "unicode": "1f9d5-1f3ff" + }, + ":woman_with_probing_cane:": { + "category": "people", + "name": "woman with probing cane", + "unicode": "1f469-200d-1f9af" + }, + ":woman_with_probing_cane_tone1:": { + "category": "people", + "name": "woman with probing cane: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9af" + }, + ":woman_with_probing_cane_tone2:": { + "category": "people", + "name": "woman with probing cane: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9af" + }, + ":woman_with_probing_cane_tone3:": { + "category": "people", + "name": "woman with probing cane: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9af" + }, + ":woman_with_probing_cane_tone4:": { + "category": "people", + "name": "woman with probing cane: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9af" + }, + ":woman_with_probing_cane_tone5:": { + "category": "people", + "name": "woman with probing cane: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9af" + }, + ":woman_with_veil:": { + "category": "people", + "name": "woman with veil", + "unicode": "1f470-200d-2640-fe0f" + }, + ":woman_with_veil_tone1:": { + "category": "people", + "name": "woman with veil: light skin tone", + "unicode": "1f470-1f3fb-200d-2640-fe0f" + }, + ":woman_with_veil_tone2:": { + "category": "people", + "name": "woman with veil: medium-light skin tone", + "unicode": "1f470-1f3fc-200d-2640-fe0f" + }, + ":woman_with_veil_tone3:": { + "category": "people", + "name": "woman with veil: medium skin tone", + "unicode": "1f470-1f3fd-200d-2640-fe0f" + }, + ":woman_with_veil_tone4:": { + "category": "people", + "name": "woman with veil: medium-dark skin tone", + "unicode": "1f470-1f3fe-200d-2640-fe0f" + }, + ":woman_with_veil_tone5:": { + "category": "people", + "name": "woman with veil: dark skin tone", + "unicode": "1f470-1f3ff-200d-2640-fe0f" + }, + ":woman_with_white_cane_facing_right:": { + "category": "people", + "name": "woman with white cane facing right", + "unicode": "1f469-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_with_white_cane_facing_right_tone1:": { + "category": "people", + "name": "woman with white cane facing right: light skin tone", + "unicode": "1f469-1f3fb-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_with_white_cane_facing_right_tone2:": { + "category": "people", + "name": "woman with white cane facing right: medium-light skin tone", + "unicode": "1f469-1f3fc-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_with_white_cane_facing_right_tone3:": { + "category": "people", + "name": "woman with white cane facing right: medium skin tone", + "unicode": "1f469-1f3fd-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_with_white_cane_facing_right_tone4:": { + "category": "people", + "name": "woman with white cane facing right: medium-dark skin tone", + "unicode": "1f469-1f3fe-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_with_white_cane_facing_right_tone5:": { + "category": "people", + "name": "woman with white cane facing right: dark skin tone", + "unicode": "1f469-1f3ff-200d-1f9af-200d-27a1-fe0f" + }, + ":woman_zombie:": { + "category": "people", + "name": "woman zombie", + "unicode": "1f9df-200d-2640-fe0f" + }, + ":womans_clothes:": { + "category": "people", + "name": "woman\u2019s clothes", + "unicode": "1f45a" + }, + ":womans_flat_shoe:": { + "category": "people", + "name": "flat shoe", + "unicode": "1f97f" + }, + ":womans_hat:": { + "category": "people", + "name": "woman\u2019s hat", + "unicode": "1f452" + }, + ":women_holding_hands_tone1:": { + "category": "people", + "name": "women holding hands: light skin tone", + "unicode": "1f46d-1f3fb" + }, + ":women_holding_hands_tone1_tone2:": { + "category": "people", + "name": "women holding hands: light skin tone, medium-light skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc" + }, + ":women_holding_hands_tone1_tone3:": { + "category": "people", + "name": "women holding hands: light skin tone, medium skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd" + }, + ":women_holding_hands_tone1_tone4:": { + "category": "people", + "name": "women holding hands: light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe" + }, + ":women_holding_hands_tone1_tone5:": { + "category": "people", + "name": "women holding hands: light skin tone, dark skin tone", + "unicode": "1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff" + }, + ":women_holding_hands_tone2:": { + "category": "people", + "name": "women holding hands: medium-light skin tone", + "unicode": "1f46d-1f3fc" + }, + ":women_holding_hands_tone2_tone1:": { + "category": "people", + "name": "women holding hands: medium-light skin tone, light skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb" + }, + ":women_holding_hands_tone2_tone3:": { + "category": "people", + "name": "women holding hands: medium-light skin tone, medium skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd" + }, + ":women_holding_hands_tone2_tone4:": { + "category": "people", + "name": "women holding hands: medium-light skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe" + }, + ":women_holding_hands_tone2_tone5:": { + "category": "people", + "name": "women holding hands: medium-light skin tone, dark skin tone", + "unicode": "1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff" + }, + ":women_holding_hands_tone3:": { + "category": "people", + "name": "women holding hands: medium skin tone", + "unicode": "1f46d-1f3fd" + }, + ":women_holding_hands_tone3_tone1:": { + "category": "people", + "name": "women holding hands: medium skin tone, light skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb" + }, + ":women_holding_hands_tone3_tone2:": { + "category": "people", + "name": "women holding hands: medium skin tone, medium-light skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc" + }, + ":women_holding_hands_tone3_tone4:": { + "category": "people", + "name": "women holding hands: medium skin tone, medium-dark skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe" + }, + ":women_holding_hands_tone3_tone5:": { + "category": "people", + "name": "women holding hands: medium skin tone, dark skin tone", + "unicode": "1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff" + }, + ":women_holding_hands_tone4:": { + "category": "people", + "name": "women holding hands: medium-dark skin tone", + "unicode": "1f46d-1f3fe" + }, + ":women_holding_hands_tone4_tone1:": { + "category": "people", + "name": "women holding hands: medium-dark skin tone, light skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb" + }, + ":women_holding_hands_tone4_tone2:": { + "category": "people", + "name": "women holding hands: medium dark skin tone, medium light skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc" + }, + ":women_holding_hands_tone4_tone3:": { + "category": "people", + "name": "women holding hands: medium-dark skin tone, medium skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd" + }, + ":women_holding_hands_tone4_tone5:": { + "category": "people", + "name": "women holding hands: medium-dark skin tone, dark skin tone", + "unicode": "1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff" + }, + ":women_holding_hands_tone5:": { + "category": "people", + "name": "women holding hands: dark skin tone", + "unicode": "1f46d-1f3ff" + }, + ":women_holding_hands_tone5_tone1:": { + "category": "people", + "name": "women holding hands: dark skin tone, light skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb" + }, + ":women_holding_hands_tone5_tone2:": { + "category": "people", + "name": "women holding hands: dark skin tone, medium-light skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc" + }, + ":women_holding_hands_tone5_tone3:": { + "category": "people", + "name": "women holding hands: dark skin tone, medium skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd" + }, + ":women_holding_hands_tone5_tone4:": { + "category": "people", + "name": "women holding hands: dark skin tone, medium-dark skin tone", + "unicode": "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe" + }, + ":women_with_bunny_ears_partying:": { + "category": "people", + "name": "women with bunny ears", + "unicode": "1f46f-200d-2640-fe0f" + }, + ":women_wrestling:": { + "category": "activity", + "name": "women wrestling", + "unicode": "1f93c-200d-2640-fe0f" + }, + ":womens:": { + "category": "symbols", + "name": "women\u2019s room", + "unicode": "1f6ba" + }, + ":wood:": { + "category": "nature", + "name": "wood", + "unicode": "1fab5" + }, + ":woozy_face:": { + "category": "people", + "name": "woozy face", + "unicode": "1f974" + }, + ":worm:": { + "category": "nature", + "name": "worm", + "unicode": "1fab1" + }, + ":worried:": { + "category": "people", + "name": "worried face", + "unicode": "1f61f" + }, + ":wrench:": { + "category": "objects", + "name": "wrench", + "unicode": "1f527" + }, + ":writing_hand:": { + "category": "people", + "name": "writing hand", + "unicode": "270d" + }, + ":writing_hand_tone1:": { + "category": "people", + "name": "writing hand: light skin tone", + "unicode": "270d-1f3fb" + }, + ":writing_hand_tone2:": { + "category": "people", + "name": "writing hand: medium-light skin tone", + "unicode": "270d-1f3fc" + }, + ":writing_hand_tone3:": { + "category": "people", + "name": "writing hand: medium skin tone", + "unicode": "270d-1f3fd" + }, + ":writing_hand_tone4:": { + "category": "people", + "name": "writing hand: medium-dark skin tone", + "unicode": "270d-1f3fe" + }, + ":writing_hand_tone5:": { + "category": "people", + "name": "writing hand: dark skin tone", + "unicode": "270d-1f3ff" + }, + ":x:": { + "category": "symbols", + "name": "cross mark", + "unicode": "274c" + }, + ":x_ray:": { + "category": "objects", + "name": "x-ray", + "unicode": "1fa7b" + }, + ":yarn:": { + "category": "people", + "name": "yarn", + "unicode": "1f9f6" + }, + ":yawning_face:": { + "category": "people", + "name": "yawning face", + "unicode": "1f971" + }, + ":yellow_circle:": { + "category": "symbols", + "name": "yellow circle", + "unicode": "1f7e1" + }, + ":yellow_heart:": { + "category": "symbols", + "name": "yellow heart", + "unicode": "1f49b" + }, + ":yellow_square:": { + "category": "symbols", + "name": "yellow square", + "unicode": "1f7e8" + }, + ":yen:": { + "category": "objects", + "name": "yen banknote", + "unicode": "1f4b4" + }, + ":yin_yang:": { + "category": "symbols", + "name": "yin yang", + "unicode": "262f" + }, + ":yo_yo:": { + "category": "activity", + "name": "yo-yo", + "unicode": "1fa80" + }, + ":yum:": { + "category": "people", + "name": "face savoring food", + "unicode": "1f60b" + }, + ":zany_face:": { + "category": "people", + "name": "zany face", + "unicode": "1f92a" + }, + ":zap:": { + "category": "nature", + "name": "high voltage", + "unicode": "26a1" + }, + ":zebra:": { + "category": "nature", + "name": "zebra", + "unicode": "1f993" + }, + ":zero:": { + "category": "symbols", + "name": "keycap: 0", + "unicode": "30-20e3", + "unicode_alt": "0030-20e3" + }, + ":zipper_mouth:": { + "category": "people", + "name": "zipper-mouth face", + "unicode": "1f910" + }, + ":zombie:": { + "category": "people", + "name": "zombie", + "unicode": "1f9df" + }, + ":zzz:": { + "category": "symbols", + "name": "zzz", + "unicode": "1f4a4" + } +} +aliases = { + ":+1:": ":thumbsup:", + ":+1_tone1:": ":thumbsup_tone1:", + ":+1_tone2:": ":thumbsup_tone2:", + ":+1_tone3:": ":thumbsup_tone3:", + ":+1_tone4:": ":thumbsup_tone4:", + ":+1_tone5:": ":thumbsup_tone5:", + ":-1:": ":thumbsdown:", + ":-1_tone1:": ":thumbsdown_tone1:", + ":-1_tone2:": ":thumbsdown_tone2:", + ":-1_tone3:": ":thumbsdown_tone3:", + ":-1_tone4:": ":thumbsdown_tone4:", + ":-1_tone5:": ":thumbsdown_tone5:", + ":ac:": ":flag_ac:", + ":ad:": ":flag_ad:", + ":admission_tickets:": ":tickets:", + ":adult_dark_skin_tone:": ":adult_tone5:", + ":adult_light_skin_tone:": ":adult_tone1:", + ":adult_medium_dark_skin_tone:": ":adult_tone4:", + ":adult_medium_light_skin_tone:": ":adult_tone2:", + ":adult_medium_skin_tone:": ":adult_tone3:", + ":ae:": ":flag_ae:", + ":af:": ":flag_af:", + ":ag:": ":flag_ag:", + ":ai:": ":flag_ai:", + ":al:": ":flag_al:", + ":alien_monster:": ":space_invader:", + ":am:": ":flag_am:", + ":angry_face:": ":angry:", + ":antenna_bars:": ":signal_strength:", + ":ao:": ":flag_ao:", + ":aq:": ":flag_aq:", + ":ar:": ":flag_ar:", + ":archery:": ":bow_and_arrow:", + ":artist_dark_skin_tone:": ":artist_tone5:", + ":artist_light_skin_tone:": ":artist_tone1:", + ":artist_medium_dark_skin_tone:": ":artist_tone4:", + ":artist_medium_light_skin_tone:": ":artist_tone2:", + ":artist_medium_skin_tone:": ":artist_tone3:", + ":as:": ":flag_as:", + ":astronaut_dark_skin_tone:": ":astronaut_tone5:", + ":astronaut_light_skin_tone:": ":astronaut_tone1:", + ":astronaut_medium_dark_skin_tone:": ":astronaut_tone4:", + ":astronaut_medium_light_skin_tone:": ":astronaut_tone2:", + ":astronaut_medium_skin_tone:": ":astronaut_tone3:", + ":at:": ":flag_at:", + ":atom_symbol:": ":atom:", + ":au:": ":flag_au:", + ":automobile:": ":red_car:", + ":aw:": ":flag_aw:", + ":ax:": ":flag_ax:", + ":az:": ":flag_az:", + ":ba:": ":flag_ba:", + ":baby_angel:": ":angel:", + ":back_arrow:": ":back:", + ":back_of_hand:": ":raised_back_of_hand:", + ":back_of_hand_tone1:": ":raised_back_of_hand_tone1:", + ":back_of_hand_tone2:": ":raised_back_of_hand_tone2:", + ":back_of_hand_tone3:": ":raised_back_of_hand_tone3:", + ":back_of_hand_tone4:": ":raised_back_of_hand_tone4:", + ":back_of_hand_tone5:": ":raised_back_of_hand_tone5:", + ":backpack:": ":school_satchel:", + ":baguette_bread:": ":french_bread:", + ":balance_scale:": ":scales:", + ":ballot_box_with_ballot:": ":ballot_box:", + ":barber_pole:": ":barber:", + ":basketball_player:": ":person_bouncing_ball:", + ":basketball_player_tone1:": ":person_bouncing_ball_tone1:", + ":basketball_player_tone2:": ":person_bouncing_ball_tone2:", + ":basketball_player_tone3:": ":person_bouncing_ball_tone3:", + ":basketball_player_tone4:": ":person_bouncing_ball_tone4:", + ":basketball_player_tone5:": ":person_bouncing_ball_tone5:", + ":bb:": ":flag_bb:", + ":bd:": ":flag_bd:", + ":be:": ":flag_be:", + ":beach_with_umbrella:": ":beach:", + ":bearded_person_dark_skin_tone:": ":bearded_person_tone5:", + ":bearded_person_light_skin_tone:": ":bearded_person_tone1:", + ":bearded_person_medium_dark_skin_tone:": ":bearded_person_tone4:", + ":bearded_person_medium_light_skin_tone:": ":bearded_person_tone2:", + ":bearded_person_medium_skin_tone:": ":bearded_person_tone3:", + ":beating_heart:": ":heartbeat:", + ":beer_mug:": ":beer:", + ":bellhop_bell:": ":bellhop:", + ":bento_box:": ":bento:", + ":bf:": ":flag_bf:", + ":bg:": ":flag_bg:", + ":bh:": ":flag_bh:", + ":bi:": ":flag_bi:", + ":bicycle:": ":bike:", + ":bicyclist:": ":person_biking:", + ":bicyclist_tone1:": ":person_biking_tone1:", + ":bicyclist_tone2:": ":person_biking_tone2:", + ":bicyclist_tone3:": ":person_biking_tone3:", + ":bicyclist_tone4:": ":person_biking_tone4:", + ":bicyclist_tone5:": ":person_biking_tone5:", + ":biohazard_sign:": ":biohazard:", + ":birthday_cake:": ":birthday:", + ":bj:": ":flag_bj:", + ":bl:": ":flag_bl:", + ":black_flag:": ":flag_black:", + ":blond-haired_man_dark_skin_tone:": ":blond-haired_man_tone5:", + ":blond-haired_man_light_skin_tone:": ":blond-haired_man_tone1:", + ":blond-haired_man_medium_dark_skin_tone:": ":blond-haired_man_tone4:", + ":blond-haired_man_medium_light_skin_tone:": ":blond-haired_man_tone2:", + ":blond-haired_man_medium_skin_tone:": ":blond-haired_man_tone3:", + ":blond-haired_woman_dark_skin_tone:": ":blond-haired_woman_tone5:", + ":blond-haired_woman_light_skin_tone:": ":blond-haired_woman_tone1:", + ":blond-haired_woman_medium_dark_skin_tone:": ":blond-haired_woman_tone4:", + ":blond-haired_woman_medium_light_skin_tone:": ":blond-haired_woman_tone2:", + ":blond-haired_woman_medium_skin_tone:": ":blond-haired_woman_tone3:", + ":bm:": ":flag_bm:", + ":bn:": ":flag_bn:", + ":bo:": ":flag_bo:", + ":bottle_with_popping_cork:": ":champagne:", + ":bow:": ":person_bowing:", + ":bow_tone1:": ":person_bowing_tone1:", + ":bow_tone2:": ":person_bowing_tone2:", + ":bow_tone3:": ":person_bowing_tone3:", + ":bow_tone4:": ":person_bowing_tone4:", + ":bow_tone5:": ":person_bowing_tone5:", + ":boxing_gloves:": ":boxing_glove:", + ":bq:": ":flag_bq:", + ":br:": ":flag_br:", + ":breast_feeding_dark_skin_tone:": ":breast_feeding_tone5:", + ":breast_feeding_light_skin_tone:": ":breast_feeding_tone1:", + ":breast_feeding_medium_dark_skin_tone:": ":breast_feeding_tone4:", + ":breast_feeding_medium_light_skin_tone:": ":breast_feeding_tone2:", + ":breast_feeding_medium_skin_tone:": ":breast_feeding_tone3:", + ":brick:": ":bricks:", + ":bs:": ":flag_bs:", + ":bt:": ":flag_bt:", + ":building_construction:": ":construction_site:", + ":bullet_train:": ":bullettrain_front:", + ":bus_stop:": ":busstop:", + ":bv:": ":flag_bv:", + ":bw:": ":flag_bw:", + ":by:": ":flag_by:", + ":bz:": ":flag_bz:", + ":ca:": ":flag_ca:", + ":call_me_hand:": ":call_me:", + ":call_me_hand_tone1:": ":call_me_tone1:", + ":call_me_hand_tone2:": ":call_me_tone2:", + ":call_me_hand_tone3:": ":call_me_tone3:", + ":call_me_hand_tone4:": ":call_me_tone4:", + ":call_me_hand_tone5:": ":call_me_tone5:", + ":card_file_box:": ":card_box:", + ":card_index_dividers:": ":dividers:", + ":carp_streamer:": ":flags:", + ":cartwheel:": ":person_doing_cartwheel:", + ":cartwheel_tone1:": ":person_doing_cartwheel_tone1:", + ":cartwheel_tone2:": ":person_doing_cartwheel_tone2:", + ":cartwheel_tone3:": ":person_doing_cartwheel_tone3:", + ":cartwheel_tone4:": ":person_doing_cartwheel_tone4:", + ":cartwheel_tone5:": ":person_doing_cartwheel_tone5:", + ":castle:": ":european_castle:", + ":cat_face:": ":cat:", + ":cc:": ":flag_cc:", + ":cf:": ":flag_cf:", + ":cg:": ":flag_cg:", + ":ch:": ":flag_ch:", + ":check_mark:": ":heavy_check_mark:", + ":cheese_wedge:": ":cheese:", + ":child_dark_skin_tone:": ":child_tone5:", + ":child_light_skin_tone:": ":child_tone1:", + ":child_medium_dark_skin_tone:": ":child_tone4:", + ":child_medium_light_skin_tone:": ":child_tone2:", + ":child_medium_skin_tone:": ":child_tone3:", + ":chile:": ":flag_cl:", + ":ci:": ":flag_ci:", + ":cigarette:": ":smoking:", + ":circled_m:": ":m:", + ":city_sunrise:": ":city_sunset:", + ":ck:": ":flag_ck:", + ":clamp:": ":compression:", + ":clapper_board:": ":clapper:", + ":clinking_glass:": ":champagne_glass:", + ":cloud_with_lightning:": ":cloud_lightning:", + ":cloud_with_rain:": ":cloud_rain:", + ":cloud_with_snow:": ":cloud_snow:", + ":cloud_with_tornado:": ":cloud_tornado:", + ":clown_face:": ":clown:", + ":club_suit:": ":clubs:", + ":clutch_bag:": ":pouch:", + ":cm:": ":flag_cm:", + ":cn:": ":flag_cn:", + ":co:": ":flag_co:", + ":collision:": ":boom:", + ":computer_disk:": ":minidisc:", + ":confused_face:": ":confused:", + ":congo:": ":flag_cd:", + ":cook_dark_skin_tone:": ":cook_tone5:", + ":cook_light_skin_tone:": ":cook_tone1:", + ":cook_medium_dark_skin_tone:": ":cook_tone4:", + ":cook_medium_light_skin_tone:": ":cook_tone2:", + ":cook_medium_skin_tone:": ":cook_tone3:", + ":cooked_rice:": ":rice:", + ":cop:": ":police_officer:", + ":cop_tone1:": ":police_officer_tone1:", + ":cop_tone2:": ":police_officer_tone2:", + ":cop_tone3:": ":police_officer_tone3:", + ":cop_tone4:": ":police_officer_tone4:", + ":cop_tone5:": ":police_officer_tone5:", + ":couch_and_lamp:": ":couch:", + ":couple_with_heart_dark_skin_tone:": ":couple_with_heart_tone5:", + ":couple_with_heart_light_skin_tone:": ":couple_with_heart_tone1:", + ":couple_with_heart_man_man_dark_skin_tone:": ":couple_with_heart_man_man_tone5:", + ":couple_with_heart_man_man_dark_skin_tone_light_skin_tone:": ":couple_with_heart_man_man_tone5_tone1:", + ":couple_with_heart_man_man_dark_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_man_man_tone5_tone4:", + ":couple_with_heart_man_man_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_man_man_tone5_tone2:", + ":couple_with_heart_man_man_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_man_man_tone5_tone3:", + ":couple_with_heart_man_man_light_skin_tone:": ":couple_with_heart_man_man_tone1:", + ":couple_with_heart_man_man_light_skin_tone_dark_skin_tone:": ":couple_with_heart_man_man_tone1_tone5:", + ":couple_with_heart_man_man_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_man_man_tone1_tone4:", + ":couple_with_heart_man_man_light_skin_tone_medium_light_skin_tone:": ":couple_with_heart_man_man_tone1_tone2:", + ":couple_with_heart_man_man_light_skin_tone_medium_skin_tone:": ":couple_with_heart_man_man_tone1_tone3:", + ":couple_with_heart_man_man_medium_dark_skin_tone:": ":couple_with_heart_man_man_tone4:", + ":couple_with_heart_man_man_medium_dark_skin_tone_dark_skin_tone:": ":couple_with_heart_man_man_tone4_tone5:", + ":couple_with_heart_man_man_medium_dark_skin_tone_light_skin_tone:": ":couple_with_heart_man_man_tone4_tone1:", + ":couple_with_heart_man_man_medium_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_man_man_tone4_tone2:", + ":couple_with_heart_man_man_medium_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_man_man_tone4_tone3:", + ":couple_with_heart_man_man_medium_light_skin_tone:": ":couple_with_heart_man_man_tone2:", + ":couple_with_heart_man_man_medium_light_skin_tone_dark_skin_tone:": ":couple_with_heart_man_man_tone2_tone5:", + ":couple_with_heart_man_man_medium_light_skin_tone_light_skin_tone:": ":couple_with_heart_man_man_tone2_tone1:", + ":couple_with_heart_man_man_medium_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_man_man_tone2_tone4:", + ":couple_with_heart_man_man_medium_light_skin_tone_medium_skin_tone:": ":couple_with_heart_man_man_tone2_tone3:", + ":couple_with_heart_man_man_medium_skin_tone:": ":couple_with_heart_man_man_tone3:", + ":couple_with_heart_man_man_medium_skin_tone_dark_skin_tone:": ":couple_with_heart_man_man_tone3_tone5:", + ":couple_with_heart_man_man_medium_skin_tone_light_skin_tone:": ":couple_with_heart_man_man_tone3_tone1:", + ":couple_with_heart_man_man_medium_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_man_man_tone3_tone4:", + ":couple_with_heart_man_man_medium_skin_tone_medium_light_skin_tone:": ":couple_with_heart_man_man_tone3_tone2:", + ":couple_with_heart_medium_dark_skin_tone:": ":couple_with_heart_tone4:", + ":couple_with_heart_medium_light_skin_tone:": ":couple_with_heart_tone2:", + ":couple_with_heart_medium_skin_tone:": ":couple_with_heart_tone3:", + ":couple_with_heart_mm:": ":couple_mm:", + ":couple_with_heart_person_person_dark_skin_tone_light_skin_tone:": ":couple_with_heart_person_person_tone5_tone1:", + ":couple_with_heart_person_person_dark_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_person_person_tone5_tone4:", + ":couple_with_heart_person_person_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_person_person_tone5_tone2:", + ":couple_with_heart_person_person_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_person_person_tone5_tone3:", + ":couple_with_heart_person_person_light_skin_tone_dark_skin_tone:": ":couple_with_heart_person_person_tone1_tone5:", + ":couple_with_heart_person_person_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_person_person_tone1_tone4:", + ":couple_with_heart_person_person_light_skin_tone_medium_light_skin_tone:": ":couple_with_heart_person_person_tone1_tone2:", + ":couple_with_heart_person_person_light_skin_tone_medium_skin_tone:": ":couple_with_heart_person_person_tone1_tone3:", + ":couple_with_heart_person_person_medium_dark_skin_tone_dark_skin_tone:": ":couple_with_heart_person_person_tone4_tone5:", + ":couple_with_heart_person_person_medium_dark_skin_tone_light_skin_tone:": ":couple_with_heart_person_person_tone4_tone1:", + ":couple_with_heart_person_person_medium_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_person_person_tone4_tone2:", + ":couple_with_heart_person_person_medium_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_person_person_tone4_tone3:", + ":couple_with_heart_person_person_medium_light_skin_tone_dark_skin_tone:": ":couple_with_heart_person_person_tone2_tone5:", + ":couple_with_heart_person_person_medium_light_skin_tone_light_skin_tone:": ":couple_with_heart_person_person_tone2_tone1:", + ":couple_with_heart_person_person_medium_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_person_person_tone2_tone4:", + ":couple_with_heart_person_person_medium_light_skin_tone_medium_skin_tone:": ":couple_with_heart_person_person_tone2_tone3:", + ":couple_with_heart_person_person_medium_skin_tone_dark_skin_tone:": ":couple_with_heart_person_person_tone3_tone5:", + ":couple_with_heart_person_person_medium_skin_tone_light_skin_tone:": ":couple_with_heart_person_person_tone3_tone1:", + ":couple_with_heart_person_person_medium_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_person_person_tone3_tone4:", + ":couple_with_heart_person_person_medium_skin_tone_medium_light_skin_tone:": ":couple_with_heart_person_person_tone3_tone2:", + ":couple_with_heart_woman_man_dark_skin_tone:": ":couple_with_heart_woman_man_tone5:", + ":couple_with_heart_woman_man_dark_skin_tone_light_skin_tone:": ":couple_with_heart_woman_man_tone5_tone1:", + ":couple_with_heart_woman_man_dark_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_man_tone5_tone4:", + ":couple_with_heart_woman_man_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_man_tone5_tone2:", + ":couple_with_heart_woman_man_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_man_tone5_tone3:", + ":couple_with_heart_woman_man_light_skin_tone:": ":couple_with_heart_woman_man_tone1:", + ":couple_with_heart_woman_man_light_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_man_tone1_tone5:", + ":couple_with_heart_woman_man_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_man_tone1_tone4:", + ":couple_with_heart_woman_man_light_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_man_tone1_tone2:", + ":couple_with_heart_woman_man_light_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_man_tone1_tone3:", + ":couple_with_heart_woman_man_medium_dark_skin_tone:": ":couple_with_heart_woman_man_tone4:", + ":couple_with_heart_woman_man_medium_dark_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_man_tone4_tone5:", + ":couple_with_heart_woman_man_medium_dark_skin_tone_light_skin_tone:": ":couple_with_heart_woman_man_tone4_tone1:", + ":couple_with_heart_woman_man_medium_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_man_tone4_tone2:", + ":couple_with_heart_woman_man_medium_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_man_tone4_tone3:", + ":couple_with_heart_woman_man_medium_light_skin_tone:": ":couple_with_heart_woman_man_tone2:", + ":couple_with_heart_woman_man_medium_light_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_man_tone2_tone5:", + ":couple_with_heart_woman_man_medium_light_skin_tone_light_skin_tone:": ":couple_with_heart_woman_man_tone2_tone1:", + ":couple_with_heart_woman_man_medium_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_man_tone2_tone4:", + ":couple_with_heart_woman_man_medium_light_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_man_tone2_tone3:", + ":couple_with_heart_woman_man_medium_skin_tone:": ":couple_with_heart_woman_man_tone3:", + ":couple_with_heart_woman_man_medium_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_man_tone3_tone5:", + ":couple_with_heart_woman_man_medium_skin_tone_light_skin_tone:": ":couple_with_heart_woman_man_tone3_tone1:", + ":couple_with_heart_woman_man_medium_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_man_tone3_tone4:", + ":couple_with_heart_woman_man_medium_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_man_tone3_tone2:", + ":couple_with_heart_woman_woman_dark_skin_tone:": ":couple_with_heart_woman_woman_tone5:", + ":couple_with_heart_woman_woman_dark_skin_tone_light_skin_tone:": ":couple_with_heart_woman_woman_tone5_tone1:", + ":couple_with_heart_woman_woman_dark_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_woman_tone5_tone4:", + ":couple_with_heart_woman_woman_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_woman_tone5_tone2:", + ":couple_with_heart_woman_woman_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_woman_tone5_tone3:", + ":couple_with_heart_woman_woman_light_skin_tone:": ":couple_with_heart_woman_woman_tone1:", + ":couple_with_heart_woman_woman_light_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_woman_tone1_tone5:", + ":couple_with_heart_woman_woman_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_woman_tone1_tone4:", + ":couple_with_heart_woman_woman_light_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_woman_tone1_tone2:", + ":couple_with_heart_woman_woman_light_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_woman_tone1_tone3:", + ":couple_with_heart_woman_woman_medium_dark_skin_tone:": ":couple_with_heart_woman_woman_tone4:", + ":couple_with_heart_woman_woman_medium_dark_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_woman_tone4_tone5:", + ":couple_with_heart_woman_woman_medium_dark_skin_tone_light_skin_tone:": ":couple_with_heart_woman_woman_tone4_tone1:", + ":couple_with_heart_woman_woman_medium_dark_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_woman_tone4_tone2:", + ":couple_with_heart_woman_woman_medium_dark_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_woman_tone4_tone3:", + ":couple_with_heart_woman_woman_medium_light_skin_tone:": ":couple_with_heart_woman_woman_tone2:", + ":couple_with_heart_woman_woman_medium_light_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_woman_tone2_tone5:", + ":couple_with_heart_woman_woman_medium_light_skin_tone_light_skin_tone:": ":couple_with_heart_woman_woman_tone2_tone1:", + ":couple_with_heart_woman_woman_medium_light_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_woman_tone2_tone4:", + ":couple_with_heart_woman_woman_medium_light_skin_tone_medium_skin_tone:": ":couple_with_heart_woman_woman_tone2_tone3:", + ":couple_with_heart_woman_woman_medium_skin_tone:": ":couple_with_heart_woman_woman_tone3:", + ":couple_with_heart_woman_woman_medium_skin_tone_dark_skin_tone:": ":couple_with_heart_woman_woman_tone3_tone5:", + ":couple_with_heart_woman_woman_medium_skin_tone_light_skin_tone:": ":couple_with_heart_woman_woman_tone3_tone1:", + ":couple_with_heart_woman_woman_medium_skin_tone_medium_dark_skin_tone:": ":couple_with_heart_woman_woman_tone3_tone4:", + ":couple_with_heart_woman_woman_medium_skin_tone_medium_light_skin_tone:": ":couple_with_heart_woman_woman_tone3_tone2:", + ":couple_with_heart_ww:": ":couple_ww:", + ":couplekiss_mm:": ":kiss_mm:", + ":couplekiss_ww:": ":kiss_ww:", + ":cow_face:": ":cow:", + ":cp:": ":flag_cp:", + ":cr:": ":flag_cr:", + ":cricket_bat_ball:": ":cricket_game:", + ":cross_mark:": ":x:", + ":crying_cat:": ":crying_cat_face:", + ":crying_face:": ":cry:", + ":cu:": ":flag_cu:", + ":curly_hair:": ":curly_haired:", + ":curry_rice:": ":curry:", + ":cv:": ":flag_cv:", + ":cw:": ":flag_cw:", + ":cx:": ":flag_cx:", + ":cy:": ":flag_cy:", + ":cz:": ":flag_cz:", + ":dagger_knife:": ":dagger:", + ":dancers:": ":people_with_bunny_ears_partying:", + ":dashing_away:": ":dash:", + ":de:": ":flag_de:", + ":deaf_man_dark_skin_tone:": ":deaf_man_tone5:", + ":deaf_man_light_skin_tone:": ":deaf_man_tone1:", + ":deaf_man_medium_dark_skin_tone:": ":deaf_man_tone4:", + ":deaf_man_medium_light_skin_tone:": ":deaf_man_tone2:", + ":deaf_man_medium_skin_tone:": ":deaf_man_tone3:", + ":deaf_person_dark_skin_tone:": ":deaf_person_tone5:", + ":deaf_person_light_skin_tone:": ":deaf_person_tone1:", + ":deaf_person_medium_dark_skin_tone:": ":deaf_person_tone4:", + ":deaf_person_medium_light_skin_tone:": ":deaf_person_tone2:", + ":deaf_person_medium_skin_tone:": ":deaf_person_tone3:", + ":deaf_woman_dark_skin_tone:": ":deaf_woman_tone5:", + ":deaf_woman_light_skin_tone:": ":deaf_woman_tone1:", + ":deaf_woman_medium_dark_skin_tone:": ":deaf_woman_tone4:", + ":deaf_woman_medium_light_skin_tone:": ":deaf_woman_tone2:", + ":deaf_woman_medium_skin_tone:": ":deaf_woman_tone3:", + ":derelict_house_building:": ":house_abandoned:", + ":desert_island:": ":island:", + ":desktop_computer:": ":desktop:", + ":dg:": ":flag_dg:", + ":diamond_suit:": ":diamonds:", + ":direct_hit:": ":dart:", + ":dj:": ":flag_dj:", + ":dk:": ":flag_dk:", + ":dm:": ":flag_dm:", + ":do:": ":flag_do:", + ":dog_face:": ":dog:", + ":double_vertical_bar:": ":pause_button:", + ":dove_of_peace:": ":dove:", + ":down_arrow:": ":arrow_down:", + ":drool:": ":drooling_face:", + ":drum_with_drumsticks:": ":drum:", + ":dz:": ":flag_dz:", + ":e_mail:": ":e-mail:", + ":ea:": ":flag_ea:", + ":ear_of_corn:": ":corn:", + ":ear_with_hearing_aid_dark_skin_tone:": ":ear_with_hearing_aid_tone5:", + ":ear_with_hearing_aid_light_skin_tone:": ":ear_with_hearing_aid_tone1:", + ":ear_with_hearing_aid_medium_dark_skin_tone:": ":ear_with_hearing_aid_tone4:", + ":ear_with_hearing_aid_medium_light_skin_tone:": ":ear_with_hearing_aid_tone2:", + ":ear_with_hearing_aid_medium_skin_tone:": ":ear_with_hearing_aid_tone3:", + ":ec:": ":flag_ec:", + ":ee:": ":flag_ee:", + ":eg:": ":flag_eg:", + ":eh:": ":flag_eh:", + ":eight_oclock:": ":clock8:", + ":eight_thirty:": ":clock830:", + ":eject_symbol:": ":eject:", + ":eleven_oclock:": ":clock11:", + ":eleven_thirty:": ":clock1130:", + ":elf_dark_skin_tone:": ":elf_tone5:", + ":elf_light_skin_tone:": ":elf_tone1:", + ":elf_medium_dark_skin_tone:": ":elf_tone4:", + ":elf_medium_light_skin_tone:": ":elf_tone2:", + ":elf_medium_skin_tone:": ":elf_tone3:", + ":email:": ":e-mail:", + ":end_arrow:": ":end:", + ":er:": ":flag_er:", + ":es:": ":flag_es:", + ":et:": ":flag_et:", + ":eu:": ":flag_eu:", + ":euro_banknote:": ":euro:", + ":ewe:": ":sheep:", + ":expecting_woman:": ":pregnant_woman:", + ":expecting_woman_tone1:": ":pregnant_woman_tone1:", + ":expecting_woman_tone2:": ":pregnant_woman_tone2:", + ":expecting_woman_tone3:": ":pregnant_woman_tone3:", + ":expecting_woman_tone4:": ":pregnant_woman_tone4:", + ":expecting_woman_tone5:": ":pregnant_woman_tone5:", + ":face_palm:": ":person_facepalming:", + ":face_palm_tone1:": ":person_facepalming_tone1:", + ":face_palm_tone2:": ":person_facepalming_tone2:", + ":face_palm_tone3:": ":person_facepalming_tone3:", + ":face_palm_tone4:": ":person_facepalming_tone4:", + ":face_palm_tone5:": ":person_facepalming_tone5:", + ":face_with_cowboy_hat:": ":cowboy:", + ":face_with_head_bandage:": ":head_bandage:", + ":face_with_rolling_eyes:": ":rolling_eyes:", + ":face_with_thermometer:": ":thermometer_face:", + ":facepalm:": ":person_facepalming:", + ":facepalm_tone1:": ":person_facepalming_tone1:", + ":facepalm_tone2:": ":person_facepalming_tone2:", + ":facepalm_tone3:": ":person_facepalming_tone3:", + ":facepalm_tone4:": ":person_facepalming_tone4:", + ":facepalm_tone5:": ":person_facepalming_tone5:", + ":factory_worker_dark_skin_tone:": ":factory_worker_tone5:", + ":factory_worker_light_skin_tone:": ":factory_worker_tone1:", + ":factory_worker_medium_dark_skin_tone:": ":factory_worker_tone4:", + ":factory_worker_medium_light_skin_tone:": ":factory_worker_tone2:", + ":factory_worker_medium_skin_tone:": ":factory_worker_tone3:", + ":fairy_dark_skin_tone:": ":fairy_tone5:", + ":fairy_light_skin_tone:": ":fairy_tone1:", + ":fairy_medium_dark_skin_tone:": ":fairy_tone4:", + ":fairy_medium_light_skin_tone:": ":fairy_tone2:", + ":fairy_medium_skin_tone:": ":fairy_tone3:", + ":farmer_dark_skin_tone:": ":farmer_tone5:", + ":farmer_light_skin_tone:": ":farmer_tone1:", + ":farmer_medium_dark_skin_tone:": ":farmer_tone4:", + ":farmer_medium_light_skin_tone:": ":farmer_tone2:", + ":farmer_medium_skin_tone:": ":farmer_tone3:", + ":fax_machine:": ":fax:", + ":fearful_face:": ":fearful:", + ":fencer:": ":person_fencing:", + ":fencing:": ":person_fencing:", + ":fi:": ":flag_fi:", + ":film_projector:": ":projector:", + ":firefighter_dark_skin_tone:": ":firefighter_tone5:", + ":firefighter_light_skin_tone:": ":firefighter_tone1:", + ":firefighter_medium_dark_skin_tone:": ":firefighter_tone4:", + ":firefighter_medium_light_skin_tone:": ":firefighter_tone2:", + ":firefighter_medium_skin_tone:": ":firefighter_tone3:", + ":first_place_medal:": ":first_place:", + ":fishing_pole:": ":fishing_pole_and_fish:", + ":five_oclock:": ":clock5:", + ":five_thirty:": ":clock530:", + ":fj:": ":flag_fj:", + ":fk:": ":flag_fk:", + ":flag_in_hole:": ":golf:", + ":flame:": ":fire:", + ":flan:": ":custard:", + ":flat_shoe:": ":womans_flat_shoe:", + ":fleur_de_lis:": ":fleur-de-lis:", + ":flexed_biceps:": ":muscle:", + ":flushed_face:": ":flushed:", + ":fm:": ":flag_fm:", + ":fo:": ":flag_fo:", + ":folded_hands:": ":pray:", + ":foot_dark_skin_tone:": ":foot_tone5:", + ":foot_light_skin_tone:": ":foot_tone1:", + ":foot_medium_dark_skin_tone:": ":foot_tone4:", + ":foot_medium_light_skin_tone:": ":foot_tone2:", + ":foot_medium_skin_tone:": ":foot_tone3:", + ":fork_and_knife_with_plate:": ":fork_knife_plate:", + ":fountain_pen:": ":pen_fountain:", + ":four_oclock:": ":clock4:", + ":four_thirty:": ":clock430:", + ":fox_face:": ":fox:", + ":fr:": ":flag_fr:", + ":frame_with_picture:": ":frame_photo:", + ":french_fries:": ":fries:", + ":frowning_face:": ":frowning2:", + ":fuel_pump:": ":fuelpump:", + ":funeral_urn:": ":urn:", + ":ga:": ":flag_ga:", + ":gay_pride_flag:": ":rainbow_flag:", + ":gb:": ":flag_gb:", + ":gd:": ":flag_gd:", + ":ge:": ":flag_ge:", + ":gem_stone:": ":gem:", + ":gf:": ":flag_gf:", + ":gg:": ":flag_gg:", + ":gh:": ":flag_gh:", + ":gi:": ":flag_gi:", + ":gl:": ":flag_gl:", + ":glass_of_milk:": ":milk:", + ":glasses:": ":eyeglasses:", + ":glowing_star:": ":star2:", + ":gm:": ":flag_gm:", + ":gn:": ":flag_gn:", + ":goal_net:": ":goal:", + ":goblin:": ":japanese_goblin:", + ":golfer:": ":person_golfing:", + ":gp:": ":flag_gp:", + ":gq:": ":flag_gq:", + ":gr:": ":flag_gr:", + ":grandma:": ":older_woman:", + ":grandma_tone1:": ":older_woman_tone1:", + ":grandma_tone2:": ":older_woman_tone2:", + ":grandma_tone3:": ":older_woman_tone3:", + ":grandma_tone4:": ":older_woman_tone4:", + ":grandma_tone5:": ":older_woman_tone5:", + ":green_salad:": ":salad:", + ":grinning_cat:": ":smiley_cat:", + ":grinning_face:": ":grinning:", + ":growing_heart:": ":heartpulse:", + ":gs:": ":flag_gs:", + ":gt:": ":flag_gt:", + ":gu:": ":flag_gu:", + ":guardsman:": ":guard:", + ":guardsman_tone1:": ":guard_tone1:", + ":guardsman_tone2:": ":guard_tone2:", + ":guardsman_tone3:": ":guard_tone3:", + ":guardsman_tone4:": ":guard_tone4:", + ":guardsman_tone5:": ":guard_tone5:", + ":gw:": ":flag_gw:", + ":gy:": ":flag_gy:", + ":haircut:": ":person_getting_haircut:", + ":haircut_tone1:": ":person_getting_haircut_tone1:", + ":haircut_tone2:": ":person_getting_haircut_tone2:", + ":haircut_tone3:": ":person_getting_haircut_tone3:", + ":haircut_tone4:": ":person_getting_haircut_tone4:", + ":haircut_tone5:": ":person_getting_haircut_tone5:", + ":hammer_and_pick:": ":hammer_pick:", + ":hammer_and_wrench:": ":tools:", + ":hand_with_index_and_middle_finger_crossed:": ":fingers_crossed:", + ":hand_with_index_and_middle_fingers_crossed_tone1:": ":fingers_crossed_tone1:", + ":hand_with_index_and_middle_fingers_crossed_tone2:": ":fingers_crossed_tone2:", + ":hand_with_index_and_middle_fingers_crossed_tone3:": ":fingers_crossed_tone3:", + ":hand_with_index_and_middle_fingers_crossed_tone4:": ":fingers_crossed_tone4:", + ":hand_with_index_and_middle_fingers_crossed_tone5:": ":fingers_crossed_tone5:", + ":hand_with_index_finger_and_thumb_crossed_dark_skin_tone:": ":hand_with_index_finger_and_thumb_crossed_tone5:", + ":hand_with_index_finger_and_thumb_crossed_light_skin_tone:": ":hand_with_index_finger_and_thumb_crossed_tone1:", + ":hand_with_index_finger_and_thumb_crossed_medium_dark_skin_tone:": ":hand_with_index_finger_and_thumb_crossed_tone4:", + ":hand_with_index_finger_and_thumb_crossed_medium_light_skin_tone:": ":hand_with_index_finger_and_thumb_crossed_tone2:", + ":hand_with_index_finger_and_thumb_crossed_medium_skin_tone:": ":hand_with_index_finger_and_thumb_crossed_tone3:", + ":handball:": ":person_playing_handball:", + ":handball_tone1:": ":person_playing_handball_tone1:", + ":handball_tone2:": ":person_playing_handball_tone2:", + ":handball_tone3:": ":person_playing_handball_tone3:", + ":handball_tone4:": ":person_playing_handball_tone4:", + ":handball_tone5:": ":person_playing_handball_tone5:", + ":handshake_dark_skin_tone:": ":handshake_tone5:", + ":handshake_dark_skin_tone_light_skin_tone:": ":handshake_tone5_tone1:", + ":handshake_dark_skin_tone_medium_dark_skin_tone:": ":handshake_tone5_tone4:", + ":handshake_dark_skin_tone_medium_light_skin_tone:": ":handshake_tone5_tone2:", + ":handshake_dark_skin_tone_medium_skin_tone:": ":handshake_tone5_tone3:", + ":handshake_light_skin_tone:": ":handshake_tone1:", + ":handshake_light_skin_tone_dark_skin_tone:": ":handshake_tone1_tone5:", + ":handshake_light_skin_tone_medium_dark_skin_tone:": ":handshake_tone1_tone4:", + ":handshake_light_skin_tone_medium_light_skin_tone:": ":handshake_tone1_tone2:", + ":handshake_light_skin_tone_medium_skin_tone:": ":handshake_tone1_tone3:", + ":handshake_medium_dark_skin_tone:": ":handshake_tone4:", + ":handshake_medium_dark_skin_tone_dark_skin_tone:": ":handshake_tone4_tone5:", + ":handshake_medium_dark_skin_tone_light_skin_tone:": ":handshake_tone4_tone1:", + ":handshake_medium_dark_skin_tone_medium_light_skin_tone:": ":handshake_tone4_tone2:", + ":handshake_medium_dark_skin_tone_medium_skin_tone:": ":handshake_tone4_tone3:", + ":handshake_medium_light_skin_tone:": ":handshake_tone2:", + ":handshake_medium_light_skin_tone_dark_skin_tone:": ":handshake_tone2_tone5:", + ":handshake_medium_light_skin_tone_light_skin_tone:": ":handshake_tone2_tone1:", + ":handshake_medium_light_skin_tone_medium_dark_skin_tone:": ":handshake_tone2_tone4:", + ":handshake_medium_light_skin_tone_medium_skin_tone:": ":handshake_tone2_tone3:", + ":handshake_medium_skin_tone:": ":handshake_tone3:", + ":handshake_medium_skin_tone_dark_skin_tone:": ":handshake_tone3_tone5:", + ":handshake_medium_skin_tone_light_skin_tone:": ":handshake_tone3_tone1:", + ":handshake_medium_skin_tone_medium_dark_skin_tone:": ":handshake_tone3_tone4:", + ":handshake_medium_skin_tone_medium_light_skin_tone:": ":handshake_tone3_tone2:", + ":hankey:": ":poop:", + ":headphone:": ":headphones:", + ":health_worker_dark_skin_tone:": ":health_worker_tone5:", + ":health_worker_light_skin_tone:": ":health_worker_tone1:", + ":health_worker_medium_dark_skin_tone:": ":health_worker_tone4:", + ":health_worker_medium_light_skin_tone:": ":health_worker_tone2:", + ":health_worker_medium_skin_tone:": ":health_worker_tone3:", + ":heart_hands_dark_skin_tone:": ":heart_hands_tone5:", + ":heart_hands_light_skin_tone:": ":heart_hands_tone1:", + ":heart_hands_medium_dark_skin_tone:": ":heart_hands_tone4:", + ":heart_hands_medium_light_skin_tone:": ":heart_hands_tone2:", + ":heart_hands_medium_skin_tone:": ":heart_hands_tone3:", + ":heart_suit:": ":hearts:", + ":heavy_heart_exclamation_mark_ornament:": ":heart_exclamation:", + ":helmet_with_white_cross:": ":helmet_with_cross:", + ":high_voltage:": ":zap:", + ":hk:": ":flag_hk:", + ":hm:": ":flag_hm:", + ":hn:": ":flag_hn:", + ":honeybee:": ":bee:", + ":horse_face:": ":horse:", + ":hot_beverage:": ":coffee:", + ":hot_dog:": ":hotdog:", + ":hot_springs:": ":hotsprings:", + ":house_buildings:": ":homes:", + ":houses:": ":homes:", + ":hr:": ":flag_hr:", + ":ht:": ":flag_ht:", + ":hu:": ":flag_hu:", + ":hugging_face:": ":hugging:", + ":hushed_face:": ":hushed:", + ":ic:": ":flag_ic:", + ":ice_hockey:": ":hockey:", + ":ie:": ":flag_ie:", + ":il:": ":flag_il:", + ":im:": ":flag_im:", + ":in:": ":flag_in:", + ":index_pointing_at_the_viewer_dark_skin_tone:": ":index_pointing_at_the_viewer_tone5:", + ":index_pointing_at_the_viewer_light_skin_tone:": ":index_pointing_at_the_viewer_tone1:", + ":index_pointing_at_the_viewer_medium_dark_skin_tone:": ":index_pointing_at_the_viewer_tone4:", + ":index_pointing_at_the_viewer_medium_light_skin_tone:": ":index_pointing_at_the_viewer_tone2:", + ":index_pointing_at_the_viewer_medium_skin_tone:": ":index_pointing_at_the_viewer_tone3:", + ":indonesia:": ":flag_id:", + ":information:": ":information_source:", + ":information_desk_person:": ":person_tipping_hand:", + ":information_desk_person_tone1:": ":person_tipping_hand_tone1:", + ":information_desk_person_tone2:": ":person_tipping_hand_tone2:", + ":information_desk_person_tone3:": ":person_tipping_hand_tone3:", + ":information_desk_person_tone4:": ":person_tipping_hand_tone4:", + ":information_desk_person_tone5:": ":person_tipping_hand_tone5:", + ":input_numbers:": ":1234:", + ":input_symbols:": ":symbols:", + ":io:": ":flag_io:", + ":iq:": ":flag_iq:", + ":ir:": ":flag_ir:", + ":is:": ":flag_is:", + ":it:": ":flag_it:", + ":je:": ":flag_je:", + ":jm:": ":flag_jm:", + ":jo:": ":flag_jo:", + ":joker:": ":black_joker:", + ":jp:": ":flag_jp:", + ":judge_dark_skin_tone:": ":judge_tone5:", + ":judge_light_skin_tone:": ":judge_tone1:", + ":judge_medium_dark_skin_tone:": ":judge_tone4:", + ":judge_medium_light_skin_tone:": ":judge_tone2:", + ":judge_medium_skin_tone:": ":judge_tone3:", + ":juggler:": ":person_juggling:", + ":juggler_tone1:": ":person_juggling_tone1:", + ":juggler_tone2:": ":person_juggling_tone2:", + ":juggler_tone3:": ":person_juggling_tone3:", + ":juggler_tone4:": ":person_juggling_tone4:", + ":juggler_tone5:": ":person_juggling_tone5:", + ":juggling:": ":person_juggling:", + ":juggling_tone1:": ":person_juggling_tone1:", + ":juggling_tone2:": ":person_juggling_tone2:", + ":juggling_tone3:": ":person_juggling_tone3:", + ":juggling_tone4:": ":person_juggling_tone4:", + ":juggling_tone5:": ":person_juggling_tone5:", + ":karate_uniform:": ":martial_arts_uniform:", + ":kayak:": ":canoe:", + ":ke:": ":flag_ke:", + ":keycap_asterisk:": ":asterisk:", + ":kg:": ":flag_kg:", + ":kh:": ":flag_kh:", + ":ki:": ":flag_ki:", + ":kick_scooter:": ":scooter:", + ":kiss_dark_skin_tone:": ":kiss_tone5:", + ":kiss_light_skin_tone:": ":kiss_tone1:", + ":kiss_man_man:": ":kiss_mm:", + ":kiss_man_man_dark_skin_tone:": ":kiss_man_man_tone5:", + ":kiss_man_man_dark_skin_tone_light_skin_tone:": ":kiss_man_man_tone5_tone1:", + ":kiss_man_man_dark_skin_tone_medium_dark_skin_tone:": ":kiss_man_man_tone5_tone4:", + ":kiss_man_man_dark_skin_tone_medium_light_skin_tone:": ":kiss_man_man_tone5_tone2:", + ":kiss_man_man_dark_skin_tone_medium_skin_tone:": ":kiss_man_man_tone5_tone3:", + ":kiss_man_man_light_skin_tone:": ":kiss_man_man_tone1:", + ":kiss_man_man_light_skin_tone_dark_skin_tone:": ":kiss_man_man_tone1_tone5:", + ":kiss_man_man_light_skin_tone_medium_dark_skin_tone:": ":kiss_man_man_tone1_tone4:", + ":kiss_man_man_light_skin_tone_medium_light_skin_tone:": ":kiss_man_man_tone1_tone2:", + ":kiss_man_man_light_skin_tone_medium_skin_tone:": ":kiss_man_man_tone1_tone3:", + ":kiss_man_man_medium_dark_skin_tone:": ":kiss_man_man_tone4:", + ":kiss_man_man_medium_dark_skin_tone_dark_skin_tone:": ":kiss_man_man_tone4_tone5:", + ":kiss_man_man_medium_dark_skin_tone_light_skin_tone:": ":kiss_man_man_tone4_tone1:", + ":kiss_man_man_medium_dark_skin_tone_medium_light_skin_tone:": ":kiss_man_man_tone4_tone2:", + ":kiss_man_man_medium_dark_skin_tone_medium_skin_tone:": ":kiss_man_man_tone4_tone3:", + ":kiss_man_man_medium_light_skin_tone:": ":kiss_man_man_tone2:", + ":kiss_man_man_medium_light_skin_tone_dark_skin_tone:": ":kiss_man_man_tone2_tone5:", + ":kiss_man_man_medium_light_skin_tone_light_skin_tone:": ":kiss_man_man_tone2_tone1:", + ":kiss_man_man_medium_light_skin_tone_medium_dark_skin_tone:": ":kiss_man_man_tone2_tone4:", + ":kiss_man_man_medium_light_skin_tone_medium_skin_tone:": ":kiss_man_man_tone2_tone3:", + ":kiss_man_man_medium_skin_tone:": ":kiss_man_man_tone3:", + ":kiss_man_man_medium_skin_tone_dark_skin_tone:": ":kiss_man_man_tone3_tone5:", + ":kiss_man_man_medium_skin_tone_light_skin_tone:": ":kiss_man_man_tone3_tone1:", + ":kiss_man_man_medium_skin_tone_medium_dark_skin_tone:": ":kiss_man_man_tone3_tone4:", + ":kiss_man_man_medium_skin_tone_medium_light_skin_tone:": ":kiss_man_man_tone3_tone2:", + ":kiss_mark:": ":kiss:", + ":kiss_medium_dark_skin_tone:": ":kiss_tone4:", + ":kiss_medium_light_skin_tone:": ":kiss_tone2:", + ":kiss_medium_skin_tone:": ":kiss_tone3:", + ":kiss_person_person_dark_skin_tone_light_skin_tone:": ":kiss_person_person_tone5_tone1:", + ":kiss_person_person_dark_skin_tone_medium_dark_skin_tone:": ":kiss_person_person_tone5_tone4:", + ":kiss_person_person_dark_skin_tone_medium_light_skin_tone:": ":kiss_person_person_tone5_tone2:", + ":kiss_person_person_dark_skin_tone_medium_skin_tone:": ":kiss_person_person_tone5_tone3:", + ":kiss_person_person_light_skin_tone_dark_skin_tone:": ":kiss_person_person_tone1_tone5:", + ":kiss_person_person_light_skin_tone_medium_dark_skin_tone:": ":kiss_person_person_tone1_tone4:", + ":kiss_person_person_light_skin_tone_medium_light_skin_tone:": ":kiss_person_person_tone1_tone2:", + ":kiss_person_person_light_skin_tone_medium_skin_tone:": ":kiss_person_person_tone1_tone3:", + ":kiss_person_person_medium_dark_skin_tone_dark_skin_tone:": ":kiss_person_person_tone4_tone5:", + ":kiss_person_person_medium_dark_skin_tone_light_skin_tone:": ":kiss_person_person_tone4_tone1:", + ":kiss_person_person_medium_dark_skin_tone_medium_light_skin_tone:": ":kiss_person_person_tone4_tone2:", + ":kiss_person_person_medium_dark_skin_tone_medium_skin_tone:": ":kiss_person_person_tone4_tone3:", + ":kiss_person_person_medium_light_skin_tone_dark_skin_tone:": ":kiss_person_person_tone2_tone5:", + ":kiss_person_person_medium_light_skin_tone_light_skin_tone:": ":kiss_person_person_tone2_tone1:", + ":kiss_person_person_medium_light_skin_tone_medium_dark_skin_tone:": ":kiss_person_person_tone2_tone4:", + ":kiss_person_person_medium_light_skin_tone_medium_skin_tone:": ":kiss_person_person_tone2_tone3:", + ":kiss_person_person_medium_skin_tone_dark_skin_tone:": ":kiss_person_person_tone3_tone5:", + ":kiss_person_person_medium_skin_tone_light_skin_tone:": ":kiss_person_person_tone3_tone1:", + ":kiss_person_person_medium_skin_tone_medium_dark_skin_tone:": ":kiss_person_person_tone3_tone4:", + ":kiss_person_person_medium_skin_tone_medium_light_skin_tone:": ":kiss_person_person_tone3_tone2:", + ":kiss_woman_man_dark_skin_tone:": ":kiss_woman_man_tone5:", + ":kiss_woman_man_dark_skin_tone_light_skin_tone:": ":kiss_woman_man_tone5_tone1:", + ":kiss_woman_man_dark_skin_tone_medium_dark_skin_tone:": ":kiss_woman_man_tone5_tone4:", + ":kiss_woman_man_dark_skin_tone_medium_light_skin_tone:": ":kiss_woman_man_tone5_tone2:", + ":kiss_woman_man_dark_skin_tone_medium_skin_tone:": ":kiss_woman_man_tone5_tone3:", + ":kiss_woman_man_light_skin_tone:": ":kiss_woman_man_tone1:", + ":kiss_woman_man_light_skin_tone_dark_skin_tone:": ":kiss_woman_man_tone1_tone5:", + ":kiss_woman_man_light_skin_tone_medium_dark_skin_tone:": ":kiss_woman_man_tone1_tone4:", + ":kiss_woman_man_light_skin_tone_medium_light_skin_tone:": ":kiss_woman_man_tone1_tone2:", + ":kiss_woman_man_light_skin_tone_medium_skin_tone:": ":kiss_woman_man_tone1_tone3:", + ":kiss_woman_man_medium_dark_skin_tone:": ":kiss_woman_man_tone4:", + ":kiss_woman_man_medium_dark_skin_tone_dark_skin_tone:": ":kiss_woman_man_tone4_tone5:", + ":kiss_woman_man_medium_dark_skin_tone_light_skin_tone:": ":kiss_woman_man_tone4_tone1:", + ":kiss_woman_man_medium_dark_skin_tone_medium_light_skin_tone:": ":kiss_woman_man_tone4_tone2:", + ":kiss_woman_man_medium_dark_skin_tone_medium_skin_tone:": ":kiss_woman_man_tone4_tone3:", + ":kiss_woman_man_medium_light_skin_tone:": ":kiss_woman_man_tone2:", + ":kiss_woman_man_medium_light_skin_tone_dark_skin_tone:": ":kiss_woman_man_tone2_tone5:", + ":kiss_woman_man_medium_light_skin_tone_light_skin_tone:": ":kiss_woman_man_tone2_tone1:", + ":kiss_woman_man_medium_light_skin_tone_medium_dark_skin_tone:": ":kiss_woman_man_tone2_tone4:", + ":kiss_woman_man_medium_light_skin_tone_medium_skin_tone:": ":kiss_woman_man_tone2_tone3:", + ":kiss_woman_man_medium_skin_tone:": ":kiss_woman_man_tone3:", + ":kiss_woman_man_medium_skin_tone_dark_skin_tone:": ":kiss_woman_man_tone3_tone5:", + ":kiss_woman_man_medium_skin_tone_light_skin_tone:": ":kiss_woman_man_tone3_tone1:", + ":kiss_woman_man_medium_skin_tone_medium_dark_skin_tone:": ":kiss_woman_man_tone3_tone4:", + ":kiss_woman_man_medium_skin_tone_medium_light_skin_tone:": ":kiss_woman_man_tone3_tone2:", + ":kiss_woman_woman_dark_skin_tone:": ":kiss_woman_woman_tone5:", + ":kiss_woman_woman_dark_skin_tone_light_skin_tone:": ":kiss_woman_woman_tone5_tone1:", + ":kiss_woman_woman_dark_skin_tone_medium_dark_skin_tone:": ":kiss_woman_woman_tone5_tone4:", + ":kiss_woman_woman_dark_skin_tone_medium_light_skin_tone:": ":kiss_woman_woman_tone5_tone2:", + ":kiss_woman_woman_dark_skin_tone_medium_skin_tone:": ":kiss_woman_woman_tone5_tone3:", + ":kiss_woman_woman_light_skin_tone:": ":kiss_woman_woman_tone1:", + ":kiss_woman_woman_light_skin_tone_dark_skin_tone:": ":kiss_woman_woman_tone1_tone5:", + ":kiss_woman_woman_light_skin_tone_medium_dark_skin_tone:": ":kiss_woman_woman_tone1_tone4:", + ":kiss_woman_woman_light_skin_tone_medium_light_skin_tone:": ":kiss_woman_woman_tone1_tone2:", + ":kiss_woman_woman_light_skin_tone_medium_skin_tone:": ":kiss_woman_woman_tone1_tone3:", + ":kiss_woman_woman_medium_dark_skin_tone:": ":kiss_woman_woman_tone4:", + ":kiss_woman_woman_medium_dark_skin_tone_dark_skin_tone:": ":kiss_woman_woman_tone4_tone5:", + ":kiss_woman_woman_medium_dark_skin_tone_light_skin_tone:": ":kiss_woman_woman_tone4_tone1:", + ":kiss_woman_woman_medium_dark_skin_tone_medium_light_skin_tone:": ":kiss_woman_woman_tone4_tone2:", + ":kiss_woman_woman_medium_dark_skin_tone_medium_skin_tone:": ":kiss_woman_woman_tone4_tone3:", + ":kiss_woman_woman_medium_light_skin_tone:": ":kiss_woman_woman_tone2:", + ":kiss_woman_woman_medium_light_skin_tone_dark_skin_tone:": ":kiss_woman_woman_tone2_tone5:", + ":kiss_woman_woman_medium_light_skin_tone_light_skin_tone:": ":kiss_woman_woman_tone2_tone1:", + ":kiss_woman_woman_medium_light_skin_tone_medium_dark_skin_tone:": ":kiss_woman_woman_tone2_tone4:", + ":kiss_woman_woman_medium_light_skin_tone_medium_skin_tone:": ":kiss_woman_woman_tone2_tone3:", + ":kiss_woman_woman_medium_skin_tone:": ":kiss_woman_woman_tone3:", + ":kiss_woman_woman_medium_skin_tone_dark_skin_tone:": ":kiss_woman_woman_tone3_tone5:", + ":kiss_woman_woman_medium_skin_tone_light_skin_tone:": ":kiss_woman_woman_tone3_tone1:", + ":kiss_woman_woman_medium_skin_tone_medium_dark_skin_tone:": ":kiss_woman_woman_tone3_tone4:", + ":kiss_woman_woman_medium_skin_tone_medium_light_skin_tone:": ":kiss_woman_woman_tone3_tone2:", + ":kissing_face:": ":kissing:", + ":kitchen_knife:": ":knife:", + ":kiwi_fruit:": ":kiwi:", + ":kiwifruit:": ":kiwi:", + ":km:": ":flag_km:", + ":kn:": ":flag_kn:", + ":kp:": ":flag_kp:", + ":kr:": ":flag_kr:", + ":kw:": ":flag_kw:", + ":ky:": ":flag_ky:", + ":kz:": ":flag_kz:", + ":la:": ":flag_la:", + ":latin_cross:": ":cross:", + ":lb:": ":flag_lb:", + ":lc:": ":flag_lc:", + ":left_arrow:": ":arrow_left:", + ":left_fist:": ":left_facing_fist:", + ":left_fist_tone1:": ":left_facing_fist_tone1:", + ":left_fist_tone2:": ":left_facing_fist_tone2:", + ":left_fist_tone3:": ":left_facing_fist_tone3:", + ":left_fist_tone4:": ":left_facing_fist_tone4:", + ":left_fist_tone5:": ":left_facing_fist_tone5:", + ":left_speech_bubble:": ":speech_left:", + ":leftwards_hand_dark_skin_tone:": ":leftwards_hand_tone5:", + ":leftwards_hand_light_skin_tone:": ":leftwards_hand_tone1:", + ":leftwards_hand_medium_dark_skin_tone:": ":leftwards_hand_tone4:", + ":leftwards_hand_medium_light_skin_tone:": ":leftwards_hand_tone2:", + ":leftwards_hand_medium_skin_tone:": ":leftwards_hand_tone3:", + ":leftwards_pushing_hand_dark_skin_tone:": ":leftwards_pushing_hand_tone5:", + ":leftwards_pushing_hand_light_skin_tone:": ":leftwards_pushing_hand_tone1:", + ":leftwards_pushing_hand_medium_dark_skin_tone:": ":leftwards_pushing_hand_tone4:", + ":leftwards_pushing_hand_medium_light_skin_tone:": ":leftwards_pushing_hand_tone2:", + ":leftwards_pushing_hand_medium_skin_tone:": ":leftwards_pushing_hand_tone3:", + ":leg_dark_skin_tone:": ":leg_tone5:", + ":leg_light_skin_tone:": ":leg_tone1:", + ":leg_medium_dark_skin_tone:": ":leg_tone4:", + ":leg_medium_light_skin_tone:": ":leg_tone2:", + ":leg_medium_skin_tone:": ":leg_tone3:", + ":li:": ":flag_li:", + ":liar:": ":lying_face:", + ":lifter:": ":person_lifting_weights:", + ":lifter_tone1:": ":person_lifting_weights_tone1:", + ":lifter_tone2:": ":person_lifting_weights_tone2:", + ":lifter_tone3:": ":person_lifting_weights_tone3:", + ":lifter_tone4:": ":person_lifting_weights_tone4:", + ":lifter_tone5:": ":person_lifting_weights_tone5:", + ":light_bulb:": ":bulb:", + ":linked_paperclips:": ":paperclips:", + ":lion:": ":lion_face:", + ":lk:": ":flag_lk:", + ":locked:": ":lock:", + ":locomotive:": ":steam_locomotive:", + ":lotion_bottle:": ":squeeze_bottle:", + ":love_you_gesture_dark_skin_tone:": ":love_you_gesture_tone5:", + ":love_you_gesture_light_skin_tone:": ":love_you_gesture_tone1:", + ":love_you_gesture_medium_dark_skin_tone:": ":love_you_gesture_tone4:", + ":love_you_gesture_medium_light_skin_tone:": ":love_you_gesture_tone2:", + ":love_you_gesture_medium_skin_tone:": ":love_you_gesture_tone3:", + ":lower_left_ballpoint_pen:": ":pen_ballpoint:", + ":lower_left_crayon:": ":crayon:", + ":lower_left_fountain_pen:": ":pen_fountain:", + ":lower_left_paintbrush:": ":paintbrush:", + ":lr:": ":flag_lr:", + ":ls:": ":flag_ls:", + ":lt:": ":flag_lt:", + ":lu:": ":flag_lu:", + ":lv:": ":flag_lv:", + ":ly:": ":flag_ly:", + ":ma:": ":flag_ma:", + ":mage_dark_skin_tone:": ":mage_tone5:", + ":mage_light_skin_tone:": ":mage_tone1:", + ":mage_medium_dark_skin_tone:": ":mage_tone4:", + ":mage_medium_light_skin_tone:": ":mage_tone2:", + ":mage_medium_skin_tone:": ":mage_tone3:", + ":male_dancer:": ":man_dancing:", + ":male_dancer_tone1:": ":man_dancing_tone1:", + ":male_dancer_tone2:": ":man_dancing_tone2:", + ":male_dancer_tone3:": ":man_dancing_tone3:", + ":male_dancer_tone4:": ":man_dancing_tone4:", + ":male_dancer_tone5:": ":man_dancing_tone5:", + ":man_artist_dark_skin_tone:": ":man_artist_tone5:", + ":man_artist_light_skin_tone:": ":man_artist_tone1:", + ":man_artist_medium_dark_skin_tone:": ":man_artist_tone4:", + ":man_artist_medium_light_skin_tone:": ":man_artist_tone2:", + ":man_artist_medium_skin_tone:": ":man_artist_tone3:", + ":man_astronaut_dark_skin_tone:": ":man_astronaut_tone5:", + ":man_astronaut_light_skin_tone:": ":man_astronaut_tone1:", + ":man_astronaut_medium_dark_skin_tone:": ":man_astronaut_tone4:", + ":man_astronaut_medium_light_skin_tone:": ":man_astronaut_tone2:", + ":man_astronaut_medium_skin_tone:": ":man_astronaut_tone3:", + ":man_bald_dark_skin_tone:": ":man_bald_tone5:", + ":man_bald_light_skin_tone:": ":man_bald_tone1:", + ":man_bald_medium_dark_skin_tone:": ":man_bald_tone4:", + ":man_bald_medium_light_skin_tone:": ":man_bald_tone2:", + ":man_bald_medium_skin_tone:": ":man_bald_tone3:", + ":man_biking_dark_skin_tone:": ":man_biking_tone5:", + ":man_biking_light_skin_tone:": ":man_biking_tone1:", + ":man_biking_medium_dark_skin_tone:": ":man_biking_tone4:", + ":man_biking_medium_light_skin_tone:": ":man_biking_tone2:", + ":man_biking_medium_skin_tone:": ":man_biking_tone3:", + ":man_bouncing_ball_dark_skin_tone:": ":man_bouncing_ball_tone5:", + ":man_bouncing_ball_light_skin_tone:": ":man_bouncing_ball_tone1:", + ":man_bouncing_ball_medium_dark_skin_tone:": ":man_bouncing_ball_tone4:", + ":man_bouncing_ball_medium_light_skin_tone:": ":man_bouncing_ball_tone2:", + ":man_bouncing_ball_medium_skin_tone:": ":man_bouncing_ball_tone3:", + ":man_bowing_dark_skin_tone:": ":man_bowing_tone5:", + ":man_bowing_light_skin_tone:": ":man_bowing_tone1:", + ":man_bowing_medium_dark_skin_tone:": ":man_bowing_tone4:", + ":man_bowing_medium_light_skin_tone:": ":man_bowing_tone2:", + ":man_bowing_medium_skin_tone:": ":man_bowing_tone3:", + ":man_cartwheeling_dark_skin_tone:": ":man_cartwheeling_tone5:", + ":man_cartwheeling_light_skin_tone:": ":man_cartwheeling_tone1:", + ":man_cartwheeling_medium_dark_skin_tone:": ":man_cartwheeling_tone4:", + ":man_cartwheeling_medium_light_skin_tone:": ":man_cartwheeling_tone2:", + ":man_cartwheeling_medium_skin_tone:": ":man_cartwheeling_tone3:", + ":man_climbing_dark_skin_tone:": ":man_climbing_tone5:", + ":man_climbing_light_skin_tone:": ":man_climbing_tone1:", + ":man_climbing_medium_dark_skin_tone:": ":man_climbing_tone4:", + ":man_climbing_medium_light_skin_tone:": ":man_climbing_tone2:", + ":man_climbing_medium_skin_tone:": ":man_climbing_tone3:", + ":man_construction_worker_dark_skin_tone:": ":man_construction_worker_tone5:", + ":man_construction_worker_light_skin_tone:": ":man_construction_worker_tone1:", + ":man_construction_worker_medium_dark_skin_tone:": ":man_construction_worker_tone4:", + ":man_construction_worker_medium_light_skin_tone:": ":man_construction_worker_tone2:", + ":man_construction_worker_medium_skin_tone:": ":man_construction_worker_tone3:", + ":man_cook_dark_skin_tone:": ":man_cook_tone5:", + ":man_cook_light_skin_tone:": ":man_cook_tone1:", + ":man_cook_medium_dark_skin_tone:": ":man_cook_tone4:", + ":man_cook_medium_light_skin_tone:": ":man_cook_tone2:", + ":man_cook_medium_skin_tone:": ":man_cook_tone3:", + ":man_curly_haired_dark_skin_tone:": ":man_curly_haired_tone5:", + ":man_curly_haired_light_skin_tone:": ":man_curly_haired_tone1:", + ":man_curly_haired_medium_dark_skin_tone:": ":man_curly_haired_tone4:", + ":man_curly_haired_medium_light_skin_tone:": ":man_curly_haired_tone2:", + ":man_curly_haired_medium_skin_tone:": ":man_curly_haired_tone3:", + ":man_dark_skin_tone_beard:": ":man_tone5_beard:", + ":man_detective_dark_skin_tone:": ":man_detective_tone5:", + ":man_detective_light_skin_tone:": ":man_detective_tone1:", + ":man_detective_medium_dark_skin_tone:": ":man_detective_tone4:", + ":man_detective_medium_light_skin_tone:": ":man_detective_tone2:", + ":man_detective_medium_skin_tone:": ":man_detective_tone3:", + ":man_elf_dark_skin_tone:": ":man_elf_tone5:", + ":man_elf_light_skin_tone:": ":man_elf_tone1:", + ":man_elf_medium_dark_skin_tone:": ":man_elf_tone4:", + ":man_elf_medium_light_skin_tone:": ":man_elf_tone2:", + ":man_elf_medium_skin_tone:": ":man_elf_tone3:", + ":man_facepalming_dark_skin_tone:": ":man_facepalming_tone5:", + ":man_facepalming_light_skin_tone:": ":man_facepalming_tone1:", + ":man_facepalming_medium_dark_skin_tone:": ":man_facepalming_tone4:", + ":man_facepalming_medium_light_skin_tone:": ":man_facepalming_tone2:", + ":man_facepalming_medium_skin_tone:": ":man_facepalming_tone3:", + ":man_factory_worker_dark_skin_tone:": ":man_factory_worker_tone5:", + ":man_factory_worker_light_skin_tone:": ":man_factory_worker_tone1:", + ":man_factory_worker_medium_dark_skin_tone:": ":man_factory_worker_tone4:", + ":man_factory_worker_medium_light_skin_tone:": ":man_factory_worker_tone2:", + ":man_factory_worker_medium_skin_tone:": ":man_factory_worker_tone3:", + ":man_fairy_dark_skin_tone:": ":man_fairy_tone5:", + ":man_fairy_light_skin_tone:": ":man_fairy_tone1:", + ":man_fairy_medium_dark_skin_tone:": ":man_fairy_tone4:", + ":man_fairy_medium_light_skin_tone:": ":man_fairy_tone2:", + ":man_fairy_medium_skin_tone:": ":man_fairy_tone3:", + ":man_farmer_dark_skin_tone:": ":man_farmer_tone5:", + ":man_farmer_light_skin_tone:": ":man_farmer_tone1:", + ":man_farmer_medium_dark_skin_tone:": ":man_farmer_tone4:", + ":man_farmer_medium_light_skin_tone:": ":man_farmer_tone2:", + ":man_farmer_medium_skin_tone:": ":man_farmer_tone3:", + ":man_feeding_baby_dark_skin_tone:": ":man_feeding_baby_tone5:", + ":man_feeding_baby_light_skin_tone:": ":man_feeding_baby_tone1:", + ":man_feeding_baby_medium_dark_skin_tone:": ":man_feeding_baby_tone4:", + ":man_feeding_baby_medium_light_skin_tone:": ":man_feeding_baby_tone2:", + ":man_feeding_baby_medium_skin_tone:": ":man_feeding_baby_tone3:", + ":man_firefighter_dark_skin_tone:": ":man_firefighter_tone5:", + ":man_firefighter_light_skin_tone:": ":man_firefighter_tone1:", + ":man_firefighter_medium_dark_skin_tone:": ":man_firefighter_tone4:", + ":man_firefighter_medium_light_skin_tone:": ":man_firefighter_tone2:", + ":man_firefighter_medium_skin_tone:": ":man_firefighter_tone3:", + ":man_frowning_dark_skin_tone:": ":man_frowning_tone5:", + ":man_frowning_light_skin_tone:": ":man_frowning_tone1:", + ":man_frowning_medium_dark_skin_tone:": ":man_frowning_tone4:", + ":man_frowning_medium_light_skin_tone:": ":man_frowning_tone2:", + ":man_frowning_medium_skin_tone:": ":man_frowning_tone3:", + ":man_gesturing_no_dark_skin_tone:": ":man_gesturing_no_tone5:", + ":man_gesturing_no_light_skin_tone:": ":man_gesturing_no_tone1:", + ":man_gesturing_no_medium_dark_skin_tone:": ":man_gesturing_no_tone4:", + ":man_gesturing_no_medium_light_skin_tone:": ":man_gesturing_no_tone2:", + ":man_gesturing_no_medium_skin_tone:": ":man_gesturing_no_tone3:", + ":man_gesturing_ok_dark_skin_tone:": ":man_gesturing_ok_tone5:", + ":man_gesturing_ok_light_skin_tone:": ":man_gesturing_ok_tone1:", + ":man_gesturing_ok_medium_dark_skin_tone:": ":man_gesturing_ok_tone4:", + ":man_gesturing_ok_medium_light_skin_tone:": ":man_gesturing_ok_tone2:", + ":man_gesturing_ok_medium_skin_tone:": ":man_gesturing_ok_tone3:", + ":man_getting_face_massage_dark_skin_tone:": ":man_getting_face_massage_tone5:", + ":man_getting_face_massage_light_skin_tone:": ":man_getting_face_massage_tone1:", + ":man_getting_face_massage_medium_dark_skin_tone:": ":man_getting_face_massage_tone4:", + ":man_getting_face_massage_medium_light_skin_tone:": ":man_getting_face_massage_tone2:", + ":man_getting_face_massage_medium_skin_tone:": ":man_getting_face_massage_tone3:", + ":man_getting_haircut_dark_skin_tone:": ":man_getting_haircut_tone5:", + ":man_getting_haircut_light_skin_tone:": ":man_getting_haircut_tone1:", + ":man_getting_haircut_medium_dark_skin_tone:": ":man_getting_haircut_tone4:", + ":man_getting_haircut_medium_light_skin_tone:": ":man_getting_haircut_tone2:", + ":man_getting_haircut_medium_skin_tone:": ":man_getting_haircut_tone3:", + ":man_golfing_dark_skin_tone:": ":man_golfing_tone5:", + ":man_golfing_light_skin_tone:": ":man_golfing_tone1:", + ":man_golfing_medium_dark_skin_tone:": ":man_golfing_tone4:", + ":man_golfing_medium_light_skin_tone:": ":man_golfing_tone2:", + ":man_golfing_medium_skin_tone:": ":man_golfing_tone3:", + ":man_guard_dark_skin_tone:": ":man_guard_tone5:", + ":man_guard_light_skin_tone:": ":man_guard_tone1:", + ":man_guard_medium_dark_skin_tone:": ":man_guard_tone4:", + ":man_guard_medium_light_skin_tone:": ":man_guard_tone2:", + ":man_guard_medium_skin_tone:": ":man_guard_tone3:", + ":man_health_worker_dark_skin_tone:": ":man_health_worker_tone5:", + ":man_health_worker_light_skin_tone:": ":man_health_worker_tone1:", + ":man_health_worker_medium_dark_skin_tone:": ":man_health_worker_tone4:", + ":man_health_worker_medium_light_skin_tone:": ":man_health_worker_tone2:", + ":man_health_worker_medium_skin_tone:": ":man_health_worker_tone3:", + ":man_in_business_suit_levitating:": ":levitate:", + ":man_in_business_suit_levitating_dark_skin_tone:": ":levitate_tone5:", + ":man_in_business_suit_levitating_light_skin_tone:": ":levitate_tone1:", + ":man_in_business_suit_levitating_medium_dark_skin_tone:": ":levitate_tone4:", + ":man_in_business_suit_levitating_medium_light_skin_tone:": ":levitate_tone2:", + ":man_in_business_suit_levitating_medium_skin_tone:": ":levitate_tone3:", + ":man_in_business_suit_levitating_tone1:": ":levitate_tone1:", + ":man_in_business_suit_levitating_tone2:": ":levitate_tone2:", + ":man_in_business_suit_levitating_tone3:": ":levitate_tone3:", + ":man_in_business_suit_levitating_tone4:": ":levitate_tone4:", + ":man_in_business_suit_levitating_tone5:": ":levitate_tone5:", + ":man_in_lotus_position_dark_skin_tone:": ":man_in_lotus_position_tone5:", + ":man_in_lotus_position_light_skin_tone:": ":man_in_lotus_position_tone1:", + ":man_in_lotus_position_medium_dark_skin_tone:": ":man_in_lotus_position_tone4:", + ":man_in_lotus_position_medium_light_skin_tone:": ":man_in_lotus_position_tone2:", + ":man_in_lotus_position_medium_skin_tone:": ":man_in_lotus_position_tone3:", + ":man_in_manual_wheelchair_dark_skin_tone:": ":man_in_manual_wheelchair_tone5:", + ":man_in_manual_wheelchair_facing_right_dark_skin_tone:": ":man_in_manual_wheelchair_facing_right_tone5:", + ":man_in_manual_wheelchair_facing_right_light_skin_tone:": ":man_in_manual_wheelchair_facing_right_tone1:", + ":man_in_manual_wheelchair_facing_right_medium_dark_skin_tone:": ":man_in_manual_wheelchair_facing_right_tone4:", + ":man_in_manual_wheelchair_facing_right_medium_light_skin_tone:": ":man_in_manual_wheelchair_facing_right_tone2:", + ":man_in_manual_wheelchair_facing_right_medium_skin_tone:": ":man_in_manual_wheelchair_facing_right_tone3:", + ":man_in_manual_wheelchair_light_skin_tone:": ":man_in_manual_wheelchair_tone1:", + ":man_in_manual_wheelchair_medium_dark_skin_tone:": ":man_in_manual_wheelchair_tone4:", + ":man_in_manual_wheelchair_medium_light_skin_tone:": ":man_in_manual_wheelchair_tone2:", + ":man_in_manual_wheelchair_medium_skin_tone:": ":man_in_manual_wheelchair_tone3:", + ":man_in_motorized_wheelchair_dark_skin_tone:": ":man_in_motorized_wheelchair_tone5:", + ":man_in_motorized_wheelchair_facing_right_dark_skin_tone:": ":man_in_motorized_wheelchair_facing_right_tone5:", + ":man_in_motorized_wheelchair_facing_right_light_skin_tone:": ":man_in_motorized_wheelchair_facing_right_tone1:", + ":man_in_motorized_wheelchair_facing_right_medium_dark_skin_tone:": ":man_in_motorized_wheelchair_facing_right_tone4:", + ":man_in_motorized_wheelchair_facing_right_medium_light_skin_tone:": ":man_in_motorized_wheelchair_facing_right_tone2:", + ":man_in_motorized_wheelchair_facing_right_medium_skin_tone:": ":man_in_motorized_wheelchair_facing_right_tone3:", + ":man_in_motorized_wheelchair_light_skin_tone:": ":man_in_motorized_wheelchair_tone1:", + ":man_in_motorized_wheelchair_medium_dark_skin_tone:": ":man_in_motorized_wheelchair_tone4:", + ":man_in_motorized_wheelchair_medium_light_skin_tone:": ":man_in_motorized_wheelchair_tone2:", + ":man_in_motorized_wheelchair_medium_skin_tone:": ":man_in_motorized_wheelchair_tone3:", + ":man_in_steamy_room_dark_skin_tone:": ":man_in_steamy_room_tone5:", + ":man_in_steamy_room_light_skin_tone:": ":man_in_steamy_room_tone1:", + ":man_in_steamy_room_medium_dark_skin_tone:": ":man_in_steamy_room_tone4:", + ":man_in_steamy_room_medium_light_skin_tone:": ":man_in_steamy_room_tone2:", + ":man_in_steamy_room_medium_skin_tone:": ":man_in_steamy_room_tone3:", + ":man_in_tuxedo_dark_skin_tone:": ":man_in_tuxedo_tone5:", + ":man_in_tuxedo_light_skin_tone:": ":man_in_tuxedo_tone1:", + ":man_in_tuxedo_medium_dark_skin_tone:": ":man_in_tuxedo_tone4:", + ":man_in_tuxedo_medium_light_skin_tone:": ":man_in_tuxedo_tone2:", + ":man_in_tuxedo_medium_skin_tone:": ":man_in_tuxedo_tone3:", + ":man_judge_dark_skin_tone:": ":man_judge_tone5:", + ":man_judge_light_skin_tone:": ":man_judge_tone1:", + ":man_judge_medium_dark_skin_tone:": ":man_judge_tone4:", + ":man_judge_medium_light_skin_tone:": ":man_judge_tone2:", + ":man_judge_medium_skin_tone:": ":man_judge_tone3:", + ":man_juggling_dark_skin_tone:": ":man_juggling_tone5:", + ":man_juggling_light_skin_tone:": ":man_juggling_tone1:", + ":man_juggling_medium_dark_skin_tone:": ":man_juggling_tone4:", + ":man_juggling_medium_light_skin_tone:": ":man_juggling_tone2:", + ":man_juggling_medium_skin_tone:": ":man_juggling_tone3:", + ":man_kneeling_dark_skin_tone:": ":man_kneeling_tone5:", + ":man_kneeling_facing_right_dark_skin_tone:": ":man_kneeling_facing_right_tone5:", + ":man_kneeling_facing_right_light_skin_tone:": ":man_kneeling_facing_right_tone1:", + ":man_kneeling_facing_right_medium_dark_skin_tone:": ":man_kneeling_facing_right_tone4:", + ":man_kneeling_facing_right_medium_light_skin_tone:": ":man_kneeling_facing_right_tone2:", + ":man_kneeling_facing_right_medium_skin_tone:": ":man_kneeling_facing_right_tone3:", + ":man_kneeling_light_skin_tone:": ":man_kneeling_tone1:", + ":man_kneeling_medium_dark_skin_tone:": ":man_kneeling_tone4:", + ":man_kneeling_medium_light_skin_tone:": ":man_kneeling_tone2:", + ":man_kneeling_medium_skin_tone:": ":man_kneeling_tone3:", + ":man_lifting_weights_dark_skin_tone:": ":man_lifting_weights_tone5:", + ":man_lifting_weights_light_skin_tone:": ":man_lifting_weights_tone1:", + ":man_lifting_weights_medium_dark_skin_tone:": ":man_lifting_weights_tone4:", + ":man_lifting_weights_medium_light_skin_tone:": ":man_lifting_weights_tone2:", + ":man_lifting_weights_medium_skin_tone:": ":man_lifting_weights_tone3:", + ":man_light_skin_tone_beard:": ":man_tone1_beard:", + ":man_mage_dark_skin_tone:": ":man_mage_tone5:", + ":man_mage_light_skin_tone:": ":man_mage_tone1:", + ":man_mage_medium_dark_skin_tone:": ":man_mage_tone4:", + ":man_mage_medium_light_skin_tone:": ":man_mage_tone2:", + ":man_mage_medium_skin_tone:": ":man_mage_tone3:", + ":man_mechanic_dark_skin_tone:": ":man_mechanic_tone5:", + ":man_mechanic_light_skin_tone:": ":man_mechanic_tone1:", + ":man_mechanic_medium_dark_skin_tone:": ":man_mechanic_tone4:", + ":man_mechanic_medium_light_skin_tone:": ":man_mechanic_tone2:", + ":man_mechanic_medium_skin_tone:": ":man_mechanic_tone3:", + ":man_medium_dark_skin_tone_beard:": ":man_tone4_beard:", + ":man_medium_light_skin_tone_beard:": ":man_tone2_beard:", + ":man_medium_skin_tone_beard:": ":man_tone3_beard:", + ":man_mountain_biking_dark_skin_tone:": ":man_mountain_biking_tone5:", + ":man_mountain_biking_light_skin_tone:": ":man_mountain_biking_tone1:", + ":man_mountain_biking_medium_dark_skin_tone:": ":man_mountain_biking_tone4:", + ":man_mountain_biking_medium_light_skin_tone:": ":man_mountain_biking_tone2:", + ":man_mountain_biking_medium_skin_tone:": ":man_mountain_biking_tone3:", + ":man_office_worker_dark_skin_tone:": ":man_office_worker_tone5:", + ":man_office_worker_light_skin_tone:": ":man_office_worker_tone1:", + ":man_office_worker_medium_dark_skin_tone:": ":man_office_worker_tone4:", + ":man_office_worker_medium_light_skin_tone:": ":man_office_worker_tone2:", + ":man_office_worker_medium_skin_tone:": ":man_office_worker_tone3:", + ":man_pilot_dark_skin_tone:": ":man_pilot_tone5:", + ":man_pilot_light_skin_tone:": ":man_pilot_tone1:", + ":man_pilot_medium_dark_skin_tone:": ":man_pilot_tone4:", + ":man_pilot_medium_light_skin_tone:": ":man_pilot_tone2:", + ":man_pilot_medium_skin_tone:": ":man_pilot_tone3:", + ":man_playing_handball_dark_skin_tone:": ":man_playing_handball_tone5:", + ":man_playing_handball_light_skin_tone:": ":man_playing_handball_tone1:", + ":man_playing_handball_medium_dark_skin_tone:": ":man_playing_handball_tone4:", + ":man_playing_handball_medium_light_skin_tone:": ":man_playing_handball_tone2:", + ":man_playing_handball_medium_skin_tone:": ":man_playing_handball_tone3:", + ":man_playing_water_polo_dark_skin_tone:": ":man_playing_water_polo_tone5:", + ":man_playing_water_polo_light_skin_tone:": ":man_playing_water_polo_tone1:", + ":man_playing_water_polo_medium_dark_skin_tone:": ":man_playing_water_polo_tone4:", + ":man_playing_water_polo_medium_light_skin_tone:": ":man_playing_water_polo_tone2:", + ":man_playing_water_polo_medium_skin_tone:": ":man_playing_water_polo_tone3:", + ":man_police_officer_dark_skin_tone:": ":man_police_officer_tone5:", + ":man_police_officer_light_skin_tone:": ":man_police_officer_tone1:", + ":man_police_officer_medium_dark_skin_tone:": ":man_police_officer_tone4:", + ":man_police_officer_medium_light_skin_tone:": ":man_police_officer_tone2:", + ":man_police_officer_medium_skin_tone:": ":man_police_officer_tone3:", + ":man_pouting_dark_skin_tone:": ":man_pouting_tone5:", + ":man_pouting_light_skin_tone:": ":man_pouting_tone1:", + ":man_pouting_medium_dark_skin_tone:": ":man_pouting_tone4:", + ":man_pouting_medium_light_skin_tone:": ":man_pouting_tone2:", + ":man_pouting_medium_skin_tone:": ":man_pouting_tone3:", + ":man_raising_hand_dark_skin_tone:": ":man_raising_hand_tone5:", + ":man_raising_hand_light_skin_tone:": ":man_raising_hand_tone1:", + ":man_raising_hand_medium_dark_skin_tone:": ":man_raising_hand_tone4:", + ":man_raising_hand_medium_light_skin_tone:": ":man_raising_hand_tone2:", + ":man_raising_hand_medium_skin_tone:": ":man_raising_hand_tone3:", + ":man_red_hair:": ":man_red_haired:", + ":man_red_haired_dark_skin_tone:": ":man_red_haired_tone5:", + ":man_red_haired_light_skin_tone:": ":man_red_haired_tone1:", + ":man_red_haired_medium_dark_skin_tone:": ":man_red_haired_tone4:", + ":man_red_haired_medium_light_skin_tone:": ":man_red_haired_tone2:", + ":man_red_haired_medium_skin_tone:": ":man_red_haired_tone3:", + ":man_rowing_boat_dark_skin_tone:": ":man_rowing_boat_tone5:", + ":man_rowing_boat_light_skin_tone:": ":man_rowing_boat_tone1:", + ":man_rowing_boat_medium_dark_skin_tone:": ":man_rowing_boat_tone4:", + ":man_rowing_boat_medium_light_skin_tone:": ":man_rowing_boat_tone2:", + ":man_rowing_boat_medium_skin_tone:": ":man_rowing_boat_tone3:", + ":man_running_dark_skin_tone:": ":man_running_tone5:", + ":man_running_facing_right_dark_skin_tone:": ":man_running_facing_right_tone5:", + ":man_running_facing_right_light_skin_tone:": ":man_running_facing_right_tone1:", + ":man_running_facing_right_medium_dark_skin_tone:": ":man_running_facing_right_tone4:", + ":man_running_facing_right_medium_light_skin_tone:": ":man_running_facing_right_tone2:", + ":man_running_facing_right_medium_skin_tone:": ":man_running_facing_right_tone3:", + ":man_running_light_skin_tone:": ":man_running_tone1:", + ":man_running_medium_dark_skin_tone:": ":man_running_tone4:", + ":man_running_medium_light_skin_tone:": ":man_running_tone2:", + ":man_running_medium_skin_tone:": ":man_running_tone3:", + ":man_scientist_dark_skin_tone:": ":man_scientist_tone5:", + ":man_scientist_light_skin_tone:": ":man_scientist_tone1:", + ":man_scientist_medium_dark_skin_tone:": ":man_scientist_tone4:", + ":man_scientist_medium_light_skin_tone:": ":man_scientist_tone2:", + ":man_scientist_medium_skin_tone:": ":man_scientist_tone3:", + ":man_shrugging_dark_skin_tone:": ":man_shrugging_tone5:", + ":man_shrugging_light_skin_tone:": ":man_shrugging_tone1:", + ":man_shrugging_medium_dark_skin_tone:": ":man_shrugging_tone4:", + ":man_shrugging_medium_light_skin_tone:": ":man_shrugging_tone2:", + ":man_shrugging_medium_skin_tone:": ":man_shrugging_tone3:", + ":man_singer_dark_skin_tone:": ":man_singer_tone5:", + ":man_singer_light_skin_tone:": ":man_singer_tone1:", + ":man_singer_medium_dark_skin_tone:": ":man_singer_tone4:", + ":man_singer_medium_light_skin_tone:": ":man_singer_tone2:", + ":man_singer_medium_skin_tone:": ":man_singer_tone3:", + ":man_standing_dark_skin_tone:": ":man_standing_tone5:", + ":man_standing_light_skin_tone:": ":man_standing_tone1:", + ":man_standing_medium_dark_skin_tone:": ":man_standing_tone4:", + ":man_standing_medium_light_skin_tone:": ":man_standing_tone2:", + ":man_standing_medium_skin_tone:": ":man_standing_tone3:", + ":man_student_dark_skin_tone:": ":man_student_tone5:", + ":man_student_light_skin_tone:": ":man_student_tone1:", + ":man_student_medium_dark_skin_tone:": ":man_student_tone4:", + ":man_student_medium_light_skin_tone:": ":man_student_tone2:", + ":man_student_medium_skin_tone:": ":man_student_tone3:", + ":man_superhero_dark_skin_tone:": ":man_superhero_tone5:", + ":man_superhero_light_skin_tone:": ":man_superhero_tone1:", + ":man_superhero_medium_dark_skin_tone:": ":man_superhero_tone4:", + ":man_superhero_medium_light_skin_tone:": ":man_superhero_tone2:", + ":man_superhero_medium_skin_tone:": ":man_superhero_tone3:", + ":man_supervillain_dark_skin_tone:": ":man_supervillain_tone5:", + ":man_supervillain_light_skin_tone:": ":man_supervillain_tone1:", + ":man_supervillain_medium_dark_skin_tone:": ":man_supervillain_tone4:", + ":man_supervillain_medium_light_skin_tone:": ":man_supervillain_tone2:", + ":man_supervillain_medium_skin_tone:": ":man_supervillain_tone3:", + ":man_surfing_dark_skin_tone:": ":man_surfing_tone5:", + ":man_surfing_light_skin_tone:": ":man_surfing_tone1:", + ":man_surfing_medium_dark_skin_tone:": ":man_surfing_tone4:", + ":man_surfing_medium_light_skin_tone:": ":man_surfing_tone2:", + ":man_surfing_medium_skin_tone:": ":man_surfing_tone3:", + ":man_swimming_dark_skin_tone:": ":man_swimming_tone5:", + ":man_swimming_light_skin_tone:": ":man_swimming_tone1:", + ":man_swimming_medium_dark_skin_tone:": ":man_swimming_tone4:", + ":man_swimming_medium_light_skin_tone:": ":man_swimming_tone2:", + ":man_swimming_medium_skin_tone:": ":man_swimming_tone3:", + ":man_teacher_dark_skin_tone:": ":man_teacher_tone5:", + ":man_teacher_light_skin_tone:": ":man_teacher_tone1:", + ":man_teacher_medium_dark_skin_tone:": ":man_teacher_tone4:", + ":man_teacher_medium_light_skin_tone:": ":man_teacher_tone2:", + ":man_teacher_medium_skin_tone:": ":man_teacher_tone3:", + ":man_technologist_dark_skin_tone:": ":man_technologist_tone5:", + ":man_technologist_light_skin_tone:": ":man_technologist_tone1:", + ":man_technologist_medium_dark_skin_tone:": ":man_technologist_tone4:", + ":man_technologist_medium_light_skin_tone:": ":man_technologist_tone2:", + ":man_technologist_medium_skin_tone:": ":man_technologist_tone3:", + ":man_tipping_hand_dark_skin_tone:": ":man_tipping_hand_tone5:", + ":man_tipping_hand_light_skin_tone:": ":man_tipping_hand_tone1:", + ":man_tipping_hand_medium_dark_skin_tone:": ":man_tipping_hand_tone4:", + ":man_tipping_hand_medium_light_skin_tone:": ":man_tipping_hand_tone2:", + ":man_tipping_hand_medium_skin_tone:": ":man_tipping_hand_tone3:", + ":man_vampire_dark_skin_tone:": ":man_vampire_tone5:", + ":man_vampire_light_skin_tone:": ":man_vampire_tone1:", + ":man_vampire_medium_dark_skin_tone:": ":man_vampire_tone4:", + ":man_vampire_medium_light_skin_tone:": ":man_vampire_tone2:", + ":man_vampire_medium_skin_tone:": ":man_vampire_tone3:", + ":man_walking_dark_skin_tone:": ":man_walking_tone5:", + ":man_walking_facing_right_dark_skin_tone:": ":man_walking_facing_right_tone5:", + ":man_walking_facing_right_light_skin_tone:": ":man_walking_facing_right_tone1:", + ":man_walking_facing_right_medium_dark_skin_tone:": ":man_walking_facing_right_tone4:", + ":man_walking_facing_right_medium_light_skin_tone:": ":man_walking_facing_right_tone2:", + ":man_walking_facing_right_medium_skin_tone:": ":man_walking_facing_right_tone3:", + ":man_walking_light_skin_tone:": ":man_walking_tone1:", + ":man_walking_medium_dark_skin_tone:": ":man_walking_tone4:", + ":man_walking_medium_light_skin_tone:": ":man_walking_tone2:", + ":man_walking_medium_skin_tone:": ":man_walking_tone3:", + ":man_wearing_turban_dark_skin_tone:": ":man_wearing_turban_tone5:", + ":man_wearing_turban_light_skin_tone:": ":man_wearing_turban_tone1:", + ":man_wearing_turban_medium_dark_skin_tone:": ":man_wearing_turban_tone4:", + ":man_wearing_turban_medium_light_skin_tone:": ":man_wearing_turban_tone2:", + ":man_wearing_turban_medium_skin_tone:": ":man_wearing_turban_tone3:", + ":man_white_haired_dark_skin_tone:": ":man_white_haired_tone5:", + ":man_white_haired_light_skin_tone:": ":man_white_haired_tone1:", + ":man_white_haired_medium_dark_skin_tone:": ":man_white_haired_tone4:", + ":man_white_haired_medium_light_skin_tone:": ":man_white_haired_tone2:", + ":man_white_haired_medium_skin_tone:": ":man_white_haired_tone3:", + ":man_with_gua_pi_mao:": ":man_with_chinese_cap:", + ":man_with_gua_pi_mao_tone1:": ":man_with_chinese_cap_tone1:", + ":man_with_gua_pi_mao_tone2:": ":man_with_chinese_cap_tone2:", + ":man_with_gua_pi_mao_tone3:": ":man_with_chinese_cap_tone3:", + ":man_with_gua_pi_mao_tone4:": ":man_with_chinese_cap_tone4:", + ":man_with_gua_pi_mao_tone5:": ":man_with_chinese_cap_tone5:", + ":man_with_probing_cane_dark_skin_tone:": ":man_with_probing_cane_tone5:", + ":man_with_probing_cane_light_skin_tone:": ":man_with_probing_cane_tone1:", + ":man_with_probing_cane_medium_dark_skin_tone:": ":man_with_probing_cane_tone4:", + ":man_with_probing_cane_medium_light_skin_tone:": ":man_with_probing_cane_tone2:", + ":man_with_probing_cane_medium_skin_tone:": ":man_with_probing_cane_tone3:", + ":man_with_turban:": ":person_wearing_turban:", + ":man_with_turban_tone1:": ":person_wearing_turban_tone1:", + ":man_with_turban_tone2:": ":person_wearing_turban_tone2:", + ":man_with_turban_tone3:": ":person_wearing_turban_tone3:", + ":man_with_turban_tone4:": ":person_wearing_turban_tone4:", + ":man_with_turban_tone5:": ":person_wearing_turban_tone5:", + ":man_with_veil_dark_skin_tone:": ":man_with_veil_tone5:", + ":man_with_veil_light_skin_tone:": ":man_with_veil_tone1:", + ":man_with_veil_medium_dark_skin_tone:": ":man_with_veil_tone4:", + ":man_with_veil_medium_light_skin_tone:": ":man_with_veil_tone2:", + ":man_with_veil_medium_skin_tone:": ":man_with_veil_tone3:", + ":man_with_white_cane_facing_right_dark_skin_tone:": ":man_with_white_cane_facing_right_tone5:", + ":man_with_white_cane_facing_right_light_skin_tone:": ":man_with_white_cane_facing_right_tone1:", + ":man_with_white_cane_facing_right_medium_dark_skin_tone:": ":man_with_white_cane_facing_right_tone4:", + ":man_with_white_cane_facing_right_medium_light_skin_tone:": ":man_with_white_cane_facing_right_tone2:", + ":man_with_white_cane_facing_right_medium_skin_tone:": ":man_with_white_cane_facing_right_tone3:", + ":mantlepiece_clock:": ":clock:", + ":map_of_japan:": ":japan:", + ":massage:": ":person_getting_massage:", + ":massage_tone1:": ":person_getting_massage_tone1:", + ":massage_tone2:": ":person_getting_massage_tone2:", + ":massage_tone3:": ":person_getting_massage_tone3:", + ":massage_tone4:": ":person_getting_massage_tone4:", + ":massage_tone5:": ":person_getting_massage_tone5:", + ":mc:": ":flag_mc:", + ":md:": ":flag_md:", + ":me:": ":flag_me:", + ":mechanic_dark_skin_tone:": ":mechanic_tone5:", + ":mechanic_light_skin_tone:": ":mechanic_tone1:", + ":mechanic_medium_dark_skin_tone:": ":mechanic_tone4:", + ":mechanic_medium_light_skin_tone:": ":mechanic_tone2:", + ":mechanic_medium_skin_tone:": ":mechanic_tone3:", + ":megaphone:": ":mega:", + ":memo:": ":pencil:", + ":men_holding_hands_dark_skin_tone:": ":men_holding_hands_tone5:", + ":men_holding_hands_dark_skin_tone_light_skin_tone:": ":men_holding_hands_tone5_tone1:", + ":men_holding_hands_dark_skin_tone_medium_dark_skin_tone:": ":men_holding_hands_tone5_tone4:", + ":men_holding_hands_dark_skin_tone_medium_light_skin_tone:": ":men_holding_hands_tone5_tone2:", + ":men_holding_hands_dark_skin_tone_medium_skin_tone:": ":men_holding_hands_tone5_tone3:", + ":men_holding_hands_light_skin_tone:": ":men_holding_hands_tone1:", + ":men_holding_hands_light_skin_tone_dark_skin_tone:": ":men_holding_hands_tone1_tone5:", + ":men_holding_hands_light_skin_tone_medium_dark_skin_tone:": ":men_holding_hands_tone1_tone4:", + ":men_holding_hands_light_skin_tone_medium_light_skin_tone:": ":men_holding_hands_tone1_tone2:", + ":men_holding_hands_light_skin_tone_medium_skin_tone:": ":men_holding_hands_tone1_tone3:", + ":men_holding_hands_medium_dark_skin_tone:": ":men_holding_hands_tone4:", + ":men_holding_hands_medium_dark_skin_tone_dark_skin_tone:": ":men_holding_hands_tone4_tone5:", + ":men_holding_hands_medium_dark_skin_tone_light_skin_tone:": ":men_holding_hands_tone4_tone1:", + ":men_holding_hands_medium_dark_skin_tone_medium_light_skin_tone:": ":men_holding_hands_tone4_tone2:", + ":men_holding_hands_medium_dark_skin_tone_medium_skin_tone:": ":men_holding_hands_tone4_tone3:", + ":men_holding_hands_medium_light_skin_tone:": ":men_holding_hands_tone2:", + ":men_holding_hands_medium_light_skin_tone_dark_skin_tone:": ":men_holding_hands_tone2_tone5:", + ":men_holding_hands_medium_light_skin_tone_light_skin_tone:": ":men_holding_hands_tone2_tone1:", + ":men_holding_hands_medium_light_skin_tone_medium_dark_skin_tone:": ":men_holding_hands_tone2_tone4:", + ":men_holding_hands_medium_light_skin_tone_medium_skin_tone:": ":men_holding_hands_tone2_tone3:", + ":men_holding_hands_medium_skin_tone:": ":men_holding_hands_tone3:", + ":men_holding_hands_medium_skin_tone_dark_skin_tone:": ":men_holding_hands_tone3_tone5:", + ":men_holding_hands_medium_skin_tone_light_skin_tone:": ":men_holding_hands_tone3_tone1:", + ":men_holding_hands_medium_skin_tone_medium_dark_skin_tone:": ":men_holding_hands_tone3_tone4:", + ":men_holding_hands_medium_skin_tone_medium_light_skin_tone:": ":men_holding_hands_tone3_tone2:", + ":mens_room:": ":mens:", + ":mermaid_dark_skin_tone:": ":mermaid_tone5:", + ":mermaid_light_skin_tone:": ":mermaid_tone1:", + ":mermaid_medium_dark_skin_tone:": ":mermaid_tone4:", + ":mermaid_medium_light_skin_tone:": ":mermaid_tone2:", + ":mermaid_medium_skin_tone:": ":mermaid_tone3:", + ":merman_dark_skin_tone:": ":merman_tone5:", + ":merman_light_skin_tone:": ":merman_tone1:", + ":merman_medium_dark_skin_tone:": ":merman_tone4:", + ":merman_medium_light_skin_tone:": ":merman_tone2:", + ":merman_medium_skin_tone:": ":merman_tone3:", + ":merperson_dark_skin_tone:": ":merperson_tone5:", + ":merperson_light_skin_tone:": ":merperson_tone1:", + ":merperson_medium_dark_skin_tone:": ":merperson_tone4:", + ":merperson_medium_light_skin_tone:": ":merperson_tone2:", + ":merperson_medium_skin_tone:": ":merperson_tone3:", + ":mf:": ":flag_mf:", + ":mg:": ":flag_mg:", + ":mh:": ":flag_mh:", + ":mk:": ":flag_mk:", + ":ml:": ":flag_ml:", + ":mm:": ":flag_mm:", + ":mn:": ":flag_mn:", + ":mo:": ":flag_mo:", + ":moai:": ":moyai:", + ":money_bag:": ":moneybag:", + ":money_mouth_face:": ":money_mouth:", + ":mother_christmas:": ":mrs_claus:", + ":mother_christmas_tone1:": ":mrs_claus_tone1:", + ":mother_christmas_tone2:": ":mrs_claus_tone2:", + ":mother_christmas_tone3:": ":mrs_claus_tone3:", + ":mother_christmas_tone4:": ":mrs_claus_tone4:", + ":mother_christmas_tone5:": ":mrs_claus_tone5:", + ":motor_boat:": ":motorboat:", + ":motorbike:": ":motor_scooter:", + ":mountain_bicyclist:": ":person_mountain_biking:", + ":mountain_bicyclist_tone1:": ":person_mountain_biking_tone1:", + ":mountain_bicyclist_tone2:": ":person_mountain_biking_tone2:", + ":mountain_bicyclist_tone3:": ":person_mountain_biking_tone3:", + ":mountain_bicyclist_tone4:": ":person_mountain_biking_tone4:", + ":mountain_bicyclist_tone5:": ":person_mountain_biking_tone5:", + ":mouse_face:": ":mouse:", + ":mouth:": ":lips:", + ":mp:": ":flag_mp:", + ":mq:": ":flag_mq:", + ":mr:": ":flag_mr:", + ":ms:": ":flag_ms:", + ":mt:": ":flag_mt:", + ":mu:": ":flag_mu:", + ":musical_notes:": ":notes:", + ":muted_speaker:": ":mute:", + ":mv:": ":flag_mv:", + ":mw:": ":flag_mw:", + ":mx:": ":flag_mx:", + ":mx_claus_dark_skin_tone:": ":mx_claus_tone5:", + ":mx_claus_light_skin_tone:": ":mx_claus_tone1:", + ":mx_claus_medium_dark_skin_tone:": ":mx_claus_tone4:", + ":mx_claus_medium_light_skin_tone:": ":mx_claus_tone2:", + ":mx_claus_medium_skin_tone:": ":mx_claus_tone3:", + ":my:": ":flag_my:", + ":mz:": ":flag_mz:", + ":na:": ":flag_na:", + ":nail_polish:": ":nail_care:", + ":national_park:": ":park:", + ":nc:": ":flag_nc:", + ":ne:": ":flag_ne:", + ":nerd_face:": ":nerd:", + ":new_moon_face:": ":new_moon_with_face:", + ":next_track:": ":track_next:", + ":nf:": ":flag_nf:", + ":ni:": ":flag_ni:", + ":nigeria:": ":flag_ng:", + ":nine_oclock:": ":clock9:", + ":nine_thirty:": ":clock930:", + ":ninja_dark_skin_tone:": ":ninja_tone5:", + ":ninja_light_skin_tone:": ":ninja_tone1:", + ":ninja_medium_dark_skin_tone:": ":ninja_tone4:", + ":ninja_medium_light_skin_tone:": ":ninja_tone2:", + ":ninja_medium_skin_tone:": ":ninja_tone3:", + ":nl:": ":flag_nl:", + ":no:": ":flag_no:", + ":no_good:": ":person_gesturing_no:", + ":no_good_tone1:": ":person_gesturing_no_tone1:", + ":no_good_tone2:": ":person_gesturing_no_tone2:", + ":no_good_tone3:": ":person_gesturing_no_tone3:", + ":no_good_tone4:": ":person_gesturing_no_tone4:", + ":no_good_tone5:": ":person_gesturing_no_tone5:", + ":no_littering:": ":do_not_litter:", + ":np:": ":flag_np:", + ":nr:": ":flag_nr:", + ":nu:": ":flag_nu:", + ":nz:": ":flag_nz:", + ":office_worker_dark_skin_tone:": ":office_worker_tone5:", + ":office_worker_light_skin_tone:": ":office_worker_tone1:", + ":office_worker_medium_dark_skin_tone:": ":office_worker_tone4:", + ":office_worker_medium_light_skin_tone:": ":office_worker_tone2:", + ":office_worker_medium_skin_tone:": ":office_worker_tone3:", + ":ogre:": ":japanese_ogre:", + ":oil_drum:": ":oil:", + ":ok_woman:": ":person_gesturing_ok:", + ":ok_woman_tone1:": ":person_gesturing_ok_tone1:", + ":ok_woman_tone2:": ":person_gesturing_ok_tone2:", + ":ok_woman_tone3:": ":person_gesturing_ok_tone3:", + ":ok_woman_tone4:": ":person_gesturing_ok_tone4:", + ":ok_woman_tone5:": ":person_gesturing_ok_tone5:", + ":old_key:": ":key2:", + ":old_man:": ":older_man:", + ":old_woman:": ":older_woman:", + ":older_adult_dark_skin_tone:": ":older_adult_tone5:", + ":older_adult_light_skin_tone:": ":older_adult_tone1:", + ":older_adult_medium_dark_skin_tone:": ":older_adult_tone4:", + ":older_adult_medium_light_skin_tone:": ":older_adult_tone2:", + ":older_adult_medium_skin_tone:": ":older_adult_tone3:", + ":older_person:": ":older_adult:", + ":om:": ":flag_om:", + ":on_arrow:": ":on:", + ":oncoming_fist:": ":punch:", + ":one_oclock:": ":clock1:", + ":one_thirty:": ":clock130:", + ":open_book:": ":book:", + ":optical_disk:": ":cd:", + ":pa:": ":flag_pa:", + ":paella:": ":shallow_pan_of_food:", + ":palm_down_hand_dark_skin_tone:": ":palm_down_hand_tone5:", + ":palm_down_hand_light_skin_tone:": ":palm_down_hand_tone1:", + ":palm_down_hand_medium_dark_skin_tone:": ":palm_down_hand_tone4:", + ":palm_down_hand_medium_light_skin_tone:": ":palm_down_hand_tone2:", + ":palm_down_hand_medium_skin_tone:": ":palm_down_hand_tone3:", + ":palm_up_hand_dark_skin_tone:": ":palm_up_hand_tone5:", + ":palm_up_hand_light_skin_tone:": ":palm_up_hand_tone1:", + ":palm_up_hand_medium_dark_skin_tone:": ":palm_up_hand_tone4:", + ":palm_up_hand_medium_light_skin_tone:": ":palm_up_hand_tone2:", + ":palm_up_hand_medium_skin_tone:": ":palm_up_hand_tone3:", + ":palms_up_together_dark_skin_tone:": ":palms_up_together_tone5:", + ":palms_up_together_light_skin_tone:": ":palms_up_together_tone1:", + ":palms_up_together_medium_dark_skin_tone:": ":palms_up_together_tone4:", + ":palms_up_together_medium_light_skin_tone:": ":palms_up_together_tone2:", + ":palms_up_together_medium_skin_tone:": ":palms_up_together_tone3:", + ":panda:": ":panda_face:", + ":party_popper:": ":tada:", + ":passenger_ship:": ":cruise_ship:", + ":paw_prints:": ":feet:", + ":pe:": ":flag_pe:", + ":peace_symbol:": ":peace:", + ":pen:": ":pen_ballpoint:", + ":pensive_face:": ":pensive:", + ":people_holding_hands_dark_skin_tone:": ":people_holding_hands_tone5:", + ":people_holding_hands_dark_skin_tone_light_skin_tone:": ":people_holding_hands_tone5_tone1:", + ":people_holding_hands_dark_skin_tone_medium_dark_skin_tone:": ":people_holding_hands_tone5_tone4:", + ":people_holding_hands_dark_skin_tone_medium_light_skin_tone:": ":people_holding_hands_tone5_tone2:", + ":people_holding_hands_dark_skin_tone_medium_skin_tone:": ":people_holding_hands_tone5_tone3:", + ":people_holding_hands_light_skin_tone:": ":people_holding_hands_tone1:", + ":people_holding_hands_light_skin_tone_dark_skin_tone:": ":people_holding_hands_tone1_tone5:", + ":people_holding_hands_light_skin_tone_medium_dark_skin_tone:": ":people_holding_hands_tone1_tone4:", + ":people_holding_hands_light_skin_tone_medium_light_skin_tone:": ":people_holding_hands_tone1_tone2:", + ":people_holding_hands_light_skin_tone_medium_skin_tone:": ":people_holding_hands_tone1_tone3:", + ":people_holding_hands_medium_dark_skin_tone:": ":people_holding_hands_tone4:", + ":people_holding_hands_medium_dark_skin_tone_dark_skin_tone:": ":people_holding_hands_tone4_tone5:", + ":people_holding_hands_medium_dark_skin_tone_light_skin_tone:": ":people_holding_hands_tone4_tone1:", + ":people_holding_hands_medium_dark_skin_tone_medium_light_skin_tone:": ":people_holding_hands_tone4_tone2:", + ":people_holding_hands_medium_dark_skin_tone_medium_skin_tone:": ":people_holding_hands_tone4_tone3:", + ":people_holding_hands_medium_light_skin_tone:": ":people_holding_hands_tone2:", + ":people_holding_hands_medium_light_skin_tone_dark_skin_tone:": ":people_holding_hands_tone2_tone5:", + ":people_holding_hands_medium_light_skin_tone_light_skin_tone:": ":people_holding_hands_tone2_tone1:", + ":people_holding_hands_medium_light_skin_tone_medium_dark_skin_tone:": ":people_holding_hands_tone2_tone4:", + ":people_holding_hands_medium_light_skin_tone_medium_skin_tone:": ":people_holding_hands_tone2_tone3:", + ":people_holding_hands_medium_skin_tone:": ":people_holding_hands_tone3:", + ":people_holding_hands_medium_skin_tone_dark_skin_tone:": ":people_holding_hands_tone3_tone5:", + ":people_holding_hands_medium_skin_tone_light_skin_tone:": ":people_holding_hands_tone3_tone1:", + ":people_holding_hands_medium_skin_tone_medium_dark_skin_tone:": ":people_holding_hands_tone3_tone4:", + ":people_holding_hands_medium_skin_tone_medium_light_skin_tone:": ":people_holding_hands_tone3_tone2:", + ":person:": ":adult:", + ":person_beard:": ":bearded_person:", + ":person_climbing_dark_skin_tone:": ":person_climbing_tone5:", + ":person_climbing_light_skin_tone:": ":person_climbing_tone1:", + ":person_climbing_medium_dark_skin_tone:": ":person_climbing_tone4:", + ":person_climbing_medium_light_skin_tone:": ":person_climbing_tone2:", + ":person_climbing_medium_skin_tone:": ":person_climbing_tone3:", + ":person_dark_skin_tone_bald:": ":person_tone5_bald:", + ":person_dark_skin_tone_curly_hair:": ":person_tone5_curly_hair:", + ":person_dark_skin_tone_red_hair:": ":person_tone5_red_hair:", + ":person_dark_skin_tone_white_hair:": ":person_tone5_white_hair:", + ":person_feeding_baby_dark_skin_tone:": ":person_feeding_baby_tone5:", + ":person_feeding_baby_light_skin_tone:": ":person_feeding_baby_tone1:", + ":person_feeding_baby_medium_dark_skin_tone:": ":person_feeding_baby_tone4:", + ":person_feeding_baby_medium_light_skin_tone:": ":person_feeding_baby_tone2:", + ":person_feeding_baby_medium_skin_tone:": ":person_feeding_baby_tone3:", + ":person_golfing_dark_skin_tone:": ":person_golfing_tone5:", + ":person_golfing_light_skin_tone:": ":person_golfing_tone1:", + ":person_golfing_medium_dark_skin_tone:": ":person_golfing_tone4:", + ":person_golfing_medium_light_skin_tone:": ":person_golfing_tone2:", + ":person_golfing_medium_skin_tone:": ":person_golfing_tone3:", + ":person_in_bed:": ":sleeping_accommodation:", + ":person_in_bed_dark_skin_tone:": ":person_in_bed_tone5:", + ":person_in_bed_light_skin_tone:": ":person_in_bed_tone1:", + ":person_in_bed_medium_dark_skin_tone:": ":person_in_bed_tone4:", + ":person_in_bed_medium_light_skin_tone:": ":person_in_bed_tone2:", + ":person_in_bed_medium_skin_tone:": ":person_in_bed_tone3:", + ":person_in_lotus_position_dark_skin_tone:": ":person_in_lotus_position_tone5:", + ":person_in_lotus_position_light_skin_tone:": ":person_in_lotus_position_tone1:", + ":person_in_lotus_position_medium_dark_skin_tone:": ":person_in_lotus_position_tone4:", + ":person_in_lotus_position_medium_light_skin_tone:": ":person_in_lotus_position_tone2:", + ":person_in_lotus_position_medium_skin_tone:": ":person_in_lotus_position_tone3:", + ":person_in_manual_wheelchair_dark_skin_tone:": ":person_in_manual_wheelchair_tone5:", + ":person_in_manual_wheelchair_facing_right_dark_skin_tone:": ":person_in_manual_wheelchair_facing_right_tone5:", + ":person_in_manual_wheelchair_facing_right_light_skin_tone:": ":person_in_manual_wheelchair_facing_right_tone1:", + ":person_in_manual_wheelchair_facing_right_medium_dark_skin_tone:": ":person_in_manual_wheelchair_facing_right_tone4:", + ":person_in_manual_wheelchair_facing_right_medium_light_skin_tone:": ":person_in_manual_wheelchair_facing_right_tone2:", + ":person_in_manual_wheelchair_facing_right_medium_skin_tone:": ":person_in_manual_wheelchair_facing_right_tone3:", + ":person_in_manual_wheelchair_light_skin_tone:": ":person_in_manual_wheelchair_tone1:", + ":person_in_manual_wheelchair_medium_dark_skin_tone:": ":person_in_manual_wheelchair_tone4:", + ":person_in_manual_wheelchair_medium_light_skin_tone:": ":person_in_manual_wheelchair_tone2:", + ":person_in_manual_wheelchair_medium_skin_tone:": ":person_in_manual_wheelchair_tone3:", + ":person_in_motorized_wheelchair_dark_skin_tone:": ":person_in_motorized_wheelchair_tone5:", + ":person_in_motorized_wheelchair_facing_right_dark_skin_tone:": ":person_in_motorized_wheelchair_facing_right_tone5:", + ":person_in_motorized_wheelchair_facing_right_light_skin_tone:": ":person_in_motorized_wheelchair_facing_right_tone1:", + ":person_in_motorized_wheelchair_facing_right_medium_dark_skin_tone:": ":person_in_motorized_wheelchair_facing_right_tone4:", + ":person_in_motorized_wheelchair_facing_right_medium_light_skin_tone:": ":person_in_motorized_wheelchair_facing_right_tone2:", + ":person_in_motorized_wheelchair_facing_right_medium_skin_tone:": ":person_in_motorized_wheelchair_facing_right_tone3:", + ":person_in_motorized_wheelchair_light_skin_tone:": ":person_in_motorized_wheelchair_tone1:", + ":person_in_motorized_wheelchair_medium_dark_skin_tone:": ":person_in_motorized_wheelchair_tone4:", + ":person_in_motorized_wheelchair_medium_light_skin_tone:": ":person_in_motorized_wheelchair_tone2:", + ":person_in_motorized_wheelchair_medium_skin_tone:": ":person_in_motorized_wheelchair_tone3:", + ":person_in_steamy_room_dark_skin_tone:": ":person_in_steamy_room_tone5:", + ":person_in_steamy_room_light_skin_tone:": ":person_in_steamy_room_tone1:", + ":person_in_steamy_room_medium_dark_skin_tone:": ":person_in_steamy_room_tone4:", + ":person_in_steamy_room_medium_light_skin_tone:": ":person_in_steamy_room_tone2:", + ":person_in_steamy_room_medium_skin_tone:": ":person_in_steamy_room_tone3:", + ":person_kneeling_dark_skin_tone:": ":person_kneeling_tone5:", + ":person_kneeling_facing_right_dark_skin_tone:": ":person_kneeling_facing_right_tone5:", + ":person_kneeling_facing_right_light_skin_tone:": ":person_kneeling_facing_right_tone1:", + ":person_kneeling_facing_right_medium_dark_skin_tone:": ":person_kneeling_facing_right_tone4:", + ":person_kneeling_facing_right_medium_light_skin_tone:": ":person_kneeling_facing_right_tone2:", + ":person_kneeling_facing_right_medium_skin_tone:": ":person_kneeling_facing_right_tone3:", + ":person_kneeling_light_skin_tone:": ":person_kneeling_tone1:", + ":person_kneeling_medium_dark_skin_tone:": ":person_kneeling_tone4:", + ":person_kneeling_medium_light_skin_tone:": ":person_kneeling_tone2:", + ":person_kneeling_medium_skin_tone:": ":person_kneeling_tone3:", + ":person_light_skin_tone_bald:": ":person_tone1_bald:", + ":person_light_skin_tone_curly_hair:": ":person_tone1_curly_hair:", + ":person_light_skin_tone_red_hair:": ":person_tone1_red_hair:", + ":person_light_skin_tone_white_hair:": ":person_tone1_white_hair:", + ":person_medium_dark_skin_tone_bald:": ":person_tone4_bald:", + ":person_medium_dark_skin_tone_curly_hair:": ":person_tone4_curly_hair:", + ":person_medium_dark_skin_tone_red_hair:": ":person_tone4_red_hair:", + ":person_medium_dark_skin_tone_white_hair:": ":person_tone4_white_hair:", + ":person_medium_light_skin_tone_bald:": ":person_tone2_bald:", + ":person_medium_light_skin_tone_curly_hair:": ":person_tone2_curly_hair:", + ":person_medium_light_skin_tone_red_hair:": ":person_tone2_red_hair:", + ":person_medium_light_skin_tone_white_hair:": ":person_tone2_white_hair:", + ":person_medium_skin_tone_bald:": ":person_tone3_bald:", + ":person_medium_skin_tone_curly_hair:": ":person_tone3_curly_hair:", + ":person_medium_skin_tone_red_hair:": ":person_tone3_red_hair:", + ":person_medium_skin_tone_white_hair:": ":person_tone3_white_hair:", + ":person_running_facing_right_dark_skin_tone:": ":person_running_facing_right_tone5:", + ":person_running_facing_right_light_skin_tone:": ":person_running_facing_right_tone1:", + ":person_running_facing_right_medium_dark_skin_tone:": ":person_running_facing_right_tone4:", + ":person_running_facing_right_medium_light_skin_tone:": ":person_running_facing_right_tone2:", + ":person_running_facing_right_medium_skin_tone:": ":person_running_facing_right_tone3:", + ":person_standing_dark_skin_tone:": ":person_standing_tone5:", + ":person_standing_light_skin_tone:": ":person_standing_tone1:", + ":person_standing_medium_dark_skin_tone:": ":person_standing_tone4:", + ":person_standing_medium_light_skin_tone:": ":person_standing_tone2:", + ":person_standing_medium_skin_tone:": ":person_standing_tone3:", + ":person_walking_facing_right_dark_skin_tone:": ":person_walking_facing_right_tone5:", + ":person_walking_facing_right_light_skin_tone:": ":person_walking_facing_right_tone1:", + ":person_walking_facing_right_medium_dark_skin_tone:": ":person_walking_facing_right_tone4:", + ":person_walking_facing_right_medium_light_skin_tone:": ":person_walking_facing_right_tone2:", + ":person_walking_facing_right_medium_skin_tone:": ":person_walking_facing_right_tone3:", + ":person_with_ball:": ":person_bouncing_ball:", + ":person_with_ball_tone1:": ":person_bouncing_ball_tone1:", + ":person_with_ball_tone2:": ":person_bouncing_ball_tone2:", + ":person_with_ball_tone3:": ":person_bouncing_ball_tone3:", + ":person_with_ball_tone4:": ":person_bouncing_ball_tone4:", + ":person_with_ball_tone5:": ":person_bouncing_ball_tone5:", + ":person_with_blond_hair:": ":blond_haired_person:", + ":person_with_blond_hair_tone1:": ":blond_haired_person_tone1:", + ":person_with_blond_hair_tone2:": ":blond_haired_person_tone2:", + ":person_with_blond_hair_tone3:": ":blond_haired_person_tone3:", + ":person_with_blond_hair_tone4:": ":blond_haired_person_tone4:", + ":person_with_blond_hair_tone5:": ":blond_haired_person_tone5:", + ":person_with_crown_dark_skin_tone:": ":person_with_crown_tone5:", + ":person_with_crown_light_skin_tone:": ":person_with_crown_tone1:", + ":person_with_crown_medium_dark_skin_tone:": ":person_with_crown_tone4:", + ":person_with_crown_medium_light_skin_tone:": ":person_with_crown_tone2:", + ":person_with_crown_medium_skin_tone:": ":person_with_crown_tone3:", + ":person_with_pouting_face:": ":person_pouting:", + ":person_with_pouting_face_tone1:": ":person_pouting_tone1:", + ":person_with_pouting_face_tone2:": ":person_pouting_tone2:", + ":person_with_pouting_face_tone3:": ":person_pouting_tone3:", + ":person_with_pouting_face_tone4:": ":person_pouting_tone4:", + ":person_with_pouting_face_tone5:": ":person_pouting_tone5:", + ":person_with_probing_cane_dark_skin_tone:": ":person_with_probing_cane_tone5:", + ":person_with_probing_cane_light_skin_tone:": ":person_with_probing_cane_tone1:", + ":person_with_probing_cane_medium_dark_skin_tone:": ":person_with_probing_cane_tone4:", + ":person_with_probing_cane_medium_light_skin_tone:": ":person_with_probing_cane_tone2:", + ":person_with_probing_cane_medium_skin_tone:": ":person_with_probing_cane_tone3:", + ":person_with_white_cane_facing_right_dark_skin_tone:": ":person_with_white_cane_facing_right_tone5:", + ":person_with_white_cane_facing_right_light_skin_tone:": ":person_with_white_cane_facing_right_tone1:", + ":person_with_white_cane_facing_right_medium_dark_skin_tone:": ":person_with_white_cane_facing_right_tone4:", + ":person_with_white_cane_facing_right_medium_light_skin_tone:": ":person_with_white_cane_facing_right_tone2:", + ":person_with_white_cane_facing_right_medium_skin_tone:": ":person_with_white_cane_facing_right_tone3:", + ":pf:": ":flag_pf:", + ":pg:": ":flag_pg:", + ":ph:": ":flag_ph:", + ":pig_face:": ":pig:", + ":pile_of_poo:": ":poop:", + ":pilot_dark_skin_tone:": ":pilot_tone5:", + ":pilot_light_skin_tone:": ":pilot_tone1:", + ":pilot_medium_dark_skin_tone:": ":pilot_tone4:", + ":pilot_medium_light_skin_tone:": ":pilot_tone2:", + ":pilot_medium_skin_tone:": ":pilot_tone3:", + ":pinched_fingers_dark_skin_tone:": ":pinched_fingers_tone5:", + ":pinched_fingers_light_skin_tone:": ":pinched_fingers_tone1:", + ":pinched_fingers_medium_dark_skin_tone:": ":pinched_fingers_tone4:", + ":pinched_fingers_medium_light_skin_tone:": ":pinched_fingers_tone2:", + ":pinched_fingers_medium_skin_tone:": ":pinched_fingers_tone3:", + ":pinching_hand_dark_skin_tone:": ":pinching_hand_tone5:", + ":pinching_hand_light_skin_tone:": ":pinching_hand_tone1:", + ":pinching_hand_medium_dark_skin_tone:": ":pinching_hand_tone4:", + ":pinching_hand_medium_light_skin_tone:": ":pinching_hand_tone2:", + ":pinching_hand_medium_skin_tone:": ":pinching_hand_tone3:", + ":pistol:": ":gun:", + ":pk:": ":flag_pk:", + ":pl:": ":flag_pl:", + ":pm:": ":flag_pm:", + ":pn:": ":flag_pn:", + ":poo:": ":poop:", + ":pot_of_food:": ":stew:", + ":pouting_face:": ":rage:", + ":pr:": ":flag_pr:", + ":pregnant_man_dark_skin_tone:": ":pregnant_man_tone5:", + ":pregnant_man_light_skin_tone:": ":pregnant_man_tone1:", + ":pregnant_man_medium_dark_skin_tone:": ":pregnant_man_tone4:", + ":pregnant_man_medium_light_skin_tone:": ":pregnant_man_tone2:", + ":pregnant_man_medium_skin_tone:": ":pregnant_man_tone3:", + ":pregnant_person_dark_skin_tone:": ":pregnant_person_tone5:", + ":pregnant_person_light_skin_tone:": ":pregnant_person_tone1:", + ":pregnant_person_medium_dark_skin_tone:": ":pregnant_person_tone4:", + ":pregnant_person_medium_light_skin_tone:": ":pregnant_person_tone2:", + ":pregnant_person_medium_skin_tone:": ":pregnant_person_tone3:", + ":previous_track:": ":track_previous:", + ":prohibited:": ":no_entry_sign:", + ":ps:": ":flag_ps:", + ":pt:": ":flag_pt:", + ":pudding:": ":custard:", + ":puzzle_piece:": ":jigsaw:", + ":pw:": ":flag_pw:", + ":py:": ":flag_py:", + ":qa:": ":flag_qa:", + ":question_mark:": ":question:", + ":rabbit_face:": ":rabbit:", + ":racing_car:": ":race_car:", + ":racing_motorcycle:": ":motorcycle:", + ":radioactive_sign:": ":radioactive:", + ":railroad_track:": ":railway_track:", + ":raised_fist:": ":fist:", + ":raised_hand_with_fingers_splayed:": ":hand_splayed:", + ":raised_hand_with_fingers_splayed_tone1:": ":hand_splayed_tone1:", + ":raised_hand_with_fingers_splayed_tone2:": ":hand_splayed_tone2:", + ":raised_hand_with_fingers_splayed_tone3:": ":hand_splayed_tone3:", + ":raised_hand_with_fingers_splayed_tone4:": ":hand_splayed_tone4:", + ":raised_hand_with_fingers_splayed_tone5:": ":hand_splayed_tone5:", + ":raised_hand_with_part_between_middle_and_ring_fingers:": ":vulcan:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone1:": ":vulcan_tone1:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone2:": ":vulcan_tone2:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone3:": ":vulcan_tone3:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone4:": ":vulcan_tone4:", + ":raised_hand_with_part_between_middle_and_ring_fingers_tone5:": ":vulcan_tone5:", + ":raising_hand:": ":person_raising_hand:", + ":raising_hand_tone1:": ":person_raising_hand_tone1:", + ":raising_hand_tone2:": ":person_raising_hand_tone2:", + ":raising_hand_tone3:": ":person_raising_hand_tone3:", + ":raising_hand_tone4:": ":person_raising_hand_tone4:", + ":raising_hand_tone5:": ":person_raising_hand_tone5:", + ":raising_hands:": ":raised_hands:", + ":re:": ":flag_re:", + ":red_apple:": ":apple:", + ":red_hair:": ":red_haired:", + ":red_heart:": ":heart:", + ":relieved_face:": ":relieved:", + ":reversed_hand_with_middle_finger_extended:": ":middle_finger:", + ":reversed_hand_with_middle_finger_extended_tone1:": ":middle_finger_tone1:", + ":reversed_hand_with_middle_finger_extended_tone2:": ":middle_finger_tone2:", + ":reversed_hand_with_middle_finger_extended_tone3:": ":middle_finger_tone3:", + ":reversed_hand_with_middle_finger_extended_tone4:": ":middle_finger_tone4:", + ":reversed_hand_with_middle_finger_extended_tone5:": ":middle_finger_tone5:", + ":rhinoceros:": ":rhino:", + ":right_anger_bubble:": ":anger_right:", + ":right_arrow:": ":arrow_right:", + ":right_fist:": ":right_facing_fist:", + ":right_fist_tone1:": ":right_facing_fist_tone1:", + ":right_fist_tone2:": ":right_facing_fist_tone2:", + ":right_fist_tone3:": ":right_facing_fist_tone3:", + ":right_fist_tone4:": ":right_facing_fist_tone4:", + ":right_fist_tone5:": ":right_facing_fist_tone5:", + ":rightwards_hand_dark_skin_tone:": ":rightwards_hand_tone5:", + ":rightwards_hand_light_skin_tone:": ":rightwards_hand_tone1:", + ":rightwards_hand_medium_dark_skin_tone:": ":rightwards_hand_tone4:", + ":rightwards_hand_medium_light_skin_tone:": ":rightwards_hand_tone2:", + ":rightwards_hand_medium_skin_tone:": ":rightwards_hand_tone3:", + ":rightwards_pushing_hand_dark_skin_tone:": ":rightwards_pushing_hand_tone5:", + ":rightwards_pushing_hand_light_skin_tone:": ":rightwards_pushing_hand_tone1:", + ":rightwards_pushing_hand_medium_dark_skin_tone:": ":rightwards_pushing_hand_tone4:", + ":rightwards_pushing_hand_medium_light_skin_tone:": ":rightwards_pushing_hand_tone2:", + ":rightwards_pushing_hand_medium_skin_tone:": ":rightwards_pushing_hand_tone3:", + ":ro:": ":flag_ro:", + ":robot_face:": ":robot:", + ":rolled_up_newspaper:": ":newspaper2:", + ":rolling_on_the_floor_laughing:": ":rofl:", + ":rowboat:": ":person_rowing_boat:", + ":rowboat_tone1:": ":person_rowing_boat_tone1:", + ":rowboat_tone2:": ":person_rowing_boat_tone2:", + ":rowboat_tone3:": ":person_rowing_boat_tone3:", + ":rowboat_tone4:": ":person_rowing_boat_tone4:", + ":rowboat_tone5:": ":person_rowing_boat_tone5:", + ":rs:": ":flag_rs:", + ":ru:": ":flag_ru:", + ":runner:": ":person_running:", + ":runner_tone1:": ":person_running_tone1:", + ":runner_tone2:": ":person_running_tone2:", + ":runner_tone3:": ":person_running_tone3:", + ":runner_tone4:": ":person_running_tone4:", + ":runner_tone5:": ":person_running_tone5:", + ":running_shirt:": ":running_shirt_with_sash:", + ":running_shoe:": ":athletic_shoe:", + ":rw:": ":flag_rw:", + ":santa_claus:": ":santa:", + ":satisfied:": ":laughing:", + ":saudi:": ":flag_sa:", + ":saudiarabia:": ":flag_sa:", + ":sb:": ":flag_sb:", + ":sc:": ":flag_sc:", + ":scientist_dark_skin_tone:": ":scientist_tone5:", + ":scientist_light_skin_tone:": ":scientist_tone1:", + ":scientist_medium_dark_skin_tone:": ":scientist_tone4:", + ":scientist_medium_light_skin_tone:": ":scientist_tone2:", + ":scientist_medium_skin_tone:": ":scientist_tone3:", + ":scorpio:": ":scorpius:", + ":sd:": ":flag_sd:", + ":se:": ":flag_se:", + ":second_place_medal:": ":second_place:", + ":seven_oclock:": ":clock7:", + ":seven_thirty:": ":clock730:", + ":sg:": ":flag_sg:", + ":sh:": ":flag_sh:", + ":shaking_hands:": ":handshake:", + ":sheaf_of_rice:": ":ear_of_rice:", + ":shelled_peanut:": ":peanuts:", + ":shit:": ":poop:", + ":shooting_star:": ":stars:", + ":shopping_trolley:": ":shopping_cart:", + ":shortcake:": ":cake:", + ":shrug:": ":person_shrugging:", + ":shrug_tone1:": ":person_shrugging_tone1:", + ":shrug_tone2:": ":person_shrugging_tone2:", + ":shrug_tone3:": ":person_shrugging_tone3:", + ":shrug_tone4:": ":person_shrugging_tone4:", + ":shrug_tone5:": ":person_shrugging_tone5:", + ":si:": ":flag_si:", + ":sick:": ":nauseated_face:", + ":sign_of_the_horns:": ":metal:", + ":sign_of_the_horns_tone1:": ":metal_tone1:", + ":sign_of_the_horns_tone2:": ":metal_tone2:", + ":sign_of_the_horns_tone3:": ":metal_tone3:", + ":sign_of_the_horns_tone4:": ":metal_tone4:", + ":sign_of_the_horns_tone5:": ":metal_tone5:", + ":singer_dark_skin_tone:": ":singer_tone5:", + ":singer_light_skin_tone:": ":singer_tone1:", + ":singer_medium_dark_skin_tone:": ":singer_tone4:", + ":singer_medium_light_skin_tone:": ":singer_tone2:", + ":singer_medium_skin_tone:": ":singer_tone3:", + ":six_oclock:": ":clock6:", + ":six_thirty:": ":clock630:", + ":sj:": ":flag_sj:", + ":sk:": ":flag_sk:", + ":skeleton:": ":skull:", + ":skis:": ":ski:", + ":skull_and_crossbones:": ":skull_crossbones:", + ":sl:": ":flag_sl:", + ":sleeping_face:": ":sleeping:", + ":sleepy_face:": ":sleepy:", + ":sleuth_or_spy:": ":detective:", + ":sleuth_or_spy_tone1:": ":detective_tone1:", + ":sleuth_or_spy_tone2:": ":detective_tone2:", + ":sleuth_or_spy_tone3:": ":detective_tone3:", + ":sleuth_or_spy_tone4:": ":detective_tone4:", + ":sleuth_or_spy_tone5:": ":detective_tone5:", + ":slightly_frowning_face:": ":slight_frown:", + ":slightly_smiling_face:": ":slight_smile:", + ":sm:": ":flag_sm:", + ":small_airplane:": ":airplane_small:", + ":smiling_face:": ":relaxed:", + ":smirking_face:": ":smirk:", + ":sn:": ":flag_sn:", + ":sneeze:": ":sneezing_face:", + ":snow_capped_mountain:": ":mountain_snow:", + ":snowboarder_dark_skin_tone:": ":snowboarder_tone5:", + ":snowboarder_light_skin_tone:": ":snowboarder_tone1:", + ":snowboarder_medium_dark_skin_tone:": ":snowboarder_tone4:", + ":snowboarder_medium_light_skin_tone:": ":snowboarder_tone2:", + ":snowboarder_medium_skin_tone:": ":snowboarder_tone3:", + ":so:": ":flag_so:", + ":soccer_ball:": ":soccer:", + ":soon_arrow:": ":soon:", + ":spade_suit:": ":spades:", + ":speaking_head_in_silhouette:": ":speaking_head:", + ":spiral_calendar_pad:": ":calendar_spiral:", + ":spiral_note_pad:": ":notepad_spiral:", + ":spiral_shell:": ":shell:", + ":sports_medal:": ":medal:", + ":spy:": ":detective:", + ":spy_tone1:": ":detective_tone1:", + ":spy_tone2:": ":detective_tone2:", + ":spy_tone3:": ":detective_tone3:", + ":spy_tone4:": ":detective_tone4:", + ":spy_tone5:": ":detective_tone5:", + ":sr:": ":flag_sr:", + ":ss:": ":flag_ss:", + ":st:": ":flag_st:", + ":steaming_bowl:": ":ramen:", + ":stop_sign:": ":octagonal_sign:", + ":student_dark_skin_tone:": ":student_tone5:", + ":student_light_skin_tone:": ":student_tone1:", + ":student_medium_dark_skin_tone:": ":student_tone4:", + ":student_medium_light_skin_tone:": ":student_tone2:", + ":student_medium_skin_tone:": ":student_tone3:", + ":studio_microphone:": ":microphone2:", + ":stuffed_pita:": ":stuffed_flatbread:", + ":sun:": ":sunny:", + ":sunset:": ":city_sunset:", + ":superhero_dark_skin_tone:": ":superhero_tone5:", + ":superhero_light_skin_tone:": ":superhero_tone1:", + ":superhero_medium_dark_skin_tone:": ":superhero_tone4:", + ":superhero_medium_light_skin_tone:": ":superhero_tone2:", + ":superhero_medium_skin_tone:": ":superhero_tone3:", + ":supervillain_dark_skin_tone:": ":supervillain_tone5:", + ":supervillain_light_skin_tone:": ":supervillain_tone1:", + ":supervillain_medium_dark_skin_tone:": ":supervillain_tone4:", + ":supervillain_medium_light_skin_tone:": ":supervillain_tone2:", + ":supervillain_medium_skin_tone:": ":supervillain_tone3:", + ":surfer:": ":person_surfing:", + ":surfer_tone1:": ":person_surfing_tone1:", + ":surfer_tone2:": ":person_surfing_tone2:", + ":surfer_tone3:": ":person_surfing_tone3:", + ":surfer_tone4:": ":person_surfing_tone4:", + ":surfer_tone5:": ":person_surfing_tone5:", + ":sv:": ":flag_sv:", + ":swimmer:": ":person_swimming:", + ":swimmer_tone1:": ":person_swimming_tone1:", + ":swimmer_tone2:": ":person_swimming_tone2:", + ":swimmer_tone3:": ":person_swimming_tone3:", + ":swimmer_tone4:": ":person_swimming_tone4:", + ":swimmer_tone5:": ":person_swimming_tone5:", + ":sx:": ":flag_sx:", + ":sy:": ":flag_sy:", + ":sz:": ":flag_sz:", + ":t_shirt:": ":shirt:", + ":ta:": ":flag_ta:", + ":table_tennis:": ":ping_pong:", + ":tc:": ":flag_tc:", + ":td:": ":flag_td:", + ":teacher_dark_skin_tone:": ":teacher_tone5:", + ":teacher_light_skin_tone:": ":teacher_tone1:", + ":teacher_medium_dark_skin_tone:": ":teacher_tone4:", + ":teacher_medium_light_skin_tone:": ":teacher_tone2:", + ":teacher_medium_skin_tone:": ":teacher_tone3:", + ":technologist_dark_skin_tone:": ":technologist_tone5:", + ":technologist_light_skin_tone:": ":technologist_tone1:", + ":technologist_medium_dark_skin_tone:": ":technologist_tone4:", + ":technologist_medium_light_skin_tone:": ":technologist_tone2:", + ":technologist_medium_skin_tone:": ":technologist_tone3:", + ":television:": ":tv:", + ":ten_oclock:": ":clock10:", + ":ten_thirty:": ":clock1030:", + ":tf:": ":flag_tf:", + ":tg:": ":flag_tg:", + ":th:": ":flag_th:", + ":thinking_face:": ":thinking:", + ":third_place_medal:": ":third_place:", + ":three_button_mouse:": ":mouse_three_button:", + ":three_oclock:": ":clock3:", + ":three_thirty:": ":clock330:", + ":thumbdown:": ":thumbsdown:", + ":thumbdown_tone1:": ":thumbsdown_tone1:", + ":thumbdown_tone2:": ":thumbsdown_tone2:", + ":thumbdown_tone3:": ":thumbsdown_tone3:", + ":thumbdown_tone4:": ":thumbsdown_tone4:", + ":thumbdown_tone5:": ":thumbsdown_tone5:", + ":thumbs_down:": ":thumbsdown:", + ":thumbs_up:": ":thumbsup:", + ":thumbup:": ":thumbsup:", + ":thumbup_tone1:": ":thumbsup_tone1:", + ":thumbup_tone2:": ":thumbsup_tone2:", + ":thumbup_tone3:": ":thumbsup_tone3:", + ":thumbup_tone4:": ":thumbsup_tone4:", + ":thumbup_tone5:": ":thumbsup_tone5:", + ":thunder_cloud_and_rain:": ":thunder_cloud_rain:", + ":tiger_face:": ":tiger:", + ":timer_clock:": ":timer:", + ":tj:": ":flag_tj:", + ":tk:": ":flag_tk:", + ":tl:": ":flag_tl:", + ":tn:": ":flag_tn:", + ":to:": ":flag_to:", + ":top_arrow:": ":top:", + ":top_hat:": ":tophat:", + ":tornado:": ":cloud_tornado:", + ":tr:": ":flag_tr:", + ":trade_mark:": ":tm:", + ":tram_car:": ":train:", + ":tt:": ":flag_tt:", + ":turkmenistan:": ":flag_tm:", + ":tuvalu:": ":flag_tv:", + ":tuxedo_tone1:": ":person_in_tuxedo_tone1:", + ":tuxedo_tone2:": ":person_in_tuxedo_tone2:", + ":tuxedo_tone3:": ":person_in_tuxedo_tone3:", + ":tuxedo_tone4:": ":person_in_tuxedo_tone4:", + ":tuxedo_tone5:": ":person_in_tuxedo_tone5:", + ":tw:": ":flag_tw:", + ":twelve_oclock:": ":clock12:", + ":twelve_thirty:": ":clock1230:", + ":two_oclock:": ":clock2:", + ":two_thirty:": ":clock230:", + ":tz:": ":flag_tz:", + ":ua:": ":flag_ua:", + ":ug:": ":flag_ug:", + ":um:": ":flag_um:", + ":umbrella_on_ground:": ":beach_umbrella:", + ":unamused_face:": ":unamused:", + ":unicorn_face:": ":unicorn:", + ":unlocked:": ":unlock:", + ":up_arrow:": ":arrow_up:", + ":up_down_arrow:": ":arrow_up_down:", + ":up_left_arrow:": ":arrow_upper_left:", + ":upside_down_face:": ":upside_down:", + ":us:": ":flag_us:", + ":uy:": ":flag_uy:", + ":uz:": ":flag_uz:", + ":va:": ":flag_va:", + ":vampire_dark_skin_tone:": ":vampire_tone5:", + ":vampire_light_skin_tone:": ":vampire_tone1:", + ":vampire_medium_dark_skin_tone:": ":vampire_tone4:", + ":vampire_medium_light_skin_tone:": ":vampire_tone2:", + ":vampire_medium_skin_tone:": ":vampire_tone3:", + ":vc:": ":flag_vc:", + ":ve:": ":flag_ve:", + ":vg:": ":flag_vg:", + ":vi:": ":flag_vi:", + ":victory_hand:": ":v:", + ":videocassette:": ":vhs:", + ":vn:": ":flag_vn:", + ":vu:": ":flag_vu:", + ":vulcan_salute:": ":vulcan:", + ":walking:": ":person_walking:", + ":walking_tone1:": ":person_walking_tone1:", + ":walking_tone2:": ":person_walking_tone2:", + ":walking_tone3:": ":person_walking_tone3:", + ":walking_tone4:": ":person_walking_tone4:", + ":walking_tone5:": ":person_walking_tone5:", + ":water_closet:": ":wc:", + ":water_polo:": ":person_playing_water_polo:", + ":water_polo_tone1:": ":person_playing_water_polo_tone1:", + ":water_polo_tone2:": ":person_playing_water_polo_tone2:", + ":water_polo_tone3:": ":person_playing_water_polo_tone3:", + ":water_polo_tone4:": ":person_playing_water_polo_tone4:", + ":water_polo_tone5:": ":person_playing_water_polo_tone5:", + ":water_wave:": ":ocean:", + ":waving_black_flag:": ":flag_black:", + ":waving_hand:": ":wave:", + ":waving_white_flag:": ":flag_white:", + ":weary_cat:": ":scream_cat:", + ":weary_face:": ":weary:", + ":weight_lifter:": ":person_lifting_weights:", + ":weight_lifter_tone1:": ":person_lifting_weights_tone1:", + ":weight_lifter_tone2:": ":person_lifting_weights_tone2:", + ":weight_lifter_tone3:": ":person_lifting_weights_tone3:", + ":weight_lifter_tone4:": ":person_lifting_weights_tone4:", + ":weight_lifter_tone5:": ":person_lifting_weights_tone5:", + ":wf:": ":flag_wf:", + ":whisky:": ":tumbler_glass:", + ":white_flag:": ":flag_white:", + ":white_frowning_face:": ":frowning2:", + ":white_hair:": ":white_haired:", + ":white_sun_behind_cloud:": ":white_sun_cloud:", + ":white_sun_behind_cloud_with_rain:": ":white_sun_rain_cloud:", + ":white_sun_with_small_cloud:": ":white_sun_small_cloud:", + ":wilted_flower:": ":wilted_rose:", + ":wind_face:": ":wind_blowing_face:", + ":winking_face:": ":wink:", + ":woman_and_man_holding_hands_dark_skin_tone:": ":woman_and_man_holding_hands_tone5:", + ":woman_and_man_holding_hands_dark_skin_tone_light_skin_tone:": ":woman_and_man_holding_hands_tone5_tone1:", + ":woman_and_man_holding_hands_dark_skin_tone_medium_dark_skin_tone:": ":woman_and_man_holding_hands_tone5_tone4:", + ":woman_and_man_holding_hands_dark_skin_tone_medium_light_skin_tone:": ":woman_and_man_holding_hands_tone5_tone2:", + ":woman_and_man_holding_hands_dark_skin_tone_medium_skin_tone:": ":woman_and_man_holding_hands_tone5_tone3:", + ":woman_and_man_holding_hands_light_skin_tone:": ":woman_and_man_holding_hands_tone1:", + ":woman_and_man_holding_hands_light_skin_tone_dark_skin_tone:": ":woman_and_man_holding_hands_tone1_tone5:", + ":woman_and_man_holding_hands_light_skin_tone_medium_dark_skin_tone:": ":woman_and_man_holding_hands_tone1_tone4:", + ":woman_and_man_holding_hands_light_skin_tone_medium_light_skin_tone:": ":woman_and_man_holding_hands_tone1_tone2:", + ":woman_and_man_holding_hands_light_skin_tone_medium_skin_tone:": ":woman_and_man_holding_hands_tone1_tone3:", + ":woman_and_man_holding_hands_medium_dark_skin_tone:": ":woman_and_man_holding_hands_tone4:", + ":woman_and_man_holding_hands_medium_dark_skin_tone_dark_skin_tone:": ":woman_and_man_holding_hands_tone4_tone5:", + ":woman_and_man_holding_hands_medium_dark_skin_tone_light_skin_tone:": ":woman_and_man_holding_hands_tone4_tone1:", + ":woman_and_man_holding_hands_medium_dark_skin_tone_medium_light_skin_tone:": ":woman_and_man_holding_hands_tone4_tone2:", + ":woman_and_man_holding_hands_medium_dark_skin_tone_medium_skin_tone:": ":woman_and_man_holding_hands_tone4_tone3:", + ":woman_and_man_holding_hands_medium_light_skin_tone:": ":woman_and_man_holding_hands_tone2:", + ":woman_and_man_holding_hands_medium_light_skin_tone_dark_skin_tone:": ":woman_and_man_holding_hands_tone2_tone5:", + ":woman_and_man_holding_hands_medium_light_skin_tone_light_skin_tone:": ":woman_and_man_holding_hands_tone2_tone1:", + ":woman_and_man_holding_hands_medium_light_skin_tone_medium_dark_skin_tone:": ":woman_and_man_holding_hands_tone2_tone4:", + ":woman_and_man_holding_hands_medium_light_skin_tone_medium_skin_tone:": ":woman_and_man_holding_hands_tone2_tone3:", + ":woman_and_man_holding_hands_medium_skin_tone:": ":woman_and_man_holding_hands_tone3:", + ":woman_and_man_holding_hands_medium_skin_tone_dark_skin_tone:": ":woman_and_man_holding_hands_tone3_tone5:", + ":woman_and_man_holding_hands_medium_skin_tone_light_skin_tone:": ":woman_and_man_holding_hands_tone3_tone1:", + ":woman_and_man_holding_hands_medium_skin_tone_medium_dark_skin_tone:": ":woman_and_man_holding_hands_tone3_tone4:", + ":woman_and_man_holding_hands_medium_skin_tone_medium_light_skin_tone:": ":woman_and_man_holding_hands_tone3_tone2:", + ":woman_artist_dark_skin_tone:": ":woman_artist_tone5:", + ":woman_artist_light_skin_tone:": ":woman_artist_tone1:", + ":woman_artist_medium_dark_skin_tone:": ":woman_artist_tone4:", + ":woman_artist_medium_light_skin_tone:": ":woman_artist_tone2:", + ":woman_artist_medium_skin_tone:": ":woman_artist_tone3:", + ":woman_astronaut_dark_skin_tone:": ":woman_astronaut_tone5:", + ":woman_astronaut_light_skin_tone:": ":woman_astronaut_tone1:", + ":woman_astronaut_medium_dark_skin_tone:": ":woman_astronaut_tone4:", + ":woman_astronaut_medium_light_skin_tone:": ":woman_astronaut_tone2:", + ":woman_astronaut_medium_skin_tone:": ":woman_astronaut_tone3:", + ":woman_bald_dark_skin_tone:": ":woman_bald_tone5:", + ":woman_bald_light_skin_tone:": ":woman_bald_tone1:", + ":woman_bald_medium_dark_skin_tone:": ":woman_bald_tone4:", + ":woman_bald_medium_light_skin_tone:": ":woman_bald_tone2:", + ":woman_bald_medium_skin_tone:": ":woman_bald_tone3:", + ":woman_biking_dark_skin_tone:": ":woman_biking_tone5:", + ":woman_biking_light_skin_tone:": ":woman_biking_tone1:", + ":woman_biking_medium_dark_skin_tone:": ":woman_biking_tone4:", + ":woman_biking_medium_light_skin_tone:": ":woman_biking_tone2:", + ":woman_biking_medium_skin_tone:": ":woman_biking_tone3:", + ":woman_bouncing_ball_dark_skin_tone:": ":woman_bouncing_ball_tone5:", + ":woman_bouncing_ball_light_skin_tone:": ":woman_bouncing_ball_tone1:", + ":woman_bouncing_ball_medium_dark_skin_tone:": ":woman_bouncing_ball_tone4:", + ":woman_bouncing_ball_medium_light_skin_tone:": ":woman_bouncing_ball_tone2:", + ":woman_bouncing_ball_medium_skin_tone:": ":woman_bouncing_ball_tone3:", + ":woman_bowing_dark_skin_tone:": ":woman_bowing_tone5:", + ":woman_bowing_light_skin_tone:": ":woman_bowing_tone1:", + ":woman_bowing_medium_dark_skin_tone:": ":woman_bowing_tone4:", + ":woman_bowing_medium_light_skin_tone:": ":woman_bowing_tone2:", + ":woman_bowing_medium_skin_tone:": ":woman_bowing_tone3:", + ":woman_cartwheeling_dark_skin_tone:": ":woman_cartwheeling_tone5:", + ":woman_cartwheeling_light_skin_tone:": ":woman_cartwheeling_tone1:", + ":woman_cartwheeling_medium_dark_skin_tone:": ":woman_cartwheeling_tone4:", + ":woman_cartwheeling_medium_light_skin_tone:": ":woman_cartwheeling_tone2:", + ":woman_cartwheeling_medium_skin_tone:": ":woman_cartwheeling_tone3:", + ":woman_climbing_dark_skin_tone:": ":woman_climbing_tone5:", + ":woman_climbing_light_skin_tone:": ":woman_climbing_tone1:", + ":woman_climbing_medium_dark_skin_tone:": ":woman_climbing_tone4:", + ":woman_climbing_medium_light_skin_tone:": ":woman_climbing_tone2:", + ":woman_climbing_medium_skin_tone:": ":woman_climbing_tone3:", + ":woman_construction_worker_dark_skin_tone:": ":woman_construction_worker_tone5:", + ":woman_construction_worker_light_skin_tone:": ":woman_construction_worker_tone1:", + ":woman_construction_worker_medium_dark_skin_tone:": ":woman_construction_worker_tone4:", + ":woman_construction_worker_medium_light_skin_tone:": ":woman_construction_worker_tone2:", + ":woman_construction_worker_medium_skin_tone:": ":woman_construction_worker_tone3:", + ":woman_cook_dark_skin_tone:": ":woman_cook_tone5:", + ":woman_cook_light_skin_tone:": ":woman_cook_tone1:", + ":woman_cook_medium_dark_skin_tone:": ":woman_cook_tone4:", + ":woman_cook_medium_light_skin_tone:": ":woman_cook_tone2:", + ":woman_cook_medium_skin_tone:": ":woman_cook_tone3:", + ":woman_curly_haired_dark_skin_tone:": ":woman_curly_haired_tone5:", + ":woman_curly_haired_light_skin_tone:": ":woman_curly_haired_tone1:", + ":woman_curly_haired_medium_dark_skin_tone:": ":woman_curly_haired_tone4:", + ":woman_curly_haired_medium_light_skin_tone:": ":woman_curly_haired_tone2:", + ":woman_curly_haired_medium_skin_tone:": ":woman_curly_haired_tone3:", + ":woman_dancing:": ":dancer:", + ":woman_dark_skin_tone_beard:": ":woman_tone5_beard:", + ":woman_detective_dark_skin_tone:": ":woman_detective_tone5:", + ":woman_detective_light_skin_tone:": ":woman_detective_tone1:", + ":woman_detective_medium_dark_skin_tone:": ":woman_detective_tone4:", + ":woman_detective_medium_light_skin_tone:": ":woman_detective_tone2:", + ":woman_detective_medium_skin_tone:": ":woman_detective_tone3:", + ":woman_elf_dark_skin_tone:": ":woman_elf_tone5:", + ":woman_elf_light_skin_tone:": ":woman_elf_tone1:", + ":woman_elf_medium_dark_skin_tone:": ":woman_elf_tone4:", + ":woman_elf_medium_light_skin_tone:": ":woman_elf_tone2:", + ":woman_elf_medium_skin_tone:": ":woman_elf_tone3:", + ":woman_facepalming_dark_skin_tone:": ":woman_facepalming_tone5:", + ":woman_facepalming_light_skin_tone:": ":woman_facepalming_tone1:", + ":woman_facepalming_medium_dark_skin_tone:": ":woman_facepalming_tone4:", + ":woman_facepalming_medium_light_skin_tone:": ":woman_facepalming_tone2:", + ":woman_facepalming_medium_skin_tone:": ":woman_facepalming_tone3:", + ":woman_factory_worker_dark_skin_tone:": ":woman_factory_worker_tone5:", + ":woman_factory_worker_light_skin_tone:": ":woman_factory_worker_tone1:", + ":woman_factory_worker_medium_dark_skin_tone:": ":woman_factory_worker_tone4:", + ":woman_factory_worker_medium_light_skin_tone:": ":woman_factory_worker_tone2:", + ":woman_factory_worker_medium_skin_tone:": ":woman_factory_worker_tone3:", + ":woman_fairy_dark_skin_tone:": ":woman_fairy_tone5:", + ":woman_fairy_light_skin_tone:": ":woman_fairy_tone1:", + ":woman_fairy_medium_dark_skin_tone:": ":woman_fairy_tone4:", + ":woman_fairy_medium_light_skin_tone:": ":woman_fairy_tone2:", + ":woman_fairy_medium_skin_tone:": ":woman_fairy_tone3:", + ":woman_farmer_dark_skin_tone:": ":woman_farmer_tone5:", + ":woman_farmer_light_skin_tone:": ":woman_farmer_tone1:", + ":woman_farmer_medium_dark_skin_tone:": ":woman_farmer_tone4:", + ":woman_farmer_medium_light_skin_tone:": ":woman_farmer_tone2:", + ":woman_farmer_medium_skin_tone:": ":woman_farmer_tone3:", + ":woman_feeding_baby_dark_skin_tone:": ":woman_feeding_baby_tone5:", + ":woman_feeding_baby_light_skin_tone:": ":woman_feeding_baby_tone1:", + ":woman_feeding_baby_medium_dark_skin_tone:": ":woman_feeding_baby_tone4:", + ":woman_feeding_baby_medium_light_skin_tone:": ":woman_feeding_baby_tone2:", + ":woman_feeding_baby_medium_skin_tone:": ":woman_feeding_baby_tone3:", + ":woman_firefighter_dark_skin_tone:": ":woman_firefighter_tone5:", + ":woman_firefighter_light_skin_tone:": ":woman_firefighter_tone1:", + ":woman_firefighter_medium_dark_skin_tone:": ":woman_firefighter_tone4:", + ":woman_firefighter_medium_light_skin_tone:": ":woman_firefighter_tone2:", + ":woman_firefighter_medium_skin_tone:": ":woman_firefighter_tone3:", + ":woman_frowning_dark_skin_tone:": ":woman_frowning_tone5:", + ":woman_frowning_light_skin_tone:": ":woman_frowning_tone1:", + ":woman_frowning_medium_dark_skin_tone:": ":woman_frowning_tone4:", + ":woman_frowning_medium_light_skin_tone:": ":woman_frowning_tone2:", + ":woman_frowning_medium_skin_tone:": ":woman_frowning_tone3:", + ":woman_gesturing_no_dark_skin_tone:": ":woman_gesturing_no_tone5:", + ":woman_gesturing_no_light_skin_tone:": ":woman_gesturing_no_tone1:", + ":woman_gesturing_no_medium_dark_skin_tone:": ":woman_gesturing_no_tone4:", + ":woman_gesturing_no_medium_light_skin_tone:": ":woman_gesturing_no_tone2:", + ":woman_gesturing_no_medium_skin_tone:": ":woman_gesturing_no_tone3:", + ":woman_gesturing_ok_dark_skin_tone:": ":woman_gesturing_ok_tone5:", + ":woman_gesturing_ok_light_skin_tone:": ":woman_gesturing_ok_tone1:", + ":woman_gesturing_ok_medium_dark_skin_tone:": ":woman_gesturing_ok_tone4:", + ":woman_gesturing_ok_medium_light_skin_tone:": ":woman_gesturing_ok_tone2:", + ":woman_gesturing_ok_medium_skin_tone:": ":woman_gesturing_ok_tone3:", + ":woman_getting_face_massage_dark_skin_tone:": ":woman_getting_face_massage_tone5:", + ":woman_getting_face_massage_light_skin_tone:": ":woman_getting_face_massage_tone1:", + ":woman_getting_face_massage_medium_dark_skin_tone:": ":woman_getting_face_massage_tone4:", + ":woman_getting_face_massage_medium_light_skin_tone:": ":woman_getting_face_massage_tone2:", + ":woman_getting_face_massage_medium_skin_tone:": ":woman_getting_face_massage_tone3:", + ":woman_getting_haircut_dark_skin_tone:": ":woman_getting_haircut_tone5:", + ":woman_getting_haircut_light_skin_tone:": ":woman_getting_haircut_tone1:", + ":woman_getting_haircut_medium_dark_skin_tone:": ":woman_getting_haircut_tone4:", + ":woman_getting_haircut_medium_light_skin_tone:": ":woman_getting_haircut_tone2:", + ":woman_getting_haircut_medium_skin_tone:": ":woman_getting_haircut_tone3:", + ":woman_golfing_dark_skin_tone:": ":woman_golfing_tone5:", + ":woman_golfing_light_skin_tone:": ":woman_golfing_tone1:", + ":woman_golfing_medium_dark_skin_tone:": ":woman_golfing_tone4:", + ":woman_golfing_medium_light_skin_tone:": ":woman_golfing_tone2:", + ":woman_golfing_medium_skin_tone:": ":woman_golfing_tone3:", + ":woman_guard_dark_skin_tone:": ":woman_guard_tone5:", + ":woman_guard_light_skin_tone:": ":woman_guard_tone1:", + ":woman_guard_medium_dark_skin_tone:": ":woman_guard_tone4:", + ":woman_guard_medium_light_skin_tone:": ":woman_guard_tone2:", + ":woman_guard_medium_skin_tone:": ":woman_guard_tone3:", + ":woman_health_worker_dark_skin_tone:": ":woman_health_worker_tone5:", + ":woman_health_worker_light_skin_tone:": ":woman_health_worker_tone1:", + ":woman_health_worker_medium_dark_skin_tone:": ":woman_health_worker_tone4:", + ":woman_health_worker_medium_light_skin_tone:": ":woman_health_worker_tone2:", + ":woman_health_worker_medium_skin_tone:": ":woman_health_worker_tone3:", + ":woman_in_lotus_position_dark_skin_tone:": ":woman_in_lotus_position_tone5:", + ":woman_in_lotus_position_light_skin_tone:": ":woman_in_lotus_position_tone1:", + ":woman_in_lotus_position_medium_dark_skin_tone:": ":woman_in_lotus_position_tone4:", + ":woman_in_lotus_position_medium_light_skin_tone:": ":woman_in_lotus_position_tone2:", + ":woman_in_lotus_position_medium_skin_tone:": ":woman_in_lotus_position_tone3:", + ":woman_in_manual_wheelchair_dark_skin_tone:": ":woman_in_manual_wheelchair_tone5:", + ":woman_in_manual_wheelchair_facing_right_dark_skin_tone:": ":woman_in_manual_wheelchair_facing_right_tone5:", + ":woman_in_manual_wheelchair_facing_right_light_skin_tone:": ":woman_in_manual_wheelchair_facing_right_tone1:", + ":woman_in_manual_wheelchair_facing_right_medium_dark_skin_tone:": ":woman_in_manual_wheelchair_facing_right_tone4:", + ":woman_in_manual_wheelchair_facing_right_medium_light_skin_tone:": ":woman_in_manual_wheelchair_facing_right_tone2:", + ":woman_in_manual_wheelchair_facing_right_medium_skin_tone:": ":woman_in_manual_wheelchair_facing_right_tone3:", + ":woman_in_manual_wheelchair_light_skin_tone:": ":woman_in_manual_wheelchair_tone1:", + ":woman_in_manual_wheelchair_medium_dark_skin_tone:": ":woman_in_manual_wheelchair_tone4:", + ":woman_in_manual_wheelchair_medium_light_skin_tone:": ":woman_in_manual_wheelchair_tone2:", + ":woman_in_manual_wheelchair_medium_skin_tone:": ":woman_in_manual_wheelchair_tone3:", + ":woman_in_motorized_wheelchair_dark_skin_tone:": ":woman_in_motorized_wheelchair_tone5:", + ":woman_in_motorized_wheelchair_facing_right_dark_skin_tone:": ":woman_in_motorized_wheelchair_facing_right_tone5:", + ":woman_in_motorized_wheelchair_facing_right_light_skin_tone:": ":woman_in_motorized_wheelchair_facing_right_tone1:", + ":woman_in_motorized_wheelchair_facing_right_medium_dark_skin_tone:": ":woman_in_motorized_wheelchair_facing_right_tone4:", + ":woman_in_motorized_wheelchair_facing_right_medium_light_skin_tone:": ":woman_in_motorized_wheelchair_facing_right_tone2:", + ":woman_in_motorized_wheelchair_facing_right_medium_skin_tone:": ":woman_in_motorized_wheelchair_facing_right_tone3:", + ":woman_in_motorized_wheelchair_light_skin_tone:": ":woman_in_motorized_wheelchair_tone1:", + ":woman_in_motorized_wheelchair_medium_dark_skin_tone:": ":woman_in_motorized_wheelchair_tone4:", + ":woman_in_motorized_wheelchair_medium_light_skin_tone:": ":woman_in_motorized_wheelchair_tone2:", + ":woman_in_motorized_wheelchair_medium_skin_tone:": ":woman_in_motorized_wheelchair_tone3:", + ":woman_in_steamy_room_dark_skin_tone:": ":woman_in_steamy_room_tone5:", + ":woman_in_steamy_room_light_skin_tone:": ":woman_in_steamy_room_tone1:", + ":woman_in_steamy_room_medium_dark_skin_tone:": ":woman_in_steamy_room_tone4:", + ":woman_in_steamy_room_medium_light_skin_tone:": ":woman_in_steamy_room_tone2:", + ":woman_in_steamy_room_medium_skin_tone:": ":woman_in_steamy_room_tone3:", + ":woman_in_tuxedo_dark_skin_tone:": ":woman_in_tuxedo_tone5:", + ":woman_in_tuxedo_light_skin_tone:": ":woman_in_tuxedo_tone1:", + ":woman_in_tuxedo_medium_dark_skin_tone:": ":woman_in_tuxedo_tone4:", + ":woman_in_tuxedo_medium_light_skin_tone:": ":woman_in_tuxedo_tone2:", + ":woman_in_tuxedo_medium_skin_tone:": ":woman_in_tuxedo_tone3:", + ":woman_judge_dark_skin_tone:": ":woman_judge_tone5:", + ":woman_judge_light_skin_tone:": ":woman_judge_tone1:", + ":woman_judge_medium_dark_skin_tone:": ":woman_judge_tone4:", + ":woman_judge_medium_light_skin_tone:": ":woman_judge_tone2:", + ":woman_judge_medium_skin_tone:": ":woman_judge_tone3:", + ":woman_juggling_dark_skin_tone:": ":woman_juggling_tone5:", + ":woman_juggling_light_skin_tone:": ":woman_juggling_tone1:", + ":woman_juggling_medium_dark_skin_tone:": ":woman_juggling_tone4:", + ":woman_juggling_medium_light_skin_tone:": ":woman_juggling_tone2:", + ":woman_juggling_medium_skin_tone:": ":woman_juggling_tone3:", + ":woman_kneeling_dark_skin_tone:": ":woman_kneeling_tone5:", + ":woman_kneeling_facing_right_dark_skin_tone:": ":woman_kneeling_facing_right_tone5:", + ":woman_kneeling_facing_right_light_skin_tone:": ":woman_kneeling_facing_right_tone1:", + ":woman_kneeling_facing_right_medium_dark_skin_tone:": ":woman_kneeling_facing_right_tone4:", + ":woman_kneeling_facing_right_medium_light_skin_tone:": ":woman_kneeling_facing_right_tone2:", + ":woman_kneeling_facing_right_medium_skin_tone:": ":woman_kneeling_facing_right_tone3:", + ":woman_kneeling_light_skin_tone:": ":woman_kneeling_tone1:", + ":woman_kneeling_medium_dark_skin_tone:": ":woman_kneeling_tone4:", + ":woman_kneeling_medium_light_skin_tone:": ":woman_kneeling_tone2:", + ":woman_kneeling_medium_skin_tone:": ":woman_kneeling_tone3:", + ":woman_lifting_weights_dark_skin_tone:": ":woman_lifting_weights_tone5:", + ":woman_lifting_weights_light_skin_tone:": ":woman_lifting_weights_tone1:", + ":woman_lifting_weights_medium_dark_skin_tone:": ":woman_lifting_weights_tone4:", + ":woman_lifting_weights_medium_light_skin_tone:": ":woman_lifting_weights_tone2:", + ":woman_lifting_weights_medium_skin_tone:": ":woman_lifting_weights_tone3:", + ":woman_light_skin_tone_beard:": ":woman_tone1_beard:", + ":woman_mage_dark_skin_tone:": ":woman_mage_tone5:", + ":woman_mage_light_skin_tone:": ":woman_mage_tone1:", + ":woman_mage_medium_dark_skin_tone:": ":woman_mage_tone4:", + ":woman_mage_medium_light_skin_tone:": ":woman_mage_tone2:", + ":woman_mage_medium_skin_tone:": ":woman_mage_tone3:", + ":woman_mechanic_dark_skin_tone:": ":woman_mechanic_tone5:", + ":woman_mechanic_light_skin_tone:": ":woman_mechanic_tone1:", + ":woman_mechanic_medium_dark_skin_tone:": ":woman_mechanic_tone4:", + ":woman_mechanic_medium_light_skin_tone:": ":woman_mechanic_tone2:", + ":woman_mechanic_medium_skin_tone:": ":woman_mechanic_tone3:", + ":woman_medium_dark_skin_tone_beard:": ":woman_tone4_beard:", + ":woman_medium_light_skin_tone_beard:": ":woman_tone2_beard:", + ":woman_medium_skin_tone_beard:": ":woman_tone3_beard:", + ":woman_mountain_biking_dark_skin_tone:": ":woman_mountain_biking_tone5:", + ":woman_mountain_biking_light_skin_tone:": ":woman_mountain_biking_tone1:", + ":woman_mountain_biking_medium_dark_skin_tone:": ":woman_mountain_biking_tone4:", + ":woman_mountain_biking_medium_light_skin_tone:": ":woman_mountain_biking_tone2:", + ":woman_mountain_biking_medium_skin_tone:": ":woman_mountain_biking_tone3:", + ":woman_office_worker_dark_skin_tone:": ":woman_office_worker_tone5:", + ":woman_office_worker_light_skin_tone:": ":woman_office_worker_tone1:", + ":woman_office_worker_medium_dark_skin_tone:": ":woman_office_worker_tone4:", + ":woman_office_worker_medium_light_skin_tone:": ":woman_office_worker_tone2:", + ":woman_office_worker_medium_skin_tone:": ":woman_office_worker_tone3:", + ":woman_pilot_dark_skin_tone:": ":woman_pilot_tone5:", + ":woman_pilot_light_skin_tone:": ":woman_pilot_tone1:", + ":woman_pilot_medium_dark_skin_tone:": ":woman_pilot_tone4:", + ":woman_pilot_medium_light_skin_tone:": ":woman_pilot_tone2:", + ":woman_pilot_medium_skin_tone:": ":woman_pilot_tone3:", + ":woman_playing_handball_dark_skin_tone:": ":woman_playing_handball_tone5:", + ":woman_playing_handball_light_skin_tone:": ":woman_playing_handball_tone1:", + ":woman_playing_handball_medium_dark_skin_tone:": ":woman_playing_handball_tone4:", + ":woman_playing_handball_medium_light_skin_tone:": ":woman_playing_handball_tone2:", + ":woman_playing_handball_medium_skin_tone:": ":woman_playing_handball_tone3:", + ":woman_playing_water_polo_dark_skin_tone:": ":woman_playing_water_polo_tone5:", + ":woman_playing_water_polo_light_skin_tone:": ":woman_playing_water_polo_tone1:", + ":woman_playing_water_polo_medium_dark_skin_tone:": ":woman_playing_water_polo_tone4:", + ":woman_playing_water_polo_medium_light_skin_tone:": ":woman_playing_water_polo_tone2:", + ":woman_playing_water_polo_medium_skin_tone:": ":woman_playing_water_polo_tone3:", + ":woman_police_officer_dark_skin_tone:": ":woman_police_officer_tone5:", + ":woman_police_officer_light_skin_tone:": ":woman_police_officer_tone1:", + ":woman_police_officer_medium_dark_skin_tone:": ":woman_police_officer_tone4:", + ":woman_police_officer_medium_light_skin_tone:": ":woman_police_officer_tone2:", + ":woman_police_officer_medium_skin_tone:": ":woman_police_officer_tone3:", + ":woman_pouting_dark_skin_tone:": ":woman_pouting_tone5:", + ":woman_pouting_light_skin_tone:": ":woman_pouting_tone1:", + ":woman_pouting_medium_dark_skin_tone:": ":woman_pouting_tone4:", + ":woman_pouting_medium_light_skin_tone:": ":woman_pouting_tone2:", + ":woman_pouting_medium_skin_tone:": ":woman_pouting_tone3:", + ":woman_raising_hand_dark_skin_tone:": ":woman_raising_hand_tone5:", + ":woman_raising_hand_light_skin_tone:": ":woman_raising_hand_tone1:", + ":woman_raising_hand_medium_dark_skin_tone:": ":woman_raising_hand_tone4:", + ":woman_raising_hand_medium_light_skin_tone:": ":woman_raising_hand_tone2:", + ":woman_raising_hand_medium_skin_tone:": ":woman_raising_hand_tone3:", + ":woman_red_haired_dark_skin_tone:": ":woman_red_haired_tone5:", + ":woman_red_haired_light_skin_tone:": ":woman_red_haired_tone1:", + ":woman_red_haired_medium_dark_skin_tone:": ":woman_red_haired_tone4:", + ":woman_red_haired_medium_light_skin_tone:": ":woman_red_haired_tone2:", + ":woman_red_haired_medium_skin_tone:": ":woman_red_haired_tone3:", + ":woman_rowing_boat_dark_skin_tone:": ":woman_rowing_boat_tone5:", + ":woman_rowing_boat_light_skin_tone:": ":woman_rowing_boat_tone1:", + ":woman_rowing_boat_medium_dark_skin_tone:": ":woman_rowing_boat_tone4:", + ":woman_rowing_boat_medium_light_skin_tone:": ":woman_rowing_boat_tone2:", + ":woman_rowing_boat_medium_skin_tone:": ":woman_rowing_boat_tone3:", + ":woman_running_dark_skin_tone:": ":woman_running_tone5:", + ":woman_running_facing_right_dark_skin_tone:": ":woman_running_facing_right_tone5:", + ":woman_running_facing_right_light_skin_tone:": ":woman_running_facing_right_tone1:", + ":woman_running_facing_right_medium_dark_skin_tone:": ":woman_running_facing_right_tone4:", + ":woman_running_facing_right_medium_light_skin_tone:": ":woman_running_facing_right_tone2:", + ":woman_running_facing_right_medium_skin_tone:": ":woman_running_facing_right_tone3:", + ":woman_running_light_skin_tone:": ":woman_running_tone1:", + ":woman_running_medium_dark_skin_tone:": ":woman_running_tone4:", + ":woman_running_medium_light_skin_tone:": ":woman_running_tone2:", + ":woman_running_medium_skin_tone:": ":woman_running_tone3:", + ":woman_scientist_dark_skin_tone:": ":woman_scientist_tone5:", + ":woman_scientist_light_skin_tone:": ":woman_scientist_tone1:", + ":woman_scientist_medium_dark_skin_tone:": ":woman_scientist_tone4:", + ":woman_scientist_medium_light_skin_tone:": ":woman_scientist_tone2:", + ":woman_scientist_medium_skin_tone:": ":woman_scientist_tone3:", + ":woman_shrugging_dark_skin_tone:": ":woman_shrugging_tone5:", + ":woman_shrugging_light_skin_tone:": ":woman_shrugging_tone1:", + ":woman_shrugging_medium_dark_skin_tone:": ":woman_shrugging_tone4:", + ":woman_shrugging_medium_light_skin_tone:": ":woman_shrugging_tone2:", + ":woman_shrugging_medium_skin_tone:": ":woman_shrugging_tone3:", + ":woman_singer_dark_skin_tone:": ":woman_singer_tone5:", + ":woman_singer_light_skin_tone:": ":woman_singer_tone1:", + ":woman_singer_medium_dark_skin_tone:": ":woman_singer_tone4:", + ":woman_singer_medium_light_skin_tone:": ":woman_singer_tone2:", + ":woman_singer_medium_skin_tone:": ":woman_singer_tone3:", + ":woman_standing_dark_skin_tone:": ":woman_standing_tone5:", + ":woman_standing_light_skin_tone:": ":woman_standing_tone1:", + ":woman_standing_medium_dark_skin_tone:": ":woman_standing_tone4:", + ":woman_standing_medium_light_skin_tone:": ":woman_standing_tone2:", + ":woman_standing_medium_skin_tone:": ":woman_standing_tone3:", + ":woman_student_dark_skin_tone:": ":woman_student_tone5:", + ":woman_student_light_skin_tone:": ":woman_student_tone1:", + ":woman_student_medium_dark_skin_tone:": ":woman_student_tone4:", + ":woman_student_medium_light_skin_tone:": ":woman_student_tone2:", + ":woman_student_medium_skin_tone:": ":woman_student_tone3:", + ":woman_superhero_dark_skin_tone:": ":woman_superhero_tone5:", + ":woman_superhero_light_skin_tone:": ":woman_superhero_tone1:", + ":woman_superhero_medium_dark_skin_tone:": ":woman_superhero_tone4:", + ":woman_superhero_medium_light_skin_tone:": ":woman_superhero_tone2:", + ":woman_superhero_medium_skin_tone:": ":woman_superhero_tone3:", + ":woman_supervillain_dark_skin_tone:": ":woman_supervillain_tone5:", + ":woman_supervillain_light_skin_tone:": ":woman_supervillain_tone1:", + ":woman_supervillain_medium_dark_skin_tone:": ":woman_supervillain_tone4:", + ":woman_supervillain_medium_light_skin_tone:": ":woman_supervillain_tone2:", + ":woman_supervillain_medium_skin_tone:": ":woman_supervillain_tone3:", + ":woman_surfing_dark_skin_tone:": ":woman_surfing_tone5:", + ":woman_surfing_light_skin_tone:": ":woman_surfing_tone1:", + ":woman_surfing_medium_dark_skin_tone:": ":woman_surfing_tone4:", + ":woman_surfing_medium_light_skin_tone:": ":woman_surfing_tone2:", + ":woman_surfing_medium_skin_tone:": ":woman_surfing_tone3:", + ":woman_swimming_dark_skin_tone:": ":woman_swimming_tone5:", + ":woman_swimming_light_skin_tone:": ":woman_swimming_tone1:", + ":woman_swimming_medium_dark_skin_tone:": ":woman_swimming_tone4:", + ":woman_swimming_medium_light_skin_tone:": ":woman_swimming_tone2:", + ":woman_swimming_medium_skin_tone:": ":woman_swimming_tone3:", + ":woman_teacher_dark_skin_tone:": ":woman_teacher_tone5:", + ":woman_teacher_light_skin_tone:": ":woman_teacher_tone1:", + ":woman_teacher_medium_dark_skin_tone:": ":woman_teacher_tone4:", + ":woman_teacher_medium_light_skin_tone:": ":woman_teacher_tone2:", + ":woman_teacher_medium_skin_tone:": ":woman_teacher_tone3:", + ":woman_technologist_dark_skin_tone:": ":woman_technologist_tone5:", + ":woman_technologist_light_skin_tone:": ":woman_technologist_tone1:", + ":woman_technologist_medium_dark_skin_tone:": ":woman_technologist_tone4:", + ":woman_technologist_medium_light_skin_tone:": ":woman_technologist_tone2:", + ":woman_technologist_medium_skin_tone:": ":woman_technologist_tone3:", + ":woman_tipping_hand_dark_skin_tone:": ":woman_tipping_hand_tone5:", + ":woman_tipping_hand_light_skin_tone:": ":woman_tipping_hand_tone1:", + ":woman_tipping_hand_medium_dark_skin_tone:": ":woman_tipping_hand_tone4:", + ":woman_tipping_hand_medium_light_skin_tone:": ":woman_tipping_hand_tone2:", + ":woman_tipping_hand_medium_skin_tone:": ":woman_tipping_hand_tone3:", + ":woman_vampire_dark_skin_tone:": ":woman_vampire_tone5:", + ":woman_vampire_light_skin_tone:": ":woman_vampire_tone1:", + ":woman_vampire_medium_dark_skin_tone:": ":woman_vampire_tone4:", + ":woman_vampire_medium_light_skin_tone:": ":woman_vampire_tone2:", + ":woman_vampire_medium_skin_tone:": ":woman_vampire_tone3:", + ":woman_walking_dark_skin_tone:": ":woman_walking_tone5:", + ":woman_walking_facing_right_dark_skin_tone:": ":woman_walking_facing_right_tone5:", + ":woman_walking_facing_right_light_skin_tone:": ":woman_walking_facing_right_tone1:", + ":woman_walking_facing_right_medium_dark_skin_tone:": ":woman_walking_facing_right_tone4:", + ":woman_walking_facing_right_medium_light_skin_tone:": ":woman_walking_facing_right_tone2:", + ":woman_walking_facing_right_medium_skin_tone:": ":woman_walking_facing_right_tone3:", + ":woman_walking_light_skin_tone:": ":woman_walking_tone1:", + ":woman_walking_medium_dark_skin_tone:": ":woman_walking_tone4:", + ":woman_walking_medium_light_skin_tone:": ":woman_walking_tone2:", + ":woman_walking_medium_skin_tone:": ":woman_walking_tone3:", + ":woman_wearing_turban_dark_skin_tone:": ":woman_wearing_turban_tone5:", + ":woman_wearing_turban_light_skin_tone:": ":woman_wearing_turban_tone1:", + ":woman_wearing_turban_medium_dark_skin_tone:": ":woman_wearing_turban_tone4:", + ":woman_wearing_turban_medium_light_skin_tone:": ":woman_wearing_turban_tone2:", + ":woman_wearing_turban_medium_skin_tone:": ":woman_wearing_turban_tone3:", + ":woman_white_haired_dark_skin_tone:": ":woman_white_haired_tone5:", + ":woman_white_haired_light_skin_tone:": ":woman_white_haired_tone1:", + ":woman_white_haired_medium_dark_skin_tone:": ":woman_white_haired_tone4:", + ":woman_white_haired_medium_light_skin_tone:": ":woman_white_haired_tone2:", + ":woman_white_haired_medium_skin_tone:": ":woman_white_haired_tone3:", + ":woman_with_headscarf_dark_skin_tone:": ":woman_with_headscarf_tone5:", + ":woman_with_headscarf_light_skin_tone:": ":woman_with_headscarf_tone1:", + ":woman_with_headscarf_medium_dark_skin_tone:": ":woman_with_headscarf_tone4:", + ":woman_with_headscarf_medium_light_skin_tone:": ":woman_with_headscarf_tone2:", + ":woman_with_headscarf_medium_skin_tone:": ":woman_with_headscarf_tone3:", + ":woman_with_probing_cane_dark_skin_tone:": ":woman_with_probing_cane_tone5:", + ":woman_with_probing_cane_light_skin_tone:": ":woman_with_probing_cane_tone1:", + ":woman_with_probing_cane_medium_dark_skin_tone:": ":woman_with_probing_cane_tone4:", + ":woman_with_probing_cane_medium_light_skin_tone:": ":woman_with_probing_cane_tone2:", + ":woman_with_probing_cane_medium_skin_tone:": ":woman_with_probing_cane_tone3:", + ":woman_with_veil_dark_skin_tone:": ":woman_with_veil_tone5:", + ":woman_with_veil_light_skin_tone:": ":woman_with_veil_tone1:", + ":woman_with_veil_medium_dark_skin_tone:": ":woman_with_veil_tone4:", + ":woman_with_veil_medium_light_skin_tone:": ":woman_with_veil_tone2:", + ":woman_with_veil_medium_skin_tone:": ":woman_with_veil_tone3:", + ":woman_with_white_cane_facing_right_dark_skin_tone:": ":woman_with_white_cane_facing_right_tone5:", + ":woman_with_white_cane_facing_right_light_skin_tone:": ":woman_with_white_cane_facing_right_tone1:", + ":woman_with_white_cane_facing_right_medium_dark_skin_tone:": ":woman_with_white_cane_facing_right_tone4:", + ":woman_with_white_cane_facing_right_medium_light_skin_tone:": ":woman_with_white_cane_facing_right_tone2:", + ":woman_with_white_cane_facing_right_medium_skin_tone:": ":woman_with_white_cane_facing_right_tone3:", + ":womans_boot:": ":boot:", + ":womans_sandal:": ":sandal:", + ":women_holding_hands_dark_skin_tone:": ":women_holding_hands_tone5:", + ":women_holding_hands_dark_skin_tone_light_skin_tone:": ":women_holding_hands_tone5_tone1:", + ":women_holding_hands_dark_skin_tone_medium_dark_skin_tone:": ":women_holding_hands_tone5_tone4:", + ":women_holding_hands_dark_skin_tone_medium_light_skin_tone:": ":women_holding_hands_tone5_tone2:", + ":women_holding_hands_dark_skin_tone_medium_skin_tone:": ":women_holding_hands_tone5_tone3:", + ":women_holding_hands_light_skin_tone:": ":women_holding_hands_tone1:", + ":women_holding_hands_light_skin_tone_dark_skin_tone:": ":women_holding_hands_tone1_tone5:", + ":women_holding_hands_light_skin_tone_medium_dark_skin_tone:": ":women_holding_hands_tone1_tone4:", + ":women_holding_hands_light_skin_tone_medium_light_skin_tone:": ":women_holding_hands_tone1_tone2:", + ":women_holding_hands_light_skin_tone_medium_skin_tone:": ":women_holding_hands_tone1_tone3:", + ":women_holding_hands_medium_dark_skin_tone:": ":women_holding_hands_tone4:", + ":women_holding_hands_medium_dark_skin_tone_dark_skin_tone:": ":women_holding_hands_tone4_tone5:", + ":women_holding_hands_medium_dark_skin_tone_light_skin_tone:": ":women_holding_hands_tone4_tone1:", + ":women_holding_hands_medium_dark_skin_tone_medium_light_skin_tone:": ":women_holding_hands_tone4_tone2:", + ":women_holding_hands_medium_dark_skin_tone_medium_skin_tone:": ":women_holding_hands_tone4_tone3:", + ":women_holding_hands_medium_light_skin_tone:": ":women_holding_hands_tone2:", + ":women_holding_hands_medium_light_skin_tone_dark_skin_tone:": ":women_holding_hands_tone2_tone5:", + ":women_holding_hands_medium_light_skin_tone_light_skin_tone:": ":women_holding_hands_tone2_tone1:", + ":women_holding_hands_medium_light_skin_tone_medium_dark_skin_tone:": ":women_holding_hands_tone2_tone4:", + ":women_holding_hands_medium_light_skin_tone_medium_skin_tone:": ":women_holding_hands_tone2_tone3:", + ":women_holding_hands_medium_skin_tone:": ":women_holding_hands_tone3:", + ":women_holding_hands_medium_skin_tone_dark_skin_tone:": ":women_holding_hands_tone3_tone5:", + ":women_holding_hands_medium_skin_tone_light_skin_tone:": ":women_holding_hands_tone3_tone1:", + ":women_holding_hands_medium_skin_tone_medium_dark_skin_tone:": ":women_holding_hands_tone3_tone4:", + ":women_holding_hands_medium_skin_tone_medium_light_skin_tone:": ":women_holding_hands_tone3_tone2:", + ":womens_room:": ":womens:", + ":world_map:": ":map:", + ":worried_face:": ":worried:", + ":worship_symbol:": ":place_of_worship:", + ":wrapped_gift:": ":gift:", + ":wrestlers:": ":people_wrestling:", + ":wrestling:": ":people_wrestling:", + ":ws:": ":flag_ws:", + ":xk:": ":flag_xk:", + ":ye:": ":flag_ye:", + ":yen_banknote:": ":yen:", + ":yt:": ":flag_yt:", + ":za:": ":flag_za:", + ":zipper_mouth_face:": ":zipper_mouth:", + ":zm:": ":flag_zm:", + ":zw:": ":flag_zw:", + "woman_in_business_suit_levitating": ":woman_levitate:", + "woman_in_business_suit_levitating_dark_skin_tone": ":woman_leviate_tone5:", + "woman_in_business_suit_levitating_light_skin_tone": ":woman_levitate_tone1:", + "woman_in_business_suit_levitating_medium_dark_skin_tone": ":woman_leviate_tone4:", + "woman_in_business_suit_levitating_medium_light_skin_tone": ":woman_leviate_tone2:", + "woman_in_business_suit_levitating_medium_skin_tone": ":woman_leviate_tone3:", + "woman_in_business_suit_levitating_tone1": ":woman_levitate_tone1:", + "woman_in_business_suit_levitating_tone2": ":woman_leviate_tone2:", + "woman_in_business_suit_levitating_tone3": ":woman_leviate_tone3:", + "woman_in_business_suit_levitating_tone4": ":woman_leviate_tone4:", + "woman_in_business_suit_levitating_tone5": ":woman_leviate_tone5:" +} diff --git a/micromamba_root/Lib/site-packages/pymdownx/util.py b/micromamba_root/Lib/site-packages/pymdownx/util.py new file mode 100644 index 0000000000000000000000000000000000000000..ddca6806b21b9798cceb299f02212986b1b18977 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pymdownx/util.py @@ -0,0 +1,369 @@ +""" +General utilities. + +MIT license. + +Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> +""" +from __future__ import annotations +from markdown import Markdown +from markdown.inlinepatterns import InlineProcessor +import xml.etree.ElementTree as etree +from collections import namedtuple +import sys +import copy +import re +import html +from urllib.request import pathname2url, url2pathname +from urllib.parse import urlparse +from functools import wraps +import warnings +from typing import Sequence, Callable, Any + +RE_WIN_DRIVE_LETTER = re.compile(r"^[A-Za-z]$") +RE_WIN_DRIVE_PATH = re.compile(r"^[A-Za-z]:(?:\\.*)?$") +RE_URL = re.compile('(http|ftp)s?|data|mailto|tel|news') +RE_WIN_DEFAULT_PROTOCOL = re.compile(r"^///[A-Za-z]:(?:/.*)?$") + +if sys.platform.startswith('win'): + _PLATFORM = "windows" +elif sys.platform == "darwin": # pragma: no cover + _PLATFORM = "osx" +else: + _PLATFORM = "linux" + +PY39 = (3, 9) <= sys.version_info +PY314 = (3, 14) <= sys.version_info + + +def clamp(value: float, mn: float, mx: float) -> float: + """Clamp the value to the given minimum and maximum.""" + + if mn is not None and mx is not None: + return max(min(value, mx), mn) + elif mn is not None: + return max(value, mn) + elif mx is not None: + return min(value, mx) + else: + return value + + +def is_win() -> bool: # pragma: no cover + """Is Windows.""" + + return _PLATFORM == "windows" + + +def is_linux() -> bool: # pragma: no cover + """Is Linux.""" + + return _PLATFORM == "linux" + + +def is_mac() -> bool: # pragma: no cover + """Is macOS.""" + + return _PLATFORM == "osx" + + +def url2path(path: str) -> str: + """Path to URL.""" + + return url2pathname(path) + + +def path2url(url: str) -> str: + """URL to path.""" + + path = pathname2url(url) + # If on windows, replace the notation to use a default protocol `///` with nothing. + if is_win() and RE_WIN_DEFAULT_PROTOCOL.match(path): + path = path.replace('///', '', 1) + if PY314: + path = path.replace('///', '/') + return path + + +def get_code_points(s: str) -> list[str]: + """Get the Unicode code points.""" + + return list(s) + + +def get_ord(c: str) -> int: + """Get Unicode ord.""" + + return ord(c) + + +def get_char(value: int) -> str: + """Get the Unicode char.""" + + return chr(value) + + +def escape_chars(md: Markdown, echrs: Sequence[str]) -> None: + """ + Add chars to the escape list. + + Don't just append as it modifies the global list permanently. + Make a copy and extend **that** copy so that only this Markdown + instance gets modified. + """ + + escaped = copy.copy(md.ESCAPED_CHARS) + for ec in echrs: + if ec not in escaped: + escaped.append(ec) + md.ESCAPED_CHARS = escaped + + +def parse_url(url: str) -> tuple[str, str, str, str, str, str, bool, bool]: + """ + Parse the URL. + + Try to determine if the following is a file path or + (as we will call anything else) a URL. + + We return it slightly modified and combine the path parts. + + We also assume if we see something like c:/ it is a Windows path. + We don't bother checking if this **is** a Windows system, but + 'nix users really shouldn't be creating weird names like c: for their folder. + """ + + is_url = False + is_absolute = False + scheme, netloc, path, params, query, fragment = urlparse(html.unescape(url)) + + if RE_URL.match(scheme): + # Clearly a URL + is_url = True + elif scheme == '' and netloc == '' and path == '': + # Maybe just a URL fragment + is_url = True + elif scheme == 'file' and (RE_WIN_DRIVE_PATH.match(netloc)): + # file://c:/path or file://c:\path + path = '/' + (netloc + path).replace('\\', '/') + netloc = '' + is_absolute = True + elif scheme == 'file' and netloc.startswith('\\'): + # file://\c:\path or file://\\path + path = (netloc + path).replace('\\', '/') + netloc = '' + is_absolute = True + elif scheme == 'file': + # file:///path + is_absolute = True + elif RE_WIN_DRIVE_LETTER.match(scheme): + # c:/path + path = '/{}:{}'.format(scheme, path.replace('\\', '/')) + scheme = 'file' + netloc = '' + is_absolute = True + elif scheme == '' and netloc != '' and url.startswith('//'): + # //file/path + path = '//' + netloc + path + scheme = 'file' + netloc = '' + is_absolute = True + elif scheme != '' and netloc != '': + # A non-file path or strange URL + is_url = True + elif path.startswith(('/', '\\')): + # /root path + is_absolute = True + + return (scheme, netloc, path, params, query, fragment, is_url, is_absolute) + + +class PatSeqItem(namedtuple('PatSeqItem', ['pattern', 'builder', 'tags', 'full_recursion'])): + """Pattern sequence item item.""" + + def __new__(cls, pattern: re.Pattern[str], builder: str, tags: str, full_recursion: bool = False) -> PatSeqItem: + """Create object.""" + + return super().__new__(cls, pattern, builder, tags, full_recursion) + + +class PatternSequenceProcessor(InlineProcessor): + """Processor for handling complex nested patterns such as strong and em matches.""" + + PATTERNS = [] # type: list[PatSeqItem] + + def build_single(self, m: re.Match[str], tag: str, full_recursion: bool, idx: int) -> etree.Element: + """Return single tag.""" + el1 = etree.Element(tag) + text = m.group(2) + self.parse_sub_patterns(text, el1, None, full_recursion, idx) + return el1 + + def build_double(self, m: re.Match[str], tags: str, full_recursion: bool, idx: int) -> etree.Element: + """Return double tag.""" + + tag1, tag2 = tags.split(",") + el1 = etree.Element(tag1) + el2 = etree.Element(tag2) + text = m.group(2) + self.parse_sub_patterns(text, el2, None, full_recursion, idx) + el1.append(el2) + if len(m.groups()) == 3: + text = m.group(3) + self.parse_sub_patterns(text, el1, el2, full_recursion, idx) + return el1 + + def build_double2(self, m: re.Match[str], tags: str, full_recursion: bool, idx: int) -> etree.Element: + """Return double tags (variant 2): `<strong>text <em>text</em></strong>`.""" + + tag1, tag2 = tags.split(",") + el1 = etree.Element(tag1) + el2 = etree.Element(tag2) + text = m.group(2) + self.parse_sub_patterns(text, el1, None, full_recursion, idx) + text = m.group(3) + el1.append(el2) + self.parse_sub_patterns(text, el2, None, full_recursion, idx) + return el1 + + def parse_sub_patterns( + self, + data: str, + parent: etree.Element, + last: None | etree.Element, + full_recursion: bool, + idx: int + ) -> None: + """ + Parses sub patterns. + + `data` (`str`): + text to evaluate. + + `parent` (`etree.Element`): + Parent to attach text and sub elements to. + + `last` (`etree.Element`): + Last appended child to parent. Can also be None if parent has no children. + + `idx` (`int`): + Current pattern index that was used to evaluate the parent. + + """ + + offset = 0 + pos = 0 + + length = len(data) + while pos < length: + # Find the start of potential emphasis or strong tokens + if self.compiled_re.match(data, pos): + matched = False + # See if the we can match an emphasis/strong pattern + for index, item in enumerate(self.PATTERNS): + # Only evaluate patterns that are after what was used on the parent + if not full_recursion and index <= idx: + continue + m = item.pattern.match(data, pos) + if m: + # Append child nodes to parent + # Text nodes should be appended to the last + # child if present, and if not, it should + # be added as the parent's text node. + text = data[offset:m.start(0)] + if text: + if last is not None: + last.tail = text + else: + parent.text = text + el = self.build_element(m, item.builder, item.tags, item.full_recursion, index) + parent.append(el) + last = el + # Move our position past the matched hunk + offset = pos = m.end(0) + matched = True + if not matched: + # We matched nothing, move on to the next character + pos += 1 + else: + # Increment position as no potential emphasis start was found. + pos += 1 + + # Append any leftover text as a text node. + text = data[offset:] + if text: + if last is not None: + last.tail = text + else: + parent.text = text + + def build_element( + self, + m: re.Match[str], + builder: str, + tags: str, + full_recursion: bool, + index: int + ) -> etree.Element: + """Element builder.""" + + if builder == 'double2': + return self.build_double2(m, tags, full_recursion, index) + elif builder == 'double': + return self.build_double(m, tags, full_recursion, index) + else: + return self.build_single(m, tags, full_recursion, index) + + def handleMatch( # type: ignore[override] + self, + m: re.Match[str], + data: str + ) -> tuple[etree.Element | None, int | None, int | None]: + """Parse patterns.""" + + el = None + start = None + end = None + + for index, item in enumerate(self.PATTERNS): + m1 = item.pattern.match(data, m.start(0)) + if m1: + start = m1.start(0) + end = m1.end(0) + el = self.build_element(m1, item.builder, item.tags, item.full_recursion, index) + break + return el, start, end + + +def deprecated(message: str, stacklevel: int = 2) -> Callable[..., Any]: # pragma: no cover + """ + Raise a `DeprecationWarning` when wrapped function/method is called. + + Usage: + + @deprecated("This method will be removed in version X; use Y instead.") + def some_method()" + pass + """ + + def _wrapper(func: Callable[..., Any]) -> Callable[..., Any]: + @wraps(func) + def _deprecated_func(*args: Any, **kwargs: Any) -> Any: + warnings.warn( + f"'{func.__name__}' is deprecated. {message}", + category=DeprecationWarning, + stacklevel=stacklevel + ) + return func(*args, **kwargs) + return _deprecated_func + return _wrapper + + +def warn_deprecated(message: str, stacklevel: int = 2) -> None: # pragma: no cover + """Warn deprecated.""" + + warnings.warn( + message, + category=DeprecationWarning, + stacklevel=stacklevel + ) diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/METADATA b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..1ef61364dda7d86ff893af6f9327f9522e4ac733 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/METADATA @@ -0,0 +1,212 @@ +Metadata-Version: 2.4 +Name: pytest +Version: 9.0.3 +Summary: pytest: simple powerful testing with Python +Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Freya Bruhin, Others (See AUTHORS) +License-Expression: MIT +Project-URL: Changelog, https://docs.pytest.org/en/stable/changelog.html +Project-URL: Contact, https://docs.pytest.org/en/stable/contact.html +Project-URL: Funding, https://docs.pytest.org/en/stable/sponsor.html +Project-URL: Homepage, https://docs.pytest.org/en/latest/ +Project-URL: Source, https://github.com/pytest-dev/pytest +Project-URL: Tracker, https://github.com/pytest-dev/pytest/issues +Keywords: test,unittest +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: Operating System :: MacOS +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: POSIX +Classifier: Operating System :: Unix +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Software Development :: Testing +Classifier: Topic :: Utilities +Requires-Python: >=3.10 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: colorama>=0.4; sys_platform == "win32" +Requires-Dist: exceptiongroup>=1; python_version < "3.11" +Requires-Dist: iniconfig>=1.0.1 +Requires-Dist: packaging>=22 +Requires-Dist: pluggy<2,>=1.5 +Requires-Dist: pygments>=2.7.2 +Requires-Dist: tomli>=1; python_version < "3.11" +Provides-Extra: dev +Requires-Dist: argcomplete; extra == "dev" +Requires-Dist: attrs>=19.2; extra == "dev" +Requires-Dist: hypothesis>=3.56; extra == "dev" +Requires-Dist: mock; extra == "dev" +Requires-Dist: requests; extra == "dev" +Requires-Dist: setuptools; extra == "dev" +Requires-Dist: xmlschema; extra == "dev" +Dynamic: license-file + +.. image:: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg + :target: https://docs.pytest.org/en/stable/ + :align: center + :height: 200 + :alt: pytest + + +------ + +.. image:: https://img.shields.io/pypi/v/pytest.svg + :target: https://pypi.org/project/pytest/ + +.. image:: https://img.shields.io/conda/vn/conda-forge/pytest.svg + :target: https://anaconda.org/conda-forge/pytest + +.. image:: https://img.shields.io/pypi/pyversions/pytest.svg + :target: https://pypi.org/project/pytest/ + +.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg + :target: https://codecov.io/gh/pytest-dev/pytest + :alt: Code coverage Status + +.. image:: https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg + :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest + +.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg + :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main + :alt: pre-commit.ci status + +.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg + :target: https://www.codetriage.com/pytest-dev/pytest + +.. image:: https://readthedocs.org/projects/pytest/badge/?version=latest + :target: https://pytest.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/Discord-pytest--dev-blue + :target: https://discord.com/invite/pytest-dev + :alt: Discord + +.. image:: https://img.shields.io/badge/Libera%20chat-%23pytest-orange + :target: https://web.libera.chat/#pytest + :alt: Libera chat + + +The ``pytest`` framework makes it easy to write small tests, yet +scales to support complex functional testing for applications and libraries. + +An example of a simple test: + +.. code-block:: python + + # content of test_sample.py + def inc(x): + return x + 1 + + + def test_answer(): + assert inc(3) == 5 + + +To execute it:: + + $ pytest + ============================= test session starts ============================= + collected 1 items + + test_sample.py F + + ================================== FAILURES =================================== + _________________________________ test_answer _________________________________ + + def test_answer(): + > assert inc(3) == 5 + E assert 4 == 5 + E + where 4 = inc(3) + + test_sample.py:5: AssertionError + ========================== 1 failed in 0.04 seconds =========================== + + +Thanks to ``pytest``'s detailed assertion introspection, you can simply use plain ``assert`` statements. See `getting-started <https://docs.pytest.org/en/stable/getting-started.html#our-first-test-run>`_ for more examples. + + +Features +-------- + +- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/how-to/assert.html>`_ (no need to remember ``self.assert*`` names) + +- `Auto-discovery + <https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_ + of test modules and functions + +- `Modular fixtures <https://docs.pytest.org/en/stable/explanation/fixtures.html>`_ for + managing small or parametrized long-lived test resources + +- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial) + test suites out of the box + +- Python 3.10+ or PyPy3 + +- Rich plugin architecture, with over 1300+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community + + +Documentation +------------- + +For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/stable/. + + +Bugs/Requests +------------- + +Please use the `GitHub issue tracker <https://github.com/pytest-dev/pytest/issues>`_ to submit bugs or request features. + + +Changelog +--------- + +Consult the `Changelog <https://docs.pytest.org/en/stable/changelog.html>`__ page for fixes and enhancements of each version. + + +Support pytest +-------------- + +`Open Collective`_ is an online funding platform for open and transparent communities. +It provides tools to raise money and share your finances in full transparency. + +It is the platform of choice for individuals and companies that want to make one-time or +monthly donations directly to the project. + +See more details in the `pytest collective`_. + +.. _Open Collective: https://opencollective.com +.. _pytest collective: https://opencollective.com/pytest + + +pytest for enterprise +--------------------- + +Available as part of the Tidelift Subscription. + +The maintainers of pytest and thousands of other packages are working with Tidelift to deliver commercial support and +maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. + +`Learn more. <https://tidelift.com/subscription/pkg/pypi-pytest?utm_source=pypi-pytest&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_ + +Security +^^^^^^^^ + +pytest has never been associated with a security vulnerability, but in any case, to report a +security vulnerability please use the `Tidelift security contact <https://tidelift.com/security>`_. +Tidelift will coordinate the fix and disclosure. + + +License +------- + +Copyright Holger Krekel and others, 2004. + +Distributed under the terms of the `MIT`_ license, pytest is free and open source software. + +.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/RECORD b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..0dc8db0f087214c99f77eaf6f708fedb86d6ee2a --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/RECORD @@ -0,0 +1,161 @@ +../../../bin/py.test,sha256=TP953k42-SVpKIvPyqkMTTWOtYbWR6Gq85FaYgy19pw,452 +../../../bin/pytest,sha256=TP953k42-SVpKIvPyqkMTTWOtYbWR6Gq85FaYgy19pw,452 +__pycache__/py.cpython-310.pyc,, +_pytest/__init__.py,sha256=4IdRJhnW5XG2KlaJkOxn5_TC9WeQ5tXDSF7tbb4vEso,391 +_pytest/__pycache__/__init__.cpython-310.pyc,, +_pytest/__pycache__/_argcomplete.cpython-310.pyc,, +_pytest/__pycache__/_version.cpython-310.pyc,, +_pytest/__pycache__/cacheprovider.cpython-310.pyc,, +_pytest/__pycache__/capture.cpython-310.pyc,, +_pytest/__pycache__/compat.cpython-310.pyc,, +_pytest/__pycache__/debugging.cpython-310.pyc,, +_pytest/__pycache__/deprecated.cpython-310.pyc,, +_pytest/__pycache__/doctest.cpython-310.pyc,, +_pytest/__pycache__/faulthandler.cpython-310.pyc,, +_pytest/__pycache__/fixtures.cpython-310.pyc,, +_pytest/__pycache__/freeze_support.cpython-310.pyc,, +_pytest/__pycache__/helpconfig.cpython-310.pyc,, +_pytest/__pycache__/hookspec.cpython-310.pyc,, +_pytest/__pycache__/junitxml.cpython-310.pyc,, +_pytest/__pycache__/legacypath.cpython-310.pyc,, +_pytest/__pycache__/logging.cpython-310.pyc,, +_pytest/__pycache__/main.cpython-310.pyc,, +_pytest/__pycache__/monkeypatch.cpython-310.pyc,, +_pytest/__pycache__/nodes.cpython-310.pyc,, +_pytest/__pycache__/outcomes.cpython-310.pyc,, +_pytest/__pycache__/pastebin.cpython-310.pyc,, +_pytest/__pycache__/pathlib.cpython-310.pyc,, +_pytest/__pycache__/pytester.cpython-310.pyc,, +_pytest/__pycache__/pytester_assertions.cpython-310.pyc,, +_pytest/__pycache__/python.cpython-310.pyc,, +_pytest/__pycache__/python_api.cpython-310.pyc,, +_pytest/__pycache__/raises.cpython-310.pyc,, +_pytest/__pycache__/recwarn.cpython-310.pyc,, +_pytest/__pycache__/reports.cpython-310.pyc,, +_pytest/__pycache__/runner.cpython-310.pyc,, +_pytest/__pycache__/scope.cpython-310.pyc,, +_pytest/__pycache__/setuponly.cpython-310.pyc,, +_pytest/__pycache__/setupplan.cpython-310.pyc,, +_pytest/__pycache__/skipping.cpython-310.pyc,, +_pytest/__pycache__/stash.cpython-310.pyc,, +_pytest/__pycache__/stepwise.cpython-310.pyc,, +_pytest/__pycache__/subtests.cpython-310.pyc,, +_pytest/__pycache__/terminal.cpython-310.pyc,, +_pytest/__pycache__/terminalprogress.cpython-310.pyc,, +_pytest/__pycache__/threadexception.cpython-310.pyc,, +_pytest/__pycache__/timing.cpython-310.pyc,, +_pytest/__pycache__/tmpdir.cpython-310.pyc,, +_pytest/__pycache__/tracemalloc.cpython-310.pyc,, +_pytest/__pycache__/unittest.cpython-310.pyc,, +_pytest/__pycache__/unraisableexception.cpython-310.pyc,, +_pytest/__pycache__/warning_types.cpython-310.pyc,, +_pytest/__pycache__/warnings.cpython-310.pyc,, +_pytest/_argcomplete.py,sha256=gh0pna66p4LVb2D8ST4568WGxvdInGT43m6slYhqNqU,3776 +_pytest/_code/__init__.py,sha256=BKbowoYQADKjAJmTWdQ8SSQLbBBsh0-dZj3TGjtn6yM,521 +_pytest/_code/__pycache__/__init__.cpython-310.pyc,, +_pytest/_code/__pycache__/code.cpython-310.pyc,, +_pytest/_code/__pycache__/source.cpython-310.pyc,, +_pytest/_code/code.py,sha256=KWjr6ZcF8iBryOHA1dyRgyBrfDSpTLxxOvjN1H3Enx4,56126 +_pytest/_code/source.py,sha256=VvNzWHYfT96SO128m7tfIdagZ35yug46bWfgXH_5Vp8,7772 +_pytest/_io/__init__.py,sha256=pkLF29VEFr6Dlr3eOtJL8sf47RLFt1Jf4X1DZBPlYmc,190 +_pytest/_io/__pycache__/__init__.cpython-310.pyc,, +_pytest/_io/__pycache__/pprint.cpython-310.pyc,, +_pytest/_io/__pycache__/saferepr.cpython-310.pyc,, +_pytest/_io/__pycache__/terminalwriter.cpython-310.pyc,, +_pytest/_io/__pycache__/wcwidth.cpython-310.pyc,, +_pytest/_io/pprint.py,sha256=GLBKL6dmnRr92GnVMkNzMkKqx08Op7tdJSeh3AewonY,19622 +_pytest/_io/saferepr.py,sha256=Hhx5F-75iz03hdk-WO86Bmy9RBuRHsuJj-YUzozfrgo,4082 +_pytest/_io/terminalwriter.py,sha256=K0pB1pfAvrKBWFARKSobQ4wWi0pdmiBaGb3a_v_AAjQ,8994 +_pytest/_io/wcwidth.py,sha256=cUEJ74UhweICwbKvU2q6noZcNgD0QlBEB9CfakGYaqA,1289 +_pytest/_py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +_pytest/_py/__pycache__/__init__.cpython-310.pyc,, +_pytest/_py/__pycache__/error.cpython-310.pyc,, +_pytest/_py/__pycache__/path.cpython-310.pyc,, +_pytest/_py/error.py,sha256=kGQ7F8_fZ6YVBhAx-u9mkTQBTx0qIxxnVMC0CgiOd70,3475 +_pytest/_py/path.py,sha256=cqCn0amzKhqSqiW1Wzt4KqvFI2ncKBzGnwERUsWpC_0,49229 +_pytest/_version.py,sha256=k2-_mebD9I3QrKiHYzmNlkdwhc4vy7pBzYy-do5yOU4,704 +_pytest/assertion/__init__.py,sha256=OjnJm4j6VHgwYjKvW8d-KFefjEdOSONFF4z10o9r7eg,7120 +_pytest/assertion/__pycache__/__init__.cpython-310.pyc,, +_pytest/assertion/__pycache__/rewrite.cpython-310.pyc,, +_pytest/assertion/__pycache__/truncate.cpython-310.pyc,, +_pytest/assertion/__pycache__/util.cpython-310.pyc,, +_pytest/assertion/rewrite.py,sha256=N2rauTZyAmVShY_6ygCcvvVT8ILy5N7oes5155ZtSxA,48206 +_pytest/assertion/truncate.py,sha256=2vOU3kS4hUZhDDL0Xaz1pM7oW_10wMc0J3b_lEbSzQI,5438 +_pytest/assertion/util.py,sha256=YQLyQ7nYHQu0ui5SeB62KB0KjuueFyHwghGT_p1dfmM,20561 +_pytest/cacheprovider.py,sha256=QCKdiepUSkuPNEx5DlhIQHbA413MwNUld4LIpV16FW8,23149 +_pytest/capture.py,sha256=kulumJdRdHu7zoosOr4lfHR0ce6LsOthau9Byrw8xV4,36829 +_pytest/compat.py,sha256=qcHcZHQyEA6TO3C0qGEgO0b_YxNu23ok0mTZ0sah6kk,10254 +_pytest/config/__init__.py,sha256=LqRPFTnta3LrYUAtRjO5Lp_vmYlcQaxjR4YGkFFuRs8,79300 +_pytest/config/__pycache__/__init__.cpython-310.pyc,, +_pytest/config/__pycache__/argparsing.cpython-310.pyc,, +_pytest/config/__pycache__/compat.cpython-310.pyc,, +_pytest/config/__pycache__/exceptions.cpython-310.pyc,, +_pytest/config/__pycache__/findpaths.cpython-310.pyc,, +_pytest/config/argparsing.py,sha256=dDjwtY9nhTQ9Q14ZbdU-EGwoQKZFuVZB1Ps0wclg5_o,20439 +_pytest/config/compat.py,sha256=djDt_XTPwXDIgnnopti2ZVrqtwzO5hFWiMhgU5dgIM4,2947 +_pytest/config/exceptions.py,sha256=6Vm9yzwUOxJGm17ZMGbw69v_i07mT1KmBwENM2scKhk,315 +_pytest/config/findpaths.py,sha256=0iq92sR6c6gVBFacwMNW-gFFzlfvWNO46dX9x39gnIg,12878 +_pytest/debugging.py,sha256=JkV7Ob7wQ53TFGkQ0Ta96jAMYGubgdXiEs39T7FPzHQ,13947 +_pytest/deprecated.py,sha256=EikoYjqdlLTZgbBNTmFdPqiP5DdZpzAyKwRbO2hA0VE,3611 +_pytest/doctest.py,sha256=GgjdWOxH-fV9eQoWQ7puKejcFdA1HPtG-Y7qbp-5L8c,25478 +_pytest/faulthandler.py,sha256=1c7DpRtP0_C3zpFUSw1BORpAG8GsiDtJ9zCuWdEiLc0,4250 +_pytest/fixtures.py,sha256=7_gKoVUCpfo4sCLy3T07p2Dv_xa5x2HnKDKZu884DeY,78681 +_pytest/freeze_support.py,sha256=X94IxipqebeA_HgzJh8dbjqGnrtEQFuMIC5hK7SGWXw,1300 +_pytest/helpconfig.py,sha256=6iy21oUDURGedZpB3emSzaFCxeNT_ERSkSIZLIxMJvU,10019 +_pytest/hookspec.py,sha256=EEkjhv3tWsIXzPS-LyvXsFx5mar3AMm4POBCePIHCMQ,43019 +_pytest/junitxml.py,sha256=1xGYlQzzO9HH3HghZ5hu4TBCf8V-IhBG5kVdx6W2PVo,25522 +_pytest/legacypath.py,sha256=_l6v8akNMfTc5TAjvbc6M-_t157p9QE6-118WM0DRt8,16588 +_pytest/logging.py,sha256=TZ67JQP_3Ylt0p11D2J68L_os9glsuggMvec0Hljtb8,35234 +_pytest/main.py,sha256=fKKyDMQfv8J2G8sjHuyyaWfVU2UQNcQAAPRNcOF0tpM,42435 +_pytest/mark/__init__.py,sha256=38H7wh2k3SZMZNZwAhPbHBxpPxYbn-wzmVtGUYigvzc,9870 +_pytest/mark/__pycache__/__init__.cpython-310.pyc,, +_pytest/mark/__pycache__/expression.cpython-310.pyc,, +_pytest/mark/__pycache__/structures.cpython-310.pyc,, +_pytest/mark/expression.py,sha256=30rS65yMCdfn1UWiCP_4imfzSeWEtP_qz4_2JV3Y1-U,11244 +_pytest/mark/structures.py,sha256=krlQ7sEUUUmFjy3yjoXA0BciTgUpklMtLqTlKOsEwac,23073 +_pytest/monkeypatch.py,sha256=WX3_6czULhvc3wSF-0N8Vesbv9wGN3dwliYcDvT8Efs,15500 +_pytest/nodes.py,sha256=aTsDhbLEVkZ2cgC8UXQW53bBDD5Y7l7ZNwB0kb5Nho4,26540 +_pytest/outcomes.py,sha256=qbgHRCERDRK8W8ZAfanQf4Dp4_W7vNoc2vv3pm3HtKo,10108 +_pytest/pastebin.py,sha256=p92zJtSNz9-xDEFzqQ3zemYggXRaDnxD6X4IyitevbA,4155 +_pytest/pathlib.py,sha256=xIOYa8ElyypD2BTuS2_8bh6OyD4DjPfBOulkFxQ5b1Q,37879 +_pytest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +_pytest/pytester.py,sha256=x0am9bXHz3QPBTPXPylcYmfP8sGhVi5RC_KPj6g3Hn4,62389 +_pytest/pytester_assertions.py,sha256=xX_HbFPB-Rz_NNDttTY39ft7_wZLvPgQQBVevSCeVmA,2253 +_pytest/python.py,sha256=_SgxiiPnr7jPgXlKs8sCjdsBSN-AoUZmzIvJMgMkVh4,68754 +_pytest/python_api.py,sha256=LzTjh4Pz25Z7wIVFDdxTQ6umqYSC5B_8GtKxu4Cvkaw,31707 +_pytest/raises.py,sha256=86V-hoY5hYba69npyrH7r4kQNb8QjouYb8SydGLmjVc,60082 +_pytest/recwarn.py,sha256=4a6s8WWqn-yCCHyqgnB_ffc_zkwXBGPCuvC-03L65c4,13386 +_pytest/reports.py,sha256=LpJypnzeOLkl66JKKIsu9390HA2qItpvvOU-5uWPpB0,23230 +_pytest/runner.py,sha256=jXhLKz4jsF9MTt0_UmPrEZZOhrbhbSyBTF_LISXcTqQ,19785 +_pytest/scope.py,sha256=pB7jsiisth16PBFacV1Yxd3Pj3YAx2dmlSmGbG4mw6A,2738 +_pytest/setuponly.py,sha256=BsRrC4ERDVr42-2G_L0AxhNU4XVwbMsy5S0lOvKr8wA,3167 +_pytest/setupplan.py,sha256=l-ycFNxDZPyY52wh4f7yaqhzZ7SW1ijSKnQLmqzDZWA,1184 +_pytest/skipping.py,sha256=WCRzHVoxF4D0GOrJoJTnzx_WOoLTsM1enlSYzG7NEnw,10810 +_pytest/stash.py,sha256=5pE3kDx4q855TW9aVvYTdrkkKlMDU6-xiX4luKpJEgI,3090 +_pytest/stepwise.py,sha256=kD81DrnhnclKBmMfauwQmbeMbYUvuw07w5WnNkmIdEQ,7689 +_pytest/subtests.py,sha256=-OzOpE0j98vDWMAsI-xMJ0FcYb6inLq6YPH_0tEyU44,13241 +_pytest/terminal.py,sha256=4v5Ab5MOeV0JAmdG6CCamnFCrHBPwKAgCvnk900hBNA,64444 +_pytest/terminalprogress.py,sha256=_IO3vRGVATz3RkkacqIAaCUC4-Rq2pTEANUAY66dEwQ,1153 +_pytest/threadexception.py,sha256=hTccpzZUrrQkDROVFAqHgXwAU481ca4Mq4CA4YB7my4,4953 +_pytest/timing.py,sha256=lPcKHaM1eKHv1_2ZgUaPK9h3FhtqGvZAYucx_LSdZw0,3108 +_pytest/tmpdir.py,sha256=slqA2yVHbP2dWOfIDolirJ45ymKDaaHbeJqcgaImHdk,12526 +_pytest/tracemalloc.py,sha256=lCUB_YUAb6R1vqq_b-LSYSXy-Tidbn2m7tfzmWAUrjk,778 +_pytest/unittest.py,sha256=lF52zcPqb931FoWCWC7Yi78kAWABDRkqb60VZpI1Hl4,24485 +_pytest/unraisableexception.py,sha256=dNaBpBHkOB4pOISoaMdau2ojrGoc_i4ux76DVXLLT-w,5179 +_pytest/warning_types.py,sha256=Vm6nG0sPUCyC3MBqHHroZXDlkU-Vvi0QTJQaaMryGJA,4398 +_pytest/warnings.py,sha256=yJMDr7vSeij-nyTuldE7wL25ZL_LumQGY6PJZpXiQ-I,5194 +py.py,sha256=txZ1tdmEW6CBTp6Idn-I2sOzzA0xKNoCi9Re27Uj6HE,329 +pytest-9.0.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pytest-9.0.3.dist-info/METADATA,sha256=w5ZvKHkWhkd7rjXlGHNtTL6ltibTp5ARIVhU4rxnAgc,7556 +pytest-9.0.3.dist-info/RECORD,, +pytest-9.0.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pytest-9.0.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91 +pytest-9.0.3.dist-info/direct_url.json,sha256=Dn_pekIBw4xlmjWsKJVdGzuvURg0BQVOS8BXIQImOyc,117 +pytest-9.0.3.dist-info/entry_points.txt,sha256=8IPrHPH3LNZQ7v5tNEOcNTZYk_SheNg64jsTM9erqL4,77 +pytest-9.0.3.dist-info/licenses/LICENSE,sha256=yoNqX57Mo7LzUCMPqiCkj7ixRWU7VWjXhIYt-GRwa5s,1091 +pytest-9.0.3.dist-info/top_level.txt,sha256=yyhjvmXH7-JOaoQIdmNQHPuoBCxOyXS3jIths_6C8A4,18 +pytest/__init__.py,sha256=e-eh4iGNxZoZ0a0THkq-IRcqKVCH78comJOCSHguh2Y,5582 +pytest/__main__.py,sha256=oVDrGGo7N0TNyzXntUblcgTKbhHGWtivcX5TC7tEcKo,154 +pytest/__pycache__/__init__.cpython-310.pyc,, +pytest/__pycache__/__main__.cpython-310.pyc,, +pytest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..14a883f292bc96b20c2b76a3081991f2676523a9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (82.0.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..a9e1704004cfbcfe3093fd6dcf9e689c7b64f947 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_pytest_1775644472/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/entry_points.txt b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..192205dfa5fda066e479ba073379747ae0abbba5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +py.test = pytest:console_main +pytest = pytest:console_main diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c3f1657fce94589bd1ec7cead810639047f3d359 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2004 Holger Krekel and others + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..3084ae51ecc94b5979ae9075ebb0e08fbda8bdbd --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest-9.0.3.dist-info/top_level.txt @@ -0,0 +1,3 @@ +_pytest +py +pytest diff --git a/micromamba_root/Lib/site-packages/pytest/__init__.py b/micromamba_root/Lib/site-packages/pytest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e6281ac38841a8f9bac1f4ab7cd236cc5df26a3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest/__init__.py @@ -0,0 +1,186 @@ +# PYTHON_ARGCOMPLETE_OK +"""pytest: unit and functional testing with Python.""" + +from __future__ import annotations + +from _pytest import __version__ +from _pytest import version_tuple +from _pytest._code import ExceptionInfo +from _pytest.assertion import register_assert_rewrite +from _pytest.cacheprovider import Cache +from _pytest.capture import CaptureFixture +from _pytest.config import cmdline +from _pytest.config import Config +from _pytest.config import console_main +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import hookspec +from _pytest.config import main +from _pytest.config import PytestPluginManager +from _pytest.config import UsageError +from _pytest.config.argparsing import OptionGroup +from _pytest.config.argparsing import Parser +from _pytest.debugging import pytestPDB as __pytestPDB +from _pytest.doctest import DoctestItem +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import FixtureLookupError +from _pytest.fixtures import FixtureRequest +from _pytest.fixtures import yield_fixture +from _pytest.freeze_support import freeze_includes +from _pytest.legacypath import TempdirFactory +from _pytest.legacypath import Testdir +from _pytest.logging import LogCaptureFixture +from _pytest.main import Dir +from _pytest.main import Session +from _pytest.mark import HIDDEN_PARAM +from _pytest.mark import Mark +from _pytest.mark import MARK_GEN as mark +from _pytest.mark import MarkDecorator +from _pytest.mark import MarkGenerator +from _pytest.mark import param +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Directory +from _pytest.nodes import File +from _pytest.nodes import Item +from _pytest.outcomes import exit +from _pytest.outcomes import fail +from _pytest.outcomes import importorskip +from _pytest.outcomes import skip +from _pytest.outcomes import xfail +from _pytest.pytester import HookRecorder +from _pytest.pytester import LineMatcher +from _pytest.pytester import Pytester +from _pytest.pytester import RecordedHookCall +from _pytest.pytester import RunResult +from _pytest.python import Class +from _pytest.python import Function +from _pytest.python import Metafunc +from _pytest.python import Module +from _pytest.python import Package +from _pytest.python_api import approx +from _pytest.raises import raises +from _pytest.raises import RaisesExc +from _pytest.raises import RaisesGroup +from _pytest.recwarn import deprecated_call +from _pytest.recwarn import WarningsRecorder +from _pytest.recwarn import warns +from _pytest.reports import CollectReport +from _pytest.reports import TestReport +from _pytest.runner import CallInfo +from _pytest.stash import Stash +from _pytest.stash import StashKey +from _pytest.subtests import SubtestReport +from _pytest.subtests import Subtests +from _pytest.terminal import TerminalReporter +from _pytest.terminal import TestShortLogReport +from _pytest.tmpdir import TempPathFactory +from _pytest.warning_types import PytestAssertRewriteWarning +from _pytest.warning_types import PytestCacheWarning +from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestConfigWarning +from _pytest.warning_types import PytestDeprecationWarning +from _pytest.warning_types import PytestExperimentalApiWarning +from _pytest.warning_types import PytestFDWarning +from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import PytestRemovedIn10Warning +from _pytest.warning_types import PytestReturnNotNoneWarning +from _pytest.warning_types import PytestUnhandledThreadExceptionWarning +from _pytest.warning_types import PytestUnknownMarkWarning +from _pytest.warning_types import PytestUnraisableExceptionWarning +from _pytest.warning_types import PytestWarning + + +set_trace = __pytestPDB.set_trace + + +__all__ = [ + "HIDDEN_PARAM", + "Cache", + "CallInfo", + "CaptureFixture", + "Class", + "CollectReport", + "Collector", + "Config", + "Dir", + "Directory", + "DoctestItem", + "ExceptionInfo", + "ExitCode", + "File", + "FixtureDef", + "FixtureLookupError", + "FixtureRequest", + "Function", + "HookRecorder", + "Item", + "LineMatcher", + "LogCaptureFixture", + "Mark", + "MarkDecorator", + "MarkGenerator", + "Metafunc", + "Module", + "MonkeyPatch", + "OptionGroup", + "Package", + "Parser", + "PytestAssertRewriteWarning", + "PytestCacheWarning", + "PytestCollectionWarning", + "PytestConfigWarning", + "PytestDeprecationWarning", + "PytestExperimentalApiWarning", + "PytestFDWarning", + "PytestPluginManager", + "PytestRemovedIn9Warning", + "PytestRemovedIn10Warning", + "PytestReturnNotNoneWarning", + "PytestUnhandledThreadExceptionWarning", + "PytestUnknownMarkWarning", + "PytestUnraisableExceptionWarning", + "PytestWarning", + "Pytester", + "RaisesExc", + "RaisesGroup", + "RecordedHookCall", + "RunResult", + "Session", + "Stash", + "StashKey", + "SubtestReport", + "Subtests", + "TempPathFactory", + "TempdirFactory", + "TerminalReporter", + "TestReport", + "TestShortLogReport", + "Testdir", + "UsageError", + "WarningsRecorder", + "__version__", + "approx", + "cmdline", + "console_main", + "deprecated_call", + "exit", + "fail", + "fixture", + "freeze_includes", + "hookimpl", + "hookspec", + "importorskip", + "main", + "mark", + "param", + "raises", + "register_assert_rewrite", + "set_trace", + "skip", + "version_tuple", + "warns", + "xfail", + "yield_fixture", +] diff --git a/micromamba_root/Lib/site-packages/pytest/__main__.py b/micromamba_root/Lib/site-packages/pytest/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..cccab5d57b86352e51cb59df8b023c42a9304d65 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytest/__main__.py @@ -0,0 +1,9 @@ +"""The pytest entry point.""" + +from __future__ import annotations + +import pytest + + +if __name__ == "__main__": + raise SystemExit(pytest.console_main()) diff --git a/micromamba_root/Lib/site-packages/pytest/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/pytest/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1908766f94e2cbe507dd865ea50b49b5e6f97866 Binary files /dev/null and b/micromamba_root/Lib/site-packages/pytest/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pytest/__pycache__/__main__.cpython-314.pyc b/micromamba_root/Lib/site-packages/pytest/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e4c5f6e03d95d96896a31364014be439e2cf046 Binary files /dev/null and b/micromamba_root/Lib/site-packages/pytest/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pytest/py.typed b/micromamba_root/Lib/site-packages/pytest/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..c0f24aef12adf85421f47aa6832fe47a27796c26 --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA @@ -0,0 +1,206 @@ +Metadata-Version: 2.4 +Name: python-dateutil +Version: 2.9.0.post0 +Summary: Extensions to the standard Python datetime module +Home-page: https://github.com/dateutil/dateutil +Author: Gustavo Niemeyer +Author-email: gustavo@niemeyer.net +Maintainer: Paul Ganssle +Maintainer-email: dateutil@python.org +License: Dual License +Project-URL: Documentation, https://dateutil.readthedocs.io/en/stable/ +Project-URL: Source, https://github.com/dateutil/dateutil +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Software Development :: Libraries +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,>=2.7 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: six>=1.5 +Dynamic: description +Dynamic: license-file + +dateutil - powerful extensions to datetime +========================================== + +|pypi| |support| |licence| + +|gitter| |readthedocs| + +|travis| |appveyor| |pipelines| |coverage| + +.. |pypi| image:: https://img.shields.io/pypi/v/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: pypi version + +.. |support| image:: https://img.shields.io/pypi/pyversions/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: supported Python version + +.. |travis| image:: https://img.shields.io/travis/dateutil/dateutil/master.svg?style=flat-square&label=Travis%20Build + :target: https://travis-ci.org/dateutil/dateutil + :alt: travis build status + +.. |appveyor| image:: https://img.shields.io/appveyor/ci/dateutil/dateutil/master.svg?style=flat-square&logo=appveyor + :target: https://ci.appveyor.com/project/dateutil/dateutil + :alt: appveyor build status + +.. |pipelines| image:: https://dev.azure.com/pythondateutilazure/dateutil/_apis/build/status/dateutil.dateutil?branchName=master + :target: https://dev.azure.com/pythondateutilazure/dateutil/_build/latest?definitionId=1&branchName=master + :alt: azure pipelines build status + +.. |coverage| image:: https://codecov.io/gh/dateutil/dateutil/branch/master/graphs/badge.svg?branch=master + :target: https://codecov.io/gh/dateutil/dateutil?branch=master + :alt: Code coverage + +.. |gitter| image:: https://badges.gitter.im/dateutil/dateutil.svg + :alt: Join the chat at https://gitter.im/dateutil/dateutil + :target: https://gitter.im/dateutil/dateutil + +.. |licence| image:: https://img.shields.io/pypi/l/python-dateutil.svg?style=flat-square + :target: https://pypi.org/project/python-dateutil/ + :alt: licence + +.. |readthedocs| image:: https://img.shields.io/readthedocs/dateutil/latest.svg?style=flat-square&label=Read%20the%20Docs + :alt: Read the documentation at https://dateutil.readthedocs.io/en/latest/ + :target: https://dateutil.readthedocs.io/en/latest/ + +The `dateutil` module provides powerful extensions to +the standard `datetime` module, available in Python. + +Installation +============ +`dateutil` can be installed from PyPI using `pip` (note that the package name is +different from the importable name):: + + pip install python-dateutil + +Download +======== +dateutil is available on PyPI +https://pypi.org/project/python-dateutil/ + +The documentation is hosted at: +https://dateutil.readthedocs.io/en/stable/ + +Code +==== +The code and issue tracker are hosted on GitHub: +https://github.com/dateutil/dateutil/ + +Features +======== + +* Computing of relative deltas (next month, next year, + next Monday, last week of month, etc); +* Computing of relative deltas between two given + date and/or datetime objects; +* Computing of dates based on very flexible recurrence rules, + using a superset of the `iCalendar <https://www.ietf.org/rfc/rfc2445.txt>`_ + specification. Parsing of RFC strings is supported as well. +* Generic parsing of dates in almost any string format; +* Timezone (tzinfo) implementations for tzfile(5) format + files (/etc/localtime, /usr/share/zoneinfo, etc), TZ + environment string (in all known formats), iCalendar + format files, given ranges (with help from relative deltas), + local machine timezone, fixed offset timezone, UTC timezone, + and Windows registry-based time zones. +* Internal up-to-date world timezone information based on + Olson's database. +* Computing of Easter Sunday dates for any given year, + using Western, Orthodox or Julian algorithms; +* A comprehensive test suite. + +Quick example +============= +Here's a snapshot, just to give an idea about the power of the +package. For more examples, look at the documentation. + +Suppose you want to know how much time is left, in +years/months/days/etc, before the next easter happening on a +year with a Friday 13th in August, and you want to get today's +date out of the "date" unix system command. Here is the code: + +.. code-block:: python3 + + >>> from dateutil.relativedelta import * + >>> from dateutil.easter import * + >>> from dateutil.rrule import * + >>> from dateutil.parser import * + >>> from datetime import * + >>> now = parse("Sat Oct 11 17:13:46 UTC 2003") + >>> today = now.date() + >>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year + >>> rdelta = relativedelta(easter(year), today) + >>> print("Today is: %s" % today) + Today is: 2003-10-11 + >>> print("Year with next Aug 13th on a Friday is: %s" % year) + Year with next Aug 13th on a Friday is: 2004 + >>> print("How far is the Easter of that year: %s" % rdelta) + How far is the Easter of that year: relativedelta(months=+6) + >>> print("And the Easter of that year is: %s" % (today+rdelta)) + And the Easter of that year is: 2004-04-11 + +Being exactly 6 months ahead was **really** a coincidence :) + +Contributing +============ + +We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the ``CONTRIBUTING.md`` file in the repository. + + +Author +====== +The dateutil module was written by Gustavo Niemeyer <gustavo@niemeyer.net> +in 2003. + +It is maintained by: + +* Gustavo Niemeyer <gustavo@niemeyer.net> 2003-2011 +* Tomi Pieviläinen <tomi.pievilainen@iki.fi> 2012-2014 +* Yaron de Leeuw <me@jarondl.net> 2014-2016 +* Paul Ganssle <paul@ganssle.io> 2015- + +Starting with version 2.4.1 and running until 2.8.2, all source and binary +distributions will be signed by a PGP key that has, at the very least, been +signed by the key which made the previous release. A table of release signing +keys can be found below: + +=========== ============================ +Releases Signing key fingerprint +=========== ============================ +2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_ +=========== ============================ + +New releases *may* have signed tags, but binary and source distributions +uploaded to PyPI will no longer have GPG signatures attached. + +Contact +======= +Our mailing list is available at `dateutil@python.org <https://mail.python.org/mailman/listinfo/dateutil>`_. As it is hosted by the PSF, it is subject to the `PSF code of +conduct <https://www.python.org/psf/conduct/>`_. + +License +======= + +All contributions after December 1, 2017 released under dual license - either `Apache 2.0 License <https://www.apache.org/licenses/LICENSE-2.0>`_ or the `BSD 3-Clause License <https://opensource.org/licenses/BSD-3-Clause>`_. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License. + + +.. _6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB: + https://pgp.mit.edu/pks/lookup?op=vindex&search=0xCD54FCE3D964BEFB diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..154737b0e9e23f6e79b2206a92c7db1e4f9a4182 --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD @@ -0,0 +1,46 @@ +dateutil/__init__.py,sha256=Mqam67WO9IkTmUFyI66vS6IoSXTp9G388DadH2LCMLY,620 +dateutil/__pycache__/__init__.cpython-39.pyc,, +dateutil/__pycache__/_common.cpython-39.pyc,, +dateutil/__pycache__/_version.cpython-39.pyc,, +dateutil/__pycache__/easter.cpython-39.pyc,, +dateutil/__pycache__/relativedelta.cpython-39.pyc,, +dateutil/__pycache__/rrule.cpython-39.pyc,, +dateutil/__pycache__/tzwin.cpython-39.pyc,, +dateutil/__pycache__/utils.cpython-39.pyc,, +dateutil/_common.py,sha256=77w0yytkrxlYbSn--lDVPUMabUXRR9I3lBv_vQRUqUY,932 +dateutil/_version.py,sha256=2coNQN--46VtKE3SZe4j-RMMPcvpTDHgLtevBHSYzyY,526 +dateutil/easter.py,sha256=dyBi-lKvimH1u_k6p7Z0JJK72QhqVtVBsqByvpEPKvc,2678 +dateutil/parser/__init__.py,sha256=wWk6GFuxTpjoggCGtgkceJoti4pVjl4_fHQXpNOaSYg,1766 +dateutil/parser/__pycache__/__init__.cpython-39.pyc,, +dateutil/parser/__pycache__/_parser.cpython-39.pyc,, +dateutil/parser/__pycache__/isoparser.cpython-39.pyc,, +dateutil/parser/_parser.py,sha256=7klDdyicksQB_Xgl-3UAmBwzCYor1AIZqklIcT6dH_8,58796 +dateutil/parser/isoparser.py,sha256=8Fy999bnCd1frSdOYuOraWfJTtd5W7qQ51NwNuH_hXM,13233 +dateutil/relativedelta.py,sha256=IY_mglMjoZbYfrvloTY2ce02aiVjPIkiZfqgNTZRfuA,24903 +dateutil/rrule.py,sha256=KJzKlaCd1jEbu4A38ZltslaoAUh9nSbdbOFdjp70Kew,66557 +dateutil/tz/__init__.py,sha256=F-Mz13v6jYseklQf9Te9J6nzcLDmq47gORa61K35_FA,444 +dateutil/tz/__pycache__/__init__.cpython-39.pyc,, +dateutil/tz/__pycache__/_common.cpython-39.pyc,, +dateutil/tz/__pycache__/_factories.cpython-39.pyc,, +dateutil/tz/__pycache__/tz.cpython-39.pyc,, +dateutil/tz/__pycache__/win.cpython-39.pyc,, +dateutil/tz/_common.py,sha256=cgzDTANsOXvEc86cYF77EsliuSab8Puwpsl5-bX3_S4,12977 +dateutil/tz/_factories.py,sha256=unb6XQNXrPMveksTCU-Ag8jmVZs4SojoPUcAHpWnrvU,2569 +dateutil/tz/tz.py,sha256=EUnEdMfeThXiY6l4sh9yBabZ63_POzy01zSsh9thn1o,62855 +dateutil/tz/win.py,sha256=xJszWgSwE1xPx_HJj4ZkepyukC_hNy016WMcXhbRaB8,12935 +dateutil/tzwin.py,sha256=7Ar4vdQCnnM0mKR3MUjbIKsZrBVfHgdwsJZc_mGYRew,59 +dateutil/utils.py,sha256=dKCchEw8eObi0loGTx91unBxm_7UGlU3v_FjFMdqwYM,1965 +dateutil/zoneinfo/__init__.py,sha256=KYg0pthCMjcp5MXSEiBJn3nMjZeNZav7rlJw5-tz1S4,5889 +dateutil/zoneinfo/__pycache__/__init__.cpython-39.pyc,, +dateutil/zoneinfo/__pycache__/rebuild.cpython-39.pyc,, +dateutil/zoneinfo/dateutil-zoneinfo.tar.gz,sha256=0-pS57bpaN4NiE3xKIGTWW-pW4A9tPkqGCeac5gARHU,156400 +dateutil/zoneinfo/rebuild.py,sha256=MiqYzCIHvNbMH-LdRYLv-4T0EIA7hDKt5GLR0IRTLdI,2392 +python_dateutil-2.9.0.post0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +python_dateutil-2.9.0.post0.dist-info/METADATA,sha256=pGHFOnG-ugFSX5O42DnhMjZPxS1jXrJlq0qbYVZfK1w,8396 +python_dateutil-2.9.0.post0.dist-info/RECORD,, +python_dateutil-2.9.0.post0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +python_dateutil-2.9.0.post0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109 +python_dateutil-2.9.0.post0.dist-info/direct_url.json,sha256=cg4j1rrSOBUrxLV-PpEUzciB2cw3FvdoY7ONQpxQNXk,126 +python_dateutil-2.9.0.post0.dist-info/licenses/LICENSE,sha256=ugD1Gg2SgjtaHN4n2LW50jIeZ-2NqbwWPv-W1eF-V34,2889 +python_dateutil-2.9.0.post0.dist-info/top_level.txt,sha256=4tjdWkhRZvF7LA_BYe_L9gB2w_p2a-z5y6ArjaRkot8,9 +python_dateutil-2.9.0.post0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..5f133dbb5cfac001f2e84cda817210c03ce6484e --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..fac5480d05e7c6680a7b8f02a18fd94c8fce473d --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_python-dateutil_1751104122/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1e65815cf0b3132689485874a93034ede7206bf4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/licenses/LICENSE @@ -0,0 +1,54 @@ +Copyright 2017- Paul Ganssle <paul@ganssle.io> +Copyright 2017- dateutil contributors (see AUTHORS file) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +The above license applies to all contributions after 2017-12-01, as well as +all contributions that have been re-licensed (see AUTHORS file for the list of +contributors who have re-licensed their code). +-------------------------------------------------------------------------------- +dateutil - Extensions to the standard Python datetime module. + +Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net> +Copyright (c) 2012-2014 - Tomi Pieviläinen <tomi.pievilainen@iki.fi> +Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net> +Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io> +Copyright (c) 2015- - dateutil contributors (see AUTHORS file) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The above BSD License Applies to all code, even that also covered by Apache 2.0. \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..66501480ba5b63f98ee9a59c1f99e5e6917da6d9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt @@ -0,0 +1 @@ +dateutil diff --git a/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/micromamba_root/Lib/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe @@ -0,0 +1 @@ + diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..6b258157adb0eea2e637a6f92a7b895899f165db --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/METADATA @@ -0,0 +1,76 @@ +Metadata-Version: 2.4 +Name: pytokens +Version: 0.3.0 +Summary: A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons. +Home-page: https://github.com/tusharsadhwani/pytokens +Author: Tushar Sadhwani +Author-email: tushar.sadhwani000@gmail.com +License: MIT +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Typing :: Typed +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE +Provides-Extra: dev +Requires-Dist: black; extra == "dev" +Requires-Dist: build; extra == "dev" +Requires-Dist: mypy; extra == "dev" +Requires-Dist: pytest; extra == "dev" +Requires-Dist: pytest-cov; extra == "dev" +Requires-Dist: setuptools; extra == "dev" +Requires-Dist: tox; extra == "dev" +Requires-Dist: twine; extra == "dev" +Requires-Dist: wheel; extra == "dev" +Dynamic: license-file + +# pytokens + +A Fast, spec compliant Python 3.14+ tokenizer that runs on older Pythons. + +## Installation + +```bash +pip install pytokens +``` + +## Usage + +```bash +python -m pytokens path/to/file.py +``` + +## Local Development / Testing + +- Create and activate a virtual environment +- Run `pip install -r requirements-dev.txt` to do an editable install +- Run `pytest` to run tests + +## Type Checking + +Run `mypy .` + +## Create and upload a package to PyPI + +Make sure to bump the version in `setup.cfg`. + +Then run the following commands: + +```bash +rm -rf dist +python -m build +``` + +Then upload it to PyPI using [twine](https://twine.readthedocs.io/en/latest/#installation): + +```bash +twine upload dist/* +``` diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..360c8782bd3a517ad92a2e36acd48cbb3d9cc801 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/RECORD @@ -0,0 +1,15 @@ +pytokens-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pytokens-0.3.0.dist-info/METADATA,sha256=S0NOv54f0xbFSFyCd7Unlj0FNABpVVNG39G-JD20LB8,1983 +pytokens-0.3.0.dist-info/RECORD,, +pytokens-0.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pytokens-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91 +pytokens-0.3.0.dist-info/direct_url.json,sha256=QmQn4OYlQEcRJfaJVjdu5NtUd5irymWE-tRR9_eMkdo,119 +pytokens-0.3.0.dist-info/licenses/LICENSE,sha256=lL965OpoM7CFOnzB8fKN2FebNKMcnBYq64gl3sI-1dw,1072 +pytokens-0.3.0.dist-info/top_level.txt,sha256=D7-37XW5Efz3vjguMITLFjDDJPKEhOGJNk7zS4IUcVA,9 +pytokens/__init__.py,sha256=42SyfhW8dZanzrcrJwBj0toUdG0wy0-5UnEatAro1cQ,39498 +pytokens/__main__.py,sha256=zJ2m95fz1-W8wuTFWmr8zleOY9ZUO6J4-lxMk2uneEA,184 +pytokens/__pycache__/__init__.cpython-310.pyc,, +pytokens/__pycache__/__main__.cpython-310.pyc,, +pytokens/__pycache__/cli.cpython-310.pyc,, +pytokens/cli.py,sha256=2W52vjmAj-VTufj5saJ4f4UOh04AYz5M98noqIZsXDw,6174 +pytokens/py.typed,sha256=DtCsIDq6KOv2NOEdQjTbeMWJKRh6ZEL2E-6Mf1RLeMA,59 diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..e7fa31b6f3f78deb1022c1f7927f07d4d16da822 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..baa950b4b19f567fd53ef2c1981873828b8f5b32 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_pytokens_1765201048/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..def1a5ad7e10107456a048eb37339e8fb527d7f7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Tushar Sadhwani + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..8277819e703f63f605a45018d88732f60984a669 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens-0.3.0.dist-info/top_level.txt @@ -0,0 +1 @@ +pytokens diff --git a/micromamba_root/Lib/site-packages/pytokens/__init__.py b/micromamba_root/Lib/site-packages/pytokens/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8ccd99b06db0d0e3f510cb9322a61ed0f1d58c7c --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens/__init__.py @@ -0,0 +1,1165 @@ +"""pytokens - A Fast, spec compliant Python 3.12+ tokenizer that runs on older Pythons.""" + +from __future__ import annotations + +from dataclasses import dataclass, field +import enum +import string +from typing import Iterator, NewType + + +class TokenizeError(Exception): ... + + +class IndentationError(TokenizeError): ... + + +class InconsistentUseOfTabsAndSpaces(IndentationError): ... + + +class DedentDoesNotMatchAnyOuterIndent(IndentationError): ... + + +class UnterminatedString(TokenizeError): ... + + +class UnexpectedEOF(TokenizeError): ... + + +class UnexpectedCharacterAfterBackslash(TokenizeError): ... + + +class NotAnIndent(AssertionError): ... + + +class Underflow(AssertionError): ... + + +class TokenType(enum.IntEnum): + whitespace = 1 + indent = 2 + dedent = 3 + newline = 4 # semantically meaningful newline + nl = 5 # non meaningful newline + comment = 6 + + _op_start = 7 # marker used to check if a token is an operator + semicolon = 8 + lparen = 9 + rparen = 10 + lbracket = 11 + rbracket = 12 + lbrace = 13 + rbrace = 14 + colon = 15 + op = 16 + _op_end = 17 # marker used to check if a token is an operator + + identifier = 18 + number = 19 + string = 20 + fstring_start = 21 + fstring_middle = 22 + fstring_end = 23 + + tstring_start = 24 + tstring_middle = 25 + tstring_end = 26 + + endmarker = 27 + + errortoken = 28 + + def __repr__(self) -> str: + return f"TokenType.{self.name}" + + def to_python_token(self) -> str: + if self.name == "identifier": + return "NAME" + + if self.is_operator(): + return "OP" + + return self.name.upper() + + def is_operator(self) -> bool: + return TokenType._op_start < self < TokenType._op_end + + +@dataclass +class Token: + type: TokenType + # Byte offsets in the file + start_index: int + end_index: int + start_line: int + # 0-indexed offset from start of line + start_col: int + end_line: int + end_col: int + + def to_byte_slice(self, source: str) -> str: + # Newline at end of file may not exist in the file + if ( + (self.type == TokenType.newline or self.type == TokenType.nl) + and self.start_index == len(source) + and self.end_index == len(source) + 1 + ): + return "" + + # Dedents at end of file also may not exist in the file + if ( + self.type == TokenType.dedent + and self.start_index == len(source) + 1 + and self.end_index == len(source) + 1 + ): + return "" + + # Endmarkers are out of bound too + if self.type == TokenType.endmarker: + return "" + + return source[self.start_index : self.end_index] + + +class FStringState: + State = NewType("State", int) + + not_fstring = State(1) + at_fstring_middle = State(2) + at_fstring_lbrace = State(3) + in_fstring_expr = State(4) + in_fstring_expr_modifier = State(5) + at_fstring_end = State(6) + + def __init__(self) -> None: + self.state = FStringState.not_fstring + self.stack: list[FStringState.State] = [] + + def enter_fstring(self) -> None: + self.stack.append(self.state) + self.state = FStringState.at_fstring_middle + + def leave_fstring(self) -> None: + assert self.state == FStringState.at_fstring_end + self.state = self.stack.pop() + + def consume_fstring_middle_for_lbrace(self) -> None: + if self.state == FStringState.in_fstring_expr_modifier: + self.stack.append(self.state) + + self.state = FStringState.at_fstring_lbrace + + def consume_fstring_middle_for_end(self) -> None: + self.state = FStringState.at_fstring_end + + def consume_lbrace(self) -> None: + self.state = FStringState.in_fstring_expr + + def consume_rbrace(self) -> None: + assert ( + self.state == FStringState.in_fstring_expr + or self.state == FStringState.in_fstring_expr_modifier + ) + + if ( + len(self.stack) > 0 + and self.stack[-1] == FStringState.in_fstring_expr_modifier + ): + self.state = self.stack.pop() + else: + self.state = FStringState.at_fstring_middle + + def consume_colon(self) -> None: + assert self.state == FStringState.in_fstring_expr + self.state = FStringState.in_fstring_expr_modifier + + +@dataclass +class TokenIterator: + source: str + issue_128233_handling: bool + + current_index: int = 0 + prev_index: int = 0 + line_number: int = 1 + prev_line_number: int = 1 + byte_offset: int = 0 + prev_byte_offset: int = 0 + all_whitespace_on_this_line: bool = True + + bracket_level: int = 0 + bracket_level_stack: list[int] = field(default_factory=list) + prev_token: Token | None = None + + indent_stack: list[str] = field(default_factory=list) + dedent_counter: int = 0 + + # f-string state + fstring_state: FStringState = field(default_factory=FStringState) + fstring_prefix_quote_stack: list[tuple[str, str]] = field(default_factory=list) + fstring_prefix: str | None = None + fstring_quote: str | None = None + + # CPython has a weird bug where every time a bare \r is + # present, the next token becomes an OP. regardless of what it is. + weird_op_case: bool = False + weird_op_case_nl: bool = False + + weird_whitespace_case: bool = False + + def is_in_bounds(self) -> bool: + return self.current_index < len(self.source) + + def peek(self) -> str: + assert self.is_in_bounds() + return self.source[self.current_index] + + def peek_next(self) -> str: + assert self.current_index + 1 < len(self.source) + return self.source[self.current_index + 1] + + def advance(self) -> None: + self.current_index += 1 + self.byte_offset += 1 + + def advance_by(self, count: int) -> None: + self.current_index += count + self.byte_offset += count + + def next_line(self) -> None: + self.line_number += 1 + self.byte_offset = 0 + self.all_whitespace_on_this_line = True + + def advance_check_newline(self) -> None: + if self.source[self.current_index] == "\n": + self.current_index += 1 + self.next_line() + else: + self.advance() + + def match(self, *options: str, ignore_case: bool = False) -> bool: + for option in options: + if self.current_index + len(option) > len(self.source): + continue + snippet = self.source[self.current_index : self.current_index + len(option)] + if ignore_case: + option = option.lower() + snippet = snippet.lower() + + if option == snippet: + return True + + return False + + def make_token(self, tok_type: TokenType) -> Token: + if self.fstring_prefix is not None and "t" in self.fstring_prefix: + if tok_type == TokenType.fstring_start: + tok_type = TokenType.tstring_start + elif tok_type == TokenType.fstring_middle: + tok_type = TokenType.tstring_middle + elif tok_type == TokenType.fstring_end: + tok_type = TokenType.tstring_end + + token_type = ( + TokenType.op + if self.weird_op_case + and not tok_type.is_operator() + and tok_type not in (TokenType.number, TokenType.string) + else tok_type + ) + if self.weird_op_case: + # And we have another weird case INSIDE the weird case. + # For some reason when CPython accidentally captures a space + # as the next character, i.e. when the token is '\r ', + # It DOESN't see it as whitespace, so in that specific case, + # we shouldn't set all_whitespace_on_this_line. + # I think this is because CPython never expecte to have a + # ' ' token in it anyway so it doesn't classify it as + # whitespace. So it becomes non-whitespace. + # Removing this if stmt breaks test 1001 right now. + token_str = self.source[self.prev_index : self.current_index] + if token_str == "\r ": + self.all_whitespace_on_this_line = False + self.weird_op_case = False + + token = Token( + type=token_type, + start_index=self.prev_index, + end_index=self.current_index, + start_line=self.prev_line_number, + start_col=self.prev_byte_offset, + end_line=self.line_number, + end_col=self.byte_offset, + ) + if tok_type == TokenType.newline or tok_type == TokenType.nl: + self.next_line() + elif tok_type == TokenType.whitespace or tok_type == TokenType.comment: + pass + else: + self.all_whitespace_on_this_line = False + + self.prev_token = token + self.prev_index = self.current_index + self.prev_line_number = self.line_number + self.prev_byte_offset = self.byte_offset + self.weird_op_case = False + + return token + + def push_fstring_prefix_quote(self, prefix: str, quote: str) -> None: + if self.fstring_prefix is not None: + assert self.fstring_quote is not None + self.fstring_prefix_quote_stack.append( + (self.fstring_prefix, self.fstring_quote) + ) + + self.fstring_prefix = prefix + self.fstring_quote = quote + + def pop_fstring_quote(self) -> None: + if self.fstring_prefix is None: + assert self.fstring_quote is None + raise Underflow + + self.fstring_prefix, self.fstring_quote = ( + (None, None) + if len(self.fstring_prefix_quote_stack) == 0 + else self.fstring_prefix_quote_stack.pop() + ) + + def newline(self) -> Token: + if self.is_in_bounds() and self.source[self.current_index] == "\r": + self.advance() + self.advance() + token_type = ( + TokenType.nl + if ( + self.weird_op_case_nl + or self.bracket_level > 0 + or self.fstring_state.state == FStringState.in_fstring_expr + or self.all_whitespace_on_this_line + ) + else TokenType.newline + ) + token = self.make_token(token_type) + self.weird_op_case_nl = False + return token + + def endmarker(self) -> Token: + if self.bracket_level != 0: + raise UnexpectedEOF + + if len(self.indent_stack) > 0: + _ = self.indent_stack.pop() + return self.make_token(TokenType.dedent) + + return self.make_token(TokenType.endmarker) + + def decimal(self) -> Token: + digit_before_decimal = False + if self.source[self.current_index].isdigit(): + digit_before_decimal = True + self.advance() + + # TODO: this is too lax; 1__2 tokenizes successfully + while self.is_in_bounds() and ( + self.source[self.current_index].isdigit() + or self.source[self.current_index] == "_" + ): + self.advance() + + if self.is_in_bounds() and self.source[self.current_index] == ".": + self.advance() + + while self.is_in_bounds() and ( + self.source[self.current_index].isdigit() + or ( + self.source[self.current_index] == "_" + and self.source[self.current_index - 1].isdigit() + ) + ): + self.advance() + # Before advancing over the 'e', ensure that there has been at least 1 digit before the 'e' + if self.current_index + 1 < len(self.source) and ( + (digit_before_decimal or self.source[self.current_index - 1].isdigit()) + and ( + self.source[self.current_index] == "e" + or self.source[self.current_index] == "E" + ) + and ( + self.source[self.current_index + 1].isdigit() + or ( + self.current_index + 2 < len(self.source) + and ( + self.source[self.current_index + 1] == "+" + or self.source[self.current_index + 1] == "-" + ) + and self.source[self.current_index + 2].isdigit() + ) + ) + ): + self.advance() + self.advance() + # optional third advance not necessary as itll get advanced just below + + # TODO: this is too lax; 1__2 tokenizes successfully + while self.is_in_bounds() and ( + self.source[self.current_index].isdigit() + or ( + (digit_before_decimal or self.source[self.current_index - 1].isdigit()) + and self.source[self.current_index] == "_" + ) + ): + self.advance() + + # Complex numbers end in a `j`. But ensure at least 1 digit before it + if self.is_in_bounds() and ( + (digit_before_decimal or self.source[self.current_index - 1].isdigit()) + and ( + self.source[self.current_index] == "j" + or self.source[self.current_index] == "J" + ) + ): + self.advance() + # If all of this resulted in just a dot, return an operator + if ( + self.current_index - self.prev_index == 1 + and self.source[self.current_index - 1] == "." + ): + # Ellipsis check + if ( + self.current_index + 2 <= len(self.source) + and self.source[self.current_index : self.current_index + 2] == ".." + ): + self.advance() + self.advance() + + return self.make_token(TokenType.op) + + return self.make_token(TokenType.number) + + def binary(self) -> Token: + # jump over `0b` + self.advance() + self.advance() + while self.is_in_bounds() and ( + self.source[self.current_index] == "0" + or self.source[self.current_index] == "1" + or self.source[self.current_index] == "_" + ): + self.advance() + if self.is_in_bounds() and ( + self.source[self.current_index] == "e" + or self.source[self.current_index] == "E" + ): + self.advance() + if self.is_in_bounds() and self.source[self.current_index] == "-": + self.advance() + + while self.is_in_bounds() and ( + self.source[self.current_index] == "0" + or self.source[self.current_index] == "1" + or self.source[self.current_index] == "_" + ): + self.advance() + return self.make_token(TokenType.number) + + def octal(self) -> Token: + # jump over `0o` + self.advance() + self.advance() + while self.is_in_bounds() and ( + self.source[self.current_index] >= "0" + and self.source[self.current_index] <= "7" + or self.source[self.current_index] == "_" + ): + self.advance() + if self.is_in_bounds() and ( + self.source[self.current_index] == "e" + or self.source[self.current_index] == "E" + ): + self.advance() + if self.is_in_bounds() and self.source[self.current_index] == "-": + self.advance() + + while self.is_in_bounds() and ( + self.source[self.current_index] >= "0" + and self.source[self.current_index] <= "7" + or self.source[self.current_index] == "_" + ): + self.advance() + return self.make_token(TokenType.number) + + def hexadecimal(self) -> Token: + # jump over `0x` + self.advance() + self.advance() + while self.is_in_bounds() and ( + self.source[self.current_index] in string.hexdigits + or self.source[self.current_index] == "_" + ): + self.advance() + if self.is_in_bounds() and ( + self.source[self.current_index] == "e" + or self.source[self.current_index] == "E" + ): + self.advance() + if self.is_in_bounds() and self.source[self.current_index] == "-": + self.advance() + + while self.is_in_bounds() and ( + self.source[self.current_index] in string.hexdigits + or self.source[self.current_index] == "_" + ): + self.advance() + return self.make_token(TokenType.number) + + def find_opening_quote(self) -> int: + # Quotes should always be within 3 chars of the beginning of the string token + for offset in range(3): + char = self.source[self.current_index + offset] + if char == '"' or char == "'": + return self.current_index + offset + + raise AssertionError("Quote not found somehow") + + def string_prefix_and_quotes(self) -> tuple[str, str]: + quote_index = self.find_opening_quote() + prefix = self.source[self.current_index : quote_index] + quote_char = self.source[quote_index] + + # Check for triple quotes + quote = ( + self.source[quote_index : quote_index + 3] + if ( + quote_index + 3 <= len(self.source) + and self.source[quote_index + 1] == quote_char + and self.source[quote_index + 2] == quote_char + ) + else self.source[quote_index : quote_index + 1] + ) + return prefix, quote + + def fstring(self) -> Token: + if self.fstring_state.state in ( + FStringState.not_fstring, + FStringState.in_fstring_expr, + ): + prefix, quote = self.string_prefix_and_quotes() + + self.push_fstring_prefix_quote(prefix, quote) + for _ in range(len(prefix)): + self.advance() + for _ in range(len(quote)): + self.advance() + self.fstring_state.enter_fstring() + return self.make_token(TokenType.fstring_start) + + if self.fstring_state.state == FStringState.at_fstring_middle: + assert self.fstring_quote is not None + is_single_quote = len(self.fstring_quote) == 1 + start_index = self.current_index + while self.is_in_bounds(): + char = self.source[self.current_index] + # For single quotes, bail on newlines + if char == "\n" and is_single_quote: + raise UnterminatedString + + # Handle escapes + if char == "\\": + self.advance() + # But don't escape a `\{` or `\}` in f-strings + # but DO escape `\N{` in f-strings, that's for unicode characters + # but DON'T escape `\N{` in raw f-strings. + assert self.fstring_prefix is not None + if ( + "r" not in self.fstring_prefix.lower() + and self.current_index + 1 < len(self.source) + and self.peek() == "N" + and self.peek_next() == "{" + ): + self.advance() + self.advance() + + if self.is_in_bounds() and not ( + self.peek() == "{" or self.peek() == "}" + ): + self.advance_check_newline() + + continue + + # Find opening / closing quote + if char == "{": + if self.peek_next() == "{": + self.advance() + self.advance() + continue + else: + self.fstring_state.consume_fstring_middle_for_lbrace() + # If fstring-middle is empty, skip it by returning the next step token + if self.current_index == start_index: + return self.fstring() + + return self.make_token(TokenType.fstring_middle) + + assert self.fstring_quote is not None + if self.match(self.fstring_quote): + self.fstring_state.consume_fstring_middle_for_end() + # If fstring-middle is empty, skip it by returning the next step token + if self.current_index == start_index: + return self.fstring() + + return self.make_token(TokenType.fstring_middle) + + self.advance_check_newline() + + raise UnexpectedEOF + + if self.fstring_state.state == FStringState.at_fstring_lbrace: + self.advance() + self.bracket_level_stack.append(self.bracket_level) + self.bracket_level = 0 + self.fstring_state.consume_lbrace() + return self.make_token(TokenType.lbrace) + + if self.fstring_state.state == FStringState.at_fstring_end: + assert self.fstring_quote is not None + for _ in range(len(self.fstring_quote)): + self.advance() + token = self.make_token(TokenType.fstring_end) + self.pop_fstring_quote() + self.fstring_state.leave_fstring() + return token + + if self.fstring_state.state == FStringState.in_fstring_expr_modifier: + start_index = self.current_index + while self.is_in_bounds(): + char = self.source[self.current_index] + assert self.fstring_quote is not None + if (char == "\n" or char == "{") and len(self.fstring_quote) == 1: + if char == "{": + self.fstring_state.consume_fstring_middle_for_lbrace() + else: + # TODO: why? + self.fstring_state.state = FStringState.in_fstring_expr + + # If fstring-middle is empty, skip it by returning the next step token + if self.current_index == start_index: + return self.fstring() + + return self.make_token(TokenType.fstring_middle) + elif char == "}": + self.fstring_state.state = FStringState.in_fstring_expr + return self.make_token(TokenType.fstring_middle) + + self.advance_check_newline() + + raise UnexpectedEOF + + raise AssertionError("Unhandled f-string state") + + def string(self) -> Token: + prefix, quote = self.string_prefix_and_quotes() + if prefix and self.weird_op_case: + self.advance() + return self.make_token(tok_type=TokenType.op) + + for char in prefix: + if char in ("f", "F", "t", "T"): + return self.fstring() + + for _ in range(len(prefix)): + self.advance() + for _ in range(len(quote)): + self.advance() + + is_single_quote = len(quote) == 1 + + while self.is_in_bounds(): + char = self.source[self.current_index] + # For single quotes, bail on newlines + if char == "\n" and is_single_quote: + raise UnterminatedString + + # Handle escapes + if char == "\\": + self.advance() + self.advance_check_newline() + continue + + # Find closing quote + if self.match(quote): + for _ in range(len(quote)): + self.advance() + return self.make_token(TokenType.string) + + self.advance_check_newline() + + raise UnexpectedEOF + + def indent(self) -> Token: + start_index = self.current_index + saw_whitespace = False + saw_tab_or_space = False + while self.is_in_bounds(): + char = self.source[self.current_index] + if self.is_whitespace(): + self.advance() + saw_whitespace = True + if char == " " or char == "\t": + saw_tab_or_space = True + else: + break + + if not self.is_in_bounds(): + # File ends with no whitespace after newline, don't return indent + if self.current_index == start_index: + raise NotAnIndent + # If reached the end of the file, don't return an indent + return self.make_token(TokenType.whitespace) + + # If the line is preceded by just linefeeds/CR/etc., + # treat it as whitespace. + if saw_whitespace and not saw_tab_or_space: + self.weird_whitespace_case = True + return self.make_token(TokenType.whitespace) + + # For lines that are just leading whitespace and a slash or a comment, + # don't return indents + next_char = self.peek() + if next_char == "#" or next_char == "\\" or self.is_newline(): + return self.make_token(TokenType.whitespace) + + new_indent = self.source[start_index : self.current_index] + current_indent = "" if len(self.indent_stack) == 0 else self.indent_stack[-1] + + if len(new_indent) == len(current_indent): + if len(new_indent) == 0: + raise NotAnIndent + + if new_indent != current_indent: + raise InconsistentUseOfTabsAndSpaces + return self.make_token(TokenType.whitespace) + elif len(new_indent) > len(current_indent): + if len(current_indent) > 0 and current_indent not in new_indent: + raise InconsistentUseOfTabsAndSpaces + self.indent_stack.append(new_indent) + return self.make_token(TokenType.indent) + else: + while len(self.indent_stack) > 0: + top_indent = self.indent_stack[-1] + if len(top_indent) < len(new_indent): + raise DedentDoesNotMatchAnyOuterIndent + + if len(top_indent) == len(new_indent): + break + + _ = self.indent_stack.pop() + self.dedent_counter += 1 + + # Let the dedent counter make the dedents. They must be length zero + return self.make_token(TokenType.whitespace) + + def is_whitespace(self) -> bool: + if self.is_newline(): + return False + + char = self.source[self.current_index] + return ( + char == " " + or char == "\r" + or char == "\t" + or char == "\x0b" + or char == "\x0c" + ) + + def is_newline(self) -> bool: + if self.source[self.current_index] == "\n": + return True + if ( + self.source[self.current_index] == "\r" + and self.current_index + 1 < len(self.source) + and self.source[self.current_index + 1] == "\n" + ): + return True + + return False + + def name(self) -> Token: + if self.weird_op_case: + self.advance() + return self.make_token(TokenType.identifier) + + # According to PEP 3131, any non-ascii character is valid in a NAME token. + # But if we see any non-identifier ASCII character we should stop. + remaining = self.source[self.current_index :] + for index, char in enumerate(remaining): + if ord(char) < 128 and not str.isalnum(char) and char != "_": + length = index + break + else: + length = len(remaining) + + self.advance_by(length) + return self.make_token(TokenType.identifier) + + def __iter__(self) -> TokenIterator: + return self + + def __next__(self) -> Token: + if self.prev_token is not None and self.prev_token.type == TokenType.endmarker: + raise StopIteration + + # EOF checks + if self.current_index == len(self.source): + if self.prev_token is None: + return self.endmarker() + + if self.prev_token.type in { + TokenType.newline, + TokenType.nl, + TokenType.dedent, + }: + return self.endmarker() + else: + return self.newline() + + if self.current_index > len(self.source): + return self.endmarker() + + # f-string check + if ( + self.fstring_state.state != FStringState.not_fstring + and self.fstring_state.state != FStringState.in_fstring_expr + ): + return self.fstring() + + current_char = self.source[self.current_index] + + # \r on its own, in certain cases it gets merged with the next char. + # It's probably a bug: https://github.com/python/cpython/issues/128233 + # 'issue_128233_handling=True' works around this bug, but if it's False + # then we produce identical tokens to CPython. + if not self.issue_128233_handling and current_char == "\r": + self.advance() + if not self.is_in_bounds(): + return self.newline() + + current_char = self.source[self.current_index] + if current_char != "\n": + self.weird_op_case = True + if ( + self.prev_token is not None + and self.prev_token.type == TokenType.comment + ): + self.weird_op_case_nl = True + + # Comment check + if current_char == "#": + if self.weird_op_case: + self.advance() + return self.make_token(TokenType.comment) + + while self.is_in_bounds() and not self.is_newline(): + if ( + not self.issue_128233_handling + and self.source[self.current_index] == "\r" + ): + break + self.advance() + return self.make_token(TokenType.comment) + + # Empty the dedent counter + if self.dedent_counter > 0: + self.dedent_counter -= 1 + return self.make_token(TokenType.dedent) + + # Newline check + if self.is_newline(): + return self.newline() + + # \<newline> check + if current_char == "\\": + self.advance() + if not self.is_in_bounds(): + raise UnexpectedEOF + + # Consume all whitespace on this line and the next. + found_whitespace = False + seen_newline = False + while self.is_in_bounds(): + if self.is_whitespace(): + self.advance() + found_whitespace = True + elif not seen_newline and (self.is_newline()): + char = self.source[self.current_index] + if char == "\r": + self.advance() + self.advance() + found_whitespace = True + seen_newline = True + # Move to next line without creating a newline token. But, + # if the previous line was all whitespace, whitespace on + # the next line is still valid indentation. Avoid consuming + if self.all_whitespace_on_this_line: + self.next_line() + break + else: + self.next_line() + # Preserve this boolean, we're on the same line semantically + self.all_whitespace_on_this_line = False + + else: + break + + if not found_whitespace: + raise UnexpectedCharacterAfterBackslash + + return self.make_token(TokenType.whitespace) + + # Indent / dedent checks + if ( + (self.byte_offset == 0 or self.weird_whitespace_case) + and self.bracket_level == 0 + and self.fstring_state.state == FStringState.not_fstring + ): + self.weird_whitespace_case = False + try: + indent_token = self.indent() + except NotAnIndent: + indent_token = None + + if indent_token is not None: + return indent_token + + if self.is_whitespace(): + while self.is_in_bounds() and self.is_whitespace(): + self.advance() + return self.make_token(TokenType.whitespace) + + if current_char in ("+", "&", "|", "^", "@", "%", "=", "!", "~"): + self.advance() + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char == "<": + self.advance() + if self.peek() == ">": + # Barry as FLUFL easter egg + self.advance() + return self.make_token(TokenType.op) + + if self.peek() == "<": + self.advance() + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char == ">": + self.advance() + if self.peek() == ">": + self.advance() + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char == "/": + self.advance() + if self.peek() == "/": + self.advance() + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char == "*": + self.advance() + if self.peek() == "*": + self.advance() + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char == "-": + self.advance() + # -> operator + if self.peek() == ">": + self.advance() + return self.make_token(TokenType.op) + + # -= operator + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char in (",", ";"): + self.advance() + return self.make_token(TokenType.op) + + # This guy is not used in Python3, but still exists + # for backwards compatibility i guess. + if current_char == "`": + self.advance() + return self.make_token(TokenType.op) + + if current_char == "(": + self.advance() + self.bracket_level += 1 + return self.make_token(TokenType.lparen) + + if current_char == ")": + self.advance() + self.bracket_level -= 1 + if self.bracket_level < 0: + self.bracket_level = 0 + return self.make_token(TokenType.rparen) + + if current_char == "[": + self.advance() + self.bracket_level += 1 + return self.make_token(TokenType.lbracket) + + if current_char == "]": + self.advance() + self.bracket_level -= 1 + if self.bracket_level < 0: + self.bracket_level = 0 + return self.make_token(TokenType.rbracket) + + if current_char == "{": + self.advance() + self.bracket_level += 1 + return self.make_token(TokenType.lbrace) + + if current_char == "}": + self.advance() + if ( + self.bracket_level == 0 + and self.fstring_state.state == FStringState.in_fstring_expr + ): + self.fstring_state.consume_rbrace() + self.bracket_level = self.bracket_level_stack.pop() + else: + self.bracket_level -= 1 + if self.bracket_level < 0: + self.bracket_level = 0 + + return self.make_token(TokenType.rbrace) + + if current_char == ":": + self.advance() + if ( + self.bracket_level == 0 + and self.fstring_state.state == FStringState.in_fstring_expr + ): + self.fstring_state.state = FStringState.in_fstring_expr_modifier + return self.make_token(TokenType.op) + else: + if self.peek() == "=": + self.advance() + return self.make_token(TokenType.op) + + if current_char in ".0123456789": + if self.current_index + 2 <= len(self.source) and self.source[ + self.current_index : self.current_index + 2 + ] in ("0b", "0B"): + return self.binary() + elif self.current_index + 2 <= len(self.source) and self.source[ + self.current_index : self.current_index + 2 + ] in ("0o", "0O"): + return self.octal() + elif self.current_index + 2 <= len(self.source) and self.source[ + self.current_index : self.current_index + 2 + ] in ("0x", "0X"): + return self.hexadecimal() + else: + return self.decimal() + + if ( + (self.current_index + 1 <= len(self.source) and self.match('"', "'")) + or ( + self.current_index + 2 <= len(self.source) + and self.match( + 'b"', + "b'", + 'r"', + "r'", + 'f"', + "f'", + 'u"', + "u'", + "t'", + 't"', + ignore_case=True, + ) + ) + or ( + self.current_index + 3 <= len(self.source) + and self.match( + 'br"', + "br'", + 'rb"', + "rb'", + 'fr"', + "fr'", + 'rf"', + "rf'", + "tr'", + 'tr"', + "rt'", + 'rt"', + ignore_case=True, + ) + ) + ): + return self.string() + + return self.name() + + +def tokenize( + source: str, + *, + fstring_tokens: bool = True, + issue_128233_handling: bool = True, +) -> Iterator[Token]: + token_iterator = TokenIterator(source, issue_128233_handling=issue_128233_handling) + if fstring_tokens: + return iter(token_iterator) + + return merge_fstring_tokens(token_iterator) + + +def merge_fstring_tokens(token_iterator: TokenIterator) -> Iterator[Token]: + """Turn post-Python-3.12 FSTRING-* tokens back to a single STRING token.""" + for token in token_iterator: + if token.type not in (TokenType.fstring_start, TokenType.tstring_start): + yield token + continue + + start_token = token + end_token = token + + fstring_starts = 1 + fstring_ends = 0 + for token in token_iterator: + if token.type in (TokenType.fstring_start, TokenType.tstring_start): + fstring_starts += 1 + if token.type in (TokenType.fstring_end, TokenType.tstring_end): + fstring_ends += 1 + + if fstring_starts == fstring_ends: + end_token = token + break + + yield Token( + type=TokenType.string, + start_index=start_token.start_index, + start_line=start_token.start_line, + start_col=start_token.start_col, + end_index=end_token.end_index, + end_line=end_token.end_line, + end_col=end_token.end_col, + ) diff --git a/micromamba_root/Lib/site-packages/pytokens/__main__.py b/micromamba_root/Lib/site-packages/pytokens/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ae31dc4d281ae51e5f5ac6995f607c86d9c3f91 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens/__main__.py @@ -0,0 +1,7 @@ +"""Support executing the CLI by doing `python -m pytokens`.""" +from __future__ import annotations + +from pytokens.cli import cli + +if __name__ == "__main__": + raise SystemExit(cli()) diff --git a/micromamba_root/Lib/site-packages/pytokens/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/pytokens/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6748415841ffc35466751a95b86161835066cde5 Binary files /dev/null and b/micromamba_root/Lib/site-packages/pytokens/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pytokens/__pycache__/__main__.cpython-314.pyc b/micromamba_root/Lib/site-packages/pytokens/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fddb3ad381e890f7d3b80a8447af79d58f6c1c7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/pytokens/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pytokens/__pycache__/cli.cpython-314.pyc b/micromamba_root/Lib/site-packages/pytokens/__pycache__/cli.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ffd9670fc3d2d9354a0c24707a692ec257636c2 Binary files /dev/null and b/micromamba_root/Lib/site-packages/pytokens/__pycache__/cli.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/pytokens/cli.py b/micromamba_root/Lib/site-packages/pytokens/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..752e5c701949a292d6b3427100112a106652f29b --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens/cli.py @@ -0,0 +1,192 @@ +"""CLI interface for pytokens.""" + +from __future__ import annotations + +import argparse +import io +import os.path +import tokenize +from typing import Iterable, NamedTuple +import warnings + +import pytokens + + +class CLIArgs: + filepath: str + validate: bool + issue_128233_handling: bool + + +def cli(argv: list[str] | None = None) -> int: + """CLI interface.""" + parser = argparse.ArgumentParser() + parser.add_argument("filepath") + parser.add_argument( + "--no-128233-handling", + dest="issue_128233_handling", + action="store_false", + ) + parser.add_argument("--validate", action="store_true") + args = parser.parse_args(argv, namespace=CLIArgs()) + + if os.path.isdir(args.filepath): + files = find_all_python_files(args.filepath) + verbose = False + else: + files = [args.filepath] + verbose = True + + for filepath in sorted(files): + with open(filepath, "rb") as file: + try: + encoding, read_bytes = tokenize.detect_encoding(file.readline) + except SyntaxError: + if args.validate: + # Broken `# coding` comment, tokenizer bails, skip file + print("\033[1;33mS\033[0m", end="", flush=True) + continue + + raise + + source = b"".join(read_bytes) + file.read() + + if args.validate: + validate( + filepath, + source, + encoding, + verbose=verbose, + issue_128233_handling=args.issue_128233_handling, + ) + + else: + source_str = source.decode(encoding) + for token in pytokens.tokenize( + source_str, + issue_128233_handling=args.issue_128233_handling, + ): + token_source = source_str[token.start_index : token.end_index] + print(repr(token_source), token) + + return 0 + + +class TokenTuple(NamedTuple): + type: str + start: tuple[int, int] + end: tuple[int, int] + + +def validate( + filepath: str, + source: bytes, + encoding: str, + *, + issue_128233_handling: bool, + verbose: bool = True, +) -> None: + """Validate the source code.""" + warnings.simplefilter("ignore") + + # Ensure all line endings have newline as a valid index + if len(source) == 0 or source[-1:] != b"\n": + source = source + b"\n" + + # Same as .splitlines(keepends=True), but doesn't split on linefeeds i.e. \x0c + sourcelines = [line + b"\n" for line in source.split(b"\n")] + # For that last newline token that exists on an imaginary line sometimes + sourcelines.append(b"\n") + + source_file = io.BytesIO(source) + builtin_tokens = tokenize.tokenize(source_file.readline) + # drop the encoding token + next(builtin_tokens) + + try: + expected_tokens_unprocessed = [ + TokenTuple(tokenize.tok_name[token.type], token.start, token.end) + for token in builtin_tokens + ] + except tokenize.TokenError: + print("\033[1;33mS\033[0m", end="", flush=True) + return + + expected_tokens = [expected_tokens_unprocessed[0]] + for index, token in enumerate(expected_tokens_unprocessed[1:], start=1): + last_token = expected_tokens[-1] + + current_token = token + # Merge consecutive FSTRING_MIDDLE tokens. it's weird cpython has it like that. + if current_token.type == last_token.type == "FSTRING_MIDDLE": + expected_tokens.pop() + current_token = TokenTuple( + current_token.type, + last_token.start, + current_token.end, + ) + + if index + 1 < len(expected_tokens_unprocessed): + # When an FSTRING_MIDDLE ends with a `{{{` like f'x{{{1}', Python eats + # the last { char as well as its end index, so we get a `x{` token + # instead of the expected `x{{` token. This fixes that case. Pretty + # much always there should be no gap between an fstring-middle ending + # and the { op after it. + # Same deal for `}}}"` + next_token = expected_tokens_unprocessed[index + 1] + if ( + (current_token.type == "FSTRING_MIDDLE" and next_token.type == "OP") + or ( + current_token.type == "FSTRING_MIDDLE" + and next_token.type == "FSTRING_END" + ) + and next_token.start[0] == current_token.end[0] + and next_token.start[1] > current_token.end[1] + ): + expected_tokens.append( + TokenTuple( + current_token.type, + current_token.start, + next_token.start, + ) + ) + continue + + expected_tokens.append(current_token) + + source_string = source.decode(encoding) + our_tokens = ( + TokenTuple( + token.type.to_python_token(), + (token.start_line, token.start_col), + (token.end_line, token.end_col), + ) + for token in pytokens.tokenize( + source_string, issue_128233_handling=issue_128233_handling + ) + if token.type != pytokens.TokenType.whitespace + ) + + for builtin_token, our_token in zip(expected_tokens, our_tokens, strict=True): + mismatch = builtin_token != our_token + if mismatch or verbose: + print("EXPECTED", builtin_token) + print("---- GOT", our_token) + + if mismatch: + print("Filepath:", filepath) + print("\033[1;31mF\033[0m", end="", flush=True) + # raise AssertionError("Tokens do not match") + return + + print("\033[1;32m.\033[0m", end="", flush=True) + + +def find_all_python_files(directory: str) -> Iterable[str]: + """Recursively find all Python files in the given directory.""" + python_files = set() + for root, _, files in os.walk(directory, followlinks=False): + for file in files: + if file.endswith(".py"): + python_files.add(os.path.join(root, file)) + return python_files diff --git a/micromamba_root/Lib/site-packages/pytokens/py.typed b/micromamba_root/Lib/site-packages/pytokens/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..d3245e747a8bc085800a555ac3ea9f4ccdafbe4b --- /dev/null +++ b/micromamba_root/Lib/site-packages/pytokens/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. This package uses inline types. diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/METADATA b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..702ee6da5865b50b297705b077ea7d5904fead58 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/METADATA @@ -0,0 +1,59 @@ +Metadata-Version: 2.4 +Name: PyYAML +Version: 6.0.3 +Summary: YAML parser and emitter for Python +Home-page: https://pyyaml.org/ +Download-URL: https://pypi.org/project/PyYAML/ +Author: Kirill Simonov +Author-email: xi@resolvent.net +License: MIT +Project-URL: Bug Tracker, https://github.com/yaml/pyyaml/issues +Project-URL: CI, https://github.com/yaml/pyyaml/actions +Project-URL: Documentation, https://pyyaml.org/wiki/PyYAMLDocumentation +Project-URL: Mailing lists, http://lists.sourceforge.net/lists/listinfo/yaml-core +Project-URL: Source Code, https://github.com/yaml/pyyaml +Platform: Any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Cython +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing :: Markup +Requires-Python: >=3.8 +License-File: LICENSE +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: download-url +Dynamic: home-page +Dynamic: license +Dynamic: license-file +Dynamic: platform +Dynamic: project-url +Dynamic: requires-python +Dynamic: summary + +YAML is a data serialization format designed for human readability +and interaction with scripting languages. PyYAML is a YAML parser +and emitter for Python. + +PyYAML features a complete YAML 1.1 parser, Unicode support, pickle +support, capable extension API, and sensible error messages. PyYAML +supports standard YAML tags and provides Python-specific tags that +allow to represent an arbitrary Python object. + +PyYAML is applicable for a broad range of tasks from complex +configuration files to object serialization and persistence. diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/RECORD b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..8785c6a18172357a896f0f4a8125d230d2062d0d --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/RECORD @@ -0,0 +1,44 @@ +_yaml/__init__.py,sha256=04Ae_5osxahpJHa3XBZUAf4wi6XX32gR8D6X6p64GEA,1402 +_yaml/__pycache__/__init__.cpython-310.pyc,, +pyyaml-6.0.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyyaml-6.0.3.dist-info/METADATA,sha256=A8O0Fe040J-u3Ek2DpMHabQMWPaFhebeAOLkkWqFjTQ,2351 +pyyaml-6.0.3.dist-info/RECORD,, +pyyaml-6.0.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyyaml-6.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92 +pyyaml-6.0.3.dist-info/direct_url.json,sha256=pCU11bRS51MdE7arMXyB-eqDpNJvUTh5UGMWtKHxUVg,102 +pyyaml-6.0.3.dist-info/licenses/LICENSE,sha256=jTko-dxEkP1jVwfLiOsmvXZBAqcoKVQwfT5RZ6V36KQ,1101 +pyyaml-6.0.3.dist-info/top_level.txt,sha256=rpj0IVMTisAjh_1vG3Ccf9v5jpCQwAz6cD1IVU5ZdhQ,11 +yaml/__init__.py,sha256=sZ38wzPWp139cwc5ARZFByUvJxtB07X32FUQAzoFR6c,12311 +yaml/__pycache__/__init__.cpython-310.pyc,, +yaml/__pycache__/composer.cpython-310.pyc,, +yaml/__pycache__/constructor.cpython-310.pyc,, +yaml/__pycache__/cyaml.cpython-310.pyc,, +yaml/__pycache__/dumper.cpython-310.pyc,, +yaml/__pycache__/emitter.cpython-310.pyc,, +yaml/__pycache__/error.cpython-310.pyc,, +yaml/__pycache__/events.cpython-310.pyc,, +yaml/__pycache__/loader.cpython-310.pyc,, +yaml/__pycache__/nodes.cpython-310.pyc,, +yaml/__pycache__/parser.cpython-310.pyc,, +yaml/__pycache__/reader.cpython-310.pyc,, +yaml/__pycache__/representer.cpython-310.pyc,, +yaml/__pycache__/resolver.cpython-310.pyc,, +yaml/__pycache__/scanner.cpython-310.pyc,, +yaml/__pycache__/serializer.cpython-310.pyc,, +yaml/__pycache__/tokens.cpython-310.pyc,, +yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883 +yaml/constructor.py,sha256=kNgkfaeLUkwQYY_Q6Ff1Tz2XVw_pG1xVE9Ak7z-viLA,28639 +yaml/cyaml.py,sha256=6ZrAG9fAYvdVe2FK_w0hmXoG7ZYsoYUwapG8CiC72H0,3851 +yaml/dumper.py,sha256=PLctZlYwZLp7XmeUdwRuv4nYOZ2UBnDIUy8-lKfLF-o,2837 +yaml/emitter.py,sha256=jghtaU7eFwg31bG0B7RZea_29Adi9CKmXq_QjgQpCkQ,43006 +yaml/error.py,sha256=Ah9z-toHJUbE9j-M8YpxgSRM5CgLCcwVzJgLLRF2Fxo,2533 +yaml/events.py,sha256=50_TksgQiE4up-lKo_V-nBy-tAIxkIPQxY5qDhKCeHw,2445 +yaml/loader.py,sha256=UVa-zIqmkFSCIYq_PgSGm4NSJttHY2Rf_zQ4_b1fHN0,2061 +yaml/nodes.py,sha256=gPKNj8pKCdh2d4gr3gIYINnPOaOxGhJAUiYhGRnPE84,1440 +yaml/parser.py,sha256=ilWp5vvgoHFGzvOZDItFoGjD6D42nhlZrZyjAwa0oJo,25495 +yaml/reader.py,sha256=0dmzirOiDG4Xo41RnuQS7K9rkY3xjHiVasfDMNTqCNw,6794 +yaml/representer.py,sha256=IuWP-cAW9sHKEnS0gCqSa894k1Bg4cgTxaDwIcbRQ-Y,14190 +yaml/resolver.py,sha256=9L-VYfm4mWHxUD1Vg4X7rjDRK_7VZd6b92wzq7Y2IKY,9004 +yaml/scanner.py,sha256=YEM3iLZSaQwXcQRg2l2R4MdT0zGP2F9eHkKGKnHyWQY,51279 +yaml/serializer.py,sha256=ChuFgmhU01hj4xgI8GaKv6vfM2Bujwa9i7d2FAHj7cA,4165 +yaml/tokens.py,sha256=lTQIzSVw8Mg9wv459-TjiOQe6wVziqaRlqX2_89rp54,2573 diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..0885d055554a9bce53952482316a33cebf0845e4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.10.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..d5c560b6c6ec3bbe18856002ee218b30e159c1dc --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/pyyaml_1770223233952/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..2f1b8e15e5627d92f0521605c9870bc8e5505cb4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017-2021 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..e6475e911f628412049bc4090d86f23ac403adde --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml-6.0.3.dist-info/top_level.txt @@ -0,0 +1,2 @@ +_yaml +yaml diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/METADATA b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..d816342453878e64a28929f274367e0483236aa9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/METADATA @@ -0,0 +1,172 @@ +Metadata-Version: 2.4 +Name: pyyaml_env_tag +Version: 1.1 +Summary: A custom YAML tag for referencing environment variables in YAML files. +Author-email: Waylan Limberg <waylan.limberg@icloud.com> +License-Expression: MIT +Project-URL: Homepage, https://github.com/waylan/pyyaml-env-tag +Project-URL: Repository, https://github.com/waylan/pyyaml-env-tag +Project-URL: Bug Tracker, https://github.com/waylan/pyyaml-env-tag/issues +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing :: Markup +Requires-Python: >=3.9 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: pyyaml +Dynamic: license-file + +# pyyaml_env_tag + +A custom YAML tag for referencing environment variables in YAML files. + +[![PyPI Version][pypi-image]][pypi-link] +[![Build Status][GHAction-image]][GHAction-link] +[![Coverage Status][codecov-image]][codecov-link] + +[pypi-image]: https://img.shields.io/pypi/v/pyyaml-env-tag.svg +[pypi-link]: https://pypi.org/project/pyyaml-env-tag/ +[GHAction-image]: https://github.com/waylan/pyyaml-env-tag/workflows/CI/badge.svg?branch=master&event=push +[GHAction-link]: https://github.com/waylan/pyyaml-env-tag/actions?query=event%3Apush+branch%3Amaster +[codecov-image]: https://codecov.io/github/waylan/pyyaml-env-tag/coverage.svg?branch=master +[codecov-link]: https://codecov.io/github/waylan/pyyaml-env-tag?branch=master + +## Installation + +Install the `pyyaml_env_tag` package with pip: + +```bash +pip install pyyaml_env_tag +``` + +### Enabling the tag + +To enable the tag, pass your loader of choice into the `add_env_tag` function, which will +return the loader with the construstor added to it. + +```python +import yaml +from yaml_env_tag import add_env_tag + +myLoader = add_env_tag(yaml.Loader) +``` + +Then you may use the loader as per usual. For example: + +```python +yaml.load(data, Loader=myLoader) +``` + +The `add_env_tag` is a high level helper function. If you need lower level access, you may +add the constructor (`yaml_env_tag.construct_env_tag`) to the loader directly using the +`add_constructor` method of the loader. Note that this requires that the tag (`!ENV`) be +defined as well. + +```python +from yaml_env_tag import construct_env_tag + +Loader.add_constructor('!ENV', construct_env_tag) +``` + +## Using the tag + +Include the tag `!ENV` followed by the name of an environment variable in a YAML +file and the value of the environment variable will be used in its place. + +```yaml +key: !ENV SOME_VARIABLE +``` + +If `SOME_VARIABLE` is set to `A string!`, then the above YAML would result in the +following Python object: + +```python +{'key': 'A string!'} +``` + +The content of the variable is parsed using YAML's implicit scalar types, such as +string, bool, integer, float, datestamp and null. More complex types are not +recognized and simply passed through as a string. For example, if `SOME_VARIABLE` +was set to the string `true`, then the above YAML would result in the following: + +```python +{'key': True} +``` + +If the variable specified is not set, then a `null` value is assigned as a default. +You may define your own default as the last item in a sequence. + +```yaml +key: !ENV [SOME_VARIABLE, default] +``` + +In the above example, if `SOME_VARIABLE` is not defined, the string `default` would +be used instead, as follows: + +```python +{'key': 'default'} +``` + +You may list multiple variables as fallbacks. The first variable which is set is +used. In any sequance with more than one item, the last item must always be a +default value and will not be resolved as an environment variable. + +```yaml +key: !ENV [SOME_VARIABLE, FALLBACK, default] +``` + +As with variable contents, the default is resolved to a Python object of the +implied type (string, bool, integer, float, datestamp and null). + +When `SOME_VARIABLE` is not set, all four of the following items will resolve to +the same value (`None`): + +```yaml +- !ENV SOME_VARIABLE +- !ENV [SOME_VARIABLE] +- !ENV [SOME_VARIABLE, ~] +- !ENV [SOME_VARIABLE, null] +``` + +## Related + +pyyaml_env_tag was inspired by the Ruby package [yaml-env-tag]. + +An alternate method of referencing environment variables in YAML files is +implemented by [pyyaml-tags] and [python_yaml_environment_variables]. +Each of those libraries use a template string and replace the template tag with +the content of the variable. While this allows a single value to reference +multiple variables and to contain additional content, it restricts all values +to strings only and does not provide a way to define defaults. + +[yaml-env-tag]: https://github.com/jirutka/yaml-env-tag +[pyyaml-tags]: https://github.com/meiblorn/pyyaml-tags +[python_yaml_environment_variables]: https://gist.github.com/mkaranasou/ba83e25c835a8f7629e34dd7ede01931 + +## License + +pyyaml_env_tag is licensed under the [MIT License] as defined in `LICENSE`. + +[MIT License]: https://opensource.org/licenses/MIT + +## Changelog + +### [1.1] - 2025-05-13 + +- Ensure tests get included with distribution (#9). + +### [1.0] - 2025-05-09 + +- Add the `add_env_tag` helper function as a higher level way of modifying the loader. + +### [0.1] - 2020-11-11 + +The initial release. diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/RECORD b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..bcb6d3c16505a162c8a66e01a0d77b6da2f788f9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/RECORD @@ -0,0 +1,10 @@ +__pycache__/yaml_env_tag.cpython-39.pyc,, +pyyaml_env_tag-1.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyyaml_env_tag-1.1.dist-info/METADATA,sha256=rFfOoDCIzl9KDh621GaPpJdFSS2qIo0EbpixqYE8eHI,5541 +pyyaml_env_tag-1.1.dist-info/RECORD,, +pyyaml_env_tag-1.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyyaml_env_tag-1.1.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91 +pyyaml_env_tag-1.1.dist-info/direct_url.json,sha256=OUuxoxcI917d0meBHJaxc32su4134gVuKjaOs46D23Q,110 +pyyaml_env_tag-1.1.dist-info/licenses/LICENSE,sha256=daWZSvooS2fm5m1_g9LTnnKXNlEUkbPTCep6Bky9484,1070 +pyyaml_env_tag-1.1.dist-info/top_level.txt,sha256=r9gUFgdtA30q3EhH3b42HCpTYcS992ORmVmO3WafNHI,13 +yaml_env_tag.py,sha256=tpc90xDTNPgsr2oAIO5CQ37LMxNdfeynMkF896JWF6M,1545 diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/WHEEL b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..8b9e2d3072660a2d4956b059dd2093da0b9d5dbf --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.1.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..902affac544f8ddafed14adf5bce1ca4fd271824 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/pyyaml-env-tag_1747236954314/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..861fbe21564fbea9e0d520f84d0379aed02f1231 --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Waylan Limberg + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..fce34124e3b39d86da20004864840a67438305af --- /dev/null +++ b/micromamba_root/Lib/site-packages/pyyaml_env_tag-1.1.dist-info/top_level.txt @@ -0,0 +1 @@ +yaml_env_tag diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..42eec28815385631d549cfb3edb71c4e5cbfa725 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/METADATA @@ -0,0 +1,120 @@ +Metadata-Version: 2.4 +Name: requests +Version: 2.34.0 +Summary: Python HTTP for Humans. +Author-email: Kenneth Reitz <me@kennethreitz.org> +Maintainer-email: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>, Nate Prewitt <nate.prewitt@gmail.com> +License: Apache-2.0 +Project-URL: Documentation, https://requests.readthedocs.io +Project-URL: Source, https://github.com/psf/requests +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Natural Language :: English +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: 3.15 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta +Classifier: Topic :: Internet :: WWW/HTTP +Classifier: Topic :: Software Development :: Libraries +Requires-Python: >=3.10 +Description-Content-Type: text/markdown +License-File: LICENSE +License-File: NOTICE +Requires-Dist: charset_normalizer<4,>=2 +Requires-Dist: idna<4,>=2.5 +Requires-Dist: urllib3<3,>=1.26 +Requires-Dist: certifi>=2023.5.7 +Provides-Extra: security +Provides-Extra: socks +Requires-Dist: PySocks!=1.5.7,>=1.5.6; extra == "socks" +Provides-Extra: use-chardet-on-py3 +Requires-Dist: chardet<8,>=3.0.2; extra == "use-chardet-on-py3" +Dynamic: license-file + +# Requests + +[![Version](https://img.shields.io/pypi/v/requests.svg?maxAge=86400)](https://pypi.org/project/requests/) +[![Supported Versions](https://img.shields.io/pypi/pyversions/requests.svg)](https://pypi.org/project/requests) +[![Downloads](https://static.pepy.tech/badge/requests/month)](https://pepy.tech/project/requests) +[![Contributors](https://img.shields.io/github/contributors/psf/requests.svg)](https://github.com/psf/requests/graphs/contributors) +[![Documentation](https://readthedocs.org/projects/requests/badge/?version=latest)](https://requests.readthedocs.io) + +**Requests** is a simple, yet elegant, HTTP library. + +```python +>>> import requests +>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass')) +>>> r.status_code +200 +>>> r.headers['content-type'] +'application/json; charset=utf8' +>>> r.encoding +'utf-8' +>>> r.text +'{"authenticated": true, ...' +>>> r.json() +{'authenticated': True, ...} +``` + +Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method! + +Requests is one of the most downloaded Python packages today, pulling in around `300M downloads / week` — according to GitHub, Requests is currently [depended upon](https://github.com/psf/requests/network/dependents?package_id=UGFja2FnZS01NzA4OTExNg%3D%3D) by `4,000,000+` repositories. + +## Installing Requests and Supported Versions + +Requests is available on PyPI: + +```console +$ python -m pip install requests +``` + +Requests officially supports Python 3.10+. + +## Supported Features & Best–Practices + +Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today. + +- Keep-Alive & Connection Pooling +- International Domains and URLs +- Sessions with Cookie Persistence +- Browser-style TLS/SSL Verification +- Basic & Digest Authentication +- Familiar `dict`–like Cookies +- Automatic Content Decompression and Decoding +- Multi-part File Uploads +- SOCKS Proxy Support +- Connection Timeouts +- Streaming Downloads +- Automatic honoring of `.netrc` +- Chunked HTTP Requests + +## Cloning the repository + +When cloning the Requests repository, you may need to add the `-c +fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit timestamp (see +[this issue](https://github.com/psf/requests/issues/2690) for more background): + +```shell +git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git +``` + +You can also apply this setting to your global Git config: + +```shell +git config --global fetch.fsck.badTimezone ignore +``` + +--- + +[![Kenneth Reitz](https://raw.githubusercontent.com/psf/requests/main/ext/kr.png)](https://kennethreitz.org) [![Python Software Foundation](https://raw.githubusercontent.com/psf/requests/main/ext/psf.png)](https://www.python.org/psf) diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..435d76a9d5a534a9e77ce7fb873c132a97c0a7be --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/RECORD @@ -0,0 +1,48 @@ +requests-2.34.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +requests-2.34.0.dist-info/METADATA,sha256=64w-xXm2cnAgXrcsEJ6g6498dx3VZgqS8TRITZnoerk,4806 +requests-2.34.0.dist-info/RECORD,, +requests-2.34.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +requests-2.34.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91 +requests-2.34.0.dist-info/direct_url.json,sha256=43w_KkG9NqeJS9_dVXFMfn6YWsyansYisQ3qdgIBHtY,119 +requests-2.34.0.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142 +requests-2.34.0.dist-info/licenses/NOTICE,sha256=9REJct7a0rTp0xRRja87fXLW4C5Jms2AIYHeb3RXHcw,38 +requests-2.34.0.dist-info/top_level.txt,sha256=fMSVmHfb5rbGOo6xv-O_tUX6j-WyixssE-SnwcDRxNQ,9 +requests/__init__.py,sha256=MRFX5_pKqRZsgn1SN-b9aU7rXKVJ7kDi6Q-J8hq81W4,5922 +requests/__pycache__/__init__.cpython-310.pyc,, +requests/__pycache__/__version__.cpython-310.pyc,, +requests/__pycache__/_internal_utils.cpython-310.pyc,, +requests/__pycache__/_types.cpython-310.pyc,, +requests/__pycache__/adapters.cpython-310.pyc,, +requests/__pycache__/api.cpython-310.pyc,, +requests/__pycache__/auth.cpython-310.pyc,, +requests/__pycache__/certs.cpython-310.pyc,, +requests/__pycache__/compat.cpython-310.pyc,, +requests/__pycache__/cookies.cpython-310.pyc,, +requests/__pycache__/exceptions.cpython-310.pyc,, +requests/__pycache__/help.cpython-310.pyc,, +requests/__pycache__/hooks.cpython-310.pyc,, +requests/__pycache__/models.cpython-310.pyc,, +requests/__pycache__/packages.cpython-310.pyc,, +requests/__pycache__/sessions.cpython-310.pyc,, +requests/__pycache__/status_codes.cpython-310.pyc,, +requests/__pycache__/structures.cpython-310.pyc,, +requests/__pycache__/utils.cpython-310.pyc,, +requests/__version__.py,sha256=Uw6k1hzJNkFZyzAXYVHE-Qc_JiJOGDlZM6AsxLpMAyY,435 +requests/_internal_utils.py,sha256=TH2NEyyYmPx9cV5HPzrHR4XdxKuW0skkD4eDXcbZgf8,1542 +requests/_types.py,sha256=Z3uDlyGkslMrN0q5b0WQgqaL9KE-jL-Yi6p5Py926ec,5882 +requests/adapters.py,sha256=ZH6r1EU94jKqQLVf8DPW8Zd4kQt-cGnFH99jB2_HdJM,28064 +requests/api.py,sha256=TRVICsBG8Ikgl5joZQR270oo6-b4G0AHWPjvQuxrVQk,7152 +requests/auth.py,sha256=6TlRpVLUw8X9m4Sl4dSbA8qrpHI8T_ES2mBTYA7IWmU,12233 +requests/certs.py,sha256=_ZxrgzWc75D_bE7uq43MI4jaOC68p9AKSZs8C0NKh-Q,430 +requests/compat.py,sha256=XXm6KJaQtQFQRDQaH3vH0kE0_BOi2z78-FJRW_mqGLQ,2465 +requests/cookies.py,sha256=ChzmFA8rlCBSLFCA41bmifp5bCUi9VyhCCb17Y4Kcjw,21549 +requests/exceptions.py,sha256=xeGPM1JFSWjjN7swVvCGffLzfAoNLBp33AXn4LPAQRs,4564 +requests/help.py,sha256=cjUZuxiE2hjYT2svt49-v3-1f3MgcLYCWuBx2sai0Xk,4210 +requests/hooks.py,sha256=69igJHXTGg5HOo9VPpUB_0NkW5VjiFrVKETnpj8Ndqs,1138 +requests/models.py,sha256=PhqYjte-BQbUY_KJGMH4hYXtZm1Q0lboWEg0kwHL7-w,41698 +requests/packages.py,sha256=_g0gZ681UyAlKHRjH6kanbaoxx2eAb6qzcXiODyTIoc,904 +requests/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +requests/sessions.py,sha256=iuFhQXbkGx-MP7uGiTC1d0YqZmRSp0eelZ424p37Va8,34266 +requests/status_codes.py,sha256=GVD0fInPGAGXh-B9jOSPZtazjmIvfZTXCpAkf-5sBA4,4351 +requests/structures.py,sha256=upRgw5B48l5vHSokrJQaxvjS7pcZf6jI0MJi2KHmegI,4134 +requests/utils.py,sha256=ZX_QI0OyWGu9E4pOwPA87rdhDCcS-WrFTyinCL99B5w,36322 diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..14a883f292bc96b20c2b76a3081991f2676523a9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (82.0.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..6aa5517e9c398242d744aa4b10611e6c1381685e --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_requests_1778534036/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..67db8588217f266eb561f75fae738656325deac9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/NOTICE b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..1ff62db688277b77c83c1766dac7f165364d3528 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/licenses/NOTICE @@ -0,0 +1,2 @@ +Requests +Copyright 2019 Kenneth Reitz diff --git a/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2293605cf1b01dca72aad0a15c45b72ed5429a2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests-2.34.0.dist-info/top_level.txt @@ -0,0 +1 @@ +requests diff --git a/micromamba_root/Lib/site-packages/requests/__init__.py b/micromamba_root/Lib/site-packages/requests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad842400b99c65c91988579e76419cf48224a680 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/__init__.py @@ -0,0 +1,219 @@ +# __ +# /__) _ _ _ _ _/ _ +# / ( (- (/ (/ (- _) / _) +# / + +""" +Requests HTTP Library +~~~~~~~~~~~~~~~~~~~~~ + +Requests is an HTTP library, written in Python, for human beings. +Basic GET usage: + + >>> import requests + >>> r = requests.get('https://www.python.org') + >>> r.status_code + 200 + >>> b'Python is a programming language' in r.content + True + +... or POST: + + >>> payload = dict(key1='value1', key2='value2') + >>> r = requests.post('https://httpbin.org/post', data=payload) + >>> print(r.text) + { + ... + "form": { + "key1": "value1", + "key2": "value2" + }, + ... + } + +The other HTTP methods are supported - see `requests.api`. Full documentation +is at <https://requests.readthedocs.io>. + +:copyright: (c) 2017 by Kenneth Reitz. +:license: Apache 2.0, see LICENSE for more details. +""" + +from __future__ import annotations + +import warnings + +import urllib3 + +from .exceptions import RequestsDependencyWarning + +try: + from charset_normalizer import __version__ as charset_normalizer_version +except ImportError: + charset_normalizer_version = None + +try: + from chardet import __version__ as chardet_version # type: ignore[import-not-found] +except ImportError: + chardet_version = None + + +def check_compatibility( + urllib3_version: str, + chardet_version: str | None, + charset_normalizer_version: str | None, +) -> None: + urllib3_version_list = urllib3_version.split(".")[:3] + assert urllib3_version_list != ["dev"] # Verify urllib3 isn't installed from git. + + # Sometimes, urllib3 only reports its version as 16.1. + if len(urllib3_version_list) == 2: + urllib3_version_list.append("0") + + # Check urllib3 for compatibility. + major, minor, patch = urllib3_version_list # noqa: F811 + major, minor, patch = int(major), int(minor), int(patch) + # urllib3 >= 1.21.1 + assert major >= 1 + if major == 1: + assert minor >= 21 + + # Check charset_normalizer for compatibility. + if chardet_version: + major, minor, patch = chardet_version.split(".")[:3] + major, minor, patch = int(major), int(minor), int(patch) + # chardet_version >= 3.0.2, < 8.0.0 + assert (3, 0, 2) <= (major, minor, patch) < (8, 0, 0) + elif charset_normalizer_version: + major, minor, patch = charset_normalizer_version.split(".")[:3] + major, minor, patch = int(major), int(minor), int(patch) + # charset_normalizer >= 2.0.0 < 4.0.0 + assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0) + else: + warnings.warn( + "Unable to find acceptable character detection dependency " + "(chardet or charset_normalizer).", + RequestsDependencyWarning, + ) + + +def _check_cryptography(cryptography_version: str) -> None: + # cryptography < 1.3.4 + try: + cryptography_version_list = list(map(int, cryptography_version.split("."))) + except ValueError: + return + + if cryptography_version_list < [1, 3, 4]: + warning = f"Old version of cryptography ({cryptography_version_list}) may cause slowdown." + warnings.warn(warning, RequestsDependencyWarning) + + +# Check imported dependencies for compatibility. +try: + check_compatibility( + urllib3.__version__, # type: ignore[reportPrivateImportUsage] + chardet_version, # type: ignore[reportUnknownArgumentType] + charset_normalizer_version, + ) +except (AssertionError, ValueError): + warnings.warn( + f"urllib3 ({urllib3.__version__}) or chardet " # type: ignore[reportPrivateImportUsage] + f"({chardet_version})/charset_normalizer ({charset_normalizer_version}) " + "doesn't match a supported version!", + RequestsDependencyWarning, + ) + +# Attempt to enable urllib3's fallback for SNI support +# if the standard library doesn't support SNI or the +# 'ssl' library isn't available. +try: + try: + import ssl + except ImportError: + ssl = None + + if not getattr(ssl, "HAS_SNI", False): + from urllib3.contrib import pyopenssl + + pyopenssl.inject_into_urllib3() + + # Check cryptography version + from cryptography import ( # type: ignore[reportMissingImports] + __version__ as cryptography_version, # type: ignore[reportUnknownVariableType] + ) + + _check_cryptography(cryptography_version) # type: ignore[reportUnknownArgumentType] +except ImportError: + pass + +# urllib3's DependencyWarnings should be silenced. +from urllib3.exceptions import DependencyWarning + +warnings.simplefilter("ignore", DependencyWarning) + +# Set default logging handler to avoid "No handler found" warnings. +import logging +from logging import NullHandler + +from . import packages, utils +from .__version__ import ( + __author__, + __author_email__, + __build__, + __cake__, + __copyright__, + __description__, + __license__, + __title__, + __url__, + __version__, +) +from .api import delete, get, head, options, patch, post, put, request +from .exceptions import ( + ConnectionError, + ConnectTimeout, + FileModeWarning, + HTTPError, + JSONDecodeError, + ReadTimeout, + RequestException, + Timeout, + TooManyRedirects, + URLRequired, +) +from .models import PreparedRequest, Request, Response +from .sessions import Session, session +from .status_codes import codes + +__all__ = ( + "ConnectionError", + "ConnectTimeout", + "HTTPError", + "JSONDecodeError", + "PreparedRequest", + "ReadTimeout", + "Request", + "RequestException", + "Response", + "Session", + "Timeout", + "TooManyRedirects", + "URLRequired", + "codes", + "delete", + "get", + "head", + "options", + "packages", + "patch", + "post", + "put", + "request", + "session", + "utils", +) + +logging.getLogger(__name__).addHandler(NullHandler()) + +# FileModeWarnings go off per the default. +warnings.simplefilter("default", FileModeWarning, append=True) diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38b319b481aa095db3b36ea9b346fa751d114c9e Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/__version__.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/__version__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17711bc8a6950222e217e652e3ee1a4be9b79332 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/__version__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/_internal_utils.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/_internal_utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0489ac54ff1dd75144cff6604b5f52b435ae5dee Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/_internal_utils.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/_types.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/_types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28bfe33a8d191af4646a0f49315729ce0754cd9f Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/_types.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/adapters.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/adapters.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..230f303162861377e2fae2ed9bb6279f3222e877 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/adapters.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/api.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/api.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46637bb4221dd5460d9af7ab81c5e1efd7d817fe Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/api.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/auth.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/auth.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..793c7a34429a3bd9253210bd4489675655059480 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/auth.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/certs.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/certs.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f64ab98c9536e80c5a5a3c8a09ac24f7e5410a5 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/certs.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/compat.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/compat.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d0fb5c42e9ba313c57f42c90775a4c65a6d60f32 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/compat.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/cookies.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/cookies.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b55f6010d1afee64901bb55db69338ab19aa049 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/cookies.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/exceptions.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20f8bf38acc8be0b7862da9c74ccb9bacda6c887 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/exceptions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/help.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/help.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..027d912c378844b767ad51e26d4056a73ef2398b Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/help.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/hooks.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/hooks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d899121e53d8e0cc574c6ff8e6e859c8f99afca Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/hooks.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/models.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/models.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5cdabf60546e6ee0f4b1472c18eae4972b4d527 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/models.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/packages.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/packages.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf2a16181254ef5d2455b62f423ba8b85297e096 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/packages.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/sessions.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/sessions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9561cbdd7bd87142f14088c509ae9a7dcb808e41 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/sessions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/status_codes.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/status_codes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29b3cf5c6441fba817f52f4b02271d27016a5d76 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/status_codes.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/structures.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/structures.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f262da799839df903bcbeae1ce424cade76a288 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/structures.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__pycache__/utils.cpython-314.pyc b/micromamba_root/Lib/site-packages/requests/__pycache__/utils.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..542cfffb7be0067130d6417681505ebddf76a3f1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/requests/__pycache__/utils.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/requests/__version__.py b/micromamba_root/Lib/site-packages/requests/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..872a8aaa227c3b6a38008d06c4c433c80e30a3e9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/__version__.py @@ -0,0 +1,14 @@ +# .-. .-. .-. . . .-. .-. .-. .-. +# |( |- |.| | | |- `-. | `-. +# ' ' `-' `-`.`-' `-' `-' ' `-' + +__title__ = "requests" +__description__ = "Python HTTP for Humans." +__url__ = "https://requests.readthedocs.io" +__version__ = "2.34.0" +__build__ = 0x023400 +__author__ = "Kenneth Reitz" +__author_email__ = "me@kennethreitz.org" +__license__ = "Apache-2.0" +__copyright__ = "Copyright Kenneth Reitz" +__cake__ = "\u2728 \U0001f370 \u2728" diff --git a/micromamba_root/Lib/site-packages/requests/_internal_utils.py b/micromamba_root/Lib/site-packages/requests/_internal_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..0466a7d347db4ed34a37db51b75fc8e80bc06055 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/_internal_utils.py @@ -0,0 +1,51 @@ +""" +requests._internal_utils +~~~~~~~~~~~~~~ + +Provides utility functions that are consumed internally by Requests +which depend on extremely few external helpers (such as compat) +""" + +import re + +from .compat import builtin_str + +_VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*\Z") +_VALID_HEADER_NAME_RE_STR = re.compile(r"^[^:\s][^:\r\n]*\Z") +_VALID_HEADER_VALUE_RE_BYTE = re.compile(rb"^\S[^\r\n]*\Z|^\Z") +_VALID_HEADER_VALUE_RE_STR = re.compile(r"^\S[^\r\n]*\Z|^\Z") + +_HEADER_VALIDATORS_STR = (_VALID_HEADER_NAME_RE_STR, _VALID_HEADER_VALUE_RE_STR) +_HEADER_VALIDATORS_BYTE = (_VALID_HEADER_NAME_RE_BYTE, _VALID_HEADER_VALUE_RE_BYTE) +HEADER_VALIDATORS = { + bytes: _HEADER_VALIDATORS_BYTE, + str: _HEADER_VALIDATORS_STR, +} + + +def to_native_string(string: str | bytes, encoding: str = "ascii") -> str: + """Given a string object, regardless of type, returns a representation of + that string in the native string type, encoding and decoding where + necessary. This assumes ASCII unless told otherwise. + """ + if isinstance(string, builtin_str): + out = string + else: + out = string.decode(encoding) + + return out + + +def unicode_is_ascii(u_string: str) -> bool: + """Determine if unicode string only contains ASCII characters. + + :param str u_string: unicode string to check. Must be unicode + and not Python 2 `str`. + :rtype: bool + """ + assert isinstance(u_string, str) + try: + u_string.encode("ascii") + return True + except UnicodeEncodeError: + return False diff --git a/micromamba_root/Lib/site-packages/requests/_types.py b/micromamba_root/Lib/site-packages/requests/_types.py new file mode 100644 index 0000000000000000000000000000000000000000..963867b0126c72d73f9c4edca94f5bd4d78d9515 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/_types.py @@ -0,0 +1,178 @@ +""" +requests._types +~~~~~~~~~~~~~~~ + +This module contains type aliases used internally by the Requests library. +These types are not part of the public API and must not be relied upon +by external code. +""" + +from __future__ import annotations + +from collections.abc import Callable, Iterable, Mapping, MutableMapping +from typing import ( + TYPE_CHECKING, + Any, + Protocol, + TypeAlias, + TypeVar, + runtime_checkable, +) + +_T_co = TypeVar("_T_co", covariant=True) +_KT_co = TypeVar("_KT_co", covariant=True) +_VT_co = TypeVar("_VT_co", covariant=True) + + +@runtime_checkable +class SupportsRead(Protocol[_T_co]): + def read(self, length: int = ..., /) -> _T_co: ... + + +@runtime_checkable +class SupportsItems(Protocol[_KT_co, _VT_co]): + def items(self) -> Iterable[tuple[_KT_co, _VT_co]]: ... + + +# These are needed at runtime for default_hooks() return type +HookType: TypeAlias = Callable[["Response"], Any] +HooksInputType: TypeAlias = Mapping[str, Iterable[HookType] | HookType] + + +def is_prepared(request: PreparedRequest) -> TypeIs[_ValidatedRequest]: + """Verify a PreparedRequest has been fully prepared.""" + if TYPE_CHECKING: + return request.url is not None and request.method is not None + # noop at runtime to avoid AssertionError + return True + + +if TYPE_CHECKING: + from http.cookiejar import CookieJar + from typing import TypeAlias, TypedDict + + from typing_extensions import ( + Buffer, # TODO: move to collections.abc when Python >= 3.12 + TypeIs, # TODO: move to typing when Python >= 3.13 + ) + + from .auth import AuthBase + from .cookies import RequestsCookieJar + from .models import PreparedRequest, Response + from .structures import CaseInsensitiveDict + + class _ValidatedRequest(PreparedRequest): + """Subtype asserting a PreparedRequest has been fully prepared before calling. + + The override suppression is required because mutable attribute types are + invariant (Liskov), but we only narrow after preparation is complete. This + is the explicit contract for Requests but Python's typing doesn't have a + better way to represent the requirement. + """ + + url: str # type: ignore[reportIncompatibleVariableOverride] + method: str # type: ignore[reportIncompatibleVariableOverride] + + # Type aliases for core API concepts (ordered by request() signature) + UriType: TypeAlias = str | bytes + + _ParamsMappingKeyType: TypeAlias = str | bytes | int | float + _ParamsMappingValueType: TypeAlias = ( + str | bytes | int | float | Iterable[str | bytes | int | float] | None + ) + ParamsType: TypeAlias = ( + SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType] + | tuple[tuple[_ParamsMappingKeyType, _ParamsMappingValueType], ...] + | Iterable[tuple[_ParamsMappingKeyType, _ParamsMappingValueType]] + | str + | bytes + | None + ) + + KVDataType: TypeAlias = Iterable[tuple[Any, Any]] | SupportsItems[Any, Any] + + RawDataType: TypeAlias = KVDataType | str | bytes + StreamDataType: TypeAlias = SupportsRead[str | bytes] + EncodableDataType: TypeAlias = RawDataType | StreamDataType + + DataType: TypeAlias = ( + KVDataType + | Iterable[bytes | str] + | str + | bytes + | Buffer + | SupportsRead[str | bytes] + | None + ) + + BodyType: TypeAlias = ( + bytes | str | Iterable[bytes | str] | SupportsRead[bytes | str] | None + ) + + HeadersType: TypeAlias = CaseInsensitiveDict[str] | Mapping[str, str | bytes] + HeadersUpdateType: TypeAlias = Mapping[str, str | bytes | None] + + CookiesType: TypeAlias = RequestsCookieJar | Mapping[str, str] + + # Building blocks for FilesType + _FileName: TypeAlias = str | None + _FileContent: TypeAlias = SupportsRead[str | bytes] | str | bytes + _FileSpecBasic: TypeAlias = tuple[_FileName, _FileContent] + _FileSpecWithContentType: TypeAlias = tuple[_FileName, _FileContent, str] + _FileSpecWithHeaders: TypeAlias = tuple[ + _FileName, _FileContent, str, CaseInsensitiveDict[str] | Mapping[str, str] + ] + _FileSpec: TypeAlias = ( + _FileContent | _FileSpecBasic | _FileSpecWithContentType | _FileSpecWithHeaders + ) + FilesType: TypeAlias = ( + Mapping[str, _FileSpec] | Iterable[tuple[str, _FileSpec]] | None + ) + + AuthType: TypeAlias = ( + tuple[str, str] | AuthBase | Callable[[PreparedRequest], PreparedRequest] | None + ) + + TimeoutType: TypeAlias = float | tuple[float | None, float | None] | None + ProxiesType: TypeAlias = MutableMapping[str, str] + HooksType: TypeAlias = dict[str, list[HookType]] | None + VerifyType: TypeAlias = bool | str + CertType: TypeAlias = str | tuple[str, str] | None + JsonType: TypeAlias = ( + None | bool | int | float | str | list["JsonType"] | dict[str, "JsonType"] + ) + + # TypedDicts for Unpack kwargs (PEP 692) + + class BaseRequestKwargs(TypedDict, total=False): + headers: Mapping[str, str | bytes] | None + cookies: RequestsCookieJar | CookieJar | dict[str, str] | None + files: FilesType + auth: AuthType + timeout: TimeoutType + allow_redirects: bool + proxies: dict[str, str] | None + hooks: HooksInputType | None + stream: bool | None + verify: VerifyType | None + cert: CertType + + class RequestKwargs(BaseRequestKwargs, total=False): + """kwargs for request(), options(), head(), delete().""" + + params: ParamsType + data: DataType + json: JsonType + + class GetKwargs(BaseRequestKwargs, total=False): + data: DataType + json: JsonType + + class PostKwargs(BaseRequestKwargs, total=False): + params: ParamsType + + class DataKwargs(BaseRequestKwargs, total=False): + """kwargs for put(), patch().""" + + params: ParamsType + json: JsonType diff --git a/micromamba_root/Lib/site-packages/requests/adapters.py b/micromamba_root/Lib/site-packages/requests/adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..40fe8a6d5a6168ba7303b91477af925db0aa3914 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/adapters.py @@ -0,0 +1,748 @@ +""" +requests.adapters +~~~~~~~~~~~~~~~~~ + +This module contains the transport adapters that Requests uses to define +and maintain connections. +""" + +from __future__ import annotations + +import os.path +import socket # noqa: F401 # type: ignore[reportUnusedImport] +import typing +import warnings +from typing import Any + +from urllib3.exceptions import ( + ClosedPoolError, + ConnectTimeoutError, + LocationValueError, + MaxRetryError, + NewConnectionError, + ProtocolError, + ReadTimeoutError, + ResponseError, +) +from urllib3.exceptions import HTTPError as _HTTPError +from urllib3.exceptions import InvalidHeader as _InvalidHeader +from urllib3.exceptions import ProxyError as _ProxyError +from urllib3.exceptions import SSLError as _SSLError +from urllib3.poolmanager import PoolManager, proxy_from_url +from urllib3.util import Timeout as TimeoutSauce +from urllib3.util import parse_url +from urllib3.util.retry import Retry + +from .auth import _basic_auth_str # type: ignore[reportPrivateUsage] +from .compat import basestring, urlparse +from .cookies import extract_cookies_to_jar +from .exceptions import ( + ConnectionError, + ConnectTimeout, + InvalidHeader, + InvalidProxyURL, + InvalidSchema, + InvalidURL, + ProxyError, + ReadTimeout, + RetryError, + SSLError, +) +from .models import Response +from .structures import CaseInsensitiveDict +from .utils import ( + DEFAULT_CA_BUNDLE_PATH, + get_auth_from_url, + get_encoding_from_headers, + prepend_scheme_if_needed, + select_proxy, + urldefragauth, +) + +try: + from urllib3.contrib.socks import SOCKSProxyManager # type: ignore[assignment] +except ImportError: + + def SOCKSProxyManager(*args: Any, **kwargs: Any) -> None: + raise InvalidSchema("Missing dependencies for SOCKS support.") + + +if typing.TYPE_CHECKING: + from urllib3.connectionpool import HTTPConnectionPool + from urllib3.poolmanager import PoolManager as _PoolManager + + from . import _types as _t + from .models import PreparedRequest + +from ._types import is_prepared as _is_prepared + +DEFAULT_POOLBLOCK = False +DEFAULT_POOLSIZE = 10 +DEFAULT_RETRIES = 0 +DEFAULT_POOL_TIMEOUT = None + + +def _urllib3_request_context( + request: PreparedRequest, + verify: bool | str | None, + client_cert: tuple[str, str] | str | None, + poolmanager: PoolManager, +) -> tuple[dict[str, Any], dict[str, Any]]: + host_params: dict[str, Any] = {} + pool_kwargs: dict[str, Any] = {} + parsed_request_url = urlparse(request.url) + scheme = parsed_request_url.scheme.lower() + port = parsed_request_url.port + + cert_reqs = "CERT_REQUIRED" + if verify is False: + cert_reqs = "CERT_NONE" + elif isinstance(verify, str): + if not os.path.isdir(verify): + pool_kwargs["ca_certs"] = verify + else: + pool_kwargs["ca_cert_dir"] = verify + pool_kwargs["cert_reqs"] = cert_reqs + if client_cert is not None: + if isinstance(client_cert, tuple) and len(client_cert) == 2: + pool_kwargs["cert_file"] = client_cert[0] + pool_kwargs["key_file"] = client_cert[1] + else: + # According to our docs, we allow users to specify just the client + # cert path + pool_kwargs["cert_file"] = client_cert + host_params = { + "scheme": scheme, + "host": parsed_request_url.hostname, + "port": port, + } + return host_params, pool_kwargs + + +class BaseAdapter: + """The Base Transport Adapter""" + + def __init__(self) -> None: + super().__init__() + + def send( + self, + request: PreparedRequest, + stream: bool = False, + timeout: _t.TimeoutType = None, + verify: _t.VerifyType = True, + cert: _t.CertType = None, + proxies: dict[str, str] | None = None, + ) -> Response: + """Sends PreparedRequest object. Returns Response object. + + :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. + :param stream: (optional) Whether to stream the request content. + :param timeout: (optional) How long to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) <timeouts>` tuple. + :type timeout: float or tuple + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use + :param cert: (optional) Any user-provided SSL certificate to be trusted. + :param proxies: (optional) The proxies dictionary to apply to the request. + """ + raise NotImplementedError + + def close(self) -> None: + """Cleans up adapter specific items.""" + raise NotImplementedError + + +class HTTPAdapter(BaseAdapter): + """The built-in HTTP Adapter for urllib3. + + Provides a general-case interface for Requests sessions to contact HTTP and + HTTPS urls by implementing the Transport Adapter interface. This class will + usually be created by the :class:`Session <Session>` class under the + covers. + + :param pool_connections: The number of urllib3 connection pools to cache. + :param pool_maxsize: The maximum number of connections to save in the pool. + :param max_retries: The maximum number of retries each connection + should attempt. Note, this applies only to failed DNS lookups, socket + connections and connection timeouts, never to requests where data has + made it to the server. By default, Requests does not retry failed + connections. If you need granular control over the conditions under + which we retry a request, import urllib3's ``Retry`` class and pass + that instead. + :param pool_block: Whether the connection pool should block for connections. + + Usage:: + + >>> import requests + >>> s = requests.Session() + >>> a = requests.adapters.HTTPAdapter(max_retries=3) + >>> s.mount('http://', a) + """ + + __attrs__: list[str] = [ + "max_retries", + "config", + "_pool_connections", + "_pool_maxsize", + "_pool_block", + ] + + max_retries: Retry + config: dict[str, Any] + proxy_manager: dict[str, Any] + _pool_connections: int + _pool_maxsize: int + _pool_block: bool + poolmanager: _PoolManager + + def __init__( + self, + pool_connections: int = DEFAULT_POOLSIZE, + pool_maxsize: int = DEFAULT_POOLSIZE, + max_retries: int | Retry = DEFAULT_RETRIES, + pool_block: bool = DEFAULT_POOLBLOCK, + ) -> None: + if max_retries == DEFAULT_RETRIES: + self.max_retries = Retry(0, read=False) + else: + self.max_retries = Retry.from_int(max_retries) + self.config = {} + self.proxy_manager = {} + + super().__init__() + + self._pool_connections = pool_connections + self._pool_maxsize = pool_maxsize + self._pool_block = pool_block + + self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) + + def __getstate__(self) -> dict[str, Any]: + return {attr: getattr(self, attr, None) for attr in self.__attrs__} + + def __setstate__(self, state: dict[str, Any]) -> None: + # Can't handle by adding 'proxy_manager' to self.__attrs__ because + # self.poolmanager uses a lambda function, which isn't pickleable. + self.proxy_manager = {} + self.config = {} + + for attr, value in state.items(): + setattr(self, attr, value) + + self.init_poolmanager( + self._pool_connections, self._pool_maxsize, block=self._pool_block + ) + + def init_poolmanager( + self, + connections: int, + maxsize: int, + block: bool = DEFAULT_POOLBLOCK, + **pool_kwargs: Any, + ) -> None: + """Initializes a urllib3 PoolManager. + + This method should not be called from user code, and is only + exposed for use when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param connections: The number of urllib3 connection pools to cache. + :param maxsize: The maximum number of connections to save in the pool. + :param block: Block when no free connections are available. + :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. + """ + # save these values for pickling + self._pool_connections = connections + self._pool_maxsize = maxsize + self._pool_block = block + + self.poolmanager = PoolManager( + num_pools=connections, + maxsize=maxsize, + block=block, + **pool_kwargs, + ) + + def proxy_manager_for(self, proxy: str, **proxy_kwargs: Any) -> Any: + """Return urllib3 ProxyManager for the given proxy. + + This method should not be called from user code, and is only + exposed for use when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param proxy: The proxy to return a urllib3 ProxyManager for. + :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. + :returns: ProxyManager + :rtype: urllib3.ProxyManager + """ + if proxy in self.proxy_manager: + manager = self.proxy_manager[proxy] + elif proxy.lower().startswith("socks"): + username, password = get_auth_from_url(proxy) + manager = self.proxy_manager[proxy] = SOCKSProxyManager( + proxy, + username=username, + password=password, + num_pools=self._pool_connections, + maxsize=self._pool_maxsize, + block=self._pool_block, + **proxy_kwargs, + ) + else: + proxy_headers = self.proxy_headers(proxy) + manager = self.proxy_manager[proxy] = proxy_from_url( + proxy, + proxy_headers=proxy_headers, + num_pools=self._pool_connections, + maxsize=self._pool_maxsize, + block=self._pool_block, + **proxy_kwargs, + ) + + return manager + + def cert_verify( + self, conn: Any, url: str, verify: _t.VerifyType, cert: _t.CertType + ) -> None: + """Verify a SSL certificate. This method should not be called from user + code, and is only exposed for use when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param conn: The urllib3 connection object associated with the cert. + :param url: The requested URL. + :param verify: Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use + :param cert: The SSL certificate to verify. + """ + if url.lower().startswith("https") and verify: + cert_loc = None + + # Allow self-specified cert location. + if verify is not True: + cert_loc = verify + + if not cert_loc: + cert_loc = DEFAULT_CA_BUNDLE_PATH + + if not cert_loc or not os.path.exists(cert_loc): + raise OSError( + f"Could not find a suitable TLS CA certificate bundle, " + f"invalid path: {cert_loc}" + ) + + conn.cert_reqs = "CERT_REQUIRED" + + if not os.path.isdir(cert_loc): + conn.ca_certs = cert_loc + else: + conn.ca_cert_dir = cert_loc + else: + conn.cert_reqs = "CERT_NONE" + conn.ca_certs = None + conn.ca_cert_dir = None + + if cert: + if not isinstance(cert, basestring): + conn.cert_file = cert[0] + conn.key_file = cert[1] + else: + conn.cert_file = cert + conn.key_file = None + if conn.cert_file and not os.path.exists(conn.cert_file): + raise OSError( + f"Could not find the TLS certificate file, " + f"invalid path: {conn.cert_file}" + ) + if conn.key_file and not os.path.exists(conn.key_file): + raise OSError( + f"Could not find the TLS key file, invalid path: {conn.key_file}" + ) + + def build_response(self, req: PreparedRequest, resp: Any) -> Response: + """Builds a :class:`Response <requests.Response>` object from a urllib3 + response. This should not be called from user code, and is only exposed + for use when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>` + + :param req: The :class:`PreparedRequest <PreparedRequest>` used to generate the response. + :param resp: The urllib3 response object. + :rtype: requests.Response + """ + assert _is_prepared(req) + response = Response() + + # Fallback to None if there's no status_code, for whatever reason. + response.status_code = getattr(resp, "status", None) # type: ignore[assignment] + + # Make headers case-insensitive. + response.headers = CaseInsensitiveDict(getattr(resp, "headers", {})) + + # Set encoding. + response.encoding = get_encoding_from_headers(response.headers) + response.raw = resp + response.reason = response.raw.reason + + if isinstance(req.url, bytes): + response.url = req.url.decode("utf-8") + else: + response.url = req.url + + # Add new cookies from the server. + extract_cookies_to_jar(response.cookies, req, resp) + + # Give the Response some context. + response.request = req + response.connection = self + + return response + + def build_connection_pool_key_attributes( + self, request: PreparedRequest, verify: _t.VerifyType, cert: _t.CertType = None + ) -> tuple[dict[str, Any], dict[str, Any]]: + """Build the PoolKey attributes used by urllib3 to return a connection. + + This looks at the PreparedRequest, the user-specified verify value, + and the value of the cert parameter to determine what PoolKey values + to use to select a connection from a given urllib3 Connection Pool. + + The SSL related pool key arguments are not consistently set. As of + this writing, use the following to determine what keys may be in that + dictionary: + + * If ``verify`` is ``True``, ``"ssl_context"`` will be set and will be the + default Requests SSL Context + * If ``verify`` is ``False``, ``"ssl_context"`` will not be set but + ``"cert_reqs"`` will be set + * If ``verify`` is a string, (i.e., it is a user-specified trust bundle) + ``"ca_certs"`` will be set if the string is not a directory recognized + by :py:func:`os.path.isdir`, otherwise ``"ca_cert_dir"`` will be + set. + * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If + ``"cert"`` is a tuple with a second item, ``"key_file"`` will also + be present + + To override these settings, one may subclass this class, call this + method and use the above logic to change parameters as desired. For + example, if one wishes to use a custom :py:class:`ssl.SSLContext` one + must both set ``"ssl_context"`` and based on what else they require, + alter the other keys to ensure the desired behaviour. + + :param request: + The PreparedRequest being sent over the connection. + :type request: + :class:`~requests.models.PreparedRequest` + :param verify: + Either a boolean, in which case it controls whether + we verify the server's TLS certificate, or a string, in which case it + must be a path to a CA bundle to use. + :param cert: + (optional) Any user-provided SSL certificate for client + authentication (a.k.a., mTLS). This may be a string (i.e., just + the path to a file which holds both certificate and key) or a + tuple of length 2 with the certificate file path and key file + path. + :returns: + A tuple of two dictionaries. The first is the "host parameters" + portion of the Pool Key including scheme, hostname, and port. The + second is a dictionary of SSLContext related parameters. + """ + return _urllib3_request_context(request, verify, cert, self.poolmanager) + + def get_connection_with_tls_context( + self, + request: PreparedRequest, + verify: _t.VerifyType, + proxies: dict[str, str] | None = None, + cert: _t.CertType = None, + ) -> HTTPConnectionPool: + """Returns a urllib3 connection for the given request and TLS settings. + This should not be called from user code, and is only exposed for use + when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param request: + The :class:`PreparedRequest <PreparedRequest>` object to be sent + over the connection. + :param verify: + Either a boolean, in which case it controls whether we verify the + server's TLS certificate, or a string, in which case it must be a + path to a CA bundle to use. + :param proxies: + (optional) The proxies dictionary to apply to the request. + :param cert: + (optional) Any user-provided SSL certificate to be used for client + authentication (a.k.a., mTLS). + :rtype: + urllib3.HTTPConnectionPool + """ + assert _is_prepared(request) + + proxy = select_proxy(request.url, proxies) + try: + host_params, pool_kwargs = self.build_connection_pool_key_attributes( + request, + verify, + cert, + ) + except ValueError as e: + raise InvalidURL(e, request=request) + if proxy: + proxy = prepend_scheme_if_needed(proxy, "http") + proxy_url = parse_url(proxy) + if not proxy_url.host: + raise InvalidProxyURL( + "Please check proxy URL. It is malformed " + "and could be missing the host." + ) + proxy_manager = self.proxy_manager_for(proxy) + conn = proxy_manager.connection_from_host( + **host_params, pool_kwargs=pool_kwargs + ) + else: + # Only scheme should be lower case + conn = self.poolmanager.connection_from_host( + **host_params, pool_kwargs=pool_kwargs + ) + + return conn + + def get_connection( + self, url: str, proxies: dict[str, str] | None = None + ) -> HTTPConnectionPool: + """DEPRECATED: Users should move to `get_connection_with_tls_context` + for all subclasses of HTTPAdapter using Requests>=2.32.2. + + Returns a urllib3 connection for the given URL. This should not be + called from user code, and is only exposed for use when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param url: The URL to connect to. + :param proxies: (optional) A Requests-style dictionary of proxies used on this request. + :rtype: urllib3.HTTPConnectionPool + """ + warnings.warn( + ( + "`get_connection` has been deprecated in favor of " + "`get_connection_with_tls_context`. Custom HTTPAdapter subclasses " + "will need to migrate for Requests>=2.32.2. Please see " + "https://github.com/psf/requests/pull/6710 for more details." + ), + DeprecationWarning, + ) + proxy = select_proxy(url, proxies) + + if proxy: + proxy = prepend_scheme_if_needed(proxy, "http") + proxy_url = parse_url(proxy) + if not proxy_url.host: + raise InvalidProxyURL( + "Please check proxy URL. It is malformed " + "and could be missing the host." + ) + proxy_manager = self.proxy_manager_for(proxy) + conn = proxy_manager.connection_from_url(url) + else: + # Only scheme should be lower case + parsed = urlparse(url) + url = parsed.geturl() + conn = self.poolmanager.connection_from_url(url) + + return conn + + def close(self) -> None: + """Disposes of any internal state. + + Currently, this closes the PoolManager and any active ProxyManager, + which closes any pooled connections. + """ + self.poolmanager.clear() + for proxy in self.proxy_manager.values(): + proxy.clear() + + def request_url( + self, request: PreparedRequest, proxies: dict[str, str] | None + ) -> str: + """Obtain the url to use when making the final request. + + If the message is being sent through a HTTP proxy, the full URL has to + be used. Otherwise, we should only use the path portion of the URL. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. + :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. + :rtype: str + """ + assert _is_prepared(request) + + proxy = select_proxy(request.url, proxies) + scheme = urlparse(request.url).scheme + + is_proxied_http_request = proxy and scheme != "https" + using_socks_proxy = False + if proxy: + proxy_scheme = urlparse(proxy).scheme.lower() + using_socks_proxy = proxy_scheme.startswith("socks") + + url = request.path_url + + if is_proxied_http_request and not using_socks_proxy: + url = urldefragauth(request.url) + + return url + + def add_headers(self, request: PreparedRequest, **kwargs: Any) -> None: + """Add any headers needed by the connection. As of v2.0 this does + nothing by default, but is left for overriding by users that subclass + the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param request: The :class:`PreparedRequest <PreparedRequest>` to add headers to. + :param kwargs: The keyword arguments from the call to send(). + """ + pass + + def proxy_headers(self, proxy: str) -> dict[str, str]: + """Returns a dictionary of the headers to add to any request sent + through a proxy. This works with urllib3 magic to ensure that they are + correctly sent to the proxy, rather than in a tunnelled request if + CONNECT is being used. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. + + :param proxy: The url of the proxy being used for this request. + :rtype: dict + """ + headers: dict[str, str] = {} + username, password = get_auth_from_url(proxy) + + if username: + headers["Proxy-Authorization"] = _basic_auth_str(username, password) + + return headers + + def send( + self, + request: PreparedRequest, + stream: bool = False, + timeout: _t.TimeoutType = None, + verify: _t.VerifyType = True, + cert: _t.CertType = None, + proxies: dict[str, str] | None = None, + ) -> Response: + """Sends PreparedRequest object. Returns Response object. + + :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. + :param stream: (optional) Whether to stream the request content. + :param timeout: (optional) How long to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) <timeouts>` tuple. + :type timeout: float or tuple or urllib3 Timeout object + :param verify: (optional) Either a boolean, in which case it controls whether + we verify the server's TLS certificate, or a string, in which case it + must be a path to a CA bundle to use + :param cert: (optional) Any user-provided SSL certificate to be trusted. + :param proxies: (optional) The proxies dictionary to apply to the request. + :rtype: requests.Response + """ + + assert _is_prepared(request) + + try: + conn = self.get_connection_with_tls_context( + request, verify, proxies=proxies, cert=cert + ) + except LocationValueError as e: + raise InvalidURL(e, request=request) + + self.cert_verify(conn, request.url, verify, cert) + url = self.request_url(request, proxies) + self.add_headers( + request, + stream=stream, + timeout=timeout, + verify=verify, + cert=cert, + proxies=proxies, + ) + + chunked = not (request.body is None or "Content-Length" in request.headers) + + if isinstance(timeout, tuple): + try: + connect, read = timeout + resolved_timeout = TimeoutSauce(connect=connect, read=read) + except ValueError: + raise ValueError( + f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " + f"or a single float to set both timeouts to the same value." + ) + elif isinstance(timeout, TimeoutSauce): + resolved_timeout = timeout + else: + resolved_timeout = TimeoutSauce(connect=timeout, read=timeout) + + try: + resp = conn.urlopen( + method=request.method, + url=url, + body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] + headers=request.headers, # type: ignore[arg-type] # urllib3#3072 + redirect=False, + assert_same_host=False, + preload_content=False, + decode_content=False, + retries=self.max_retries, + timeout=resolved_timeout, + chunked=chunked, + ) + + except (ProtocolError, OSError) as err: + raise ConnectionError(err, request=request) + + except MaxRetryError as e: + if isinstance(e.reason, ConnectTimeoutError): + # TODO: Remove this in 3.0.0: see #2811 + if not isinstance(e.reason, NewConnectionError): + raise ConnectTimeout(e, request=request) + + if isinstance(e.reason, ResponseError): + raise RetryError(e, request=request) + + if isinstance(e.reason, _ProxyError): + raise ProxyError(e, request=request) + + if isinstance(e.reason, _SSLError): + # This branch is for urllib3 v1.22 and later. + raise SSLError(e, request=request) + + raise ConnectionError(e, request=request) + + except ClosedPoolError as e: + raise ConnectionError(e, request=request) + + except _ProxyError as e: + raise ProxyError(e) + + except (_SSLError, _HTTPError) as e: + if isinstance(e, _SSLError): + # This branch is for urllib3 versions earlier than v1.22 + raise SSLError(e, request=request) + elif isinstance(e, ReadTimeoutError): + raise ReadTimeout(e, request=request) + elif isinstance(e, _InvalidHeader): + raise InvalidHeader(e, request=request) + else: + raise + + return self.build_response(request, resp) diff --git a/micromamba_root/Lib/site-packages/requests/api.py b/micromamba_root/Lib/site-packages/requests/api.py new file mode 100644 index 0000000000000000000000000000000000000000..eeb3b54d7f27e2c843080dfe81dfdb0d460c2b31 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/api.py @@ -0,0 +1,180 @@ +""" +requests.api +~~~~~~~~~~~~ + +This module implements the Requests API. + +:copyright: (c) 2012 by Kenneth Reitz. +:license: Apache2, see LICENSE for more details. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from . import sessions +from .models import Response + +if TYPE_CHECKING: + from typing_extensions import Unpack + + from . import _types as _t + + +def request( + method: str, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs] +) -> Response: + """Constructs and sends a :class:`Request <Request>`. + + :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the query string for the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. + :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. + :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. + :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. + ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` + or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content_type'`` is a string + defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers + to add for the file. + :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. + :param timeout: (optional) How many seconds to wait for the server to send data + before giving up, as a float, or a :ref:`(connect timeout, read + timeout) <timeouts>` tuple. + :type timeout: float or tuple + :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. + :type allow_redirects: bool + :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use. Defaults to ``True``. + :param stream: (optional) if ``False``, the response content will be immediately downloaded. + :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. + :return: :class:`Response <Response>` object + :rtype: requests.Response + + Usage:: + + >>> import requests + >>> req = requests.request('GET', 'https://httpbin.org/get') + >>> req + <Response [200]> + """ + + # By using the 'with' statement we are sure the session is closed, thus we + # avoid leaving sockets open which can trigger a ResourceWarning in some + # cases, and look like a memory leak in others. + with sessions.Session() as session: + return session.request(method=method, url=url, **kwargs) + + +def get( + url: _t.UriType, params: _t.ParamsType = None, **kwargs: Unpack[_t.GetKwargs] +) -> Response: + r"""Sends a GET request. + + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the query string for the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("get", url, params=params, **kwargs) + + +def options(url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends an OPTIONS request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("options", url, **kwargs) + + +def head(url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends a HEAD request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. If + `allow_redirects` is not provided, it will be set to `False` (as + opposed to the default :meth:`request` behavior). + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + kwargs.setdefault("allow_redirects", False) + return request("head", url, **kwargs) + + +def post( + url: _t.UriType, + data: _t.DataType = None, + json: _t.JsonType = None, + **kwargs: Unpack[_t.PostKwargs], +) -> Response: + r"""Sends a POST request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("post", url, data=data, json=json, **kwargs) + + +def put( + url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs] +) -> Response: + r"""Sends a PUT request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("put", url, data=data, **kwargs) + + +def patch( + url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs] +) -> Response: + r"""Sends a PATCH request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("patch", url, data=data, **kwargs) + + +def delete(url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends a DELETE request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response <Response>` object + :rtype: requests.Response + """ + + return request("delete", url, **kwargs) diff --git a/micromamba_root/Lib/site-packages/requests/auth.py b/micromamba_root/Lib/site-packages/requests/auth.py new file mode 100644 index 0000000000000000000000000000000000000000..2af481dbf59e31965bde74c2e27d73517a39d7ac --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/auth.py @@ -0,0 +1,354 @@ +""" +requests.auth +~~~~~~~~~~~~~ + +This module contains the authentication handlers for Requests. +""" + +from __future__ import annotations + +import hashlib +import os +import re +import threading +import time +import warnings +from base64 import b64encode +from typing import TYPE_CHECKING, Any, Final, cast, overload + +from ._internal_utils import to_native_string +from .compat import basestring, str, urlparse +from .cookies import extract_cookies_to_jar +from .utils import parse_dict_header + +if TYPE_CHECKING: + from http.cookiejar import CookieJar + from typing import Any + + from .models import PreparedRequest, Response + +CONTENT_TYPE_FORM_URLENCODED: Final = "application/x-www-form-urlencoded" +CONTENT_TYPE_MULTI_PART: Final = "multipart/form-data" + + +def _basic_auth_str(username: bytes | str, password: bytes | str) -> str: + """Returns a Basic Auth string.""" + + # "I want us to put a big-ol' comment on top of it that + # says that this behaviour is dumb but we need to preserve + # it because people are relying on it." + # - Lukasa + # + # These are here solely to maintain backwards compatibility + # for things like ints. This will be removed in 3.0.0. + if not isinstance(username, basestring): # type: ignore[reportUnnecessaryIsInstance] # runtime guard for non-str/bytes + warnings.warn( + "Non-string usernames will no longer be supported in Requests " + f"3.0.0. Please convert the object you've passed in ({username!r}) to " + "a string or bytes object in the near future to avoid " + "problems.", + category=DeprecationWarning, + ) + username = str(username) + + if not isinstance(password, basestring): # type: ignore[reportUnnecessaryIsInstance] # runtime guard for non-str/bytes + warnings.warn( + "Non-string passwords will no longer be supported in Requests " + f"3.0.0. Please convert the object you've passed in ({type(password)!r}) to " + "a string or bytes object in the near future to avoid " + "problems.", + category=DeprecationWarning, + ) + password = str(password) + # -- End Removal -- + + if isinstance(username, str): + username = username.encode("latin1") + + if isinstance(password, str): + password = password.encode("latin1") + + authstr = "Basic " + to_native_string( + b64encode(b":".join((username, password))).strip() + ) + + return authstr + + +class AuthBase: + """Base class that all auth implementations derive from""" + + def __call__(self, r: PreparedRequest) -> PreparedRequest: + raise NotImplementedError("Auth hooks must be callable.") + + +class HTTPBasicAuth(AuthBase): + """Attaches HTTP Basic Authentication to the given Request object.""" + + username: bytes | str + password: bytes | str + + @overload + def __init__(self, username: str, password: str) -> None: ... + @overload + def __init__(self, username: bytes, password: bytes) -> None: ... + + def __init__(self, username: bytes | str, password: bytes | str) -> None: + self.username = username + self.password = password + + def __eq__(self, other: object) -> bool: + return all( + [ + self.username == getattr(other, "username", None), + self.password == getattr(other, "password", None), + ] + ) + + def __ne__(self, other: Any) -> bool: + return not self == other + + def __call__(self, r: PreparedRequest) -> PreparedRequest: + r.headers["Authorization"] = _basic_auth_str(self.username, self.password) + return r + + +class HTTPProxyAuth(HTTPBasicAuth): + """Attaches HTTP Proxy Authentication to a given Request object.""" + + def __call__(self, r: PreparedRequest) -> PreparedRequest: + r.headers["Proxy-Authorization"] = _basic_auth_str(self.username, self.password) + return r + + +class HTTPDigestAuth(AuthBase): + """Attaches HTTP Digest Authentication to the given Request object.""" + + username: bytes | str + password: bytes | str + _thread_local: threading.local + last_nonce: str + nonce_count: int + chal: dict[str, str] + pos: int | None + num_401_calls: int | None + + @overload + def __init__(self, username: str, password: str) -> None: ... + @overload + def __init__(self, username: bytes, password: bytes) -> None: ... + + def __init__(self, username: bytes | str, password: bytes | str) -> None: + self.username = username + self.password = password + # Keep state in per-thread local storage + self._thread_local = threading.local() + + def init_per_thread_state(self) -> None: + # Ensure state is initialized just once per-thread + if not hasattr(self._thread_local, "init"): + self._thread_local.init = True + self._thread_local.last_nonce = "" + self._thread_local.nonce_count = 0 + self._thread_local.chal = {} + self._thread_local.pos = None + self._thread_local.num_401_calls = None + + def build_digest_header(self, method: str, url: str) -> str | None: + """ + :rtype: str + """ + + realm = self._thread_local.chal["realm"] + nonce = self._thread_local.chal["nonce"] + qop = self._thread_local.chal.get("qop") + algorithm = self._thread_local.chal.get("algorithm") + opaque = self._thread_local.chal.get("opaque") + hash_utf8 = None + + if algorithm is None: + _algorithm = "MD5" + else: + _algorithm = algorithm.upper() + # lambdas assume digest modules are imported at the top level + if _algorithm == "MD5" or _algorithm == "MD5-SESS": + + def md5_utf8(x: str | bytes) -> str: + if isinstance(x, str): + x = x.encode("utf-8") + return hashlib.md5(x, usedforsecurity=False).hexdigest() + + hash_utf8 = md5_utf8 + elif _algorithm == "SHA": + + def sha_utf8(x: str | bytes) -> str: + if isinstance(x, str): + x = x.encode("utf-8") + return hashlib.sha1(x, usedforsecurity=False).hexdigest() + + hash_utf8 = sha_utf8 + elif _algorithm == "SHA-256": + + def sha256_utf8(x: str | bytes) -> str: + if isinstance(x, str): + x = x.encode("utf-8") + return hashlib.sha256(x, usedforsecurity=False).hexdigest() + + hash_utf8 = sha256_utf8 + elif _algorithm == "SHA-512": + + def sha512_utf8(x: str | bytes) -> str: + if isinstance(x, str): + x = x.encode("utf-8") + return hashlib.sha512(x, usedforsecurity=False).hexdigest() + + hash_utf8 = sha512_utf8 + + if hash_utf8 is None: + return None + + def KD(s: str, d: str) -> str: + return hash_utf8(f"{s}:{d}") + + # XXX not implemented yet + entdig = None + p_parsed = urlparse(url) + #: path is request-uri defined in RFC 2616 which should not be empty + path = p_parsed.path or "/" + if p_parsed.query: + path += f"?{p_parsed.query}" + + A1 = f"{self.username}:{realm}:{self.password}" + A2 = f"{method}:{path}" + + HA1 = hash_utf8(A1) + HA2 = hash_utf8(A2) + + if nonce == self._thread_local.last_nonce: + self._thread_local.nonce_count += 1 + else: + self._thread_local.nonce_count = 1 + ncvalue = f"{self._thread_local.nonce_count:08x}" + s = str(self._thread_local.nonce_count).encode("utf-8") + s += nonce.encode("utf-8") + s += time.ctime().encode("utf-8") + s += os.urandom(8) + + cnonce = hashlib.sha1(s, usedforsecurity=False).hexdigest()[:16] + if _algorithm == "MD5-SESS": + HA1 = hash_utf8(f"{HA1}:{nonce}:{cnonce}") # type: ignore[reportConstantRedefinition] # RFC 2617 terminology + + if not qop: + respdig = KD(HA1, f"{nonce}:{HA2}") + elif qop == "auth" or "auth" in qop.split(","): + noncebit = f"{nonce}:{ncvalue}:{cnonce}:auth:{HA2}" + respdig = KD(HA1, noncebit) + else: + # XXX handle auth-int. + return None + + self._thread_local.last_nonce = nonce + + # XXX should the partial digests be encoded too? + base = ( + f'username="{self.username}", realm="{realm}", nonce="{nonce}", ' + f'uri="{path}", response="{respdig}"' + ) + if opaque: + base += f', opaque="{opaque}"' + if algorithm: + base += f', algorithm="{algorithm}"' + if entdig: + base += f', digest="{entdig}"' + if qop: + base += f', qop="auth", nc={ncvalue}, cnonce="{cnonce}"' + + return f"Digest {base}" + + def handle_redirect(self, r: Response, **kwargs: Any) -> None: + """Reset num_401_calls counter on redirects.""" + if r.is_redirect: + self._thread_local.num_401_calls = 1 + + def handle_401(self, r: Response, **kwargs: Any) -> Response: + """ + Takes the given response and tries digest-auth, if needed. + + :rtype: requests.Response + """ + + # If response is not 4xx, do not auth + # See https://github.com/psf/requests/issues/3772 + if not 400 <= r.status_code < 500: + self._thread_local.num_401_calls = 1 + return r + + if self._thread_local.pos is not None: + # Rewind the file position indicator of the body to where + # it was to resend the request. + if (seek := getattr(r.request.body, "seek", None)) is not None: + seek(self._thread_local.pos) + s_auth = r.headers.get("www-authenticate", "") + + if "digest" in s_auth.lower() and self._thread_local.num_401_calls < 2: + self._thread_local.num_401_calls += 1 + pat = re.compile(r"digest ", flags=re.IGNORECASE) + self._thread_local.chal = parse_dict_header(pat.sub("", s_auth, count=1)) + + # Consume content and release the original connection + # to allow our new request to reuse the same one. + r.content + r.close() + prep = r.request.copy() + cookie_jar = cast("CookieJar", prep._cookies) # type: ignore[reportPrivateUsage] + extract_cookies_to_jar(cookie_jar, r.request, r.raw) + prep.prepare_cookies(cookie_jar) + + _digest_auth = self.build_digest_header( + cast(str, prep.method), cast(str, prep.url) + ) + if _digest_auth: + prep.headers["Authorization"] = _digest_auth + _r = r.connection.send(prep, **kwargs) + _r.history.append(r) + _r.request = prep + + return _r + + self._thread_local.num_401_calls = 1 + return r + + def __call__(self, r: PreparedRequest) -> PreparedRequest: + # Initialize per-thread state, if needed + self.init_per_thread_state() + # If we have a saved nonce, skip the 401 + if self._thread_local.last_nonce: + _digest_auth = self.build_digest_header( + cast(str, r.method), cast(str, r.url) + ) + if _digest_auth: + r.headers["Authorization"] = _digest_auth + if (tell := getattr(r.body, "tell", None)) is not None: + self._thread_local.pos = tell() + else: + # In the case of HTTPDigestAuth being reused and the body of + # the previous request was a file-like object, pos has the + # file position of the previous body. Ensure it's set to + # None. + self._thread_local.pos = None + r.register_hook("response", self.handle_401) + r.register_hook("response", self.handle_redirect) + self._thread_local.num_401_calls = 1 + + return r + + def __eq__(self, other: object) -> bool: + return all( + [ + self.username == getattr(other, "username", None), + self.password == getattr(other, "password", None), + ] + ) + + def __ne__(self, other: Any) -> bool: + return not self == other diff --git a/micromamba_root/Lib/site-packages/requests/certs.py b/micromamba_root/Lib/site-packages/requests/certs.py new file mode 100644 index 0000000000000000000000000000000000000000..4f85ac070bc0230af8155bcadfaa96165268cede --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/certs.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +""" +requests.certs +~~~~~~~~~~~~~~ + +This module returns the preferred default CA certificate bundle. There is +only one — the one from the certifi package. + +If you are packaging Requests, e.g., for a Linux distribution or a managed +environment, you can change the definition of where() to return a separately +packaged CA bundle. +""" + +from certifi import where + +if __name__ == "__main__": + print(where()) diff --git a/micromamba_root/Lib/site-packages/requests/compat.py b/micromamba_root/Lib/site-packages/requests/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..deab3c091fed207315c5af60fb415d7407a08b48 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/compat.py @@ -0,0 +1,113 @@ +""" +requests.compat +~~~~~~~~~~~~~~~ + +This module previously handled import compatibility issues +between Python 2 and Python 3. It remains for backwards +compatibility until the next major version. +""" + +# pyright: reportUnusedImport=false + +from __future__ import annotations + +import importlib +import sys +from types import ModuleType + +# ------- +# urllib3 +# ------- +from urllib3 import ( + __version__ as urllib3_version, # type: ignore[reportPrivateImportUsage] +) + +# Detect which major version of urllib3 is being used. +try: + is_urllib3_1 = int(urllib3_version.split(".")[0]) == 1 +except (TypeError, AttributeError): + # If we can't discern a version, prefer old functionality. + is_urllib3_1 = True + +# ------------------- +# Character Detection +# ------------------- + + +def _resolve_char_detection() -> ModuleType | None: + """Find supported character detection libraries.""" + chardet = None + for lib in ("chardet", "charset_normalizer"): + if chardet is None: + try: + chardet = importlib.import_module(lib) + except ImportError: + pass + return chardet + + +chardet = _resolve_char_detection() + +# ------- +# Pythons +# ------- + +# Syntax sugar. +_ver = sys.version_info + +#: Python 2.x? +is_py2 = _ver[0] == 2 + +#: Python 3.x? +is_py3 = _ver[0] == 3 + +# json/simplejson module import resolution +has_simplejson = False +try: + import simplejson as json # type: ignore[import-not-found] + + has_simplejson = True +except ImportError: + import json + +if has_simplejson: + from simplejson import JSONDecodeError # type: ignore[import-not-found] +else: + from json import JSONDecodeError + +# Keep OrderedDict for backwards compatibility. +from collections import OrderedDict +from collections.abc import Callable, Mapping, MutableMapping +from http import cookiejar as cookielib +from http.cookies import Morsel +from io import StringIO + +# -------------- +# Legacy Imports +# -------------- +from urllib.parse import ( + quote, + quote_plus, + unquote, + unquote_plus, + urldefrag, + urlencode, + urljoin, + urlparse, + urlsplit, + urlunparse, +) +from urllib.request import ( + getproxies, + getproxies_environment, + parse_http_list, + proxy_bypass, + proxy_bypass_environment, # type: ignore[attr-defined] # https://github.com/python/cpython/issues/145331 +) + +builtin_str = str +str = str +bytes = bytes +basestring = (str, bytes) +numeric_types = (int, float) +integer_types = (int,) diff --git a/micromamba_root/Lib/site-packages/requests/cookies.py b/micromamba_root/Lib/site-packages/requests/cookies.py new file mode 100644 index 0000000000000000000000000000000000000000..2e3fc215095fad13817562bbaee871cba57eec08 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/cookies.py @@ -0,0 +1,625 @@ +""" +requests.cookies +~~~~~~~~~~~~~~~~ + +Compatibility code to be able to use `http.cookiejar.CookieJar` with requests. + +requests.utils imports from here, so be careful with imports. +""" + +from __future__ import annotations + +import calendar +import copy +import time +from collections.abc import Iterator, MutableMapping +from http.cookiejar import Cookie, CookieJar, CookiePolicy +from typing import TYPE_CHECKING, Any, TypeVar, overload + +from ._internal_utils import to_native_string +from ._types import is_prepared as _is_prepared +from .compat import Morsel, cookielib, urlparse, urlunparse + +if TYPE_CHECKING: + from _typeshed import SupportsKeysAndGetItem + + from .models import PreparedRequest + +import threading + + +class MockRequest: + """Wraps a `requests.PreparedRequest` to mimic a `urllib2.Request`. + + The code in `http.cookiejar.CookieJar` expects this interface in order to correctly + manage cookie policies, i.e., determine whether a cookie can be set, given the + domains of the request and the cookie. + + The original request object is read-only. The client is responsible for collecting + the new headers via `get_new_headers()` and interpreting them appropriately. You + probably want `get_cookie_header`, defined below. + """ + + type: str + + def __init__(self, request: PreparedRequest) -> None: + assert _is_prepared(request) + self._r = request + self._new_headers: dict[str, str] = {} + self.type = urlparse(self._r.url).scheme + + def get_type(self) -> str: + return self.type + + def get_host(self) -> str: + return urlparse(self._r.url).netloc + + def get_origin_req_host(self) -> str: + return self.get_host() + + def get_full_url(self) -> str: + # Only return the response's URL if the user hadn't set the Host + # header + if not self._r.headers.get("Host"): + return self._r.url + # If they did set it, retrieve it and reconstruct the expected domain + host = to_native_string(self._r.headers["Host"], encoding="utf-8") + parsed = urlparse(self._r.url) + # Reconstruct the URL as we expect it + return urlunparse( + [ + parsed.scheme, + host, + parsed.path, + parsed.params, + parsed.query, + parsed.fragment, + ] + ) + + def is_unverifiable(self) -> bool: + return True + + def has_header(self, name: str) -> bool: + return name in self._r.headers or name in self._new_headers + + def get_header(self, name: str, default: str | None = None) -> str | None: + return self._r.headers.get(name, self._new_headers.get(name, default)) # type: ignore[return-value] + + def add_header(self, key: str, val: str) -> None: + """cookiejar has no legitimate use for this method; add it back if you find one.""" + raise NotImplementedError( + "Cookie headers should be added with add_unredirected_header()" + ) + + def add_unredirected_header(self, name: str, value: str) -> None: + self._new_headers[name] = value + + def get_new_headers(self) -> dict[str, str]: + return self._new_headers + + @property + def unverifiable(self) -> bool: + return self.is_unverifiable() + + @property + def origin_req_host(self) -> str: + return self.get_origin_req_host() + + @property + def host(self) -> str: + return self.get_host() + + +class MockResponse: + """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. + + ...what? Basically, expose the parsed HTTP headers from the server response + the way `http.cookiejar` expects to see them. + """ + + def __init__(self, headers: Any) -> None: + """Make a MockResponse for `cookiejar` to read. + + :param headers: a httplib.HTTPMessage or analogous carrying the headers + """ + self._headers = headers + + def info(self) -> Any: + return self._headers + + def getheaders(self, name: str) -> Any: + self._headers.getheaders(name) + + +def extract_cookies_to_jar( + jar: CookieJar, request: PreparedRequest, response: Any +) -> None: + """Extract the cookies from the response into a CookieJar. + + :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar) + :param request: our own requests.Request object + :param response: urllib3.HTTPResponse object + """ + if not (hasattr(response, "_original_response") and response._original_response): + return + # the _original_response field is the wrapped httplib.HTTPResponse object, + req = MockRequest(request) + # pull out the HTTPMessage with the headers and put it in the mock: + res = MockResponse(response._original_response.msg) + jar.extract_cookies(res, req) # type: ignore[arg-type] + + +def get_cookie_header(jar: CookieJar, request: PreparedRequest) -> str | None: + """ + Produce an appropriate Cookie header string to be sent with `request`, or None. + + :rtype: str + """ + r = MockRequest(request) + jar.add_cookie_header(r) # type: ignore[arg-type] + return r.get_new_headers().get("Cookie") + + +def remove_cookie_by_name( + cookiejar: CookieJar, name: str, domain: str | None = None, path: str | None = None +) -> None: + """Unsets a cookie by name, by default over all domains and paths. + + Wraps CookieJar.clear(), is O(n). + """ + clearables: list[tuple[str, str, str]] = [] + for cookie in cookiejar: + if cookie.name != name: + continue + if domain is not None and domain != cookie.domain: + continue + if path is not None and path != cookie.path: + continue + clearables.append((cookie.domain, cookie.path, cookie.name)) + + for domain, path, name in clearables: + cookiejar.clear(domain, path, name) + + +class CookieConflictError(RuntimeError): + """There are two cookies that meet the criteria specified in the cookie jar. + Use .get and .set and include domain and path args in order to be more specific. + """ + + +class RequestsCookieJar(CookieJar, MutableMapping[str, str | None]): # type: ignore[misc] + """Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict + interface. + + This is the CookieJar we create by default for requests and sessions that + don't specify one, since some clients may expect response.cookies and + session.cookies to support dict operations. + + Requests does not use the dict interface internally; it's just for + compatibility with external client code. All requests code should work + out of the box with externally provided instances of ``CookieJar``, e.g. + ``LWPCookieJar`` and ``FileCookieJar``. + + Unlike a regular CookieJar, this class is pickleable. + + .. warning:: dictionary operations that are normally O(1) may be O(n). + """ + + _policy: CookiePolicy + + def get( # type: ignore[override] + self, + name: str, + default: str | None = None, + domain: str | None = None, + path: str | None = None, + ) -> str | None: + """Dict-like get() that also supports optional domain and path args in + order to resolve naming collisions from using one cookie jar over + multiple domains. + + .. warning:: operation is O(n), not O(1). + """ + try: + return self._find_no_duplicates(name, domain, path) + except KeyError: + return default + + def set( + self, name: str, value: str | Morsel[dict[str, str]] | None, **kwargs: Any + ) -> Cookie | None: + """Dict-like set() that also supports optional domain and path args in + order to resolve naming collisions from using one cookie jar over + multiple domains. + """ + # support client code that unsets cookies by assignment of a None value: + if value is None: + remove_cookie_by_name( + self, name, domain=kwargs.get("domain"), path=kwargs.get("path") + ) + return + + if isinstance(value, Morsel): + c = morsel_to_cookie(value) + else: + c = create_cookie(name, value, **kwargs) + self.set_cookie(c) + return c + + def iterkeys(self) -> Iterator[str]: + """Dict-like iterkeys() that returns an iterator of names of cookies + from the jar. + + .. seealso:: itervalues() and iteritems(). + """ + for cookie in iter(self): + yield cookie.name + + def keys(self) -> list[str]: # type: ignore[override] + """Dict-like keys() that returns a list of names of cookies from the + jar. + + .. seealso:: values() and items(). + """ + return list(self.iterkeys()) + + def itervalues(self) -> Iterator[str | None]: + """Dict-like itervalues() that returns an iterator of values of cookies + from the jar. + + .. seealso:: iterkeys() and iteritems(). + """ + for cookie in iter(self): + yield cookie.value + + def values(self) -> list[str | None]: # type: ignore[override] + """Dict-like values() that returns a list of values of cookies from the + jar. + + .. seealso:: keys() and items(). + """ + return list(self.itervalues()) + + def iteritems(self) -> Iterator[tuple[str, str | None]]: + """Dict-like iteritems() that returns an iterator of name-value tuples + from the jar. + + .. seealso:: iterkeys() and itervalues(). + """ + for cookie in iter(self): + yield cookie.name, cookie.value + + def items(self) -> list[tuple[str, str | None]]: # type: ignore[override] + """Dict-like items() that returns a list of name-value tuples from the + jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a + vanilla python dict of key value pairs. + + .. seealso:: keys() and values(). + """ + return list(self.iteritems()) + + def list_domains(self) -> list[str]: + """Utility method to list all the domains in the jar.""" + domains: list[str] = [] + for cookie in iter(self): + if cookie.domain not in domains: + domains.append(cookie.domain) + return domains + + def list_paths(self) -> list[str]: + """Utility method to list all the paths in the jar.""" + paths: list[str] = [] + for cookie in iter(self): + if cookie.path not in paths: + paths.append(cookie.path) + return paths + + def multiple_domains(self) -> bool: + """Returns True if there are multiple domains in the jar. + Returns False otherwise. + + :rtype: bool + """ + domains: list[str] = [] + for cookie in iter(self): + if cookie.domain is not None and cookie.domain in domains: # type: ignore[reportUnnecessaryComparison] # defensive check + return True + domains.append(cookie.domain) + return False # there is only one domain in jar + + def get_dict( + self, domain: str | None = None, path: str | None = None + ) -> dict[str, str | None]: + """Takes as an argument an optional domain and path and returns a plain + old Python dict of name-value pairs of cookies that meet the + requirements. + + :rtype: dict + """ + dictionary: dict[str, str | None] = {} + for cookie in iter(self): + if (domain is None or cookie.domain == domain) and ( + path is None or cookie.path == path + ): + dictionary[cookie.name] = cookie.value + return dictionary + + def __iter__(self) -> Iterator[Cookie]: # type: ignore[override] + """RequestCookieJar's __iter__ comes from CookieJar not MutableMapping.""" + return super().__iter__() + + def __contains__(self, name: object) -> bool: + try: + return super().__contains__(name) + except CookieConflictError: + return True + + def __getitem__(self, name: str) -> str | None: + """Dict-like __getitem__() for compatibility with client code. Throws + exception if there are more than one cookie with name. In that case, + use the more explicit get() method instead. + + .. warning:: operation is O(n), not O(1). + """ + return self._find_no_duplicates(name) + + def __setitem__( + self, name: str, value: str | Morsel[dict[str, str]] | None + ) -> None: + """Dict-like __setitem__ for compatibility with client code. Throws + exception if there is already a cookie of that name in the jar. In that + case, use the more explicit set() method instead. + """ + self.set(name, value) + + def __delitem__(self, name: str) -> None: + """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s + ``remove_cookie_by_name()``. + """ + remove_cookie_by_name(self, name) + + def set_cookie(self, cookie: Cookie, *args: Any, **kwargs: Any) -> None: + if ( + (value := cookie.value) is not None + and value.startswith('"') + and value.endswith('"') + ): + cookie.value = value.replace('\\"', "") + return super().set_cookie(cookie, *args, **kwargs) + + def update( # type: ignore[override] + self, other: CookieJar | SupportsKeysAndGetItem[str, str] + ) -> None: + """Updates this jar with cookies from another CookieJar or dict-like""" + if isinstance(other, cookielib.CookieJar): + for cookie in other: + self.set_cookie(copy.copy(cookie)) + else: + super().update(other) + + def _find( + self, name: str, domain: str | None = None, path: str | None = None + ) -> str | None: + """Requests uses this method internally to get cookie values. + + If there are conflicting cookies, _find arbitrarily chooses one. + See _find_no_duplicates if you want an exception thrown if there are + conflicting cookies. + + :param name: a string containing name of cookie + :param domain: (optional) string containing domain of cookie + :param path: (optional) string containing path of cookie + :return: cookie.value + """ + for cookie in iter(self): + if cookie.name == name: + if domain is None or cookie.domain == domain: + if path is None or cookie.path == path: + return cookie.value + + raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") + + def _find_no_duplicates( + self, name: str, domain: str | None = None, path: str | None = None + ) -> str: + """Both ``__get_item__`` and ``get`` call this function: it's never + used elsewhere in Requests. + + :param name: a string containing name of cookie + :param domain: (optional) string containing domain of cookie + :param path: (optional) string containing path of cookie + :raises KeyError: if cookie is not found + :raises CookieConflictError: if there are multiple cookies + that match name and optionally domain and path + :return: cookie.value + """ + toReturn = None + for cookie in iter(self): + if cookie.name == name: + if domain is None or cookie.domain == domain: + if path is None or cookie.path == path: + if toReturn is not None: + # if there are multiple cookies that meet passed in criteria + raise CookieConflictError( + f"There are multiple cookies with name, {name!r}" + ) + # we will eventually return this as long as no cookie conflict + toReturn = cookie.value + + if toReturn is not None: + return toReturn + raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") + + def __getstate__(self) -> dict[str, Any]: + """Unlike a normal CookieJar, this class is pickleable.""" + state = self.__dict__.copy() + # remove the unpickleable RLock object + state.pop("_cookies_lock") + return state + + def __setstate__(self, state: dict[str, Any]) -> None: + """Unlike a normal CookieJar, this class is pickleable.""" + self.__dict__.update(state) + if "_cookies_lock" not in self.__dict__: + self._cookies_lock = threading.RLock() + + def copy(self) -> RequestsCookieJar: + """Return a copy of this RequestsCookieJar.""" + new_cj = RequestsCookieJar() + new_cj.set_policy(self.get_policy()) + new_cj.update(self) + return new_cj + + def get_policy(self) -> CookiePolicy: + """Return the CookiePolicy instance used.""" + return self._policy + + +def _copy_cookie_jar(jar: CookieJar | None) -> CookieJar | None: # type: ignore[reportUnusedFunction] # cross-module usage in models.py + if jar is None: + return None + + if copy_method := getattr(jar, "copy", None): + # We're dealing with an instance of RequestsCookieJar + return copy_method() + # We're dealing with a generic CookieJar instance + new_jar = copy.copy(jar) + new_jar.clear() + for cookie in jar: + new_jar.set_cookie(copy.copy(cookie)) + return new_jar + + +def create_cookie(name: str, value: str, **kwargs: Any) -> Cookie: + """Make a cookie from underspecified parameters. + + By default, the pair of `name` and `value` will be set for the domain '' + and sent on every request (this is sometimes called a "supercookie"). + """ + result: dict[str, Any] = { + "version": 0, + "name": name, + "value": value, + "port": None, + "domain": "", + "path": "/", + "secure": False, + "expires": None, + "discard": True, + "comment": None, + "comment_url": None, + "rest": {"HttpOnly": None}, + "rfc2109": False, + } + + badargs = set(kwargs) - set(result) + if badargs: + raise TypeError( + f"create_cookie() got unexpected keyword arguments: {list(badargs)}" + ) + + result.update(kwargs) + result["port_specified"] = bool(result["port"]) + result["domain_specified"] = bool(result["domain"]) + result["domain_initial_dot"] = result["domain"].startswith(".") + result["path_specified"] = bool(result["path"]) + + return cookielib.Cookie(**result) + + +def morsel_to_cookie(morsel: Morsel[Any]) -> Cookie: + """Convert a Morsel object into a Cookie containing the one k/v pair.""" + + expires: int | None = None + if morsel["max-age"]: + try: + expires = int(time.time() + int(morsel["max-age"])) + except ValueError: + raise TypeError(f"max-age: {morsel['max-age']} must be integer") + elif morsel["expires"]: + time_template = "%a, %d-%b-%Y %H:%M:%S GMT" + expires = calendar.timegm(time.strptime(morsel["expires"], time_template)) + return create_cookie( + comment=morsel["comment"], + comment_url=bool(morsel["comment"]), + discard=False, + domain=morsel["domain"], + expires=expires, + name=morsel.key, + path=morsel["path"], + port=None, + rest={"HttpOnly": morsel["httponly"]}, + rfc2109=False, + secure=bool(morsel["secure"]), + value=morsel.value, + version=morsel["version"] or 0, + ) + + +_CookieJarT = TypeVar("_CookieJarT", bound=CookieJar) + + +@overload +def cookiejar_from_dict( + cookie_dict: dict[str, str] | None, + cookiejar: None = None, + overwrite: bool = True, +) -> RequestsCookieJar: ... + + +@overload +def cookiejar_from_dict( + cookie_dict: dict[str, str] | None, + cookiejar: _CookieJarT, + overwrite: bool = True, +) -> _CookieJarT: ... + + +def cookiejar_from_dict( + cookie_dict: dict[str, str] | None, + cookiejar: CookieJar | None = None, + overwrite: bool = True, +) -> CookieJar: + """Returns a CookieJar from a key/value dictionary. + + :param cookie_dict: Dict of key/values to insert into CookieJar. + :param cookiejar: (optional) A cookiejar to add the cookies to. + :param overwrite: (optional) If False, will not replace cookies + already in the jar with new ones. + :rtype: CookieJar + """ + if cookiejar is None: + cookiejar = RequestsCookieJar() + + if cookie_dict is not None: + names_from_jar = [cookie.name for cookie in cookiejar] + for name in cookie_dict: + if overwrite or (name not in names_from_jar): + cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) + + return cookiejar + + +def merge_cookies( + cookiejar: CookieJar, cookies: dict[str, str] | CookieJar | None +) -> CookieJar: + """Add cookies to cookiejar and returns a merged CookieJar. + + :param cookiejar: CookieJar object to add the cookies to. + :param cookies: Dictionary or CookieJar object to be added. + :rtype: CookieJar + """ + if not isinstance(cookiejar, cookielib.CookieJar): # type: ignore[reportUnnecessaryIsInstance] # runtime guard + raise ValueError("You can only merge into CookieJar") + + if isinstance(cookies, dict): + cookiejar = cookiejar_from_dict(cookies, cookiejar=cookiejar, overwrite=False) + elif isinstance(cookies, cookielib.CookieJar): + if update_method := getattr(cookiejar, "update", None): + update_method(cookies) + else: + for cookie_in_jar in cookies: + cookiejar.set_cookie(cookie_in_jar) + + return cookiejar diff --git a/micromamba_root/Lib/site-packages/requests/exceptions.py b/micromamba_root/Lib/site-packages/requests/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..cb5e9510e3b1cf4804ac6091fd7fdb55e9f2745b --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/exceptions.py @@ -0,0 +1,162 @@ +""" +requests.exceptions +~~~~~~~~~~~~~~~~~~~ + +This module contains the set of Requests' exceptions. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from urllib3.exceptions import HTTPError as BaseHTTPError + +from .compat import JSONDecodeError as CompatJSONDecodeError + +if TYPE_CHECKING: + from .models import PreparedRequest, Request, Response + + +class RequestException(IOError): + """There was an ambiguous exception that occurred while handling your + request. + """ + + response: Response | None + request: Request | PreparedRequest | None + + def __init__(self, *args: Any, **kwargs: Any) -> None: + """Initialize RequestException with `request` and `response` objects.""" + response: Response | None = kwargs.pop("response", None) + self.response = response + self.request = kwargs.pop("request", None) + if response is not None and not self.request and hasattr(response, "request"): + self.request = response.request + super().__init__(*args, **kwargs) + + +class InvalidJSONError(RequestException): + """A JSON error occurred.""" + + +class JSONDecodeError(InvalidJSONError, CompatJSONDecodeError): + """Couldn't decode the text into json""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + """ + Construct the JSONDecodeError instance first with all + args. Then use it's args to construct the IOError so that + the json specific args aren't used as IOError specific args + and the error message from JSONDecodeError is preserved. + """ + CompatJSONDecodeError.__init__(self, *args) + InvalidJSONError.__init__(self, *self.args, **kwargs) + + def __reduce__(self) -> tuple[Any, ...] | str: + """ + The __reduce__ method called when pickling the object must + be the one from the JSONDecodeError (be it json/simplejson) + as it expects all the arguments for instantiation, not just + one like the IOError, and the MRO would by default call the + __reduce__ method from the IOError due to the inheritance order. + """ + return CompatJSONDecodeError.__reduce__(self) + + +class HTTPError(RequestException): + """An HTTP error occurred.""" + + +class ConnectionError(RequestException): + """A Connection error occurred.""" + + +class ProxyError(ConnectionError): + """A proxy error occurred.""" + + +class SSLError(ConnectionError): + """An SSL error occurred.""" + + +class Timeout(RequestException): + """The request timed out. + + Catching this error will catch both + :exc:`~requests.exceptions.ConnectTimeout` and + :exc:`~requests.exceptions.ReadTimeout` errors. + """ + + +class ConnectTimeout(ConnectionError, Timeout): + """The request timed out while trying to connect to the remote server. + + Requests that produced this error are safe to retry. + """ + + +class ReadTimeout(Timeout): + """The server did not send any data in the allotted amount of time.""" + + +class URLRequired(RequestException): + """A valid URL is required to make a request.""" + + +class TooManyRedirects(RequestException): + """Too many redirects.""" + + +class MissingSchema(RequestException, ValueError): + """The URL scheme (e.g. http or https) is missing.""" + + +class InvalidSchema(RequestException, ValueError): + """The URL scheme provided is either invalid or unsupported.""" + + +class InvalidURL(RequestException, ValueError): + """The URL provided was somehow invalid.""" + + +class InvalidHeader(RequestException, ValueError): + """The header value provided was somehow invalid.""" + + +class InvalidProxyURL(InvalidURL): + """The proxy URL provided is invalid.""" + + +class ChunkedEncodingError(RequestException): + """The server declared chunked encoding but sent an invalid chunk.""" + + +class ContentDecodingError(RequestException, BaseHTTPError): + """Failed to decode response content.""" + + +class StreamConsumedError(RequestException, TypeError): + """The content for this response was already consumed.""" + + +class RetryError(RequestException): + """Custom retries logic failed""" + + +class UnrewindableBodyError(RequestException): + """Requests encountered an error when trying to rewind a body.""" + + +# Warnings + + +class RequestsWarning(Warning): + """Base warning for Requests.""" + + +class FileModeWarning(RequestsWarning, DeprecationWarning): + """A file was opened in text mode, but Requests determined its binary length.""" + + +class RequestsDependencyWarning(RequestsWarning): + """An imported dependency doesn't match the expected version range.""" diff --git a/micromamba_root/Lib/site-packages/requests/help.py b/micromamba_root/Lib/site-packages/requests/help.py new file mode 100644 index 0000000000000000000000000000000000000000..9269cc71263e3f5938a89a9d6c2fed5a4274cc14 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/help.py @@ -0,0 +1,134 @@ +"""Module containing bug report helper(s).""" + +# pyright: reportUnknownMemberType=false + +import json +import platform +import ssl +import sys +from typing import Any + +import idna +import urllib3 + +from . import __version__ as requests_version + +try: + import charset_normalizer +except ImportError: + charset_normalizer = None + +try: + import chardet # type: ignore[import-not-found] +except ImportError: + chardet = None + +try: + from urllib3.contrib import pyopenssl +except ImportError: + pyopenssl = None + OpenSSL = None + cryptography = None +else: + import cryptography # type: ignore[import-not-found] + import OpenSSL # type: ignore[import-not-found] + + +def _implementation(): + """Return a dict with the Python implementation and version. + + Provide both the name and the version of the Python implementation + currently running. For example, on CPython 3.10.3 it will return + {'name': 'CPython', 'version': '3.10.3'}. + + This function works best on CPython and PyPy: in particular, it probably + doesn't work for Jython or IronPython. Future investigation should be done + to work out the correct shape of the code for those platforms. + """ + implementation = platform.python_implementation() + + if implementation == "CPython": + implementation_version = platform.python_version() + elif implementation == "PyPy": + pypy = sys.pypy_version_info # type: ignore[attr-defined] + implementation_version = f"{pypy.major}.{pypy.minor}.{pypy.micro}" + if sys.pypy_version_info.releaselevel != "final": # type: ignore[attr-defined] + implementation_version = "".join( + [implementation_version, sys.pypy_version_info.releaselevel] # type: ignore[attr-defined] + ) + elif implementation == "Jython": + implementation_version = platform.python_version() # Complete Guess + elif implementation == "IronPython": + implementation_version = platform.python_version() # Complete Guess + else: + implementation_version = "Unknown" + + return {"name": implementation, "version": implementation_version} + + +def info() -> dict[str, Any]: + """Generate information for a bug report.""" + try: + platform_info = { + "system": platform.system(), + "release": platform.release(), + } + except OSError: + platform_info = { + "system": "Unknown", + "release": "Unknown", + } + + implementation_info = _implementation() + urllib3_info = {"version": urllib3.__version__} # type: ignore[reportPrivateImportUsage] + charset_normalizer_info = {"version": None} + chardet_info: dict[str, str | None] = {"version": None} + if charset_normalizer: + charset_normalizer_info = {"version": charset_normalizer.__version__} + if chardet: + chardet_info = {"version": chardet.__version__} + + pyopenssl_info: dict[str, str | None] = { + "version": None, + "openssl_version": "", + } + if OpenSSL: + pyopenssl_info = { + "version": OpenSSL.__version__, + "openssl_version": f"{OpenSSL.SSL.OPENSSL_VERSION_NUMBER:x}", + } + cryptography_info = { + "version": getattr(cryptography, "__version__", ""), + } + idna_info = { + "version": getattr(idna, "__version__", ""), + } + + system_ssl = ssl.OPENSSL_VERSION_NUMBER + system_ssl_info = {"version": f"{system_ssl:x}" if system_ssl is not None else ""} # type: ignore[reportUnnecessaryComparison] + + return { + "platform": platform_info, + "implementation": implementation_info, + "system_ssl": system_ssl_info, + "using_pyopenssl": pyopenssl is not None, + "using_charset_normalizer": chardet is None, + "pyOpenSSL": pyopenssl_info, + "urllib3": urllib3_info, + "chardet": chardet_info, + "charset_normalizer": charset_normalizer_info, + "cryptography": cryptography_info, + "idna": idna_info, + "requests": { + "version": requests_version, + }, + } + + +def main(): + """Pretty-print the bug information as JSON.""" + print(json.dumps(info(), sort_keys=True, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/micromamba_root/Lib/site-packages/requests/hooks.py b/micromamba_root/Lib/site-packages/requests/hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..11ff9e9f27e76f5ef6b9b609e88c2f418d655e16 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/hooks.py @@ -0,0 +1,48 @@ +""" +requests.hooks +~~~~~~~~~~~~~~ + +This module provides the capabilities for the Requests hooks system. + +Available hooks: + +``response``: + The response generated from a Request. +""" + +from __future__ import annotations + +from collections.abc import Callable, Iterable +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from . import _types as _t + from .models import Response + +HOOKS: list[str] = ["response"] + + +def default_hooks() -> dict[str, list[_t.HookType]]: + return {event: [] for event in HOOKS} + + +# TODO: response is the only one + + +def dispatch_hook( + key: str, + hooks: _t.HooksInputType | None, + hook_data: Response, + **kwargs: Any, +) -> Response: + """Dispatches a hook dictionary on a given piece of data.""" + hooks_dict = hooks or {} + hook_list: Iterable[_t.HookType] | _t.HookType | None = hooks_dict.get(key) + if hook_list: + if isinstance(hook_list, Callable): + hook_list = [hook_list] + for hook in hook_list: + _hook_data = hook(hook_data, **kwargs) + if _hook_data is not None: + hook_data = _hook_data + return hook_data diff --git a/micromamba_root/Lib/site-packages/requests/models.py b/micromamba_root/Lib/site-packages/requests/models.py new file mode 100644 index 0000000000000000000000000000000000000000..4142f2a4bbf39820b46b414a15af805a34b1a013 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/models.py @@ -0,0 +1,1180 @@ +""" +requests.models +~~~~~~~~~~~~~~~ + +This module contains the primary objects that power Requests. +""" + +from __future__ import annotations + +import datetime + +# Import encoding now, to avoid implicit import later. +# Implicit import within threads may cause LookupError when standard library is in a ZIP, +# such as in Embedded Python. See https://github.com/psf/requests/issues/3578. +import encodings.idna # noqa: F401 # type: ignore[reportUnusedImport] +from collections.abc import Callable, Generator, Iterable, Iterator, Mapping +from io import UnsupportedOperation +from typing import ( + TYPE_CHECKING, + Any, + Final, + Literal, + cast, + overload, +) + +from urllib3.exceptions import ( + DecodeError, + LocationParseError, + ProtocolError, + ReadTimeoutError, + SSLError, +) +from urllib3.fields import RequestField +from urllib3.filepost import encode_multipart_formdata +from urllib3.util import parse_url + +from ._internal_utils import to_native_string, unicode_is_ascii +from ._types import SupportsRead as _SupportsRead +from .auth import HTTPBasicAuth +from .compat import ( + JSONDecodeError, + basestring, + builtin_str, + chardet, + cookielib, + urlencode, + urlsplit, + urlunparse, +) +from .compat import json as complexjson +from .cookies import ( + _copy_cookie_jar, # type: ignore[reportPrivateUsage] + cookiejar_from_dict, + get_cookie_header, +) +from .exceptions import ( + ChunkedEncodingError, + ConnectionError, + ContentDecodingError, + HTTPError, + InvalidJSONError, + InvalidURL, + MissingSchema, + StreamConsumedError, +) +from .exceptions import JSONDecodeError as RequestsJSONDecodeError +from .exceptions import SSLError as RequestsSSLError +from .hooks import default_hooks +from .status_codes import codes +from .structures import CaseInsensitiveDict +from .utils import ( + check_header_validity, + get_auth_from_url, + guess_filename, + guess_json_utf, + iter_slices, + parse_header_links, + requote_uri, + stream_decode_response_unicode, + super_len, + to_key_val_list, +) + +if TYPE_CHECKING: + from http.cookiejar import CookieJar + + from typing_extensions import Self + + from . import _types as _t + from .adapters import HTTPAdapter + from .cookies import RequestsCookieJar + +#: The set of HTTP status codes that indicate an automatically +#: processable redirect. +REDIRECT_STATI: Final[tuple[int, ...]] = ( # type: ignore[assignment] + codes.moved, # 301 + codes.found, # 302 + codes.other, # 303 + codes.temporary_redirect, # 307 + codes.permanent_redirect, # 308 +) + +DEFAULT_REDIRECT_LIMIT: int = 30 +CONTENT_CHUNK_SIZE: int = 10 * 1024 +ITER_CHUNK_SIZE: int = 512 + + +class RequestEncodingMixin: + url: str | None + + @property + def path_url(self) -> str: + """Build the path URL to use.""" + + url: list[str] = [] + + p = urlsplit(cast(str, self.url)) + + path = p.path + if not path: + path = "/" + + url.append(path) + + query = p.query + if query: + url.append("?") + url.append(query) + + return "".join(url) + + @overload + @staticmethod + def _encode_params(data: str) -> str: ... + + @overload + @staticmethod + def _encode_params(data: bytes) -> bytes: ... + + @overload + @staticmethod + def _encode_params( + data: _t.SupportsRead[str | bytes], + ) -> _t.SupportsRead[str | bytes]: ... + + @overload + @staticmethod + def _encode_params(data: _t.KVDataType) -> str: ... + + @staticmethod + def _encode_params( + data: _t.EncodableDataType, + ) -> str | bytes | _t.SupportsRead[str | bytes]: + """Encode parameters in a piece of data. + + Will successfully encode parameters when passed as a dict or a list of + 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary + if parameters are supplied as a dict. + """ + + if isinstance(data, (str, bytes)): + return data + elif isinstance(data, _SupportsRead): + return data + elif hasattr(data, "__iter__"): + result: list[tuple[bytes, bytes]] = [] + for k, vs in to_key_val_list(data): + if isinstance(vs, basestring) or not hasattr(vs, "__iter__"): + vs = [vs] + for v in vs: + if v is not None: + result.append( + ( + k.encode("utf-8") if isinstance(k, str) else k, + v.encode("utf-8") if isinstance(v, str) else v, + ) + ) + return urlencode(result, doseq=True) + else: + return data # type: ignore[return-value] # unreachable for valid _t.DataType + + @staticmethod + def _encode_files( + files: _t.FilesType, data: _t.RawDataType | None + ) -> tuple[bytes, str]: + """Build the body for a multipart/form-data request. + + Will successfully encode files when passed as a dict or a list of + tuples. Order is retained if data is a list of tuples but arbitrary + if parameters are supplied as a dict. + The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) + or 4-tuples (filename, fileobj, contentype, custom_headers). + """ + if not files: + raise ValueError("Files must be provided.") + elif isinstance(data, basestring): + raise ValueError("Data must not be a string.") + + new_fields: list[RequestField | tuple[str, bytes]] = [] + fields = to_key_val_list(data or {}) + files = to_key_val_list(files or {}) + + for field, val in fields: + if isinstance(val, basestring) or not hasattr(val, "__iter__"): + val = [val] + for v in val: + if v is not None: + # Don't call str() on bytestrings: in Py3 it all goes wrong. + if not isinstance(v, bytes): + v = str(v) + + new_fields.append( + ( + field.decode("utf-8") + if isinstance(field, bytes) + else field, + v.encode("utf-8") if isinstance(v, str) else v, + ) + ) + + for k, v in files: + # support for explicit filename + ft = None + fh = None + if isinstance(v, (tuple, list)): + if len(v) == 2: + fn, fp = v + elif len(v) == 3: + fn, fp, ft = v + else: + fn, fp, ft, fh = v + else: + fn = guess_filename(v) or k + fp = v + + if isinstance(fp, (str, bytes, bytearray)): + fdata = fp + elif isinstance(fp, _SupportsRead): # type: ignore[reportUnnecessaryIsInstance] # defensive check for untyped callers + fdata = fp.read() + elif fp is None: # type: ignore[reportUnnecessaryComparison] # defensive check for untyped callers + continue + else: + fdata = fp + + rf = RequestField(name=k, data=fdata, filename=fn, headers=fh) + rf.make_multipart(content_type=ft) + new_fields.append(rf) + + body, content_type = encode_multipart_formdata(new_fields) + + return body, content_type + + +class RequestHooksMixin: + hooks: dict[str, list[_t.HookType]] + + def register_hook( + self, event: str, hook: Iterable[_t.HookType] | _t.HookType + ) -> None: + """Properly register a hook.""" + + if event not in self.hooks: + raise ValueError(f'Unsupported event specified, with event name "{event}"') + + if isinstance(hook, Callable): + self.hooks[event].append(hook) + elif hasattr(hook, "__iter__"): + self.hooks[event].extend(h for h in hook if isinstance(h, Callable)) # type: ignore[reportUnnecessaryIsInstance] # defensive runtime filter + + def deregister_hook(self, event: str, hook: _t.HookType) -> bool: + """Deregister a previously registered hook. + Returns True if the hook existed, False if not. + """ + + try: + self.hooks[event].remove(hook) + return True + except ValueError: + return False + + +class Request(RequestHooksMixin): + """A user-created :class:`Request <Request>` object. + + Used to prepare a :class:`PreparedRequest <PreparedRequest>`, which is sent to the server. + + :param method: HTTP method to use. + :param url: URL to send. + :param headers: dictionary of headers to send. + :param files: dictionary of {filename: fileobject} files to multipart upload. + :param data: the body to attach to the request. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. + :param json: json for the body to attach to the request (if files or data is not specified). + :param params: URL parameters to append to the URL. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. + :param auth: Auth handler or (user, pass) tuple. + :param cookies: dictionary or CookieJar of cookies to attach to this request. + :param hooks: dictionary of callback hooks, for internal usage. + + Usage:: + + >>> import requests + >>> req = requests.Request('GET', 'https://httpbin.org/get') + >>> req.prepare() + <PreparedRequest [GET]> + """ + + method: str | None + url: _t.UriType | None + headers: CaseInsensitiveDict[str] | Mapping[str, str | bytes] | None + files: _t.FilesType + data: _t.DataType + json: _t.JsonType + params: _t.ParamsType + auth: _t.AuthType + cookies: RequestsCookieJar | CookieJar | dict[str, str] | None + + def __init__( + self, + method: str | None = None, + url: _t.UriType | None = None, + headers: Mapping[str, str | bytes] | None = None, + files: _t.FilesType = None, + data: _t.DataType = None, + params: _t.ParamsType = None, + auth: _t.AuthType = None, + cookies: RequestsCookieJar | CookieJar | dict[str, str] | None = None, + hooks: _t.HooksInputType | None = None, + json: _t.JsonType = None, + ) -> None: + # Default empty dicts for dict params. + data = [] if data is None else data + files = [] if files is None else files + headers = {} if headers is None else headers + params = {} if params is None else params + hooks = {} if hooks is None else hooks + + self.hooks = default_hooks() + for k, v in list(hooks.items()): + self.register_hook(event=k, hook=v) + + self.method = method + self.url = url + self.headers = headers + self.files = files + self.data = data + self.json = json + self.params = params + self.auth = auth + self.cookies = cookies + + def __repr__(self) -> str: + return f"<Request [{self.method}]>" + + def prepare(self) -> PreparedRequest: + """Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it.""" + p = PreparedRequest() + p.prepare( + method=self.method, + url=self.url, + headers=self.headers, + files=self.files, + data=self.data, + json=self.json, + params=self.params, + auth=self.auth, + cookies=self.cookies, + hooks=self.hooks, + ) + return p + + +class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): + """The fully mutable :class:`PreparedRequest <PreparedRequest>` object, + containing the exact bytes that will be sent to the server. + + Instances are generated from a :class:`Request <Request>` object, and + should not be instantiated manually; doing so may produce undesirable + effects. + + Usage:: + + >>> import requests + >>> req = requests.Request('GET', 'https://httpbin.org/get') + >>> r = req.prepare() + >>> r + <PreparedRequest [GET]> + + >>> s = requests.Session() + >>> s.send(r) + <Response [200]> + """ + + method: str | None + url: str | None + headers: CaseInsensitiveDict[str | bytes] + _cookies: RequestsCookieJar | CookieJar | None + body: _t.BodyType + hooks: dict[str, list[_t.HookType]] + _body_position: int | object | None + + def __init__(self) -> None: + #: HTTP verb to send to the server. + self.method = None + #: HTTP URL to send the request to. + self.url = None + #: dictionary of HTTP headers. + self.headers = None # type: ignore[assignment] + # The `CookieJar` used to create the Cookie header will be stored here + # after prepare_cookies is called + self._cookies = None + #: request body to send to the server. + self.body = None + #: dictionary of callback hooks, for internal usage. + self.hooks = default_hooks() + #: integer denoting starting position of a readable file-like body. + self._body_position = None + + def prepare( + self, + method: str | None = None, + url: _t.UriType | None = None, + headers: Mapping[str, str | bytes] | None = None, + files: _t.FilesType = None, + data: _t.DataType = None, + params: _t.ParamsType = None, + auth: _t.AuthType = None, + cookies: RequestsCookieJar | CookieJar | dict[str, str] | None = None, + hooks: _t.HooksInputType | None = None, + json: _t.JsonType = None, + ) -> None: + """Prepares the entire request with the given parameters.""" + + url = cast("_t.UriType", url) + self.prepare_method(method) + self.prepare_url(url, params) + self.prepare_headers(headers) + self.prepare_cookies(cookies) + self.prepare_body(data, files, json) + self.prepare_auth(auth, url) + + # Note that prepare_auth must be last to enable authentication schemes + # such as OAuth to work on a fully prepared request. + + # This MUST go after prepare_auth. Authenticators could add a hook + self.prepare_hooks(hooks) + + def __repr__(self) -> str: + return f"<PreparedRequest [{self.method}]>" + + def copy(self) -> PreparedRequest: + p = PreparedRequest() + p.method = self.method + p.url = self.url + p.headers = self.headers.copy() if self.headers is not None else None # type: ignore[assignment] + p._cookies = _copy_cookie_jar(self._cookies) + p.body = self.body + p.hooks = self.hooks + p._body_position = self._body_position + return p + + def prepare_method(self, method: str | None) -> None: + """Prepares the given HTTP method.""" + self.method = method + if self.method is not None: + self.method = to_native_string(self.method.upper()) + + @staticmethod + def _get_idna_encoded_host(host: str) -> str: + import idna + + try: + host = idna.encode(host, uts46=True).decode("utf-8") + except idna.IDNAError: + raise UnicodeError + return host + + def prepare_url( + self, + url: _t.UriType, + params: _t.ParamsType, + ) -> None: + """Prepares the given HTTP URL.""" + #: Accept objects that have string representations. + #: We're unable to blindly call unicode/str functions + #: as this will include the bytestring indicator (b'') + #: on python 3.x. + #: https://github.com/psf/requests/pull/2238 + if isinstance(url, bytes): + url = url.decode("utf8") + else: + url = str(url) + + # Remove leading whitespaces from url + url = url.lstrip() + + # Don't do any URL preparation for non-HTTP schemes like `mailto`, + # `data` etc to work around exceptions from `url_parse`, which + # handles RFC 3986 only. + if ":" in url and not url.lower().startswith("http"): + self.url = url + return + + # Support for unicode domain names and paths. + try: + scheme, auth, host, port, path, query, fragment = parse_url(url) + except LocationParseError as e: + raise InvalidURL(*e.args) + + if not scheme: + raise MissingSchema( + f"Invalid URL {url!r}: No scheme supplied. " + f"Perhaps you meant https://{url}?" + ) + + if not host: + raise InvalidURL(f"Invalid URL {url!r}: No host supplied") + + # In general, we want to try IDNA encoding the hostname if the string contains + # non-ASCII characters. This allows users to automatically get the correct IDNA + # behaviour. For strings containing only ASCII characters, we need to also verify + # it doesn't start with a wildcard (*), before allowing the unencoded hostname. + if not unicode_is_ascii(host): + try: + host = self._get_idna_encoded_host(host) + except UnicodeError: + raise InvalidURL("URL has an invalid label.") + elif host.startswith(("*", ".")): + raise InvalidURL("URL has an invalid label.") + + # Carefully reconstruct the network location + netloc = auth or "" + if netloc: + netloc += "@" + netloc += host + if port: + netloc += f":{port}" + + # Bare domains aren't valid URLs. + if not path: + path = "/" + + if isinstance(params, (str, bytes)): + params = to_native_string(params) + + if params is not None: + enc_params = self._encode_params(params) + else: + enc_params = "" + + if enc_params: + if query: + query = f"{query}&{enc_params}" + else: + query = enc_params + + url = requote_uri(urlunparse((scheme, netloc, path, "", query, fragment))) + self.url = url + + def prepare_headers(self, headers: Mapping[str, str | bytes] | None) -> None: + """Prepares the given HTTP headers.""" + + self.headers = CaseInsensitiveDict() + if headers: + for header in headers.items(): + # Raise exception on invalid header value. + check_header_validity(header) + name, value = header + self.headers[to_native_string(name)] = value + + def prepare_body( + self, data: _t.DataType, files: _t.FilesType, json: _t.JsonType = None + ) -> None: + """Prepares the given HTTP body data.""" + + # Check if file, fo, generator, iterator. + # If not, run through normal process. + + # Nottin' on you. + body = None + content_type = None + + if not data and json is not None: + # urllib3 requires a bytes-like body. Python 2's json.dumps + # provides this natively, but Python 3 gives a Unicode string. + content_type = "application/json" + + try: + body = complexjson.dumps(json, allow_nan=False) + except ValueError as ve: + raise InvalidJSONError(ve, request=self) + + if not isinstance(body, bytes): + body = body.encode("utf-8") + + if isinstance(data, Iterable) and not isinstance( + data, (str, bytes, list, tuple, Mapping) + ): + try: + length = super_len(data) + except (TypeError, AttributeError, UnsupportedOperation): + length = None + + body = data + + if getattr(body, "tell", None) is not None: + # Record the current file position before reading. + # This will allow us to rewind a file in the event + # of a redirect. + try: + self._body_position = body.tell() # type: ignore[union-attr] # guarded by getattr check + except OSError: + # This differentiates from None, allowing us to catch + # a failed `tell()` later when trying to rewind the body + self._body_position = object() + + if files: + raise NotImplementedError( + "Streamed bodies and files are mutually exclusive." + ) + + if length: + self.headers["Content-Length"] = builtin_str(length) + else: + self.headers["Transfer-Encoding"] = "chunked" + else: + # After is_stream filtering, remaining data is raw (not streamed) + raw_data = cast("_t.RawDataType | None", data) + + # Multi-part file uploads. + if files: + (body, content_type) = self._encode_files(files, raw_data) + else: + if raw_data: + body = self._encode_params(raw_data) + if isinstance(data, basestring) or isinstance(data, _SupportsRead): + content_type = None + else: + content_type = "application/x-www-form-urlencoded" + + self.prepare_content_length(body) + + # Add content-type if it wasn't explicitly provided. + if content_type and ("content-type" not in self.headers): + self.headers["Content-Type"] = content_type + + self.body = body # type: ignore[assignment] # body transforms from DataType to BodyType + + def prepare_content_length(self, body: _t.BodyType) -> None: + """Prepare Content-Length header based on request method and body""" + if body is not None: + length = super_len(body) + if length: + # If length exists, set it. Otherwise, we fallback + # to Transfer-Encoding: chunked. + self.headers["Content-Length"] = builtin_str(length) + elif ( + self.method not in ("GET", "HEAD") + and self.headers.get("Content-Length") is None + ): + # Set Content-Length to 0 for methods that can have a body + # but don't provide one. (i.e. not GET or HEAD) + self.headers["Content-Length"] = "0" + + def prepare_auth( + self, + auth: _t.AuthType, + url: _t.UriType = "", + ) -> None: + """Prepares the given HTTP auth data.""" + + # If no Auth is explicitly provided, extract it from the URL first. + if auth is None: + url_auth = get_auth_from_url(cast(str, self.url)) + auth = url_auth if any(url_auth) else None + + if auth: + if isinstance(auth, tuple) and len(auth) == 2: # type: ignore[arg-type] # pyright widens tuple from Callable in AuthType + # special-case basic HTTP auth + auth_handler = HTTPBasicAuth(*auth) # type: ignore[arg-type] # pyright widens tuple from Callable in AuthType + else: + # TODO: can be fixed by flipping the conditionals + auth_handler = cast("Callable[..., PreparedRequest]", auth) + + # Allow auth to make its changes. + r = auth_handler(self) + + # Update self to reflect the auth changes. + self.__dict__.update(r.__dict__) + + # Recompute Content-Length + self.prepare_content_length(self.body) + + def prepare_cookies( + self, cookies: RequestsCookieJar | CookieJar | dict[str, str] | None + ) -> None: + """Prepares the given HTTP cookie data. + + This function eventually generates a ``Cookie`` header from the + given cookies using cookielib. Due to cookielib's design, the header + will not be regenerated if it already exists, meaning this function + can only be called once for the life of the + :class:`PreparedRequest <PreparedRequest>` object. Any subsequent calls + to ``prepare_cookies`` will have no actual effect, unless the "Cookie" + header is removed beforehand. + """ + if isinstance(cookies, cookielib.CookieJar): + self._cookies = cookies + else: + self._cookies = cookiejar_from_dict(cookies) + + cookies_jar = cast("CookieJar", self._cookies) + cookie_header = get_cookie_header(cookies_jar, self) + if cookie_header is not None: + self.headers["Cookie"] = cookie_header + + def prepare_hooks(self, hooks: _t.HooksInputType | None) -> None: + """Prepares the given hooks.""" + # hooks can be passed as None to the prepare method and to this + # method. To prevent iterating over None, simply use an empty list + # if hooks is False-y + hooks = hooks or {} + for event in hooks: + self.register_hook(event, hooks[event]) + + +class Response: + """The :class:`Response <Response>` object, which contains a + server's response to an HTTP request. + """ + + _content: bytes | Literal[False] | None + _content_consumed: bool + _next: PreparedRequest | None + status_code: int + headers: CaseInsensitiveDict[str] + raw: Any + url: str + encoding: str | None + history: list[Response] + reason: str | None + cookies: RequestsCookieJar + elapsed: datetime.timedelta + request: PreparedRequest + connection: HTTPAdapter + + __attrs__: list[str] = [ + "_content", + "status_code", + "headers", + "url", + "history", + "encoding", + "reason", + "cookies", + "elapsed", + "request", + ] + + def __init__(self) -> None: + self._content = False + self._content_consumed = False + self._next = None + + #: Integer Code of responded HTTP Status, e.g. 404 or 200. + self.status_code = None # type: ignore[assignment] + + #: Case-insensitive Dictionary of Response Headers. + #: For example, ``headers['content-encoding']`` will return the + #: value of a ``'Content-Encoding'`` response header. + self.headers = CaseInsensitiveDict() + + #: File-like object representation of response (for advanced usage). + #: Use of ``raw`` requires that ``stream=True`` be set on the request. + #: This requirement does not apply for use internally to Requests. + self.raw = None + + #: Final URL location of Response. + self.url = None # type: ignore[assignment] + + #: Encoding to decode with when accessing r.text. + self.encoding = None + + #: A list of :class:`Response <Response>` objects from + #: the history of the Request. Any redirect responses will end + #: up here. The list is sorted from the oldest to the most recent request. + self.history = [] + + #: Textual reason of responded HTTP Status, e.g. "Not Found" or "OK". + self.reason = None + + #: A CookieJar of Cookies the server sent back. + self.cookies = cookiejar_from_dict({}) + + #: The amount of time elapsed between sending the request + #: and the arrival of the response (as a timedelta). + #: This property specifically measures the time taken between sending + #: the first byte of the request and finishing parsing the headers. It + #: is therefore unaffected by consuming the response content or the + #: value of the ``stream`` keyword argument. + self.elapsed = datetime.timedelta(0) + + #: The :class:`PreparedRequest <PreparedRequest>` object to which this + #: is a response. + self.request = None # type: ignore[assignment] + + def __enter__(self) -> Self: + return self + + def __exit__(self, *args: Any) -> None: + self.close() + + def __getstate__(self) -> dict[str, Any]: + # Consume everything; accessing the content attribute makes + # sure the content has been fully read. + if not self._content_consumed: + self.content + + return {attr: getattr(self, attr, None) for attr in self.__attrs__} + + def __setstate__(self, state: dict[str, Any]) -> None: + for name, value in state.items(): + setattr(self, name, value) + + # pickled objects do not have .raw + setattr(self, "_content_consumed", True) + setattr(self, "raw", None) + + def __repr__(self) -> str: + return f"<Response [{self.status_code}]>" + + def __bool__(self) -> bool: + """Returns True if :attr:`status_code` is less than 400. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code, is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + return self.ok + + def __nonzero__(self) -> bool: + """Returns True if :attr:`status_code` is less than 400. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code, is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + return self.ok + + def __iter__(self) -> Iterator[bytes]: + """Allows you to use a response as an iterator.""" + return self.iter_content(128) + + @property + def ok(self) -> bool: + """Returns True if :attr:`status_code` is less than 400, False if not. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + try: + self.raise_for_status() + except HTTPError: + return False + return True + + @property + def is_redirect(self) -> bool: + """True if this Response is a well-formed HTTP redirect that could have + been processed automatically (by :meth:`Session.resolve_redirects`). + """ + return "location" in self.headers and self.status_code in REDIRECT_STATI + + @property + def is_permanent_redirect(self) -> bool: + """True if this Response one of the permanent versions of redirect.""" + return "location" in self.headers and self.status_code in ( + codes.moved_permanently, + codes.permanent_redirect, + ) + + @property + def next(self) -> PreparedRequest | None: + """Returns a PreparedRequest for the next request in a redirect chain, if there is one.""" + return self._next + + @property + def apparent_encoding(self) -> str | None: + """The apparent encoding, provided by the charset_normalizer or chardet libraries.""" + if chardet is not None: + return chardet.detect(self.content)["encoding"] + else: + # If no character detection library is available, we'll fall back + # to a standard Python utf-8 str. + return "utf-8" + + @overload + def iter_content( + self, chunk_size: int | None = 1, decode_unicode: Literal[False] = False + ) -> Iterator[bytes]: ... + @overload + def iter_content( + self, chunk_size: int | None = 1, *, decode_unicode: Literal[True] + ) -> Iterator[str | bytes]: ... + def iter_content( + self, chunk_size: int | None = 1, decode_unicode: bool = False + ) -> Iterator[str | bytes]: + """Iterates over the response data. When stream=True is set on the + request, this avoids reading the content at once into memory for + large responses. The chunk size is the number of bytes it should + read into memory. This is not necessarily the length of each item + returned as decoding can take place. + + chunk_size must be of type int or None. A value of None will + function differently depending on the value of `stream`. + stream=True will read data as it arrives in whatever size the + chunks are received. If stream=False, data is returned as + a single chunk. + + If decode_unicode is True, content will be decoded using encoding + information from the response. If no encoding information is available, + bytes will be returned. This can be bypassed by manually setting + `encoding` on the response. + """ + + def generate() -> Generator[bytes, None, None]: + # Special case for urllib3. + if hasattr(self.raw, "stream"): + try: + yield from self.raw.stream(chunk_size, decode_content=True) + except ProtocolError as e: + raise ChunkedEncodingError(e) + except DecodeError as e: + raise ContentDecodingError(e) + except ReadTimeoutError as e: + raise ConnectionError(e) + except SSLError as e: + raise RequestsSSLError(e) + else: + # Standard file-like object. + while True: + chunk = self.raw.read(chunk_size) + if not chunk: + break + yield chunk + + self._content_consumed = True + + if self._content_consumed and isinstance(self._content, bool): + raise StreamConsumedError() + elif chunk_size is not None and not isinstance(chunk_size, int): # type: ignore[reportUnnecessaryIsInstance] # runtime guard for untyped callers + raise TypeError( + f"chunk_size must be an int, it is instead a {type(chunk_size)}." + ) + + if self._content_consumed: + # simulate reading small chunks of the content + content = cast(bytes, self._content) + chunks = iter_slices(content, chunk_size) + else: + chunks = generate() + + if decode_unicode: + chunks = stream_decode_response_unicode(chunks, self) + + return chunks + + @overload + def iter_lines( + self, + chunk_size: int = ITER_CHUNK_SIZE, + decode_unicode: Literal[False] = False, + delimiter: bytes | None = None, + ) -> Iterator[bytes]: ... + @overload + def iter_lines( + self, + chunk_size: int = ITER_CHUNK_SIZE, + *, + decode_unicode: Literal[True], + delimiter: str | bytes | None = None, + ) -> Iterator[str | bytes]: ... + def iter_lines( + self, + chunk_size: int = ITER_CHUNK_SIZE, + decode_unicode: bool = False, + delimiter: str | bytes | None = None, + ) -> Iterator[str | bytes]: + """Iterates over the response data, one line at a time. When + stream=True is set on the request, this avoids reading the + content at once into memory for large responses. + + The decode_unicode param works the same as in `iter_content`, with the + same caveats. + + .. note:: This method is not reentrant safe. + """ + + pending: str | bytes | None = None + + for chunk in self.iter_content( + chunk_size=chunk_size, decode_unicode=decode_unicode + ): + if pending is not None: + # TODO: remove cast after iter_lines rewrite + chunk = cast("str | bytes", pending + chunk) # type: ignore[operator] + + if delimiter: + lines = chunk.split(delimiter) # type: ignore[arg-type] + else: + lines = chunk.splitlines() + + if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]: + pending = lines.pop() + else: + pending = None + + yield from lines + + if pending is not None: + yield pending + + @property + def content(self) -> bytes: + """Content of the response, in bytes.""" + + if self._content is False: + # Read the contents. + if self._content_consumed: + raise RuntimeError("The content for this response was already consumed") + + if self.status_code == 0 or self.raw is None: + self._content = None + else: + self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b"" + + self._content_consumed = True + # don't need to release the connection; that's been handled by urllib3 + # since we exhausted the data. + return self._content # type: ignore[return-value] + + @property + def text(self) -> str: + """Content of the response, in unicode. + + If Response.encoding is None, encoding will be guessed using + ``charset_normalizer`` or ``chardet``. + + The encoding of the response content is determined based solely on HTTP + headers, following RFC 2616 to the letter. If you can take advantage of + non-HTTP knowledge to make a better guess at the encoding, you should + set ``r.encoding`` appropriately before accessing this property. + """ + + # Try charset from content-type + content = None + encoding = self.encoding + + if not self.content: + return "" + + # Fallback to auto-detected encoding. + if self.encoding is None: + encoding = self.apparent_encoding + + # Decode unicode from given encoding. + try: + content = str(self.content, encoding or "utf-8", errors="replace") + except (LookupError, TypeError): + # A LookupError is raised if the encoding was not found which could + # indicate a misspelling or similar mistake. + # + # A TypeError can be raised if encoding is None + # + # So we try blindly encoding. + content = str(self.content, errors="replace") + + return content + + def json(self, **kwargs: Any) -> Any: + r"""Decodes the JSON response body (if any) as a Python object. + + This may return a dictionary, list, etc. depending on what is in the response. + + :param \*\*kwargs: Optional arguments that ``json.loads`` takes. + :raises requests.exceptions.JSONDecodeError: If the response body does not + contain valid json. + """ + + if not self.encoding and self.content and len(self.content) > 3: + # No encoding set. JSON RFC 4627 section 3 states we should expect + # UTF-8, -16 or -32. Detect which one to use; If the detection or + # decoding fails, fall back to `self.text` (using charset_normalizer to make + # a best guess). + encoding = guess_json_utf(self.content) + if encoding is not None: + try: + return complexjson.loads(self.content.decode(encoding), **kwargs) + except UnicodeDecodeError: + # Wrong UTF codec detected; usually because it's not UTF-8 + # but some other 8-bit codec. This is an RFC violation, + # and the server didn't bother to tell us what codec *was* + # used. + pass + except JSONDecodeError as e: + raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) + + try: + return complexjson.loads(self.text, **kwargs) + except JSONDecodeError as e: + # Catch JSON-related errors and raise as requests.JSONDecodeError + # This aliases json.JSONDecodeError and simplejson.JSONDecodeError + raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) + + @property + def links(self) -> dict[str, dict[str, str]]: + """Returns the parsed header links of the response, if any.""" + + header = self.headers.get("link") + + resolved_links: dict[str, dict[str, str]] = {} + + if header: + links = parse_header_links(header) + + for link in links: + key = link.get("rel") or link.get("url") + if key is not None: + resolved_links[key] = link + + return resolved_links + + def raise_for_status(self) -> None: + """Raises :class:`HTTPError`, if one occurred.""" + + http_error_msg = "" + if isinstance(self.reason, bytes): + # We attempt to decode utf-8 first because some servers + # choose to localize their reason strings. If the string + # isn't utf-8, we fall back to iso-8859-1 for all other + # encodings. (See PR #3538) + try: + reason = self.reason.decode("utf-8") + except UnicodeDecodeError: + reason = self.reason.decode("iso-8859-1") + else: + reason = self.reason + + if 400 <= self.status_code < 500: + http_error_msg = ( + f"{self.status_code} Client Error: {reason} for url: {self.url}" + ) + + elif 500 <= self.status_code < 600: + http_error_msg = ( + f"{self.status_code} Server Error: {reason} for url: {self.url}" + ) + + if http_error_msg: + raise HTTPError(http_error_msg, response=self) + + def close(self) -> None: + """Releases the connection back to the pool. Once this method has been + called the underlying ``raw`` object must not be accessed again. + + *Note: Should not normally need to be called explicitly.* + """ + if not self._content_consumed: + self.raw.close() + + release_conn = getattr(self.raw, "release_conn", None) + if release_conn is not None: + release_conn() diff --git a/micromamba_root/Lib/site-packages/requests/packages.py b/micromamba_root/Lib/site-packages/requests/packages.py new file mode 100644 index 0000000000000000000000000000000000000000..5ab3d8e250de8475cb22553f564e5444e02c7460 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/packages.py @@ -0,0 +1,23 @@ +import sys + +from .compat import chardet + +# This code exists for backwards compatibility reasons. +# I don't like it either. Just look the other way. :) + +for package in ("urllib3", "idna"): + locals()[package] = __import__(package) + # This traversal is apparently necessary such that the identities are + # preserved (requests.packages.urllib3.* is urllib3.*) + for mod in list(sys.modules): + if mod == package or mod.startswith(f"{package}."): + sys.modules[f"requests.packages.{mod}"] = sys.modules[mod] + +if chardet is not None: + target = chardet.__name__ + for mod in list(sys.modules): + if mod == target or mod.startswith(f"{target}."): + imported_mod = sys.modules[mod] + sys.modules[f"requests.packages.{mod}"] = imported_mod + mod = mod.replace(target, "chardet") + sys.modules[f"requests.packages.{mod}"] = imported_mod diff --git a/micromamba_root/Lib/site-packages/requests/py.typed b/micromamba_root/Lib/site-packages/requests/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/requests/sessions.py b/micromamba_root/Lib/site-packages/requests/sessions.py new file mode 100644 index 0000000000000000000000000000000000000000..8f13887d187deda256e08f305950a56a9c145ea5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/sessions.py @@ -0,0 +1,920 @@ +""" +requests.sessions +~~~~~~~~~~~~~~~~~ + +This module provides a Session object to manage and persist settings across +requests (cookies, auth, proxies). +""" + +from __future__ import annotations + +import os +import sys +import time +from collections import OrderedDict +from collections.abc import Generator, Mapping, MutableMapping +from datetime import timedelta +from typing import TYPE_CHECKING, Any, cast + +from ._internal_utils import to_native_string +from ._types import is_prepared as _is_prepared +from .adapters import HTTPAdapter +from .auth import _basic_auth_str # type: ignore[reportPrivateUsage] +from .compat import cookielib, urljoin, urlparse +from .cookies import ( + RequestsCookieJar, + cookiejar_from_dict, + extract_cookies_to_jar, + merge_cookies, +) +from .exceptions import ( + ChunkedEncodingError, + ContentDecodingError, + InvalidSchema, + TooManyRedirects, +) +from .hooks import default_hooks, dispatch_hook + +# formerly defined here, reexposed here for backward compatibility +from .models import ( # noqa: F401 + DEFAULT_REDIRECT_LIMIT, + REDIRECT_STATI, # type: ignore[reportUnusedImport] + PreparedRequest, + Request, + Response, +) +from .status_codes import codes +from .structures import CaseInsensitiveDict +from .utils import ( # noqa: F401 + DEFAULT_PORTS, + default_headers, + get_auth_from_url, + get_environ_proxies, + get_netrc_auth, + requote_uri, + resolve_proxies, + rewind_body, + should_bypass_proxies, # type: ignore[reportUnusedImport] # re-export for external consumers + to_key_val_list, +) + +if TYPE_CHECKING: + from http.cookiejar import CookieJar + + from typing_extensions import Self, Unpack + + from . import _types as _t + from .adapters import BaseAdapter + +# Preferred clock, based on which one is more accurate on a given system. +if sys.platform == "win32": + preferred_clock = time.perf_counter +else: + preferred_clock = time.time + + +def merge_setting( + request_setting: Any, session_setting: Any, dict_class: type = OrderedDict +) -> Any: + """Determines appropriate setting for a given request, taking into account + the explicit setting on that request, and the setting in the session. If a + setting is a dictionary, they will be merged together using `dict_class` + """ + + if session_setting is None: + return request_setting + + if request_setting is None: + return session_setting + + # Bypass if not a dictionary (e.g. verify) + if not ( + isinstance(session_setting, Mapping) and isinstance(request_setting, Mapping) + ): + return request_setting + + merged_setting = dict_class(to_key_val_list(session_setting)) # type: ignore[arg-type] # isinstance narrows Any to Mapping[Unknown] + merged_setting.update(to_key_val_list(request_setting)) # type: ignore[arg-type] + + # Remove keys that are set to None. Extract keys first to avoid altering + # the dictionary during iteration. + none_keys = [k for (k, v) in merged_setting.items() if v is None] + for key in none_keys: + del merged_setting[key] + + return merged_setting + + +def merge_hooks( + request_hooks: _t.HooksType, + session_hooks: _t.HooksType, + dict_class: type = OrderedDict, +) -> _t.HooksType: + """Properly merges both requests and session hooks. + + This is necessary because when request_hooks == {'response': []}, the + merge breaks Session hooks entirely. + """ + if session_hooks is None or session_hooks.get("response") == []: + return request_hooks + + if request_hooks is None or request_hooks.get("response") == []: + return session_hooks + + return merge_setting(request_hooks, session_hooks, dict_class) + + +class SessionRedirectMixin: + max_redirects: int + trust_env: bool + cookies: RequestsCookieJar + + def send(self, request: PreparedRequest, **kwargs: Any) -> Response: ... + + def get_redirect_target(self, resp: Response) -> str | None: + """Receives a Response. Returns a redirect URI or ``None``""" + # Due to the nature of how requests processes redirects this method will + # be called at least once upon the original response and at least twice + # on each subsequent redirect response (if any). + # If a custom mixin is used to handle this logic, it may be advantageous + # to cache the redirect location onto the response object as a private + # attribute. + if resp.is_redirect: + location = resp.headers["location"] + # Currently the underlying http module on py3 decode headers + # in latin1, but empirical evidence suggests that latin1 is very + # rarely used with non-ASCII characters in HTTP headers. + # It is more likely to get UTF8 header rather than latin1. + # This causes incorrect handling of UTF8 encoded location headers. + # To solve this, we re-encode the location in latin1. + location = location.encode("latin1") + return to_native_string(location, "utf8") + return None + + def should_strip_auth(self, old_url: str, new_url: str) -> bool: + """Decide whether Authorization header should be removed when redirecting""" + old_parsed = urlparse(old_url) + new_parsed = urlparse(new_url) + if old_parsed.hostname != new_parsed.hostname: + return True + # Special case: allow http -> https redirect when using the standard + # ports. This isn't specified by RFC 7235, but is kept to avoid + # breaking backwards compatibility with older versions of requests + # that allowed any redirects on the same host. + if ( + old_parsed.scheme == "http" + and old_parsed.port in (80, None) + and new_parsed.scheme == "https" + and new_parsed.port in (443, None) + ): + return False + + # Handle default port usage corresponding to scheme. + changed_port = old_parsed.port != new_parsed.port + changed_scheme = old_parsed.scheme != new_parsed.scheme + default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None) + if ( + not changed_scheme + and old_parsed.port in default_port + and new_parsed.port in default_port + ): + return False + + # Standard case: root URI must match + return changed_port or changed_scheme + + def resolve_redirects( + self, + resp: Response, + req: PreparedRequest, + stream: bool = False, + timeout: _t.TimeoutType = None, + verify: _t.VerifyType = True, + cert: _t.CertType = None, + proxies: dict[str, str] | None = None, + yield_requests: bool = False, + **adapter_kwargs: Any, + ) -> Generator[Response, None, None]: + """Receives a Response. Returns a generator of Responses or Requests.""" + + hist: list[Response] = [] # keep track of history + + url = self.get_redirect_target(resp) + previous_fragment = urlparse(req.url).fragment + while url: + prepared_request = req.copy() + + # Update history and keep track of redirects. + resp.history = hist[:] + hist.append(resp) + + try: + resp.content # Consume socket so it can be released + except (ChunkedEncodingError, ContentDecodingError, RuntimeError): + resp.raw.read(decode_content=False) + + if len(resp.history) >= self.max_redirects: + raise TooManyRedirects( + f"Exceeded {self.max_redirects} redirects.", response=resp + ) + + # Release the connection back into the pool. + resp.close() + + # Handle redirection without scheme (see: RFC 1808 Section 4) + if url.startswith("//"): + parsed_rurl = urlparse(resp.url) + url = ":".join([to_native_string(parsed_rurl.scheme), url]) + + # Normalize url case and attach previous fragment if needed (RFC 7231 7.1.2) + parsed = urlparse(url) + if parsed.fragment == "" and previous_fragment: + parsed = parsed._replace(fragment=previous_fragment) + elif parsed.fragment: + previous_fragment = parsed.fragment + url = parsed.geturl() + + # Facilitate relative 'location' headers, as allowed by RFC 7231. + # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') + # Compliant with RFC3986, we percent encode the url. + if not parsed.netloc: + url = urljoin(resp.url, requote_uri(url)) + else: + url = requote_uri(url) + + prepared_request.url = to_native_string(url) + + self.rebuild_method(prepared_request, resp) + + # https://github.com/psf/requests/issues/1084 + if resp.status_code not in ( + codes.temporary_redirect, + codes.permanent_redirect, + ): + # https://github.com/psf/requests/issues/3490 + purged_headers = ("Content-Length", "Content-Type", "Transfer-Encoding") + for header in purged_headers: + prepared_request.headers.pop(header, None) + prepared_request.body = None + + headers = prepared_request.headers + headers.pop("Cookie", None) + + # Extract any cookies sent on the response to the cookiejar + # in the new request. Because we've mutated our copied prepared + # request, use the old one that we haven't yet touched. + cookie_jar = cast("CookieJar", prepared_request._cookies) # type: ignore[reportPrivateUsage] + extract_cookies_to_jar(cookie_jar, req, resp.raw) + merge_cookies(cookie_jar, self.cookies) + prepared_request.prepare_cookies(cookie_jar) + + # Rebuild auth and proxy information. + proxies = self.rebuild_proxies(prepared_request, proxies) + self.rebuild_auth(prepared_request, resp) + + # A failed tell() sets `_body_position` to `object()`. This non-None + # value ensures `rewindable` will be True, allowing us to raise an + # UnrewindableBodyError, instead of hanging the connection. + rewindable = prepared_request._body_position is not None and ( # type: ignore[reportPrivateUsage] + "Content-Length" in headers or "Transfer-Encoding" in headers + ) + + # Attempt to rewind consumed file-like object. + if rewindable: + rewind_body(prepared_request) + + # Override the original request. + req = prepared_request + + if yield_requests: + yield req # type: ignore[misc] # Internal use only, returns PreparedRequest + else: + resp = self.send( + req, + stream=stream, + timeout=timeout, + verify=verify, + cert=cert, + proxies=proxies, + allow_redirects=False, + **adapter_kwargs, + ) + + extract_cookies_to_jar(self.cookies, prepared_request, resp.raw) + + # extract redirect url, if any, for the next loop + url = self.get_redirect_target(resp) + yield resp + + def rebuild_auth( + self, prepared_request: PreparedRequest, response: Response + ) -> None: + """When being redirected we may want to strip authentication from the + request to avoid leaking credentials. This method intelligently removes + and reapplies authentication where possible to avoid credential loss. + """ + original_request = response.request + assert _is_prepared(original_request) + assert _is_prepared(prepared_request) + + headers = prepared_request.headers + original_url = original_request.url + url = prepared_request.url + + if "Authorization" in headers and self.should_strip_auth(original_url, url): + # If we get redirected to a new host, we should strip out any + # authentication headers. + del headers["Authorization"] + + # .netrc might have more auth for us on our new host. + new_auth = get_netrc_auth(url) if self.trust_env else None + if new_auth is not None: + prepared_request.prepare_auth(new_auth) + + def rebuild_proxies( + self, + prepared_request: PreparedRequest, + proxies: dict[str, str] | None, + ) -> dict[str, str]: + """This method re-evaluates the proxy configuration by considering the + environment variables. If we are redirected to a URL covered by + NO_PROXY, we strip the proxy configuration. Otherwise, we set missing + proxy keys for this URL (in case they were stripped by a previous + redirect). + + This method also replaces the Proxy-Authorization header where + necessary. + + :rtype: dict + """ + assert _is_prepared(prepared_request) + headers = prepared_request.headers + scheme = urlparse(prepared_request.url).scheme + new_proxies = resolve_proxies(prepared_request, proxies, self.trust_env) + + if "Proxy-Authorization" in headers: + del headers["Proxy-Authorization"] + + try: + username, password = get_auth_from_url(new_proxies[scheme]) + except KeyError: + username, password = None, None + + # urllib3 handles proxy authorization for us in the standard adapter. + # Avoid appending this to TLS tunneled requests where it may be leaked. + if not scheme.startswith("https") and username and password: + headers["Proxy-Authorization"] = _basic_auth_str(username, password) + + return new_proxies + + def rebuild_method( + self, prepared_request: PreparedRequest, response: Response + ) -> None: + """When being redirected we may want to change the method of the request + based on certain specs or browser behavior. + """ + method = prepared_request.method + + # https://tools.ietf.org/html/rfc7231#section-6.4.4 + if response.status_code == codes.see_other and method != "HEAD": + method = "GET" + + # Do what the browsers do, despite standards... + # First, turn 302s into GETs. + if response.status_code == codes.found and method != "HEAD": + method = "GET" + + # Second, if a POST is responded to with a 301, turn it into a GET. + # This bizarre behaviour is explained in Issue 1704. + if response.status_code == codes.moved and method == "POST": + method = "GET" + + prepared_request.method = method + + +class Session(SessionRedirectMixin): + """A Requests session. + + Provides cookie persistence, connection-pooling, and configuration. + + Basic Usage:: + + >>> import requests + >>> s = requests.Session() + >>> s.get('https://httpbin.org/get') + <Response [200]> + + Or as a context manager:: + + >>> with requests.Session() as s: + ... s.get('https://httpbin.org/get') + <Response [200]> + """ + + headers: CaseInsensitiveDict[str] + auth: _t.AuthType + proxies: dict[str, str] + hooks: dict[str, list[_t.HookType]] + params: MutableMapping[str, Any] + stream: bool + verify: _t.VerifyType + cert: _t.CertType + max_redirects: int + trust_env: bool + cookies: RequestsCookieJar + adapters: MutableMapping[str, BaseAdapter] + + __attrs__: list[str] = [ + "headers", + "cookies", + "auth", + "proxies", + "hooks", + "params", + "verify", + "cert", + "adapters", + "stream", + "trust_env", + "max_redirects", + ] + + def __init__(self) -> None: + #: A case-insensitive dictionary of headers to be sent on each + #: :class:`Request <Request>` sent from this + #: :class:`Session <Session>`. + self.headers = default_headers() + + #: Default Authentication tuple or object to attach to + #: :class:`Request <Request>`. + self.auth = None + + #: Dictionary mapping protocol or protocol and host to the URL of the proxy + #: (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) to + #: be used on each :class:`Request <Request>`. + self.proxies = {} + + #: Event-handling hooks. + self.hooks = default_hooks() + + #: Dictionary of querystring data to attach to each + #: :class:`Request <Request>`. The dictionary values may be lists for + #: representing multivalued query parameters. + self.params = {} + + #: Stream response content default. + self.stream = False + + #: SSL Verification default. + #: Defaults to `True`, requiring requests to verify the TLS certificate at the + #: remote end. + #: If verify is set to `False`, requests will accept any TLS certificate + #: presented by the server, and will ignore hostname mismatches and/or + #: expired certificates, which will make your application vulnerable to + #: man-in-the-middle (MitM) attacks. + #: Only set this to `False` for testing. + #: If verify is set to a string, it must be the path to a CA bundle file + #: that will be used to verify the TLS certificate. + self.verify = True + + #: SSL client certificate default, if String, path to ssl client + #: cert file (.pem). If Tuple, ('cert', 'key') pair. + self.cert = None + + #: Maximum number of redirects allowed. If the request exceeds this + #: limit, a :class:`TooManyRedirects` exception is raised. + #: This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is + #: 30. + self.max_redirects = DEFAULT_REDIRECT_LIMIT + + #: Trust environment settings for proxy configuration, default + #: authentication and similar. + self.trust_env = True + + #: A CookieJar containing all currently outstanding cookies set on this + #: session. By default it is a + #: :class:`RequestsCookieJar <requests.cookies.RequestsCookieJar>`, but + #: may be any other ``cookielib.CookieJar`` compatible object. + self.cookies = cookiejar_from_dict({}) + + # Default connection adapters. + self.adapters = OrderedDict() + self.mount("https://", HTTPAdapter()) + self.mount("http://", HTTPAdapter()) + + def __enter__(self) -> Self: + return self + + def __exit__(self, *args: Any) -> None: + self.close() + + def prepare_request(self, request: Request) -> PreparedRequest: + """Constructs a :class:`PreparedRequest <PreparedRequest>` for + transmission and returns it. The :class:`PreparedRequest` has settings + merged from the :class:`Request <Request>` instance and those of the + :class:`Session`. + + :param request: :class:`Request` instance to prepare with this + session's settings. + :rtype: requests.PreparedRequest + """ + url = cast("_t.UriType", request.url) + method = cast(str, request.method) + + cookies = request.cookies or {} + + # Bootstrap CookieJar. + if not isinstance(cookies, cookielib.CookieJar): + cookies = cookiejar_from_dict(cookies) + + # Merge with session cookies + merged_cookies = merge_cookies( + merge_cookies(RequestsCookieJar(), self.cookies), cookies + ) + + # Set environment's basic authentication if not explicitly set. + auth = request.auth + if self.trust_env and not auth and not self.auth: + auth = get_netrc_auth(url) + + p = PreparedRequest() + p.prepare( + method=method.upper(), + url=url, + files=request.files, + data=request.data, + json=request.json, + headers=merge_setting( + request.headers, self.headers, dict_class=CaseInsensitiveDict + ), + params=merge_setting(request.params, self.params), + auth=merge_setting(auth, self.auth), + cookies=merged_cookies, + hooks=merge_hooks(request.hooks, self.hooks), + ) + return p + + def request( + self, + method: str, + url: _t.UriType, + params: _t.ParamsType = None, + data: _t.DataType = None, + headers: Mapping[str, str | bytes] | None = None, + cookies: RequestsCookieJar | CookieJar | dict[str, str] | None = None, + files: _t.FilesType = None, + auth: _t.AuthType = None, + timeout: _t.TimeoutType = None, + allow_redirects: bool = True, + proxies: dict[str, str] | None = None, + hooks: _t.HooksInputType | None = None, + stream: bool | None = None, + verify: _t.VerifyType | None = None, + cert: _t.CertType = None, + json: _t.JsonType = None, + ) -> Response: + """Constructs a :class:`Request <Request>`, prepares it and sends it. + Returns :class:`Response <Response>` object. + + :param method: method for the new :class:`Request` object. + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary or bytes to be sent in the query + string for the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) json to send in the body of the + :class:`Request`. + :param headers: (optional) Dictionary of HTTP Headers to send with the + :class:`Request`. + :param cookies: (optional) Dict or CookieJar object to send with the + :class:`Request`. + :param files: (optional) Dictionary of ``'filename': file-like-objects`` + for multipart encoding upload. + :param auth: (optional) Auth tuple or callable to enable + Basic/Digest/Custom HTTP Auth. + :param timeout: (optional) How many seconds to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) <timeouts>` tuple. + :type timeout: float or tuple + :param allow_redirects: (optional) Set to True by default. + :type allow_redirects: bool + :param proxies: (optional) Dictionary mapping protocol or protocol and + hostname to the URL of the proxy. + :param hooks: (optional) Dictionary mapping hook name to one event or + list of events, event must be callable. + :param stream: (optional) whether to immediately download the response + content. Defaults to ``False``. + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use. Defaults to ``True``. When set to + ``False``, requests will accept any TLS certificate presented by + the server, and will ignore hostname mismatches and/or expired + certificates, which will make your application vulnerable to + man-in-the-middle (MitM) attacks. Setting verify to ``False`` + may be useful during local development or testing. + :param cert: (optional) if String, path to ssl client cert file (.pem). + If Tuple, ('cert', 'key') pair. + :rtype: requests.Response + """ + if isinstance(url, bytes): + url = url.decode("utf-8") + + # Create the Request. + req = Request( + method=method.upper(), + url=url, + headers=headers, + files=files, + data=data or {}, + json=json, + params=params or {}, + auth=auth, + cookies=cookies, + hooks=hooks, + ) + prep = self.prepare_request(req) + + assert _is_prepared(prep) + + proxies = proxies or {} + + settings = self.merge_environment_settings( + prep.url, proxies, stream, verify, cert + ) + + # Send the request. + send_kwargs = { + "timeout": timeout, + "allow_redirects": allow_redirects, + } + send_kwargs.update(settings) + resp = self.send(prep, **send_kwargs) + + return resp + + def get( + self, + url: _t.UriType, + params: _t.ParamsType = None, + **kwargs: Unpack[_t.GetKwargs], + ) -> Response: + r"""Sends a GET request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the query string for the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault("allow_redirects", True) + return self.request("GET", url, params=params, **kwargs) + + def options(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends a OPTIONS request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault("allow_redirects", True) + return self.request("OPTIONS", url, **kwargs) + + def head(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends a HEAD request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault("allow_redirects", False) + return self.request("HEAD", url, **kwargs) + + def post( + self, + url: _t.UriType, + data: _t.DataType = None, + json: _t.JsonType = None, + **kwargs: Unpack[_t.PostKwargs], + ) -> Response: + r"""Sends a POST request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param json: (optional) json to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request("POST", url, data=data, json=json, **kwargs) + + def put( + self, url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs] + ) -> Response: + r"""Sends a PUT request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request("PUT", url, data=data, **kwargs) + + def patch( + self, url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs] + ) -> Response: + r"""Sends a PATCH request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request("PATCH", url, data=data, **kwargs) + + def delete(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response: + r"""Sends a DELETE request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request("DELETE", url, **kwargs) + + def send(self, request: PreparedRequest, **kwargs: Any) -> Response: + """Send a given PreparedRequest. + + :rtype: requests.Response + """ + # Set defaults that the hooks can utilize to ensure they always have + # the correct parameters to reproduce the previous request. + kwargs.setdefault("stream", self.stream) + kwargs.setdefault("verify", self.verify) + kwargs.setdefault("cert", self.cert) + if "proxies" not in kwargs: + kwargs["proxies"] = resolve_proxies(request, self.proxies, self.trust_env) + + # It's possible that users might accidentally send a Request object. + # Guard against that specific failure case. + if isinstance(request, Request): + raise ValueError("You can only send PreparedRequests.") + + assert _is_prepared(request) + + # Set up variables needed for resolve_redirects and dispatching of hooks + allow_redirects = kwargs.pop("allow_redirects", True) + stream = kwargs.get("stream") + hooks = request.hooks + + # Get the appropriate adapter to use + adapter = self.get_adapter(url=request.url) + + # Start time (approximately) of the request + start = preferred_clock() + + # Send the request + r = adapter.send(request, **kwargs) + + # Total elapsed time of the request (approximately) + elapsed = preferred_clock() - start + r.elapsed = timedelta(seconds=elapsed) + + # Response manipulation hooks + r = dispatch_hook("response", hooks, r, **kwargs) + + # Persist cookies + if r.history: + # If the hooks create history then we want those cookies too + for resp in r.history: + extract_cookies_to_jar(self.cookies, resp.request, resp.raw) + + extract_cookies_to_jar(self.cookies, request, r.raw) + + # Resolve redirects if allowed. + if allow_redirects: + # Redirect resolving generator. + gen = self.resolve_redirects(r, request, **kwargs) + history = [resp for resp in gen] + else: + history = [] + + # Shuffle things around if there's history. + if history: + # Insert the first (original) request at the start + history.insert(0, r) + # Get the last request made + r = history.pop() + r.history = history + + # If redirects aren't being followed, store the response on the Request for Response.next(). + if not allow_redirects: + try: + r._next = next( # type: ignore[assignment] # yield_requests=True returns PreparedRequest + self.resolve_redirects(r, request, yield_requests=True, **kwargs) + ) + except StopIteration: + pass + + if not stream: + r.content + + return r + + def merge_environment_settings( + self, + url: str, + proxies: dict[str, str] | None, + stream: bool | None, + verify: _t.VerifyType | None, + cert: _t.CertType, + ) -> dict[str, Any]: + """ + Check the environment and merge it with some settings. + + :rtype: dict + """ + # Gather clues from the surrounding environment. + if self.trust_env: + # Set environment's proxies. + no_proxy = proxies.get("no_proxy") if proxies is not None else None + env_proxies = get_environ_proxies(url, no_proxy=no_proxy) + if proxies is not None: + for k, v in env_proxies.items(): + proxies.setdefault(k, v) + + # Look for requests environment configuration + # and be compatible with cURL. + if verify is True or verify is None: + verify = ( + os.environ.get("REQUESTS_CA_BUNDLE") + or os.environ.get("CURL_CA_BUNDLE") + or verify + ) + + # Merge all the kwargs. + proxies = merge_setting(proxies, self.proxies) + stream = merge_setting(stream, self.stream) + verify = merge_setting(verify, self.verify) + cert = merge_setting(cert, self.cert) + + return {"proxies": proxies, "stream": stream, "verify": verify, "cert": cert} + + def get_adapter(self, url: str) -> BaseAdapter: + """ + Returns the appropriate connection adapter for the given URL. + + :rtype: requests.adapters.BaseAdapter + """ + for prefix, adapter in self.adapters.items(): + if url.lower().startswith(prefix.lower()): + return adapter + + # Nothing matches :-/ + raise InvalidSchema(f"No connection adapters were found for {url!r}") + + def close(self) -> None: + """Closes all adapters and as such the session""" + for v in self.adapters.values(): + v.close() + + def mount(self, prefix: str, adapter: BaseAdapter) -> None: + """Registers a connection adapter to a prefix. + + Adapters are sorted in descending order by prefix length. + """ + self.adapters[prefix] = adapter + keys_to_move = [k for k in self.adapters if len(k) < len(prefix)] + + for key in keys_to_move: + self.adapters[key] = self.adapters.pop(key) + + def __getstate__(self) -> dict[str, Any]: + state = {attr: getattr(self, attr, None) for attr in self.__attrs__} + return state + + def __setstate__(self, state: dict[str, Any]) -> None: + for attr, value in state.items(): + setattr(self, attr, value) + + +def session() -> Session: + """ + Returns a :class:`Session` for context-management. + + .. deprecated:: 1.0.0 + + This method has been deprecated since version 1.0.0 and is only kept for + backwards compatibility. New code should use :class:`~requests.sessions.Session` + to create a session. This may be removed at a future date. + + :rtype: Session + """ + return Session() diff --git a/micromamba_root/Lib/site-packages/requests/status_codes.py b/micromamba_root/Lib/site-packages/requests/status_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..6c59d6baec83bd82055106a5d2cea08fa1195274 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/status_codes.py @@ -0,0 +1,128 @@ +r""" +The ``codes`` object defines a mapping from common names for HTTP statuses +to their numerical codes, accessible either as attributes or as dictionary +items. + +Example:: + + >>> import requests + >>> requests.codes['temporary_redirect'] + 307 + >>> requests.codes.teapot + 418 + >>> requests.codes['\o/'] + 200 + +Some codes have multiple names, and both upper- and lower-case versions of +the names are allowed. For example, ``codes.ok``, ``codes.OK``, and +``codes.okay`` all correspond to the HTTP status code 200. +""" + +from .structures import LookupDict + +_codes = { + # Informational. + 100: ("continue",), + 101: ("switching_protocols",), + 102: ("processing", "early-hints"), + 103: ("checkpoint",), + 122: ("uri_too_long", "request_uri_too_long"), + 200: ("ok", "okay", "all_ok", "all_okay", "all_good", "\\o/", "✓"), + 201: ("created",), + 202: ("accepted",), + 203: ("non_authoritative_info", "non_authoritative_information"), + 204: ("no_content",), + 205: ("reset_content", "reset"), + 206: ("partial_content", "partial"), + 207: ("multi_status", "multiple_status", "multi_stati", "multiple_stati"), + 208: ("already_reported",), + 226: ("im_used",), + # Redirection. + 300: ("multiple_choices",), + 301: ("moved_permanently", "moved", "\\o-"), + 302: ("found",), + 303: ("see_other", "other"), + 304: ("not_modified",), + 305: ("use_proxy",), + 306: ("switch_proxy",), + 307: ("temporary_redirect", "temporary_moved", "temporary"), + 308: ( + "permanent_redirect", + "resume_incomplete", + "resume", + ), # "resume" and "resume_incomplete" to be removed in 3.0 + # Client Error. + 400: ("bad_request", "bad"), + 401: ("unauthorized",), + 402: ("payment_required", "payment"), + 403: ("forbidden",), + 404: ("not_found", "-o-"), + 405: ("method_not_allowed", "not_allowed"), + 406: ("not_acceptable",), + 407: ("proxy_authentication_required", "proxy_auth", "proxy_authentication"), + 408: ("request_timeout", "timeout"), + 409: ("conflict",), + 410: ("gone",), + 411: ("length_required",), + 412: ("precondition_failed", "precondition"), + 413: ("request_entity_too_large", "content_too_large"), + 414: ("request_uri_too_large", "uri_too_long"), + 415: ("unsupported_media_type", "unsupported_media", "media_type"), + 416: ( + "requested_range_not_satisfiable", + "requested_range", + "range_not_satisfiable", + ), + 417: ("expectation_failed",), + 418: ("im_a_teapot", "teapot", "i_am_a_teapot"), + 421: ("misdirected_request",), + 422: ("unprocessable_entity", "unprocessable", "unprocessable_content"), + 423: ("locked",), + 424: ("failed_dependency", "dependency"), + 425: ("unordered_collection", "unordered", "too_early"), + 426: ("upgrade_required", "upgrade"), + 428: ("precondition_required", "precondition"), + 429: ("too_many_requests", "too_many"), + 431: ("header_fields_too_large", "fields_too_large"), + 444: ("no_response", "none"), + 449: ("retry_with", "retry"), + 450: ("blocked_by_windows_parental_controls", "parental_controls"), + 451: ("unavailable_for_legal_reasons", "legal_reasons"), + 499: ("client_closed_request",), + # Server Error. + 500: ("internal_server_error", "server_error", "/o\\", "✗"), + 501: ("not_implemented",), + 502: ("bad_gateway",), + 503: ("service_unavailable", "unavailable"), + 504: ("gateway_timeout",), + 505: ("http_version_not_supported", "http_version"), + 506: ("variant_also_negotiates",), + 507: ("insufficient_storage",), + 509: ("bandwidth_limit_exceeded", "bandwidth"), + 510: ("not_extended",), + 511: ("network_authentication_required", "network_auth", "network_authentication"), +} + +codes: LookupDict[int] = LookupDict(name="status_codes") + + +def _init(): + for code, titles in _codes.items(): + for title in titles: + setattr(codes, title, code) + if not title.startswith(("\\", "/")): + setattr(codes, title.upper(), code) + + def doc(code: int) -> str: + names = ", ".join(f"``{n}``" for n in _codes[code]) + return "* %d: %s" % (code, names) + + global __doc__ + __doc__ = ( + __doc__ + "\n" + "\n".join(doc(code) for code in sorted(_codes)) + if __doc__ is not None + else None + ) + + +_init() diff --git a/micromamba_root/Lib/site-packages/requests/structures.py b/micromamba_root/Lib/site-packages/requests/structures.py new file mode 100644 index 0000000000000000000000000000000000000000..7675eaf15a181dada66c02bb0468dc00d6f523b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/structures.py @@ -0,0 +1,130 @@ +""" +requests.structures +~~~~~~~~~~~~~~~~~~~ + +Data structures that power Requests. +""" + +from __future__ import annotations + +from collections import OrderedDict +from collections.abc import Iterable, Iterator, Mapping +from typing import Any, Generic, TypeVar, overload + +from .compat import MutableMapping + +_VT = TypeVar("_VT") +_D = TypeVar("_D") + + +class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): + """A case-insensitive ``dict``-like object. + + Implements all methods and operations of + ``MutableMapping`` as well as dict's ``copy``. Also + provides ``lower_items``. + + All keys are expected to be strings. The structure remembers the + case of the last key to be set, and ``iter(instance)``, + ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` + will contain case-sensitive keys. However, querying and contains + testing is case insensitive:: + + cid = CaseInsensitiveDict() + cid['Accept'] = 'application/json' + cid['aCCEPT'] == 'application/json' # True + list(cid) == ['Accept'] # True + + For example, ``headers['content-encoding']`` will return the + value of a ``'Content-Encoding'`` response header, regardless + of how the header name was originally stored. + + If the constructor, ``.update``, or equality comparison + operations are given keys that have equal ``.lower()``s, the + behavior is undefined. + """ + + _store: OrderedDict[str, tuple[str, _VT]] + + def __init__( + self, + data: Mapping[str, _VT] | Iterable[tuple[str, _VT]] | None = None, + **kwargs: _VT, + ) -> None: + self._store = OrderedDict() + if data is None: + data = {} + self.update(data, **kwargs) + + def __setitem__(self, key: str, value: _VT) -> None: + # Use the lowercased key for lookups, but store the actual + # key alongside the value. + self._store[key.lower()] = (key, value) + + def __getitem__(self, key: str) -> _VT: + return self._store[key.lower()][1] + + def __delitem__(self, key: str) -> None: + del self._store[key.lower()] + + def __iter__(self) -> Iterator[str]: + return (casedkey for casedkey, _ in self._store.values()) + + def __len__(self) -> int: + return len(self._store) + + def lower_items(self) -> Iterator[tuple[str, _VT]]: + """Like iteritems(), but with all lowercase keys.""" + return ((lowerkey, keyval[1]) for (lowerkey, keyval) in self._store.items()) + + def __eq__(self, other: object) -> bool: + if isinstance(other, Mapping): + other_dict: CaseInsensitiveDict[Any] = CaseInsensitiveDict(other) # type: ignore[reportUnknownArgumentType] + else: + return NotImplemented + # Compare insensitively + return dict(self.lower_items()) == dict(other_dict.lower_items()) + + # Copy is required + def copy(self) -> CaseInsensitiveDict[_VT]: + return CaseInsensitiveDict(self._store.values()) + + def __repr__(self) -> str: + return str(dict(self.items())) + + +class LookupDict(dict[str, _VT]): + """Dictionary lookup object.""" + + name: Any + + def __init__(self, name: Any = None) -> None: + self.name = name + super().__init__() + + def __repr__(self) -> str: + return f"<lookup '{self.name}'>" + + def __getattr__(self, key: str) -> _VT | None: + # We need this for type checkers to infer typing + # on attribute access with status_codes.py + if key in self.__dict__: + return self.__dict__[key] + else: + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{key}'" + ) + + def __getitem__(self, key: str) -> _VT | None: # type: ignore[override] + # We allow fall-through here, so values default to None + + return self.__dict__.get(key, None) + + @overload + def get(self, key: str, default: None = None) -> _VT | None: ... + + @overload + def get(self, key: str, default: _D | _VT) -> _D | _VT: ... + + def get(self, key: str, default: _D | None = None) -> _VT | _D | None: + return self.__dict__.get(key, default) diff --git a/micromamba_root/Lib/site-packages/requests/utils.py b/micromamba_root/Lib/site-packages/requests/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..120336ddc6ed5d802735685349c3c3cd42e0c597 --- /dev/null +++ b/micromamba_root/Lib/site-packages/requests/utils.py @@ -0,0 +1,1155 @@ +""" +requests.utils +~~~~~~~~~~~~~~ + +This module provides utility functions that are used within Requests +that are also useful for external consumption. +""" + +from __future__ import annotations + +import codecs +import contextlib +import io +import os +import re +import socket +import struct +import sys +import tempfile +import warnings +import zipfile +from collections import OrderedDict +from collections.abc import Generator, Iterable +from typing import ( + TYPE_CHECKING, + Any, + Final, + TypeVar, + cast, + overload, +) + +from urllib3.util import make_headers, parse_url + +from . import certs +from .__version__ import __version__ + +# to_native_string is unused here, but imported here for backwards compatibility +from ._internal_utils import ( # noqa: F401 + _HEADER_VALIDATORS_BYTE, # type: ignore[reportPrivateUsage] + _HEADER_VALIDATORS_STR, # type: ignore[reportPrivateUsage] + HEADER_VALIDATORS, # type: ignore[reportUnusedImport] + to_native_string, # type: ignore[reportUnusedImport] +) +from ._types import SupportsItems as _SupportsItems +from .compat import ( + Mapping, + bytes, + getproxies, + getproxies_environment, + integer_types, + is_urllib3_1, + proxy_bypass, + proxy_bypass_environment, # type: ignore[attr-defined] # https://github.com/python/cpython/issues/145331 + quote, + str, + unquote, + urlparse, + urlunparse, +) +from .compat import parse_http_list as _parse_list_header +from .cookies import cookiejar_from_dict +from .exceptions import ( + FileModeWarning, + InvalidHeader, + InvalidURL, + UnrewindableBodyError, +) +from .structures import CaseInsensitiveDict + +if TYPE_CHECKING: + from http.cookiejar import CookieJar + from io import BufferedWriter + + from . import _types as _t + from .models import PreparedRequest, Request, Response + +NETRC_FILES: Final = (".netrc", "_netrc") + + +# Certificate is extracted by certifi when needed. +DEFAULT_CA_BUNDLE_PATH: str = certs.where() + + +DEFAULT_PORTS: Final = {"http": 80, "https": 443} + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +# Ensure that ', ' is used to preserve previous delimiter behavior. +DEFAULT_ACCEPT_ENCODING: Final = ", ".join( + re.split(r",\s*", make_headers(accept_encoding=True)["accept-encoding"]) +) + + +if sys.platform == "win32": + # provide a proxy_bypass version on Windows without DNS lookups + + def proxy_bypass_registry(host: str) -> bool: + try: + import winreg + except ImportError: + return False + + try: + internetSettings = winreg.OpenKey( + winreg.HKEY_CURRENT_USER, + r"Software\Microsoft\Windows\CurrentVersion\Internet Settings", + ) + # ProxyEnable could be REG_SZ or REG_DWORD, normalizing it + proxyEnable = int(winreg.QueryValueEx(internetSettings, "ProxyEnable")[0]) + # ProxyOverride is almost always a string + proxyOverride = winreg.QueryValueEx(internetSettings, "ProxyOverride")[0] + except (OSError, ValueError): + return False + if not proxyEnable or not proxyOverride: + return False + + # make a check value list from the registry entry: replace the + # '<local>' string by the localhost entry and the corresponding + # canonical entry. + proxyOverride = proxyOverride.split(";") + # filter out empty strings to avoid re.match return true in the following code. + proxyOverride = filter(None, proxyOverride) + # now check if we match one of the registry values. + for test in proxyOverride: + if test == "<local>": + if "." not in host: + return True + test = test.replace(".", r"\.") # mask dots + test = test.replace("*", r".*") # change glob sequence + test = test.replace("?", r".") # change glob char + if re.match(test, host, re.I): + return True + return False + + def proxy_bypass(host: str) -> bool: # noqa + """Return True, if the host should be bypassed. + + Checks proxy settings gathered from the environment, if specified, + or the registry. + """ + if getproxies_environment(): + return proxy_bypass_environment(host) + else: + return proxy_bypass_registry(host) + + +def dict_to_sequence( + d: _t.SupportsItems[Any, Any] | Iterable[tuple[Any, Any]], +) -> Iterable[tuple[Any, Any]]: + """Returns an internal sequence dictionary update.""" + + if isinstance(d, _SupportsItems): + return d.items() + + return d + + +def super_len(o: Any) -> int: + total_length = None + current_position = 0 + + if not is_urllib3_1 and isinstance(o, str): + # urllib3 2.x+ treats all strings as utf-8 instead + # of latin-1 (iso-8859-1) like http.client. + o = o.encode("utf-8") + + if hasattr(o, "__len__"): + total_length = len(o) + + elif hasattr(o, "len"): + total_length = o.len + + elif hasattr(o, "fileno"): + try: + fileno = o.fileno() + except (io.UnsupportedOperation, AttributeError): + # AttributeError is a surprising exception, seeing as how we've just checked + # that `hasattr(o, 'fileno')`. It happens for objects obtained via + # `Tarfile.extractfile()`, per issue 5229. + pass + else: + total_length = os.fstat(fileno).st_size + + # Having used fstat to determine the file length, we need to + # confirm that this file was opened up in binary mode. + if "b" not in o.mode: + warnings.warn( + ( + "Requests has determined the content-length for this " + "request using the binary size of the file: however, the " + "file has been opened in text mode (i.e. without the 'b' " + "flag in the mode). This may lead to an incorrect " + "content-length. In Requests 3.0, support will be removed " + "for files in text mode." + ), + FileModeWarning, + ) + + if hasattr(o, "tell"): + try: + current_position = o.tell() + except OSError: + # This can happen in some weird situations, such as when the file + # is actually a special file descriptor like stdin. In this + # instance, we don't know what the length is, so set it to zero and + # let requests chunk it instead. + if total_length is not None: + current_position = total_length + else: + if hasattr(o, "seek") and total_length is None: + # StringIO and BytesIO have seek but no usable fileno + try: + # seek to end of file + o.seek(0, 2) + total_length = o.tell() + + # seek back to current position to support + # partially read file-like objects + o.seek(current_position or 0) + except OSError: + total_length = 0 + + if total_length is None: + total_length = 0 + + return max(0, total_length - current_position) + + +def get_netrc_auth( + url: _t.UriType, raise_errors: bool = False +) -> tuple[str, str] | None: + """Returns the Requests tuple auth for a given url from netrc.""" + + if isinstance(url, bytes): + url = url.decode("utf-8") + + netrc_file = os.environ.get("NETRC") + if netrc_file is not None: + netrc_locations = (netrc_file,) + else: + netrc_locations = (f"~/{f}" for f in NETRC_FILES) + + try: + from netrc import NetrcParseError, netrc + + netrc_path = None + + for f in netrc_locations: + loc = os.path.expanduser(f) + if os.path.exists(loc): + netrc_path = loc + break + + # Abort early if there isn't one. + if netrc_path is None: + return + + ri = urlparse(url) + host = ri.hostname + + if host is None: + return + + try: + _netrc = netrc(netrc_path).authenticators(host) + if _netrc and any(_netrc): + # Return with login / password + login_i = 0 if _netrc[0] else 1 + return (_netrc[login_i] or "", _netrc[2] or "") + except (NetrcParseError, OSError): + # If there was a parsing error or a permissions issue reading the file, + # we'll just skip netrc auth unless explicitly asked to raise errors. + if raise_errors: + raise + + # App Engine hackiness. + except (ImportError, AttributeError): + pass + + +def guess_filename(obj: Any) -> str | None: + """Tries to guess the filename of the given object.""" + name = getattr(obj, "name", None) + if name and isinstance(name, (str, bytes)) and name[0] != "<" and name[-1] != ">": + return os.path.basename(name) # type: ignore[return-value] # urllib3 accepts bytes but types str only + + +def extract_zipped_paths(path: str) -> str: + """Replace nonexistent paths that look like they refer to a member of a zip + archive with the location of an extracted copy of the target, or else + just return the provided path unchanged. + """ + if os.path.exists(path): + # this is already a valid path, no need to do anything further + return path + + # find the first valid part of the provided path and treat that as a zip archive + # assume the rest of the path is the name of a member in the archive + archive, member = os.path.split(path) + while archive and not os.path.exists(archive): + archive, prefix = os.path.split(archive) + if not prefix: + # If we don't check for an empty prefix after the split (in other words, archive remains unchanged after the split), + # we _can_ end up in an infinite loop on a rare corner case affecting a small number of users + break + member = "/".join([prefix, member]) + + if not zipfile.is_zipfile(archive): + return path + + zip_file = zipfile.ZipFile(archive) + if member not in zip_file.namelist(): + return path + + # we have a valid zip archive and a valid member of that archive + suffix = os.path.splitext(member.split("/")[-1])[-1] + fd, extracted_path = tempfile.mkstemp(suffix=suffix) + try: + os.write(fd, zip_file.read(member)) + finally: + os.close(fd) + + return extracted_path + + +@contextlib.contextmanager +def atomic_open(filename: str) -> Generator[BufferedWriter, None, None]: + """Write a file to the disk in an atomic fashion""" + tmp_descriptor, tmp_name = tempfile.mkstemp(dir=os.path.dirname(filename)) + try: + with os.fdopen(tmp_descriptor, "wb") as tmp_handler: + yield tmp_handler + os.replace(tmp_name, filename) + except BaseException: + os.remove(tmp_name) + raise + + +def from_key_val_list( + value: Mapping[Any, Any] | Iterable[tuple[Any, Any]] | None, +) -> dict[Any, Any] | None: + """Take an object and test to see if it can be represented as a + dictionary. Unless it can not be represented as such, return an + OrderedDict, e.g., + + :: + + >>> from_key_val_list([('key', 'val')]) + OrderedDict([('key', 'val')]) + >>> from_key_val_list('string') + Traceback (most recent call last): + ... + ValueError: cannot encode objects that are not 2-tuples + >>> from_key_val_list({'key': 'val'}) + OrderedDict([('key', 'val')]) + + :rtype: OrderedDict + """ + if value is None: + return None + + if isinstance(value, (str, bytes, bool, int)): + raise ValueError("cannot encode objects that are not 2-tuples") + + return OrderedDict(value) + + +@overload +def to_key_val_list(value: None) -> None: ... +@overload +def to_key_val_list( + value: _t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]], +) -> list[tuple[_KT, _VT]]: ... +def to_key_val_list( + value: _t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]] | None, +) -> list[tuple[_KT, _VT]] | None: + """Take an object and test to see if it can be represented as a + dictionary. If it can be, return a list of tuples, e.g., + + :: + + >>> to_key_val_list([('key', 'val')]) + [('key', 'val')] + >>> to_key_val_list({'key': 'val'}) + [('key', 'val')] + >>> to_key_val_list('string') + Traceback (most recent call last): + ... + ValueError: cannot encode objects that are not 2-tuples + + :rtype: list + """ + if value is None: + return None + + if isinstance(value, (str, bytes, bool, int)): + raise ValueError("cannot encode objects that are not 2-tuples") + + if isinstance(value, _SupportsItems): + return list(value.items()) + + return list(value) + + +# From mitsuhiko/werkzeug (used with permission). +def parse_list_header(value: str) -> list[str]: + """Parse lists as described by RFC 2068 Section 2. + + In particular, parse comma-separated lists where the elements of + the list may include quoted-strings. A quoted-string could + contain a comma. A non-quoted string could have quotes in the + middle. Quotes are removed automatically after parsing. + + It basically works like :func:`parse_set_header` just that items + may appear multiple times and case sensitivity is preserved. + + The return value is a standard :class:`list`: + + >>> parse_list_header('token, "quoted value"') + ['token', 'quoted value'] + + To create a header from the :class:`list` again, use the + :func:`dump_header` function. + + :param value: a string with a list header. + :return: :class:`list` + :rtype: list + """ + result: list[str] = [] + for item in _parse_list_header(value): + if item[:1] == item[-1:] == '"': + item = unquote_header_value(item[1:-1]) + result.append(item) + return result + + +# From mitsuhiko/werkzeug (used with permission). +def parse_dict_header(value: str) -> dict[str, str | None]: + """Parse lists of key, value pairs as described by RFC 2068 Section 2 and + convert them into a python dict: + + >>> d = parse_dict_header('foo="is a fish", bar="as well"') + >>> type(d) is dict + True + >>> sorted(d.items()) + [('bar', 'as well'), ('foo', 'is a fish')] + + If there is no value for a key it will be `None`: + + >>> parse_dict_header('key_without_value') + {'key_without_value': None} + + To create a header from the :class:`dict` again, use the + :func:`dump_header` function. + + :param value: a string with a dict header. + :return: :class:`dict` + :rtype: dict + """ + result: dict[str, str | None] = {} + for item in _parse_list_header(value): + if "=" not in item: + result[item] = None + continue + name, value = item.split("=", 1) + if value[:1] == value[-1:] == '"': + value = unquote_header_value(value[1:-1]) + result[name] = value + return result + + +# From mitsuhiko/werkzeug (used with permission). +def unquote_header_value(value: str, is_filename: bool = False) -> str: + r"""Unquotes a header value. (Reversal of :func:`quote_header_value`). + This does not use the real unquoting but what browsers are actually + using for quoting. + + :param value: the header value to unquote. + :rtype: str + """ + if value and value[0] == value[-1] == '"': + # this is not the real unquoting, but fixing this so that the + # RFC is met will result in bugs with internet explorer and + # probably some other browsers as well. IE for example is + # uploading files with "C:\foo\bar.txt" as filename + value = value[1:-1] + + # if this is a filename and the starting characters look like + # a UNC path, then just return the value without quotes. Using the + # replace sequence below on a UNC path has the effect of turning + # the leading double slash into a single slash and then + # _fix_ie_filename() doesn't work correctly. See #458. + if not is_filename or value[:2] != "\\\\": + return value.replace("\\\\", "\\").replace('\\"', '"') + return value + + +def dict_from_cookiejar(cj: CookieJar) -> dict[str, str | None]: + """Returns a key/value dictionary from a CookieJar. + + :param cj: CookieJar object to extract cookies from. + :rtype: dict + """ + + cookie_dict = {cookie.name: cookie.value for cookie in cj} + return cookie_dict + + +def add_dict_to_cookiejar(cj: CookieJar, cookie_dict: dict[str, str]) -> CookieJar: + """Returns a CookieJar from a key/value dictionary. + + :param cj: CookieJar to insert cookies into. + :param cookie_dict: Dict of key/values to insert into CookieJar. + :rtype: CookieJar + """ + + return cookiejar_from_dict(cookie_dict, cj) + + +def get_encodings_from_content(content: str) -> list[str]: + """Returns encodings from given content string. + + :param content: bytestring to extract encodings from. + """ + warnings.warn( + ( + "In requests 3.0, get_encodings_from_content will be removed. For " + "more information, please see the discussion on issue #2266. (This" + " warning should only appear once.)" + ), + DeprecationWarning, + ) + + charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I) + pragma_re = re.compile(r'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I) + xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]') + + return ( + charset_re.findall(content) + + pragma_re.findall(content) + + xml_re.findall(content) + ) + + +def _parse_content_type_header(header: str) -> tuple[str, dict[str, Any]]: + """Returns content type and parameters from given header. + + :param header: string + :return: tuple containing content type and dictionary of + parameters. + """ + + tokens = header.split(";") + content_type, params = tokens[0].strip(), tokens[1:] + params_dict: dict[str, str | bool] = {} + strip_chars = "\"' " + + for param in params: + param = param.strip() + if param and (idx := param.find("=")) != -1: + key = param[:idx].strip(strip_chars) + value = param[idx + 1 :].strip(strip_chars) + params_dict[key.lower()] = value + return content_type, params_dict + + +def get_encoding_from_headers(headers: CaseInsensitiveDict[str]) -> str | None: + """Returns encodings from given HTTP Header Dict. + + :param headers: dictionary to extract encoding from. + :rtype: str + """ + + content_type = headers.get("content-type") + + if not content_type: + return None + + content_type, params = _parse_content_type_header(content_type) + + if "charset" in params: + return params["charset"].strip("'\"") + + if "text" in content_type: + return "ISO-8859-1" + + if "application/json" in content_type: + # Assume UTF-8 based on RFC 4627: https://www.ietf.org/rfc/rfc4627.txt since the charset was unset + return "utf-8" + + +def stream_decode_response_unicode( + iterator: Iterable[bytes], r: Response +) -> Generator[str | bytes, None, None]: + """Stream decodes an iterator.""" + + if r.encoding is None: + yield from iterator + return + + decoder = codecs.getincrementaldecoder(r.encoding)(errors="replace") + for chunk in iterator: + rv = decoder.decode(chunk) + if rv: + yield rv + rv = decoder.decode(b"", final=True) + if rv: + yield rv + + +@overload +def iter_slices( + string: bytes, slice_length: int | None +) -> Generator[bytes, None, None]: ... +@overload +def iter_slices( + string: str, slice_length: int | None +) -> Generator[str, None, None]: ... +def iter_slices( + string: bytes | str, slice_length: int | None +) -> Generator[bytes | str, None, None]: + """Iterate over slices of a string.""" + pos = 0 + if slice_length is None or slice_length <= 0: + slice_length = len(string) + while pos < len(string): + yield string[pos : pos + slice_length] + pos += slice_length + + +def get_unicode_from_response(r: Response) -> str | bytes | None: + """Returns the requested content back in unicode. + + :param r: Response object to get unicode content from. + + Tried: + + 1. charset from content-type + 2. fall back and replace all unicode characters + + :rtype: str + """ + warnings.warn( + ( + "In requests 3.0, get_unicode_from_response will be removed. For " + "more information, please see the discussion on issue #2266. (This" + " warning should only appear once.)" + ), + DeprecationWarning, + ) + if r.content is None: # type: ignore[reportUnnecessaryComparison] + return None + + tried_encodings: list[str] = [] + + # Try charset from content-type + encoding = get_encoding_from_headers(r.headers) + + if encoding: + try: + return str(r.content, encoding) + except UnicodeError: + tried_encodings.append(encoding) + + # Fall back: + try: + return str(r.content, encoding or "utf-8", errors="replace") + except TypeError: + return r.content + + +# The unreserved URI characters (RFC 3986) +UNRESERVED_SET: Final = frozenset( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789-._~" +) + + +def unquote_unreserved(uri: str) -> str: + """Un-escape any percent-escape sequences in a URI that are unreserved + characters. This leaves all reserved, illegal and non-ASCII bytes encoded. + + :rtype: str + """ + parts = uri.split("%") + for i in range(1, len(parts)): + h = parts[i][0:2] + if len(h) == 2 and h.isalnum(): + try: + c = chr(int(h, 16)) + except ValueError: + raise InvalidURL(f"Invalid percent-escape sequence: '{h}'") + + if c in UNRESERVED_SET: + parts[i] = c + parts[i][2:] + else: + parts[i] = f"%{parts[i]}" + else: + parts[i] = f"%{parts[i]}" + return "".join(parts) + + +def requote_uri(uri: str) -> str: + """Re-quote the given URI. + + This function passes the given URI through an unquote/quote cycle to + ensure that it is fully and consistently quoted. + + :rtype: str + """ + safe_with_percent = "!#$%&'()*+,/:;=?@[]~" + safe_without_percent = "!#$&'()*+,/:;=?@[]~" + try: + # Unquote only the unreserved characters + # Then quote only illegal characters (do not quote reserved, + # unreserved, or '%') + return quote(unquote_unreserved(uri), safe=safe_with_percent) + except InvalidURL: + # We couldn't unquote the given URI, so let's try quoting it, but + # there may be unquoted '%'s in the URI. We need to make sure they're + # properly quoted so they do not cause issues elsewhere. + return quote(uri, safe=safe_without_percent) + + +def address_in_network(ip: str, net: str) -> bool: + """This function allows you to check if an IP belongs to a network subnet + + Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 + returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 + + :rtype: bool + """ + ipaddr = struct.unpack("=L", socket.inet_aton(ip))[0] + netaddr, bits = net.split("/") + netmask = struct.unpack("=L", socket.inet_aton(dotted_netmask(int(bits))))[0] + network = struct.unpack("=L", socket.inet_aton(netaddr))[0] & netmask + return (ipaddr & netmask) == (network & netmask) + + +def dotted_netmask(mask: int) -> str: + """Converts mask from /xx format to xxx.xxx.xxx.xxx + + Example: if mask is 24 function returns 255.255.255.0 + + :rtype: str + """ + bits = 0xFFFFFFFF ^ (1 << 32 - mask) - 1 + return socket.inet_ntoa(struct.pack(">I", bits)) + + +def is_ipv4_address(string_ip: str) -> bool: + """ + :rtype: bool + """ + try: + socket.inet_aton(string_ip) + except OSError: + return False + return True + + +def is_valid_cidr(string_network: str) -> bool: + """ + Very simple check of the cidr format in no_proxy variable. + + :rtype: bool + """ + if string_network.count("/") == 1: + try: + mask = int(string_network.split("/")[1]) + except ValueError: + return False + + if mask < 1 or mask > 32: + return False + + try: + socket.inet_aton(string_network.split("/")[0]) + except OSError: + return False + else: + return False + return True + + +@contextlib.contextmanager +def set_environ(env_name: str, value: str | None) -> Generator[None, None, None]: + """Set the environment variable 'env_name' to 'value' + + Save previous value, yield, and then restore the previous value stored in + the environment variable 'env_name'. + + If 'value' is None, do nothing""" + value_changed = value is not None + old_value: str | None = None + if value_changed: + old_value = os.environ.get(env_name) + os.environ[env_name] = value + try: + yield + finally: + if value_changed: + if old_value is None: + del os.environ[env_name] + else: + os.environ[env_name] = old_value + + +def should_bypass_proxies(url: str, no_proxy: str | None) -> bool: + """ + Returns whether we should bypass proxies or not. + + :rtype: bool + """ + + # Prioritize lowercase environment variables over uppercase + # to keep a consistent behaviour with other http projects (curl, wget). + def get_proxy(key: str) -> str | None: + return os.environ.get(key) or os.environ.get(key.upper()) + + # First check whether no_proxy is defined. If it is, check that the URL + # we're getting isn't in the no_proxy list. + no_proxy_arg = no_proxy + if no_proxy is None: + no_proxy = get_proxy("no_proxy") + parsed = urlparse(url) + hostname = parsed.hostname + + if hostname is None: + # URLs don't always have hostnames, e.g. file:/// urls. + return True + + if no_proxy: + # We need to check whether we match here. We need to see if we match + # the end of the hostname, both with and without the port. + no_proxy_hosts = (host for host in no_proxy.replace(" ", "").split(",") if host) + + if is_ipv4_address(hostname): + for proxy_ip in no_proxy_hosts: + if is_valid_cidr(proxy_ip): + if address_in_network(hostname, proxy_ip): + return True + elif hostname == proxy_ip: + # If no_proxy ip was defined in plain IP notation instead of cidr notation & + # matches the IP of the index + return True + else: + host_with_port = hostname + if parsed.port: + host_with_port += f":{parsed.port}" + + for host in no_proxy_hosts: + host = host.lstrip(".") + if hostname == host or host_with_port == host: + return True + host = "." + host + if hostname.endswith(host) or host_with_port.endswith(host): + return True + + with set_environ("no_proxy", no_proxy_arg): + try: + bypass = proxy_bypass(hostname) + except (TypeError, socket.gaierror): + bypass = False + + if bypass: + return True + + return False + + +def get_environ_proxies(url: str, no_proxy: str | None = None) -> dict[str, str]: + """ + Return a dict of environment proxies. + + :rtype: dict + """ + if should_bypass_proxies(url, no_proxy=no_proxy): + return {} + else: + return getproxies() + + +def select_proxy(url: str, proxies: dict[str, str] | None) -> str | None: + """Select a proxy for the url, if applicable. + + :param url: The url being for the request + :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs + """ + proxies = proxies or {} + urlparts = urlparse(url) + if urlparts.hostname is None: + return proxies.get(urlparts.scheme, proxies.get("all")) + + proxy_keys = [ + urlparts.scheme + "://" + urlparts.hostname, + urlparts.scheme, + "all://" + urlparts.hostname, + "all", + ] + proxy = None + for proxy_key in proxy_keys: + if proxy_key in proxies: + proxy = proxies[proxy_key] + break + + return proxy + + +def resolve_proxies( + request: Request | PreparedRequest, + proxies: dict[str, str] | None, + trust_env: bool = True, +) -> dict[str, str]: + """This method takes proxy information from a request and configuration + input to resolve a mapping of target proxies. This will consider settings + such as NO_PROXY to strip proxy configurations. + + :param request: Request or PreparedRequest + :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs + :param trust_env: Boolean declaring whether to trust environment configs + + :rtype: dict + """ + proxies = proxies if proxies is not None else {} + url = cast(str, request.url) + scheme = urlparse(url).scheme + no_proxy = proxies.get("no_proxy") + new_proxies = proxies.copy() + + if trust_env and not should_bypass_proxies(url, no_proxy=no_proxy): + environ_proxies = get_environ_proxies(url, no_proxy=no_proxy) + + proxy = environ_proxies.get(scheme, environ_proxies.get("all")) + + if proxy: + new_proxies.setdefault(scheme, proxy) + return new_proxies + + +def default_user_agent(name: str = "python-requests") -> str: + """ + Return a string representing the default user agent. + + :rtype: str + """ + return f"{name}/{__version__}" + + +def default_headers() -> CaseInsensitiveDict[str]: + """ + :rtype: requests.structures.CaseInsensitiveDict + """ + return CaseInsensitiveDict( + { + "User-Agent": default_user_agent(), + "Accept-Encoding": DEFAULT_ACCEPT_ENCODING, + "Accept": "*/*", + "Connection": "keep-alive", + } + ) + + +def parse_header_links(value: str) -> list[dict[str, str]]: + """Return a list of parsed link headers proxies. + + i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg" + + :rtype: list + """ + + links: list[dict[str, str]] = [] + + replace_chars = " '\"" + + value = value.strip(replace_chars) + if not value: + return links + + for val in re.split(", *<", value): + try: + url, params = val.split(";", 1) + except ValueError: + url, params = val, "" + + link: dict[str, str] = {"url": url.strip("<> '\"")} + + for param in params.split(";"): + try: + key, value = param.split("=") + except ValueError: + break + + link[key.strip(replace_chars)] = value.strip(replace_chars) + + links.append(link) + + return links + + +# Null bytes; no need to recreate these on each call to guess_json_utf +_null = "\x00".encode("ascii") # encoding to ASCII for Python 3 +_null2 = _null * 2 +_null3 = _null * 3 + + +def guess_json_utf(data: bytes) -> str | None: + """ + :rtype: str + """ + # JSON always starts with two ASCII characters, so detection is as + # easy as counting the nulls and from their location and count + # determine the encoding. Also detect a BOM, if present. + sample = data[:4] + if sample in (codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE): + return "utf-32" # BOM included + if sample[:3] == codecs.BOM_UTF8: + return "utf-8-sig" # BOM included, MS style (discouraged) + if sample[:2] in (codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE): + return "utf-16" # BOM included + nullcount = sample.count(_null) + if nullcount == 0: + return "utf-8" + if nullcount == 2: + if sample[::2] == _null2: # 1st and 3rd are null + return "utf-16-be" + if sample[1::2] == _null2: # 2nd and 4th are null + return "utf-16-le" + # Did not detect 2 valid UTF-16 ascii-range characters + if nullcount == 3: + if sample[:3] == _null3: + return "utf-32-be" + if sample[1:] == _null3: + return "utf-32-le" + # Did not detect a valid UTF-32 ascii-range character + return None + + +def prepend_scheme_if_needed(url: str, new_scheme: str) -> str: + """Given a URL that may or may not have a scheme, prepend the given scheme. + Does not replace a present scheme with the one provided as an argument. + + :rtype: str + """ + parsed = parse_url(url) + scheme, auth, _host, _port, path, query, fragment = parsed + + # A defect in urlparse determines that there isn't a netloc present in some + # urls. We previously assumed parsing was overly cautious, and swapped the + # netloc and path. Due to a lack of tests on the original defect, this is + # maintained with parse_url for backwards compatibility. + netloc = parsed.netloc + if not netloc: + netloc, path = path, netloc + + if auth: + # parse_url doesn't provide the netloc with auth + # so we'll add it ourselves. + netloc = cast(str, netloc) + netloc = "@".join([auth, netloc]) + if scheme is None: + scheme = new_scheme + if path is None: + path = "" + + return urlunparse((scheme, netloc, path, "", query, fragment)) + + +def get_auth_from_url(url: str) -> tuple[str, str]: + """Given a url with authentication components, extract them into a tuple of + username,password. + + :rtype: (str,str) + """ + parsed = urlparse(url) + + try: + # except handles parsed.username/password being None + auth = (unquote(parsed.username), unquote(parsed.password)) # type: ignore[arg-type] + except (AttributeError, TypeError): + auth = ("", "") + + return auth + + +def check_header_validity(header: tuple[str | bytes, str | bytes]) -> None: + """Verifies that header parts don't contain leading whitespace + reserved characters, or return characters. + + :param header: tuple, in the format (name, value). + """ + name, value = header + _validate_header_part(header, name, 0) + _validate_header_part(header, value, 1) + + +def _validate_header_part( + header: tuple[str | bytes, str | bytes], + header_part: str | bytes, + header_validator_index: int, +) -> None: + if isinstance(header_part, str): + validator = _HEADER_VALIDATORS_STR[header_validator_index] + elif isinstance(header_part, bytes): # type: ignore[reportUnnecessaryIsInstance] + # runtime guard for non-str/bytes input + validator = _HEADER_VALIDATORS_BYTE[header_validator_index] + else: + raise InvalidHeader( + f"Header part ({header_part!r}) from {header} " + f"must be of type str or bytes, not {type(header_part)}" + ) + + if not validator.match(header_part): # type: ignore[arg-type] + header_kind = "name" if header_validator_index == 0 else "value" + raise InvalidHeader( + f"Invalid leading whitespace, reserved character(s), or return " + f"character(s) in header {header_kind}: {header_part!r}" + ) + + +def urldefragauth(url: str) -> str: + """ + Given a url remove the fragment and the authentication part. + + :rtype: str + """ + scheme, netloc, path, params, query, _fragment = urlparse(url) + + # see func:`prepend_scheme_if_needed` + if not netloc: + netloc, path = path, netloc + + netloc = netloc.rsplit("@", 1)[-1] + + return urlunparse((scheme, netloc, path, params, query, "")) + + +def rewind_body(prepared_request: PreparedRequest) -> None: + """Move file pointer back to its recorded starting position + so it can be read again on redirect. + """ + body_seek = getattr(prepared_request.body, "seek", None) + if body_seek is not None and isinstance( + prepared_request._body_position, # type: ignore[reportPrivateUsage] + integer_types, + ): + try: + body_seek(prepared_request._body_position) # type: ignore[reportPrivateUsage] + except OSError: + raise UnrewindableBodyError( + "An error occurred when rewinding request body for redirect." + ) + else: + raise UnrewindableBodyError("Unable to rewind request body for redirect.") diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/METADATA b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..e46f51be3ccf44f8a2b35854e28294a668f00fde --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/METADATA @@ -0,0 +1,592 @@ +Metadata-Version: 2.4 +Name: ruff +Version: 0.15.12 +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Rust +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Software Development :: Quality Assurance +License-File: LICENSE +Summary: An extremely fast Python linter and code formatter, written in Rust. +Keywords: automation,flake8,pycodestyle,pyflakes,pylint,clippy +Home-Page: https://docs.astral.sh/ruff +Author-email: "Astral Software Inc." <hey@astral.sh> +License-Expression: MIT +Requires-Python: >=3.7 +Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM +Project-URL: Changelog, https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md +Project-URL: Documentation, https://docs.astral.sh/ruff/ +Project-URL: Repository, https://github.com/astral-sh/ruff + +<!-- Begin section: Overview --> + +# Ruff + +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![image](https://img.shields.io/pypi/v/ruff.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff.svg)](https://github.com/astral-sh/ruff/blob/main/LICENSE) +[![image](https://img.shields.io/pypi/pyversions/ruff.svg)](https://pypi.python.org/pypi/ruff) +[![Actions status](https://github.com/astral-sh/ruff/workflows/CI/badge.svg)](https://github.com/astral-sh/ruff/actions) +[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.com/invite/astral-sh) + +[**Docs**](https://docs.astral.sh/ruff/) | [**Playground**](https://play.ruff.rs/) + +An extremely fast Python linter and code formatter, written in Rust. + +<p align="center"> + <img alt="Shows a bar chart with benchmark results." src="https://user-images.githubusercontent.com/1309177/232603516-4fb4892d-585c-4b20-b810-3db9161831e4.svg"> +</p> + +<p align="center"> + <i>Linting the CPython codebase from scratch.</i> +</p> + +- ⚡️ 10-100x faster than existing linters (like Flake8) and formatters (like Black) +- 🐍 Installable via `pip` +- 🛠️ `pyproject.toml` support +- 🤝 Python 3.14 compatibility +- ⚖️ Drop-in parity with [Flake8](https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-flake8), isort, and [Black](https://docs.astral.sh/ruff/faq/#how-does-ruffs-formatter-compare-to-black) +- 📦 Built-in caching, to avoid re-analyzing unchanged files +- 🔧 Fix support, for automatic error correction (e.g., automatically remove unused imports) +- 📏 Over [800 built-in rules](https://docs.astral.sh/ruff/rules/), with native re-implementations + of popular Flake8 plugins, like flake8-bugbear +- ⌨️ First-party [editor integrations](https://docs.astral.sh/ruff/editors) for [VS Code](https://github.com/astral-sh/ruff-vscode) and [more](https://docs.astral.sh/ruff/editors/setup) +- 🌎 Monorepo-friendly, with [hierarchical and cascading configuration](https://docs.astral.sh/ruff/configuration/#config-file-discovery) + +Ruff aims to be orders of magnitude faster than alternative tools while integrating more +functionality behind a single, common interface. + +Ruff can be used to replace [Flake8](https://pypi.org/project/flake8/) (plus dozens of plugins), +[Black](https://github.com/psf/black), [isort](https://pypi.org/project/isort/), +[pydocstyle](https://pypi.org/project/pydocstyle/), [pyupgrade](https://pypi.org/project/pyupgrade/), +[autoflake](https://pypi.org/project/autoflake/), and more, all while executing tens or hundreds of +times faster than any individual tool. + +Ruff is extremely actively developed and used in major open-source projects like: + +- [Apache Airflow](https://github.com/apache/airflow) +- [Apache Superset](https://github.com/apache/superset) +- [FastAPI](https://github.com/tiangolo/fastapi) +- [Hugging Face](https://github.com/huggingface/transformers) +- [Pandas](https://github.com/pandas-dev/pandas) +- [SciPy](https://github.com/scipy/scipy) + +...and [many more](#whos-using-ruff). + +Ruff is backed by [Astral](https://astral.sh), the creators of +[uv](https://github.com/astral-sh/uv) and [ty](https://github.com/astral-sh/ty). + +Read the [launch +post](https://astral.sh/blog/announcing-astral-the-company-behind-ruff), or the +original [project +announcement](https://notes.crmarsh.com/python-tooling-could-be-much-much-faster). + +## Testimonials + +[**Sebastián Ramírez**](https://twitter.com/tiangolo/status/1591912354882764802), creator +of [FastAPI](https://github.com/tiangolo/fastapi): + +> Ruff is so fast that sometimes I add an intentional bug in the code just to confirm it's actually +> running and checking the code. + +[**Nick Schrock**](https://twitter.com/schrockn/status/1612615862904827904), founder of [Elementl](https://www.elementl.com/), +co-creator of [GraphQL](https://graphql.org/): + +> Why is Ruff a gamechanger? Primarily because it is nearly 1000x faster. Literally. Not a typo. On +> our largest module (dagster itself, 250k LOC) pylint takes about 2.5 minutes, parallelized across 4 +> cores on my M1. Running ruff against our _entire_ codebase takes .4 seconds. + +[**Bryan Van de Ven**](https://github.com/bokeh/bokeh/pull/12605), co-creator +of [Bokeh](https://github.com/bokeh/bokeh/), original author +of [Conda](https://docs.conda.io/en/latest/): + +> Ruff is ~150-200x faster than flake8 on my machine, scanning the whole repo takes ~0.2s instead of +> ~20s. This is an enormous quality of life improvement for local dev. It's fast enough that I added +> it as an actual commit hook, which is terrific. + +[**Timothy Crosley**](https://twitter.com/timothycrosley/status/1606420868514877440), +creator of [isort](https://github.com/PyCQA/isort): + +> Just switched my first project to Ruff. Only one downside so far: it's so fast I couldn't believe +> it was working till I intentionally introduced some errors. + +[**Tim Abbott**](https://github.com/zulip/zulip/pull/23431#issuecomment-1302557034), lead developer of [Zulip](https://github.com/zulip/zulip) (also [here](https://github.com/astral-sh/ruff/issues/465#issuecomment-1317400028)): + +> This is just ridiculously fast... `ruff` is amazing. + +<!-- End section: Overview --> + +## Table of Contents + +For more, see the [documentation](https://docs.astral.sh/ruff/). + +1. [Getting Started](#getting-started) +1. [Configuration](#configuration) +1. [Rules](#rules) +1. [Contributing](#contributing) +1. [Support](#support) +1. [Acknowledgements](#acknowledgements) +1. [Who's Using Ruff?](#whos-using-ruff) +1. [License](#license) + +## Getting Started<a id="getting-started"></a> + +For more, see the [documentation](https://docs.astral.sh/ruff/). + +### Installation + +Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI. + +Invoke Ruff directly with [`uvx`](https://docs.astral.sh/uv/): + +```shell +uvx ruff check # Lint all files in the current directory. +uvx ruff format # Format all files in the current directory. +``` + +Or install Ruff with `uv` (recommended), `pip`, or `pipx`: + +```shell +# With uv. +uv tool install ruff@latest # Install Ruff globally. +uv add --dev ruff # Or add Ruff to your project. + +# With pip. +pip install ruff + +# With pipx. +pipx install ruff +``` + +Starting with version `0.5.0`, Ruff can be installed with our standalone installers: + +```shell +# On macOS and Linux. +curl -LsSf https://astral.sh/ruff/install.sh | sh + +# On Windows. +powershell -c "irm https://astral.sh/ruff/install.ps1 | iex" + +# For a specific version. +curl -LsSf https://astral.sh/ruff/0.15.12/install.sh | sh +powershell -c "irm https://astral.sh/ruff/0.15.12/install.ps1 | iex" +``` + +You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff), +and with [a variety of other package managers](https://docs.astral.sh/ruff/installation/). + +### Usage + +To run Ruff as a linter, try any of the following: + +```shell +ruff check # Lint all files in the current directory (and any subdirectories). +ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories). +ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`. +ruff check path/to/code/to/file.py # Lint `file.py`. +ruff check @arguments.txt # Lint using an input file, treating its contents as newline-delimited command-line arguments. +``` + +Or, to run Ruff as a formatter: + +```shell +ruff format # Format all files in the current directory (and any subdirectories). +ruff format path/to/code/ # Format all files in `/path/to/code` (and any subdirectories). +ruff format path/to/code/*.py # Format all `.py` files in `/path/to/code`. +ruff format path/to/code/to/file.py # Format `file.py`. +ruff format @arguments.txt # Format using an input file, treating its contents as newline-delimited command-line arguments. +``` + +Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff-pre-commit`](https://github.com/astral-sh/ruff-pre-commit): + +```yaml +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.15.12 + hooks: + # Run the linter. + - id: ruff-check + args: [ --fix ] + # Run the formatter. + - id: ruff-format +``` + +Ruff can also be used as a [VS Code extension](https://github.com/astral-sh/ruff-vscode) or with [various other editors](https://docs.astral.sh/ruff/editors/setup). + +Ruff can also be used as a [GitHub Action](https://github.com/features/actions) via +[`ruff-action`](https://github.com/astral-sh/ruff-action): + +```yaml +name: Ruff +on: [ push, pull_request ] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v3 +``` + +### Configuration<a id="configuration"></a> + +Ruff can be configured through a `pyproject.toml`, `ruff.toml`, or `.ruff.toml` file (see: +[_Configuration_](https://docs.astral.sh/ruff/configuration/), or [_Settings_](https://docs.astral.sh/ruff/settings/) +for a complete list of all configuration options). + +If left unspecified, Ruff's default configuration is equivalent to the following `ruff.toml` file: + +```toml +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.10 +target-version = "py310" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" +``` + +Note that, in a `pyproject.toml`, each section header should be prefixed with `tool.ruff`. For +example, `[lint]` should be replaced with `[tool.ruff.lint]`. + +Some configuration options can be provided via dedicated command-line arguments, such as those +related to rule enablement and disablement, file discovery, and logging level: + +```shell +ruff check --select F401 --select F403 --quiet +``` + +The remaining configuration options can be provided through a catch-all `--config` argument: + +```shell +ruff check --config "lint.per-file-ignores = {'some_file.py' = ['F841']}" +``` + +To opt in to the latest lint rules, formatter style changes, interface updates, and more, enable +[preview mode](https://docs.astral.sh/ruff/preview/) by setting `preview = true` in your configuration +file or passing `--preview` on the command line. Preview mode enables a collection of unstable +features that may change prior to stabilization. + +See `ruff help` for more on Ruff's top-level commands, or `ruff help check` and `ruff help format` +for more on the linting and formatting commands, respectively. + +## Rules<a id="rules"></a> + +<!-- Begin section: Rules --> + +**Ruff supports over 900 lint rules**, many of which are inspired by popular tools like Flake8, +isort, pyupgrade, and others. Regardless of the rule's origin, Ruff re-implements every rule in +Rust as a first-party feature. + +By default, Ruff enables Flake8's `F` rules, along with a subset of the `E` rules, omitting any +stylistic rules that overlap with the use of a formatter, like `ruff format` or +[Black](https://github.com/psf/black). + +If you're just getting started with Ruff, **the default rule set is a great place to start**: it +catches a wide variety of common errors (like unused imports) with zero configuration. + +In [preview](https://docs.astral.sh/ruff/preview/), Ruff enables an expanded set of default rules +that includes rules from the `B`, `UP`, and `RUF` categories, as well as many more. If you give the +new defaults a try, feel free to leave feedback in the [GitHub +discussion](https://github.com/astral-sh/ruff/discussions/23203), where you can also find the new +rule set listed in full. + +<!-- End section: Rules --> + +Beyond the defaults, Ruff re-implements some of the most popular Flake8 plugins and related code +quality tools, including: + +- [autoflake](https://pypi.org/project/autoflake/) +- [eradicate](https://pypi.org/project/eradicate/) +- [flake8-2020](https://pypi.org/project/flake8-2020/) +- [flake8-annotations](https://pypi.org/project/flake8-annotations/) +- [flake8-async](https://pypi.org/project/flake8-async) +- [flake8-bandit](https://pypi.org/project/flake8-bandit/) ([#1646](https://github.com/astral-sh/ruff/issues/1646)) +- [flake8-blind-except](https://pypi.org/project/flake8-blind-except/) +- [flake8-boolean-trap](https://pypi.org/project/flake8-boolean-trap/) +- [flake8-bugbear](https://pypi.org/project/flake8-bugbear/) +- [flake8-builtins](https://pypi.org/project/flake8-builtins/) +- [flake8-commas](https://pypi.org/project/flake8-commas/) +- [flake8-comprehensions](https://pypi.org/project/flake8-comprehensions/) +- [flake8-copyright](https://pypi.org/project/flake8-copyright/) +- [flake8-datetimez](https://pypi.org/project/flake8-datetimez/) +- [flake8-debugger](https://pypi.org/project/flake8-debugger/) +- [flake8-django](https://pypi.org/project/flake8-django/) +- [flake8-docstrings](https://pypi.org/project/flake8-docstrings/) +- [flake8-eradicate](https://pypi.org/project/flake8-eradicate/) +- [flake8-errmsg](https://pypi.org/project/flake8-errmsg/) +- [flake8-executable](https://pypi.org/project/flake8-executable/) +- [flake8-future-annotations](https://pypi.org/project/flake8-future-annotations/) +- [flake8-gettext](https://pypi.org/project/flake8-gettext/) +- [flake8-implicit-str-concat](https://pypi.org/project/flake8-implicit-str-concat/) +- [flake8-import-conventions](https://github.com/joaopalmeiro/flake8-import-conventions) +- [flake8-logging](https://pypi.org/project/flake8-logging/) +- [flake8-logging-format](https://pypi.org/project/flake8-logging-format/) +- [flake8-no-pep420](https://pypi.org/project/flake8-no-pep420) +- [flake8-pie](https://pypi.org/project/flake8-pie/) +- [flake8-print](https://pypi.org/project/flake8-print/) +- [flake8-pyi](https://pypi.org/project/flake8-pyi/) +- [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style/) +- [flake8-quotes](https://pypi.org/project/flake8-quotes/) +- [flake8-raise](https://pypi.org/project/flake8-raise/) +- [flake8-return](https://pypi.org/project/flake8-return/) +- [flake8-self](https://pypi.org/project/flake8-self/) +- [flake8-simplify](https://pypi.org/project/flake8-simplify/) +- [flake8-slots](https://pypi.org/project/flake8-slots/) +- [flake8-super](https://pypi.org/project/flake8-super/) +- [flake8-tidy-imports](https://pypi.org/project/flake8-tidy-imports/) +- [flake8-todos](https://pypi.org/project/flake8-todos/) +- [flake8-type-checking](https://pypi.org/project/flake8-type-checking/) +- [flake8-use-pathlib](https://pypi.org/project/flake8-use-pathlib/) +- [flynt](https://pypi.org/project/flynt/) ([#2102](https://github.com/astral-sh/ruff/issues/2102)) +- [isort](https://pypi.org/project/isort/) +- [mccabe](https://pypi.org/project/mccabe/) +- [pandas-vet](https://pypi.org/project/pandas-vet/) +- [pep8-naming](https://pypi.org/project/pep8-naming/) +- [pydocstyle](https://pypi.org/project/pydocstyle/) +- [pygrep-hooks](https://github.com/pre-commit/pygrep-hooks) +- [pylint-airflow](https://pypi.org/project/pylint-airflow/) +- [pyupgrade](https://pypi.org/project/pyupgrade/) +- [tryceratops](https://pypi.org/project/tryceratops/) +- [yesqa](https://pypi.org/project/yesqa/) + +For a complete enumeration of the supported rules, see [_Rules_](https://docs.astral.sh/ruff/rules/). + +## Contributing<a id="contributing"></a> + +Contributions are welcome and highly appreciated. To get started, check out the +[**contributing guidelines**](https://docs.astral.sh/ruff/contributing/). + +You can also join us on [**Discord**](https://discord.com/invite/astral-sh). + +## Support<a id="support"></a> + +Having trouble? Check out the existing issues on [**GitHub**](https://github.com/astral-sh/ruff/issues), +or feel free to [**open a new one**](https://github.com/astral-sh/ruff/issues/new). + +You can also ask for help on [**Discord**](https://discord.com/invite/astral-sh). + +## Acknowledgements<a id="acknowledgements"></a> + +Ruff's linter draws on both the APIs and implementation details of many other +tools in the Python ecosystem, especially [Flake8](https://github.com/PyCQA/flake8), [Pyflakes](https://github.com/PyCQA/pyflakes), +[pycodestyle](https://github.com/PyCQA/pycodestyle), [pydocstyle](https://github.com/PyCQA/pydocstyle), +[pyupgrade](https://github.com/asottile/pyupgrade), and [isort](https://github.com/PyCQA/isort). + +In some cases, Ruff includes a "direct" Rust port of the corresponding tool. +We're grateful to the maintainers of these tools for their work, and for all +the value they've provided to the Python community. + +Ruff's formatter is built on a fork of Rome's [`rome_formatter`](https://github.com/rome/tools/tree/main/crates/rome_formatter), +and again draws on both API and implementation details from [Rome](https://github.com/rome/tools), +[Prettier](https://github.com/prettier/prettier), and [Black](https://github.com/psf/black). + +Ruff's import resolver is based on the import resolution algorithm from [Pyright](https://github.com/microsoft/pyright). + +Ruff is also influenced by a number of tools outside the Python ecosystem, like +[Clippy](https://github.com/rust-lang/rust-clippy) and [ESLint](https://github.com/eslint/eslint). + +Ruff is the beneficiary of a large number of [contributors](https://github.com/astral-sh/ruff/graphs/contributors). + +Ruff is released under the MIT license. + +## Who's Using Ruff?<a id="whos-using-ruff"></a> + +Ruff is used by a number of major open-source projects and companies, including: + +- [Albumentations](https://github.com/albumentations-team/AlbumentationsX) +- Amazon ([AWS SAM](https://github.com/aws/serverless-application-model)) +- [Anki](https://apps.ankiweb.net/) +- Anthropic ([Python SDK](https://github.com/anthropics/anthropic-sdk-python)) +- [Apache Airflow](https://github.com/apache/airflow) +- AstraZeneca ([Magnus](https://github.com/AstraZeneca/magnus-core)) +- [Babel](https://github.com/python-babel/babel) +- Benchling ([Refac](https://github.com/benchling/refac)) +- [Bokeh](https://github.com/bokeh/bokeh) +- Capital One ([datacompy](https://github.com/capitalone/datacompy)) +- CrowdCent ([NumerBlox](https://github.com/crowdcent/numerblox)) <!-- typos: ignore --> +- [Cryptography (PyCA)](https://github.com/pyca/cryptography) +- CERN ([Indico](https://getindico.io/)) +- [DVC](https://github.com/iterative/dvc) +- [Dagger](https://github.com/dagger/dagger) +- [Dagster](https://github.com/dagster-io/dagster) +- Databricks ([MLflow](https://github.com/mlflow/mlflow)) +- [Dify](https://github.com/langgenius/dify) +- [FastAPI](https://github.com/tiangolo/fastapi) +- [Godot](https://github.com/godotengine/godot) +- [Gradio](https://github.com/gradio-app/gradio) +- [Great Expectations](https://github.com/great-expectations/great_expectations) +- [HTTPX](https://github.com/encode/httpx) +- [Hatch](https://github.com/pypa/hatch) +- [Home Assistant](https://github.com/home-assistant/core) +- Hugging Face ([Transformers](https://github.com/huggingface/transformers), + [Datasets](https://github.com/huggingface/datasets), + [Diffusers](https://github.com/huggingface/diffusers)) +- IBM ([Qiskit](https://github.com/Qiskit/qiskit)) +- ING Bank ([popmon](https://github.com/ing-bank/popmon), [probatus](https://github.com/ing-bank/probatus)) +- [Ibis](https://github.com/ibis-project/ibis) +- [ivy](https://github.com/unifyai/ivy) +- [JAX](https://github.com/jax-ml/jax) +- [Jupyter](https://github.com/jupyter-server/jupyter_server) +- [Kraken Tech](https://kraken.tech/) +- [LangChain](https://github.com/hwchase17/langchain) +- [Litestar](https://litestar.dev/) +- [LlamaIndex](https://github.com/jerryjliu/llama_index) +- Matrix ([Synapse](https://github.com/matrix-org/synapse)) +- [MegaLinter](https://github.com/oxsecurity/megalinter) +- Meltano ([Meltano CLI](https://github.com/meltano/meltano), [Singer SDK](https://github.com/meltano/sdk)) +- Microsoft ([Semantic Kernel](https://github.com/microsoft/semantic-kernel), + [ONNX Runtime](https://github.com/microsoft/onnxruntime), + [LightGBM](https://github.com/microsoft/LightGBM)) +- Modern Treasury ([Python SDK](https://github.com/Modern-Treasury/modern-treasury-python)) +- Mozilla ([Firefox](https://github.com/mozilla/gecko-dev)) +- [Mypy](https://github.com/python/mypy) +- [Nautobot](https://github.com/nautobot/nautobot) +- Netflix ([Dispatch](https://github.com/Netflix/dispatch)) +- [Neon](https://github.com/neondatabase/neon) +- [Nokia](https://nokia.com/) +- [NoneBot](https://github.com/nonebot/nonebot2) +- [NumPyro](https://github.com/pyro-ppl/numpyro) +- [ONNX](https://github.com/onnx/onnx) +- [OpenBB](https://github.com/OpenBB-finance/OpenBBTerminal) +- [Open Wine Components](https://github.com/Open-Wine-Components/umu-launcher) +- [PDM](https://github.com/pdm-project/pdm) +- [PaddlePaddle](https://github.com/PaddlePaddle/Paddle) +- [Pandas](https://github.com/pandas-dev/pandas) +- [Pillow](https://github.com/python-pillow/Pillow) +- [Poetry](https://github.com/python-poetry/poetry) +- [Polars](https://github.com/pola-rs/polars) +- [PostHog](https://github.com/PostHog/posthog) +- Prefect ([Python SDK](https://github.com/PrefectHQ/prefect), [Marvin](https://github.com/PrefectHQ/marvin)) +- [PyInstaller](https://github.com/pyinstaller/pyinstaller) +- [PyMC](https://github.com/pymc-devs/pymc/) +- [PyMC-Marketing](https://github.com/pymc-labs/pymc-marketing) +- [pytest](https://github.com/pytest-dev/pytest) +- [PyTorch](https://github.com/pytorch/pytorch) +- [Pydantic](https://github.com/pydantic/pydantic) +- [Pylint](https://github.com/PyCQA/pylint) +- [PyScripter](https://github.com/pyscripter/pyscripter) +- [PyVista](https://github.com/pyvista/pyvista) +- [Reflex](https://github.com/reflex-dev/reflex) +- [River](https://github.com/online-ml/river) +- [Rippling](https://rippling.com) +- [Robyn](https://github.com/sansyrox/robyn) +- [Saleor](https://github.com/saleor/saleor) +- Scale AI ([Launch SDK](https://github.com/scaleapi/launch-python-client)) +- [SciPy](https://github.com/scipy/scipy) +- Snowflake ([SnowCLI](https://github.com/Snowflake-Labs/snowcli)) +- [Sphinx](https://github.com/sphinx-doc/sphinx) +- [Stable Baselines3](https://github.com/DLR-RM/stable-baselines3) +- [Starlette](https://github.com/encode/starlette) +- [Streamlit](https://github.com/streamlit/streamlit) +- [The Algorithms](https://github.com/TheAlgorithms/Python) +- [Vega-Altair](https://github.com/altair-viz/altair) +- [Weblate](https://weblate.org/) +- WordPress ([Openverse](https://github.com/WordPress/openverse)) +- [ZenML](https://github.com/zenml-io/zenml) +- [Zulip](https://github.com/zulip/zulip) +- [build (PyPA)](https://github.com/pypa/build) +- [cibuildwheel (PyPA)](https://github.com/pypa/cibuildwheel) +- [delta-rs](https://github.com/delta-io/delta-rs) +- [featuretools](https://github.com/alteryx/featuretools) +- [meson-python](https://github.com/mesonbuild/meson-python) +- [nox](https://github.com/wntrblm/nox) +- [pip](https://github.com/pypa/pip) + +### Show Your Support + +If you're using Ruff, consider adding the Ruff badge to your project's `README.md`: + +```md +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +``` + +...or `README.rst`: + +```rst +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff +``` + +...or, as HTML: + +```html +<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;"></a> +``` + +## License<a id="license"></a> + +This repository is licensed under the [MIT License](https://github.com/astral-sh/ruff/blob/main/LICENSE) + +<div align="center"> + <a target="_blank" href="https://astral.sh" style="background:none"> + <img src="https://raw.githubusercontent.com/astral-sh/ruff/main/assets/svg/Astral.svg" alt="Made by Astral"> + </a> +</div> + diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/RECORD b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..54cb36d37cccaac1bbd5d3e2e4fef80eb832db75 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/RECORD @@ -0,0 +1,15 @@ +../../Scripts/ruff.exe,sha256=FssVN7myiug8Fd2SSI8Cbf5BvhZMwrzeKjIoarF0ees,32527360 +ruff-0.15.12.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +ruff-0.15.12.dist-info/METADATA,sha256=Cr9dF0FhHiOajEp_fiKOgSS5ykYQ0DHDyIq-OUkc9zk,26462 +ruff-0.15.12.dist-info/RECORD,, +ruff-0.15.12.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +ruff-0.15.12.dist-info/WHEEL,sha256=0cg7uMdVM1SNK0ih4zFWnV0wsxqvcArlTmRGOaRhEnw,94 +ruff-0.15.12.dist-info/direct_url.json,sha256=ueCYSOORz7OXCytzxOW0JU1MaUdLSkN0LfelNelUn7I,80 +ruff-0.15.12.dist-info/licenses/LICENSE,sha256=JZfYVBIrd93HGXFWTKI1CjdghXXOMkrcVlCisgUcjxg,20731 +ruff-0.15.12.dist-info/sboms/ruff.cyclonedx.json,sha256=0J3AUF3LOF35nWuO6ELo5_ZZ09xACojktXWDU6dV88w,485228 +ruff/__init__.py,sha256=66in9yDSCiYhREjuxLSvAc_g5xf2p3PYcEAeBswQhC0,103 +ruff/__main__.py,sha256=nR1_1pzzfX3Ts4rOpu-mfmQp3vpdBFLC3_qU2K_rrD4,534 +ruff/__pycache__/__init__.cpython-310.pyc,, +ruff/__pycache__/__main__.cpython-310.pyc,, +ruff/__pycache__/_find_ruff.cpython-310.pyc,, +ruff/_find_ruff.py,sha256=JNxoKJXkqiSkmVrTCJ_sv4Ol0SwMBcozEe3W67bb0io,3250 diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/WHEEL b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..3649840b10778bde1e9c8acf8782c848d4e69bcd --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: maturin (1.13.1) +Root-Is-Purelib: false +Tag: py3-none-win_amd64 diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..76fc77c2e3a032a4c6f46bd216aa87aaeee11f6e --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/bld/rattler-build_ruff_1778119435/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..655a0c76fc5539b2f8e63b673741a5fd0e0c5799 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/licenses/LICENSE @@ -0,0 +1,430 @@ +MIT License + +Copyright (c) 2022 Charles Marsh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +end of terms and conditions + +The externally maintained libraries from which parts of the Software is derived +are: + +- autoflake, licensed as follows: + """ + Copyright (C) 2012-2018 Steven Myint + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- autotyping, licensed as follows: + """ + MIT License + + Copyright (c) 2023 Jelle Zijlstra + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- Flake8, licensed as follows: + """ + == Flake8 License (MIT) == + + Copyright (C) 2011-2013 Tarek Ziade <tarek@ziade.org> + Copyright (C) 2012-2016 Ian Cordasco <graffatcolmingov@gmail.com> + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- flake8-eradicate, licensed as follows: + """ + MIT License + + Copyright (c) 2018 Nikita Sobolev + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- flake8-pyi, licensed as follows: + """ + The MIT License (MIT) + + Copyright (c) 2016 Łukasz Langa + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- flake8-simplify, licensed as follows: + """ + MIT License + + Copyright (c) 2020 Martin Thoma + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- isort, licensed as follows: + """ + The MIT License (MIT) + + Copyright (c) 2013 Timothy Edmund Crosley + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + """ + +- pygrep-hooks, licensed as follows: + """ + Copyright (c) 2018 Anthony Sottile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + """ + +- pycodestyle, licensed as follows: + """ + Copyright © 2006-2009 Johann C. Rocholl <johann@rocholl.net> + Copyright © 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> + Copyright © 2014-2020 Ian Lee <IanLee1521@gmail.com> + + Licensed under the terms of the Expat License + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- pydocstyle, licensed as follows: + """ + Copyright (c) 2012 GreenSteam, <http://greensteam.dk/> + + Copyright (c) 2014-2020 Amir Rachum, <http://amir.rachum.com/> + + Copyright (c) 2020 Sambhav Kothari, <https://github.com/samj1912> + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- Pyflakes, licensed as follows: + """ + Copyright 2005-2011 Divmod, Inc. + Copyright 2013-2014 Florent Xicluna + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + """ + +- Pyright, licensed as follows: + """ + MIT License + + Pyright - A static type checker for the Python language + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE + """ + +- pyupgrade, licensed as follows: + """ + Copyright (c) 2017 Anthony Sottile + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + """ + +- rome/tools, licensed under the MIT license: + """ + MIT License + + Copyright (c) Rome Tools, Inc. and its affiliates. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- RustPython, licensed as follows: + """ + MIT License + + Copyright (c) 2020 RustPython Team + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- rust-analyzer/text-size, licensed under the MIT license: + """ + Permission is hereby granted, free of charge, to any + person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the + Software without restriction, including without + limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice + shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + """ diff --git a/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/sboms/ruff.cyclonedx.json b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/sboms/ruff.cyclonedx.json new file mode 100644 index 0000000000000000000000000000000000000000..b5a90fc63facaa20a6c9b5209e2890d339e7c945 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff-0.15.12.dist-info/sboms/ruff.cyclonedx.json @@ -0,0 +1,14672 @@ +{ + "bomFormat": "CycloneDX", + "specVersion": "1.5", + "version": 1, + "metadata": { + "timestamp": "2026-05-07T02:03:55.000000000Z", + "tools": [ + { + "vendor": "CycloneDX", + "name": "cargo-cyclonedx", + "version": "0.5.9" + } + ], + "authors": [ + { + "name": "Charlie Marsh", + "email": "charlie.r.marsh@gmail.com" + } + ], + "component": { + "type": "application", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff#0.15.12", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff", + "version": "0.15.12", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff@0.15.12?download_url=file://.", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ], + "components": [ + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff#0.15.12 bin-target-0", + "name": "ruff", + "version": "0.15.12", + "purl": "pkg:cargo/ruff@0.15.12?download_url=file://.#src/lib.rs" + }, + { + "type": "application", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff#0.15.12 bin-target-1", + "name": "ruff", + "version": "0.15.12", + "purl": "pkg:cargo/ruff@0.15.12?download_url=file://.#src/main.rs" + } + ] + }, + "properties": [ + { + "name": "cdx:rustc:sbom:target:all_targets", + "value": "true" + } + ] + }, + "components": [ + { + "type": "library", + "bom-ref": "git+https://github.com/astral-sh/lsp-types.git?rev=e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c#lsp-types@0.95.1", + "author": "Markus Westerlind <marwes91@gmail.com>, Bruno Medeiros <bruno.do.medeiros@gmail.com>", + "name": "lsp-types", + "version": "0.95.1", + "description": "Types for interaction with a language server, using VSCode's Language Server Protocol", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/lsp-types@0.95.1?vcs_url=git%2Bhttps://github.com/astral-sh/lsp-types.git%40e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/lsp-types" + }, + { + "type": "vcs", + "url": "https://github.com/gluon-lang/lsp-types" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_annotate_snippets#0.1.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_annotate_snippets", + "version": "0.1.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/ruff_annotate_snippets@0.1.0?download_url=file://..\\ruff_annotate_snippets", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_cache", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_cache@0.0.0?download_url=file://..\\ruff_cache", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_db", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_db@0.0.0?download_url=file://..\\ruff_db", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_diagnostics", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_diagnostics@0.0.0?download_url=file://..\\ruff_diagnostics", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_formatter#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_formatter", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_formatter@0.0.0?download_url=file://..\\ruff_formatter", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_graph#0.1.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_graph", + "version": "0.1.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_graph@0.1.0?download_url=file://..\\ruff_graph", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_index#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_index", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_index@0.0.0?download_url=file://..\\ruff_index", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_linter", + "version": "0.15.12", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_linter@0.15.12?download_url=file://..\\ruff_linter", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_macros", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_macros@0.0.0?download_url=file://..\\ruff_macros", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_markdown#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_markdown", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_markdown@0.0.0?download_url=file://..\\ruff_markdown", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_memory_usage#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_memory_usage", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_memory_usage@0.0.0?download_url=file://..\\ruff_memory_usage", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_notebook", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_notebook@0.0.0?download_url=file://..\\ruff_notebook", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_options_metadata#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_options_metadata", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_options_metadata@0.0.0?download_url=file://..\\ruff_options_metadata", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_ast", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_ast@0.0.0?download_url=file://..\\ruff_python_ast", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_codegen#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_codegen", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_codegen@0.0.0?download_url=file://..\\ruff_python_codegen", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_formatter", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_formatter@0.0.0?download_url=file://..\\ruff_python_formatter", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_importer#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_importer", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_importer@0.0.0?download_url=file://..\\ruff_python_importer", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_index#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_index", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_index@0.0.0?download_url=file://..\\ruff_python_index", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_literal#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>, RustPython Team", + "name": "ruff_python_literal", + "version": "0.0.0", + "description": "Common literal handling utilities mostly useful for unparse and repr.", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_literal@0.0.0?download_url=file://..\\ruff_python_literal", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>, RustPython Team", + "name": "ruff_python_parser", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_parser@0.0.0?download_url=file://..\\ruff_python_parser", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_semantic#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_semantic", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_semantic@0.0.0?download_url=file://..\\ruff_python_semantic", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_stdlib", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_stdlib@0.0.0?download_url=file://..\\ruff_python_stdlib", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_python_trivia", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_python_trivia@0.0.0?download_url=file://..\\ruff_python_trivia", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_server#0.2.2", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_server", + "version": "0.2.2", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_server@0.2.2?download_url=file://..\\ruff_server", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_source_file", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_source_file@0.0.0?download_url=file://..\\ruff_source_file", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_text_size", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_text_size@0.0.0?download_url=file://..\\ruff_text_size", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_workspace#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ruff_workspace", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ruff_workspace@0.0.0?download_url=file://..\\ruff_workspace", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_module_resolver#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ty_module_resolver", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ty_module_resolver@0.0.0?download_url=file://..\\ty_module_resolver", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_site_packages#0.0.0", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ty_site_packages", + "version": "0.0.0", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ty_site_packages@0.0.0?download_url=file://..\\ty_site_packages", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_static#0.0.1", + "author": "Charlie Marsh <charlie.r.marsh@gmail.com>", + "name": "ty_static", + "version": "0.0.1", + "scope": "required", + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/ty_static@0.0.1?download_url=file://..\\ty_static", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "website", + "url": "https://docs.astral.sh/ruff" + }, + { + "type": "vcs", + "url": "https://github.com/astral-sh/ruff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#adler2@2.0.1", + "author": "Jonas Schievink <jonasschievink@gmail.com>, oyvindln <oyvindln@users.noreply.github.com>", + "name": "adler2", + "version": "2.0.1", + "description": "A simple clean-room implementation of the Adler-32 checksum", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + } + ], + "licenses": [ + { + "expression": "0BSD OR MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/adler2@2.0.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/adler2/" + }, + { + "type": "vcs", + "url": "https://github.com/oyvindln/adler2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "aho-corasick", + "version": "1.1.4", + "description": "Fast multiple substring searching.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/aho-corasick@1.1.4", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/BurntSushi/aho-corasick" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/aho-corasick" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#allocator-api2@0.2.21", + "author": "Zakarum <zaq.dev@icloud.com>", + "name": "allocator-api2", + "version": "0.2.21", + "description": "Mirror of Rust's allocator API", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/allocator-api2@0.2.21", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/allocator-api2" + }, + { + "type": "website", + "url": "https://github.com/zakarumych/allocator-api2" + }, + { + "type": "vcs", + "url": "https://github.com/zakarumych/allocator-api2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#android_system_properties@0.1.5", + "author": "Nicolas Silva <nical@fastmail.com>", + "name": "android_system_properties", + "version": "0.1.5", + "description": "Minimal Android system properties wrapper", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/android_system_properties@0.1.5", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/android_system_properties" + }, + { + "type": "website", + "url": "https://github.com/nical/android_system_properties" + }, + { + "type": "vcs", + "url": "https://github.com/nical/android_system_properties" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#annotate-snippets@0.11.5", + "name": "annotate-snippets", + "version": "0.11.5", + "description": "Library for building code annotations", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/annotate-snippets@0.11.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/annotate-snippets-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anstream@1.0.0", + "name": "anstream", + "version": "1.0.0", + "description": "IO stream adapters for writing colored text that will gracefully degrade according to your terminal's capabilities.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anstream@1.0.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-parse@1.0.0", + "name": "anstyle-parse", + "version": "1.0.0", + "description": "Parse ANSI Style Escapes", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anstyle-parse@1.0.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-query@1.1.4", + "name": "anstyle-query", + "version": "1.1.4", + "description": "Look up colored console capabilities", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anstyle-query@1.1.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-wincon@3.0.10", + "name": "anstyle-wincon", + "version": "3.0.10", + "description": "Styling legacy Windows terminals", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anstyle-wincon@3.0.10", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "name": "anstyle", + "version": "1.0.14", + "description": "ANSI text styling", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anstyle@1.0.14", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "anyhow", + "version": "1.0.102", + "description": "Flexible concrete Error type built on std::error::Error", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/anyhow@1.0.102", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/anyhow" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/anyhow" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#arc-swap@1.9.1", + "author": "Michal 'vorner' Vaner <vorner@vorner.cz>", + "name": "arc-swap", + "version": "1.9.1", + "description": "Atomically swappable Arc", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/arc-swap@1.9.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/arc-swap" + }, + { + "type": "vcs", + "url": "https://github.com/vorner/arc-swap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#argfile@1.0.0", + "name": "argfile", + "version": "1.0.0", + "description": "Load additional CLI args from file", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "99489a733dea0d2930bfa59c243146a8513ce7b0991b9d006647687cc61f53e7" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/argfile@1.0.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/rust-cli/argfile" + }, + { + "type": "vcs", + "url": "https://github.com/rust-cli/argfile.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#attribute-derive-macro@0.10.3", + "name": "attribute-derive-macro", + "version": "0.10.3", + "description": "Clap for proc macro attributes", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "463b53ad0fd5b460af4b1915fe045ff4d946d025fb6c4dc3337752eaa980f71b" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/attribute-derive-macro@0.10.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/attribute-derive" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/attribute-derive" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#attribute-derive@0.10.3", + "name": "attribute-derive", + "version": "0.10.3", + "description": "Clap like parsing for attributes in proc-macros", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0053e96dd3bec5b4879c23a138d6ef26f2cb936c9cdc96274ac2b9ed44b5bb54" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/attribute-derive@0.10.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/attribute-derive" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/attribute-derive" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0", + "author": "Josh Stone <cuviper@gmail.com>", + "name": "autocfg", + "version": "1.5.0", + "description": "Automatic cfg for Rust compiler features", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/autocfg@1.5.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/autocfg/" + }, + { + "type": "vcs", + "url": "https://github.com/cuviper/autocfg" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bincode@2.0.1", + "author": "Ty Overby <ty@pre-alpha.com>, Zoey Riordan <zoey@dos.cafe>, Victor Koenders <bincode@trangar.com>", + "name": "bincode", + "version": "2.0.1", + "description": "A binary serialization / deserialization strategy for transforming structs into bytes and vice versa!", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/bincode@2.0.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bincode" + }, + { + "type": "vcs", + "url": "https://github.com/bincode-org/bincode" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bincode_derive@2.0.1", + "author": "Zoey Riordan <zoey@dos.cafe>, Victor Koenders <bincode@trangar.com>", + "name": "bincode_derive", + "version": "2.0.1", + "description": "Implementation of #[derive(Encode, Decode)] for bincode", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/bincode_derive@2.0.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bincode_derive" + }, + { + "type": "vcs", + "url": "https://github.com/bincode-org/bincode" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bitflags@1.3.2", + "author": "The Rust Project Developers", + "name": "bitflags", + "version": "1.3.2", + "description": "A macro to generate structures which behave like bitflags. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/bitflags@1.3.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bitflags" + }, + { + "type": "website", + "url": "https://github.com/bitflags/bitflags" + }, + { + "type": "vcs", + "url": "https://github.com/bitflags/bitflags" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "author": "The Rust Project Developers", + "name": "bitflags", + "version": "2.11.0", + "description": "A macro to generate structures which behave like bitflags. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/bitflags@2.11.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bitflags" + }, + { + "type": "website", + "url": "https://github.com/bitflags/bitflags" + }, + { + "type": "vcs", + "url": "https://github.com/bitflags/bitflags" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#boxcar@0.2.14", + "author": "Ibraheem Ahmed <ibraheem@ibraheem.ca>", + "name": "boxcar", + "version": "0.2.14", + "description": "A concurrent, append-only vector", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/boxcar@0.2.14", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/ibraheemdev/boxcar" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "bstr", + "version": "1.12.1", + "description": "A string type that is not required to be valid UTF-8.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/bstr@1.12.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bstr" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/bstr" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/bstr" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#bumpalo@3.19.0", + "author": "Nick Fitzgerald <fitzgen@gmail.com>", + "name": "bumpalo", + "version": "3.19.0", + "description": "A fast bump allocation arena for Rust.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/bumpalo@3.19.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/bumpalo" + }, + { + "type": "vcs", + "url": "https://github.com/fitzgen/bumpalo" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#byteorder@1.5.0", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "byteorder", + "version": "1.5.0", + "description": "Library for reading/writing numbers in big-endian and little-endian.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/byteorder@1.5.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/byteorder" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/byteorder" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/byteorder" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#cachedir@0.3.1", + "author": "Jakub Stasiak <jakub@stasiak.at>", + "name": "cachedir", + "version": "0.3.1", + "description": "A library to help interacting with cache directories and CACHEDIR.TAG files.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4703f3937077db8fa35bee3c8789343c1aec2585f0146f09d658d4ccc0e8d873" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/cachedir@0.3.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/jstasiak/cachedir" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#camino@1.2.2", + "author": "Without Boats <saoirse@without.boats>, Ashley Williams <ashley666ashley@gmail.com>, Steve Klabnik <steve@steveklabnik.com>, Rain <rain@sunshowers.io>", + "name": "camino", + "version": "1.2.2", + "description": "UTF-8 paths", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/camino@1.2.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/camino" + }, + { + "type": "vcs", + "url": "https://github.com/camino-rs/camino" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#castaway@0.2.4", + "author": "Stephen M. Coakley <me@stephencoakley.com>", + "name": "castaway", + "version": "0.2.4", + "description": "Safe, zero-cost downcasting for limited compile-time specialization.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/castaway@0.2.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/sagebind/castaway" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "cc", + "version": "1.2.38", + "description": "A build-time dependency for Cargo build scripts to assist in invoking the native C compiler to compile native C code into a static archive to be linked into Rust code. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/cc@1.2.38", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/cc" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/cc-rs" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/cc-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "cfg-if", + "version": "1.0.3", + "description": "A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/cfg-if@1.0.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/cfg-if" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#cfg_aliases@0.2.1", + "author": "Zicklag <zicklag@katharostech.com>", + "name": "cfg_aliases", + "version": "0.2.1", + "description": "A tiny utility to help save you a lot of effort with long winded `#[cfg()]` checks.", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/cfg_aliases@0.2.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/cfg_aliases" + }, + { + "type": "website", + "url": "https://github.com/katharostech/cfg_aliases" + }, + { + "type": "vcs", + "url": "https://github.com/katharostech/cfg_aliases" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#chacha20@0.10.0", + "author": "RustCrypto Developers", + "name": "chacha20", + "version": "0.10.0", + "description": "The ChaCha20 stream cipher (RFC 8439) implemented in pure Rust using traits from the RustCrypto `cipher` crate, with optional architecture-specific hardware acceleration (AVX2, SSE2). Additionally provides the ChaCha8, ChaCha12, XChaCha20, XChaCha12 and XChaCha8 stream ciphers, and also optional rand_core-compatible RNGs based on those ciphers. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/chacha20@0.10.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/chacha20" + }, + { + "type": "vcs", + "url": "https://github.com/RustCrypto/stream-ciphers" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#chrono@0.4.44", + "name": "chrono", + "version": "0.4.44", + "description": "Date and time library for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/chrono@0.4.44", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/chrono/" + }, + { + "type": "website", + "url": "https://github.com/chronotope/chrono" + }, + { + "type": "vcs", + "url": "https://github.com/chronotope/chrono" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "name": "clap", + "version": "4.6.0", + "description": "A simple to use, efficient, and full-featured Command Line Argument Parser", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap@4.6.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_builder@4.6.0", + "name": "clap_builder", + "version": "4.6.0", + "description": "A simple to use, efficient, and full-featured Command Line Argument Parser", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap_builder@4.6.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete@4.5.58", + "name": "clap_complete", + "version": "4.5.58", + "description": "Generate shell completion scripts for your clap::Command", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "75bf0b32ad2e152de789bb635ea4d3078f6b838ad7974143e99b99f45a04af4a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap_complete@4.5.58", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete_command@0.6.1", + "name": "clap_complete_command", + "version": "0.6.1", + "description": "Reduces boilerplate for adding a shell completion command to Clap", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "da8e198c052315686d36371e8a3c5778b7852fc75cc313e4e11eeb7a644a1b62" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/clap_complete_command@0.6.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/clap_complete_command" + }, + { + "type": "vcs", + "url": "https://github.com/nihaals/clap-complete-command" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete_nushell@4.5.8", + "name": "clap_complete_nushell", + "version": "4.5.8", + "description": "A generator library used with clap for Nushell completion scripts", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0a0c951694691e65bf9d421d597d68416c22de9632e884c28412cb8cd8b73dce" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap_complete_nushell@4.5.8", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_derive@4.6.0", + "name": "clap_derive", + "version": "4.6.0", + "description": "Parse command line argument by defining a struct, derive crate.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap_derive@4.6.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clap_lex@1.0.0", + "name": "clap_lex", + "version": "1.0.0", + "description": "Minimal, flexible command line parser", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/clap_lex@1.0.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/clap-rs/clap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#clearscreen@4.0.6", + "author": "Félix Saparelli <felix@passcod.name>", + "name": "clearscreen", + "version": "4.0.6", + "description": "Cross-platform terminal screen clearing", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d669bb552908e336ad5681789752033b45566b7e591aeaac7a614e58e5d6d8f2" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/clearscreen@4.0.6", + "externalReferences": [ + { + "type": "documentation", + "url": "https://github.com/watchexec/clearscreen" + }, + { + "type": "website", + "url": "https://github.com/watchexec/clearscreen" + }, + { + "type": "vcs", + "url": "https://github.com/watchexec/clearscreen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#collection_literals@1.0.2", + "name": "collection_literals", + "version": "1.0.2", + "description": "Easy-to-use macros for initializing any collection", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "26b3f65b8fb8e88ba339f7d23a390fe1b0896217da05e2a66c584c9b29a91df8" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/collection_literals@1.0.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/staedoix/collection_literals" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#colorchoice@1.0.4", + "name": "colorchoice", + "version": "1.0.4", + "description": "Global override of color control", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/colorchoice@1.0.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-cli/anstyle.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "author": "Thomas Wickham <mackwic@gmail.com>", + "name": "colored", + "version": "3.1.1", + "description": "The most simple way to add colors in your terminal", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" + } + ], + "licenses": [ + { + "expression": "MPL-2.0" + } + ], + "purl": "pkg:cargo/colored@3.1.1", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/mackwic/colored" + }, + { + "type": "vcs", + "url": "https://github.com/mackwic/colored" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "author": "Parker Timmerman <parker@parkertimmerman.com>", + "name": "compact_str", + "version": "0.9.0", + "description": "A memory efficient string type that transparently stores strings on the stack, when possible", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/compact_str@0.9.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/ParkMyCar/compact_str" + }, + { + "type": "vcs", + "url": "https://github.com/ParkMyCar/compact_str" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#core-foundation-sys@0.8.7", + "author": "The Servo Project Developers", + "name": "core-foundation-sys", + "version": "0.8.7", + "description": "Bindings to Core Foundation for macOS", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/core-foundation-sys@0.8.7", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/servo/core-foundation-rs" + }, + { + "type": "vcs", + "url": "https://github.com/servo/core-foundation-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#countme@3.0.1", + "author": "Aleksey Kladov <aleksey.kladov@gmail.com>", + "name": "countme", + "version": "3.0.1", + "description": "Counts the number of live instances of types", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/countme@3.0.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/matklad/countme" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#cpufeatures@0.3.0", + "author": "RustCrypto Developers", + "name": "cpufeatures", + "version": "0.3.0", + "description": "Lightweight runtime CPU feature detection for aarch64, loongarch64, and x86/x86_64 targets, with no_std support and support for mobile targets including Android and iOS ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/cpufeatures@0.3.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/cpufeatures" + }, + { + "type": "vcs", + "url": "https://github.com/RustCrypto/utils" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crc32fast@1.5.0", + "author": "Sam Rijs <srijs@airpost.net>, Alex Crichton <alex@alexcrichton.com>", + "name": "crc32fast", + "version": "1.5.0", + "description": "Fast, SIMD-accelerated CRC32 (IEEE) checksum computation", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crc32fast@1.5.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/srijs/rust-crc32fast" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-channel@0.5.15", + "name": "crossbeam-channel", + "version": "0.5.15", + "description": "Multi-producer multi-consumer channels for message passing", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam-channel@0.5.15", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-deque@0.8.6", + "name": "crossbeam-deque", + "version": "0.8.6", + "description": "Concurrent work-stealing deque", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam-deque@0.8.6", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-deque" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-epoch@0.9.18", + "name": "crossbeam-epoch", + "version": "0.9.18", + "description": "Epoch-based garbage collection", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam-epoch@0.9.18", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-epoch" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-queue@0.3.12", + "name": "crossbeam-queue", + "version": "0.3.12", + "description": "Concurrent queues", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam-queue@0.3.12", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-queue" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21", + "name": "crossbeam-utils", + "version": "0.8.21", + "description": "Utilities for concurrent programming", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam-utils@0.8.21", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam@0.8.4", + "name": "crossbeam", + "version": "0.8.4", + "description": "Tools for concurrent programming", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/crossbeam@0.8.4", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/crossbeam-rs/crossbeam" + }, + { + "type": "vcs", + "url": "https://github.com/crossbeam-rs/crossbeam" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#darling@0.23.0", + "author": "Ted Driggs <ted.driggs@outlook.com>", + "name": "darling", + "version": "0.23.0", + "description": "A proc-macro library for reading attributes into structs when implementing custom derives. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/darling@0.23.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/darling/0.23.0" + }, + { + "type": "vcs", + "url": "https://github.com/TedDriggs/darling" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#darling_core@0.23.0", + "author": "Ted Driggs <ted.driggs@outlook.com>", + "name": "darling_core", + "version": "0.23.0", + "description": "Helper crate for proc-macro library for reading attributes into structs when implementing custom derives. Use https://crates.io/crates/darling in your code. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/darling_core@0.23.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/TedDriggs/darling" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#darling_macro@0.23.0", + "author": "Ted Driggs <ted.driggs@outlook.com>", + "name": "darling_macro", + "version": "0.23.0", + "description": "Internal support for a proc-macro library for reading attributes into structs when implementing custom derives. Use https://crates.io/crates/darling in your code. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/darling_macro@0.23.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/TedDriggs/darling" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#dashmap@6.1.0", + "author": "Acrimon <joel.wejdenstal@gmail.com>", + "name": "dashmap", + "version": "6.1.0", + "description": "Blazing fast concurrent HashMap for Rust.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/dashmap@6.1.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/dashmap" + }, + { + "type": "website", + "url": "https://github.com/xacrimon/dashmap" + }, + { + "type": "vcs", + "url": "https://github.com/xacrimon/dashmap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#derive-where@1.6.0", + "name": "derive-where", + "version": "1.6.0", + "description": "Deriving with custom trait bounds", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/derive-where@1.6.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/derive-where" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/derive-where" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#dirs-sys@0.5.0", + "author": "Simon Ochsenreither <simon@ochsenreither.de>", + "name": "dirs-sys", + "version": "0.5.0", + "description": "System-level helper functions for the dirs and directories crates.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/dirs-sys@0.5.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/dirs-dev/dirs-sys-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#dirs@6.0.0", + "author": "Simon Ochsenreither <simon@ochsenreither.de>", + "name": "dirs", + "version": "6.0.0", + "description": "A tiny low-level library that provides platform-specific standard locations of directories for config, cache and other data on Linux, Windows, macOS and Redox by leveraging the mechanisms defined by the XDG base/user directory specifications on Linux, the Known Folder API on Windows, and the Standard Directory guidelines on macOS.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/dirs@6.0.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/soc/dirs-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "author": "Jane Lusby <jlusby@yaah.dev>", + "name": "displaydoc", + "version": "0.2.5", + "description": "A derive macro for implementing the display Trait via a doc comment and string interpolation ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/displaydoc@0.2.5", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/displaydoc" + }, + { + "type": "website", + "url": "https://github.com/yaahc/displaydoc" + }, + { + "type": "vcs", + "url": "https://github.com/yaahc/displaydoc" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#drop_bomb@0.1.5", + "author": "Aleksey Kladov <aleksey.kladov@gmail.com>", + "name": "drop_bomb", + "version": "0.1.5", + "description": "A runtime guard for implementing linear types. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/drop_bomb@0.1.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/matklad/drop_bomb" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#dunce@1.0.5", + "author": "Kornel <kornel@geekhood.net>", + "name": "dunce", + "version": "1.0.5", + "description": "Normalize Windows paths to the most compatible format, avoiding UNC where possible", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + } + ], + "licenses": [ + { + "expression": "CC0-1.0 OR MIT-0 OR Apache-2.0" + } + ], + "purl": "pkg:cargo/dunce@1.0.5", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/dunce" + }, + { + "type": "website", + "url": "https://lib.rs/crates/dunce" + }, + { + "type": "vcs", + "url": "https://gitlab.com/kornelski/dunce" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#dyn-clone@1.0.20", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "dyn-clone", + "version": "1.0.20", + "description": "Clone trait that is dyn-compatible", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/dyn-clone@1.0.20", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/dyn-clone" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/dyn-clone" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#either@1.15.0", + "author": "bluss", + "name": "either", + "version": "1.15.0", + "description": "The enum `Either` with variants `Left` and `Right` is a general purpose sum type with two cases. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/either@1.15.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/either/1/" + }, + { + "type": "vcs", + "url": "https://github.com/rayon-rs/either" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#equivalent@1.0.2", + "name": "equivalent", + "version": "1.0.2", + "description": "Traits for key comparison in maps.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/equivalent@1.0.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/indexmap-rs/equivalent" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#errno@0.3.14", + "author": "Chris Wong <lambda.fairy@gmail.com>, Dan Gohman <dev@sunfishcode.online>", + "name": "errno", + "version": "0.3.14", + "description": "Cross-platform interface to the `errno` variable.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/errno@0.3.14", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/errno" + }, + { + "type": "vcs", + "url": "https://github.com/lambda-fairy/rust-errno" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#etcetera@0.11.0", + "name": "etcetera", + "version": "0.11.0", + "description": "An unopinionated library for obtaining configuration, data, cache, & other directories", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/etcetera@0.11.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/etcetera" + }, + { + "type": "website", + "url": "https://github.com/lunacookies/etcetera" + }, + { + "type": "vcs", + "url": "https://github.com/lunacookies/etcetera" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#fastrand@2.3.0", + "author": "Stjepan Glavina <stjepang@gmail.com>", + "name": "fastrand", + "version": "2.3.0", + "description": "A simple and fast random number generator", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/fastrand@2.3.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/smol-rs/fastrand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#fern@0.7.1", + "author": "David Ross <daboross@daboross.net>", + "name": "fern", + "version": "0.7.1", + "description": "Simple, efficient logging", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/fern@0.7.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/fern/" + }, + { + "type": "vcs", + "url": "https://github.com/daboross/fern" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#filetime@0.2.27", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "filetime", + "version": "0.2.27", + "description": "Platform-agnostic accessors of timestamps in File metadata ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/filetime@0.2.27", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/filetime" + }, + { + "type": "website", + "url": "https://github.com/alexcrichton/filetime" + }, + { + "type": "vcs", + "url": "https://github.com/alexcrichton/filetime" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#find-msvc-tools@0.1.2", + "name": "find-msvc-tools", + "version": "0.1.2", + "description": "Find windows-specific tools, read MSVC versions from the registry and from COM interfaces", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/find-msvc-tools@0.1.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/find-msvc-tools" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/cc-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#flate2@1.1.2", + "author": "Alex Crichton <alex@alexcrichton.com>, Josh Triplett <josh@joshtriplett.org>", + "name": "flate2", + "version": "1.1.2", + "description": "DEFLATE compression and decompression exposed as Read/BufRead/Write streams. Supports miniz_oxide and multiple zlib implementations. Supports zlib, gzip, and raw deflate streams. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/flate2@1.1.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/flate2" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/flate2-rs" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/flate2-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#fnv@1.0.7", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "fnv", + "version": "1.0.7", + "description": "Fowler–Noll–Vo hash function", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/fnv@1.0.7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://doc.servo.org/fnv/" + }, + { + "type": "vcs", + "url": "https://github.com/servo/rust-fnv" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#foldhash@0.1.5", + "author": "Orson Peters <orsonpeters@gmail.com>", + "name": "foldhash", + "version": "0.1.5", + "description": "A fast, non-cryptographic, minimally DoS-resistant hashing algorithm.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + } + ], + "licenses": [ + { + "expression": "Zlib" + } + ], + "purl": "pkg:cargo/foldhash@0.1.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/orlp/foldhash" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#form_urlencoded@1.2.2", + "author": "The rust-url developers", + "name": "form_urlencoded", + "version": "1.2.2", + "description": "Parser and serializer for the application/x-www-form-urlencoded syntax, as used by HTML forms.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/form_urlencoded@1.2.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/servo/rust-url" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#fs-err@3.3.0", + "author": "Andrew Hickman <andrew.hickman1@sky.com>", + "name": "fs-err", + "version": "3.3.0", + "description": "A drop-in replacement for std::fs with more helpful error messages.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "73fde052dbfc920003cfd2c8e2c6e6d4cc7c1091538c3a24226cec0665ab08c0" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/fs-err@3.3.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/fs-err" + }, + { + "type": "vcs", + "url": "https://github.com/andrewhickman/fs-err" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#fsevent-sys@4.1.0", + "author": "Pierre Baillet <pierre@baillet.name>", + "name": "fsevent-sys", + "version": "4.1.0", + "description": "Rust bindings to the fsevent macOS API for file changes notifications", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/fsevent-sys@4.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/octplane/fsevent-rust/tree/master/fsevent-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#get-size-derive2@0.8.0", + "author": "Denis Kerp, Nicolas", + "name": "get-size-derive2", + "version": "0.8.0", + "description": "Derives the GetSize trait.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "dfd774e8175d3adb09c1742cb4697fb08490607fc02acfaa3b66b88254239d1d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/get-size-derive2@0.8.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/bircni/get-size2/tree/main/crates/get-size-derive2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "author": "Denis Kerp, Nicolas", + "name": "get-size2", + "version": "0.8.0", + "description": "Determine the size in bytes an object occupies inside RAM.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d5b6f7d040889b1980e31d03585f0150223f44eeada7a69c525cbb74c38266f6" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/get-size2@0.8.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/bircni/get-size2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#getopts@0.2.24", + "author": "The Rust Project Developers", + "name": "getopts", + "version": "0.2.24", + "description": "getopts-like option parsing", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/getopts@0.2.24", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/getopts" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.2.16", + "author": "The Rand Project Developers", + "name": "getrandom", + "version": "0.2.16", + "description": "A small cross-platform library for retrieving random data from system source", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/getrandom@0.2.16", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/getrandom" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/getrandom" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.3.4", + "author": "The Rand Project Developers", + "name": "getrandom", + "version": "0.3.4", + "description": "A small cross-platform library for retrieving random data from system source", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/getrandom@0.3.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/getrandom" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/getrandom" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.4.2", + "author": "The Rand Project Developers", + "name": "getrandom", + "version": "0.4.2", + "description": "A small cross-platform library for retrieving random data from system source", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/getrandom@0.4.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/getrandom" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/getrandom" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3", + "author": "The Rust Project Developers", + "name": "glob", + "version": "0.3.3", + "description": "Support for matching file paths against Unix shell style patterns. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/glob@0.3.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/glob" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/glob" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/glob" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "globset", + "version": "0.4.18", + "description": "Cross platform single glob and glob set matching. Glob set matching is the process of matching one or more glob patterns against a single candidate path simultaneously, and returning all of the globs that matched. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/globset@0.4.18", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/globset" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/ripgrep/tree/master/crates/globset" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/ripgrep/tree/master/crates/globset" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#globwalk@0.9.1", + "author": "Gilad Naaman <gilad@naaman.io>", + "name": "globwalk", + "version": "0.9.1", + "description": "Glob-matched recursive file system walking.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/globwalk@0.9.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/gilnaa/globwalk" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.14.5", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "hashbrown", + "version": "0.14.5", + "description": "A Rust port of Google's SwissTable hash map", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/hashbrown@0.14.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/hashbrown" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.15.5", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "hashbrown", + "version": "0.15.5", + "description": "A Rust port of Google's SwissTable hash map", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/hashbrown@0.15.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/hashbrown" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.17.0", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "hashbrown", + "version": "0.17.0", + "description": "A Rust port of Google's SwissTable hash map", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/hashbrown@0.17.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/hashbrown" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#hashlink@0.10.0", + "author": "kyren <kerriganw@gmail.com>", + "name": "hashlink", + "version": "0.10.0", + "description": "HashMap-like containers that hold their key-value pairs in a user controllable order", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/hashlink@0.10.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/hashlink" + }, + { + "type": "vcs", + "url": "https://github.com/kyren/hashlink" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "name": "heck", + "version": "0.5.0", + "description": "heck is a case conversion library.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/heck@0.5.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/withoutboats/heck" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone-haiku@0.1.2", + "author": "René Kijewski <crates.io@k6i.de>", + "name": "iana-time-zone-haiku", + "version": "0.1.2", + "description": "iana-time-zone support crate for Haiku OS", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/iana-time-zone-haiku@0.1.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/strawlab/iana-time-zone" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone@0.1.64", + "author": "Andrew Straw <strawman@astraw.com>, René Kijewski <rene.kijewski@fu-berlin.de>, Ryan Lopopolo <rjl@hyperbo.la>", + "name": "iana-time-zone", + "version": "0.1.64", + "description": "get the IANA time zone for the current system", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/iana-time-zone@0.1.64", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/strawlab/iana-time-zone" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_collections@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_collections", + "version": "2.2.0", + "description": "Collection of API for use in ICU libraries.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_collections@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_locale_core@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_locale_core", + "version": "2.2.0", + "description": "API for managing Unicode Language and Locale Identifiers", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_locale_core@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_normalizer", + "version": "2.2.0", + "description": "API for normalizing text into Unicode Normalization Forms", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_normalizer@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer_data@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_normalizer_data", + "version": "2.2.0", + "description": "Data for the icu_normalizer crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_normalizer_data@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_properties@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_properties", + "version": "2.2.0", + "description": "Definitions for Unicode properties", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_properties@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_properties_data@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_properties_data", + "version": "2.2.0", + "description": "Data for the icu_properties crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_properties_data@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#icu_provider@2.2.0", + "author": "The ICU4X Project Developers", + "name": "icu_provider", + "version": "2.2.0", + "description": "Trait and struct definitions for the ICU data provider", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/icu_provider@2.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#id-arena@2.3.0", + "author": "Nick Fitzgerald <fitzgen@gmail.com>, Aleksey Kladov <aleksey.kladov@gmail.com>", + "name": "id-arena", + "version": "2.3.0", + "description": "A simple, id-based arena.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/id-arena@2.3.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/id-arena" + }, + { + "type": "vcs", + "url": "https://github.com/fitzgen/id-arena" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ident_case@1.0.1", + "author": "Ted Driggs <ted.driggs@outlook.com>", + "name": "ident_case", + "version": "1.0.1", + "description": "Utility for applying case rules to Rust identifiers.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/ident_case@1.0.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ident_case/1.0.1" + }, + { + "type": "vcs", + "url": "https://github.com/TedDriggs/ident_case" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#idna@1.1.0", + "author": "The rust-url developers", + "name": "idna", + "version": "1.1.0", + "description": "IDNA (Internationalizing Domain Names in Applications) and Punycode.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/idna@1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/servo/rust-url/" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#idna_adapter@1.2.1", + "author": "The rust-url developers", + "name": "idna_adapter", + "version": "1.2.1", + "description": "Back end adapter for idna", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/idna_adapter@1.2.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/idna_adapter/latest/idna_adapter/" + }, + { + "type": "website", + "url": "https://docs.rs/crate/idna_adapter/latest" + }, + { + "type": "vcs", + "url": "https://github.com/hsivonen/idna_adapter" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "ignore", + "version": "0.4.25", + "description": "A fast library for efficiently matching ignore files such as `.gitignore` against file paths. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/ignore@0.4.25", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ignore" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#imperative@1.0.7", + "author": "Ed Page <eopage@gmail.com>", + "name": "imperative", + "version": "1.0.7", + "description": "Check for imperative mood in text", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "35e1d0bd9c575c52e59aad8e122a11786e852a154678d0c86e9e243d55273970" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/imperative@1.0.7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/imperative" + }, + { + "type": "vcs", + "url": "https://github.com/crate-ci/imperative" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "name": "indexmap", + "version": "2.14.0", + "description": "A hash table with consistent order and fast iteration.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/indexmap@2.14.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/indexmap/" + }, + { + "type": "vcs", + "url": "https://github.com/indexmap-rs/indexmap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#inotify-sys@0.1.5", + "author": "Hanno Braun <hb@hannobraun.de>", + "name": "inotify-sys", + "version": "0.1.5", + "description": "inotify bindings for the Rust programming language", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" + } + ], + "licenses": [ + { + "expression": "ISC" + } + ], + "purl": "pkg:cargo/inotify-sys@0.1.5", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/inotify-sys" + }, + { + "type": "vcs", + "url": "https://github.com/hannobraun/inotify-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#inotify@0.11.0", + "author": "Hanno Braun <mail@hannobraun.de>, Félix Saparelli <me@passcod.name>, Cristian Kubis <cristian.kubis@tsunix.de>, Frank Denis <github@pureftpd.org>", + "name": "inotify", + "version": "0.11.0", + "description": "Idiomatic wrapper for inotify", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" + } + ], + "licenses": [ + { + "expression": "ISC" + } + ], + "purl": "pkg:cargo/inotify@0.11.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/inotify" + }, + { + "type": "vcs", + "url": "https://github.com/hannobraun/inotify" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#interpolator@0.5.0", + "name": "interpolator", + "version": "0.5.0", + "description": "runtime format strings, fully compatible with std's macros", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/interpolator@0.5.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/interpolator" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/interpolator" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#intrusive-collections@0.9.7", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "intrusive-collections", + "version": "0.9.7", + "description": "Intrusive collections for Rust (linked list and red-black tree)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/intrusive-collections@0.9.7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/intrusive-collections" + }, + { + "type": "vcs", + "url": "https://github.com/Amanieu/intrusive-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#inventory@0.3.24", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "inventory", + "version": "0.3.24", + "description": "Typed distributed plugin registration", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/inventory@0.3.24", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/inventory" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/inventory" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "author": "강동윤 <kdy1997.dev@gmail.com>", + "name": "is-macro", + "version": "0.3.7", + "description": "Derive methods for using custom enums like Option / Result", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" + } + ], + "licenses": [ + { + "expression": "Apache-2.0" + } + ], + "purl": "pkg:cargo/is-macro@0.3.7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/is-macro" + }, + { + "type": "vcs", + "url": "https://github.com/dudykr/ddbase.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#is_terminal_polyfill@1.70.1", + "name": "is_terminal_polyfill", + "version": "1.70.1", + "description": "Polyfill for `is_terminal` stdlib feature for use with older MSRVs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/is_terminal_polyfill@1.70.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/polyfill-rs/is_terminal_polyfill" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#itertools@0.13.0", + "author": "bluss", + "name": "itertools", + "version": "0.13.0", + "description": "Extra iterator adaptors, iterator methods, free functions, and macros.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/itertools@0.13.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/itertools/" + }, + { + "type": "vcs", + "url": "https://github.com/rust-itertools/itertools" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "author": "bluss", + "name": "itertools", + "version": "0.14.0", + "description": "Extra iterator adaptors, iterator methods, free functions, and macros.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/itertools@0.14.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/itertools/" + }, + { + "type": "vcs", + "url": "https://github.com/rust-itertools/itertools" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#itoa@1.0.15", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "itoa", + "version": "1.0.15", + "description": "Fast integer primitive to string conversion", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/itoa@1.0.15", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/itoa" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/itoa" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-static@0.2.23", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "jiff-static", + "version": "0.2.23", + "description": "Create static TimeZone values for Jiff (useful in core-only environments).", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/jiff-static@0.2.23", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jiff-tzdb" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/jiff/tree/master/crates/jiff-static" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/jiff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb-platform@0.1.3", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "jiff-tzdb-platform", + "version": "0.1.3", + "description": "The entire Time Zone Database embedded into your binary for specific platforms. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/jiff-tzdb-platform@0.1.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jiff-tzdb-platform" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/jiff/tree/master/crates/jiff-tzdb-platform" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/jiff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb@0.1.4", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "jiff-tzdb", + "version": "0.1.4", + "description": "The entire Time Zone Database embedded into your binary.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c1283705eb0a21404d2bfd6eef2a7593d240bc42a0bdb39db0ad6fa2ec026524" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/jiff-tzdb@0.1.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jiff-tzdb" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/jiff/tree/master/crates/jiff-tzdb" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/jiff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jiff@0.2.23", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "jiff", + "version": "0.2.23", + "description": "A date-time library that encourages you to jump into the pit of success. This library is heavily inspired by the Temporal project. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/jiff@0.2.23", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jiff" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/jiff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jobserver@0.1.34", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "jobserver", + "version": "0.1.34", + "description": "An implementation of the GNU Make jobserver for Rust. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/jobserver@0.1.34", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jobserver" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/jobserver-rs" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/jobserver-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#jod-thread@1.0.0", + "author": "Aleksey Kladov <aleksey.kladov@gmail.com>", + "name": "jod-thread", + "version": "1.0.0", + "description": "std::thread which joins on drop by default.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a037eddb7d28de1d0fc42411f501b53b75838d313908078d6698d064f3029b24" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/jod-thread@1.0.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jod-thread" + }, + { + "type": "vcs", + "url": "https://github.com/matklad/jod-thread" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#js-sys@0.3.82", + "author": "The wasm-bindgen Developers", + "name": "js-sys", + "version": "0.3.82", + "description": "Bindings for all JS global objects and functions in all JS environments like Node.js and browsers, built on `#[wasm_bindgen]` using the `wasm-bindgen` crate. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/js-sys@0.3.82", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/js-sys" + }, + { + "type": "website", + "url": "https://wasm-bindgen.github.io/wasm-bindgen/" + }, + { + "type": "vcs", + "url": "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#kqueue-sys@1.0.4", + "author": "William Orr <will@worrbase.com>, Daniel (dmilith) Dettlaff <dmilith@me.com>", + "name": "kqueue-sys", + "version": "1.0.4", + "description": "Low-level kqueue interface for BSDs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/kqueue-sys@1.0.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://gitlab.com/rust-kqueue/rust-kqueue-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#kqueue@1.1.1", + "author": "William Orr <will@worrbase.com>", + "name": "kqueue", + "version": "1.1.1", + "description": "kqueue interface for BSDs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/kqueue@1.1.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.worrbase.com/rust/kqueue/" + }, + { + "type": "vcs", + "url": "https://gitlab.com/rust-kqueue/rust-kqueue" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#lazy_static@1.5.0", + "author": "Marvin Löbel <loebel.marvin@gmail.com>", + "name": "lazy_static", + "version": "1.5.0", + "description": "A macro for declaring lazily evaluated statics in Rust.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/lazy_static@1.5.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/lazy_static" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang-nursery/lazy-static.rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#leb128fmt@0.1.0", + "author": "Bryant Luk <code@bryantluk.com>", + "name": "leb128fmt", + "version": "0.1.0", + "description": "A library to encode and decode LEB128 compressed integers.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/leb128fmt@0.1.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/leb128fmt" + }, + { + "type": "vcs", + "url": "https://github.com/bluk/leb128fmt" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "author": "The Rust Project Developers", + "name": "libc", + "version": "0.2.184", + "description": "Raw FFI bindings to platform libraries like libc.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/libc@0.2.184", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/libc" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#libcst@1.8.6", + "author": "LibCST Developers", + "name": "libcst", + "version": "1.8.6", + "description": "A Python parser and Concrete Syntax Tree library.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6aea7143e4a0ed59b87a1ee71e198500889f8b005311136be15e84c97a6fcd8d" + } + ], + "licenses": [ + { + "expression": "MIT AND (MIT AND PSF-2.0)" + } + ], + "purl": "pkg:cargo/libcst@1.8.6", + "externalReferences": [ + { + "type": "documentation", + "url": "https://libcst.rtfd.org" + }, + { + "type": "vcs", + "url": "https://github.com/Instagram/LibCST" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#libcst_derive@1.8.6", + "name": "libcst_derive", + "version": "1.8.6", + "description": "Proc macro helpers for libcst.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0903173ea316c34a44d0497161e04d9210af44f5f5e89bf2f55d9a254c9a0e8d" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/libcst_derive@1.8.6", + "externalReferences": [ + { + "type": "documentation", + "url": "https://libcst.rtfd.org" + }, + { + "type": "vcs", + "url": "https://github.com/Instagram/LibCST" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#libmimalloc-sys@0.1.44", + "author": "Octavian Oncescu <octavonce@gmail.com>", + "name": "libmimalloc-sys", + "version": "0.1.44", + "description": "Sys crate wrapping the mimalloc allocator", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/libmimalloc-sys@0.1.44", + "externalReferences": [ + { + "type": "other", + "url": "mimalloc" + }, + { + "type": "vcs", + "url": "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#libredox@0.1.10", + "author": "4lDO2 <4lDO2@protonmail.com>", + "name": "libredox", + "version": "0.1.10", + "description": "Redox stable ABI", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/libredox@0.1.10", + "externalReferences": [ + { + "type": "vcs", + "url": "https://gitlab.redox-os.org/redox-os/libredox.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#linux-raw-sys@0.12.1", + "author": "Dan Gohman <dev@sunfishcode.online>", + "name": "linux-raw-sys", + "version": "0.12.1", + "description": "Generated bindings for Linux's userspace API", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/linux-raw-sys@0.12.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/linux-raw-sys" + }, + { + "type": "vcs", + "url": "https://github.com/sunfishcode/linux-raw-sys" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#litemap@0.8.0", + "author": "The ICU4X Project Developers", + "name": "litemap", + "version": "0.8.0", + "description": "A key-value Map implementation based on a flat, sorted Vec.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/litemap@0.8.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/litemap" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#lock_api@0.4.13", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "lock_api", + "version": "0.4.13", + "description": "Wrappers to create fully-featured Mutex and RwLock types. Compatible with no_std.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/lock_api@0.4.13", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Amanieu/parking_lot" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "author": "The Rust Project Developers", + "name": "log", + "version": "0.4.29", + "description": "A lightweight logging facade for Rust ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/log@0.4.29", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/log" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/log" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#lsp-server@0.7.9", + "name": "lsp-server", + "version": "0.7.9", + "description": "Generic LSP server scaffold.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7d6ada348dbc2703cbe7637b2dda05cff84d3da2819c24abcb305dd613e0ba2e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/lsp-server@0.7.9", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/rust-analyzer/tree/master/lib/lsp-server" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#manyhow-macros@0.11.4", + "name": "manyhow-macros", + "version": "0.11.4", + "description": "Macro for manyhow", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "46fce34d199b78b6e6073abf984c9cf5fd3e9330145a93ee0738a7443e371495" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/manyhow-macros@0.11.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/manyhow" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/manyhow" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#manyhow@0.11.4", + "name": "manyhow", + "version": "0.11.4", + "description": "proc macro error handling à la anyhow x proc-macro-error", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b33efb3ca6d3b07393750d4030418d594ab1139cee518f0dc88db70fec873587" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/manyhow@0.11.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/manyhow" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/manyhow" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#matchers@0.2.0", + "author": "Eliza Weisman <eliza@buoyant.io>", + "name": "matchers", + "version": "0.2.0", + "description": "Regex matching on character and byte streams. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/matchers@0.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/matchers/" + }, + { + "type": "website", + "url": "https://github.com/hawkw/matchers" + }, + { + "type": "vcs", + "url": "https://github.com/hawkw/matchers" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#matchit@0.9.2", + "author": "Ibraheem Ahmed <ibraheem@ibraheem.ca>", + "name": "matchit", + "version": "0.9.2", + "description": "A high performance, zero-copy URL router.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "8863b587001c1b9a8a4e36008cebc6b3612cb1226fe2de94858e06092687b608" + } + ], + "licenses": [ + { + "expression": "MIT AND BSD-3-Clause" + } + ], + "purl": "pkg:cargo/matchit@0.9.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/ibraheemdev/matchit" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "author": "Andrew Gallant <jamslam@gmail.com>, bluss", + "name": "memchr", + "version": "2.8.0", + "description": "Provides extremely fast (uses SIMD on x86_64, aarch64 and wasm32) routines for 1, 2 or 3 byte search and single substring search. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/memchr@2.8.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/memchr/" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/memchr" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/memchr" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#memoffset@0.9.1", + "author": "Gilad Naaman <gilad.naaman@gmail.com>", + "name": "memoffset", + "version": "0.9.1", + "description": "offset_of functionality for Rust structs.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/memoffset@0.9.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Gilnaa/memoffset" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#mimalloc@0.1.48", + "author": "Octavian Oncescu <octavonce@gmail.com>, Vincent Rouillé <vincent@speedy37.fr>, Thom Chiovoloni <chiovolonit@gmail.com>", + "name": "mimalloc", + "version": "0.1.48", + "description": "Performance and security oriented drop-in allocator", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/mimalloc@0.1.48", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/purpleprotocol/mimalloc_rust" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#minimal-lexical@0.2.1", + "author": "Alex Huszagh <ahuszagh@gmail.com>", + "name": "minimal-lexical", + "version": "0.2.1", + "description": "Fast float parsing conversion routines.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/minimal-lexical@0.2.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/minimal-lexical" + }, + { + "type": "vcs", + "url": "https://github.com/Alexhuszagh/minimal-lexical" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#miniz_oxide@0.8.9", + "author": "Frommi <daniil.liferenko@gmail.com>, oyvindln <oyvindln@users.noreply.github.com>, Rich Geldreich richgel99@gmail.com", + "name": "miniz_oxide", + "version": "0.8.9", + "description": "DEFLATE compression and decompression library rewritten in Rust based on miniz", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" + } + ], + "licenses": [ + { + "expression": "MIT OR Zlib OR Apache-2.0" + } + ], + "purl": "pkg:cargo/miniz_oxide@0.8.9", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/miniz_oxide" + }, + { + "type": "website", + "url": "https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide" + }, + { + "type": "vcs", + "url": "https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#mio@1.0.4", + "author": "Carl Lerche <me@carllerche.com>, Thomas de Zeeuw <thomasdezeeuw@gmail.com>, Tokio Contributors <team@tokio.rs>", + "name": "mio", + "version": "1.0.4", + "description": "Lightweight non-blocking I/O.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/mio@1.0.4", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/tokio-rs/mio" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/mio" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#natord@1.0.9", + "author": "Kang Seonghoon <public+rust@mearie.org>", + "name": "natord", + "version": "1.0.9", + "description": "Natural ordering for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/natord@1.0.9", + "externalReferences": [ + { + "type": "documentation", + "url": "https://lifthrasiir.github.io/rust-natord/" + }, + { + "type": "website", + "url": "https://github.com/lifthrasiir/rust-natord" + }, + { + "type": "vcs", + "url": "https://github.com/lifthrasiir/rust-natord" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#newtype-uuid@1.3.2", + "name": "newtype-uuid", + "version": "1.3.2", + "description": "Newtype wrapper around UUIDs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5c012d14ef788ab066a347d19e3dda699916c92293b05b85ba2c76b8c82d2830" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/newtype-uuid@1.3.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/newtype-uuid" + }, + { + "type": "vcs", + "url": "https://github.com/oxidecomputer/newtype-uuid" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#nix@0.31.2", + "author": "The nix-rust Project Developers", + "name": "nix", + "version": "0.31.2", + "description": "Rust friendly bindings to *nix APIs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/nix@0.31.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/nix-rust/nix" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#nom@7.1.3", + "author": "contact@geoffroycouprie.com", + "name": "nom", + "version": "7.1.3", + "description": "A byte-oriented, zero-copy, parser combinators library", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/nom@7.1.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/nom" + }, + { + "type": "vcs", + "url": "https://github.com/Geal/nom" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#notify-types@2.0.0", + "author": "Daniel Faust <hessijames@gmail.com>", + "name": "notify-types", + "version": "2.0.0", + "description": "Types used by the notify crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/notify-types@2.0.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/notify-types" + }, + { + "type": "website", + "url": "https://github.com/notify-rs/notify" + }, + { + "type": "vcs", + "url": "https://github.com/notify-rs/notify.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#notify@8.2.0", + "author": "Félix Saparelli <me@passcod.name>, Daniel Faust <hessijames@gmail.com>, Aron Heinecke <Ox0p54r36@t-online.de>", + "name": "notify", + "version": "8.2.0", + "description": "Cross-platform filesystem notification library", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" + } + ], + "licenses": [ + { + "expression": "CC0-1.0" + } + ], + "purl": "pkg:cargo/notify@8.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/notify" + }, + { + "type": "website", + "url": "https://github.com/notify-rs/notify" + }, + { + "type": "vcs", + "url": "https://github.com/notify-rs/notify.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#nu-ansi-term@0.50.1", + "author": "ogham@bsago.me, Ryan Scheel (Havvy) <ryan.havvy@gmail.com>, Josh Triplett <josh@joshtriplett.org>, The Nushell Project Developers", + "name": "nu-ansi-term", + "version": "0.50.1", + "description": "Library for ANSI terminal colors and styles (bold, underline)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/nu-ansi-term@0.50.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/nushell/nu-ansi-term" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#num-traits@0.2.19", + "author": "The Rust Project Developers", + "name": "num-traits", + "version": "0.2.19", + "description": "Numeric traits for generic mathematics", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/num-traits@0.2.19", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/num-traits" + }, + { + "type": "website", + "url": "https://github.com/rust-num/num-traits" + }, + { + "type": "vcs", + "url": "https://github.com/rust-num/num-traits" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "author": "Aleksey Kladov <aleksey.kladov@gmail.com>", + "name": "once_cell", + "version": "1.21.3", + "description": "Single assignment cells and lazy values.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/once_cell@1.21.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/once_cell" + }, + { + "type": "vcs", + "url": "https://github.com/matklad/once_cell" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#once_cell_polyfill@1.70.1", + "name": "once_cell_polyfill", + "version": "1.70.1", + "description": "Polyfill for `OnceCell` stdlib feature for use with older MSRVs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/once_cell_polyfill@1.70.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/polyfill-rs/once_cell_polyfill" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#option-ext@0.2.0", + "author": "Simon Ochsenreither <simon@ochsenreither.de>", + "name": "option-ext", + "version": "0.2.0", + "description": "Extends `Option` with additional operations", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + } + ], + "licenses": [ + { + "expression": "MPL-2.0" + } + ], + "purl": "pkg:cargo/option-ext@0.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/option-ext/" + }, + { + "type": "website", + "url": "https://github.com/soc/option-ext" + }, + { + "type": "vcs", + "url": "https://github.com/soc/option-ext.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ordermap@1.2.0", + "name": "ordermap", + "version": "1.2.0", + "description": "A hash table with consistent order and fast iteration.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7f7476a5b122ff1fce7208e7ee9dccd0a516e835f5b8b19b8f3c98a34cf757c1" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/ordermap@1.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ordermap/" + }, + { + "type": "vcs", + "url": "https://github.com/indexmap-rs/ordermap" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#os_str_bytes@7.1.1", + "author": "dylni", + "name": "os_str_bytes", + "version": "7.1.1", + "description": "Lossless functionality for platform-native strings ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "63eceb7b5d757011a87d08eb2123db15d87fb0c281f65d101ce30a1e96c3ad5c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/os_str_bytes@7.1.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/dylni/os_str_bytes" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#parking_lot@0.12.4", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "parking_lot", + "version": "0.12.4", + "description": "More compact and efficient implementations of the standard synchronization primitives.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/parking_lot@0.12.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Amanieu/parking_lot" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#parking_lot_core@0.9.11", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "parking_lot_core", + "version": "0.9.11", + "description": "An advanced API for creating custom synchronization primitives.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/parking_lot_core@0.9.11", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Amanieu/parking_lot" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#paste@1.0.15", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "paste", + "version": "1.0.15", + "description": "Macros for all your token pasting needs", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/paste@1.0.15", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/paste" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/paste" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#path-absolutize@3.1.1", + "author": "Magic Len <len@magiclen.org>", + "name": "path-absolutize", + "version": "3.1.1", + "description": "A library for extending `Path` and `PathBuf` in order to get an absolute path and remove the containing dots.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e4af381fe79fa195b4909485d99f73a80792331df0625188e707854f0b3383f5" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/path-absolutize@3.1.1", + "externalReferences": [ + { + "type": "website", + "url": "https://magiclen.org/path-absolutize" + }, + { + "type": "vcs", + "url": "https://github.com/magiclen/path-absolutize" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#path-dedot@3.1.1", + "author": "Magic Len <len@magiclen.org>", + "name": "path-dedot", + "version": "3.1.1", + "description": "A library for extending `Path` and `PathBuf` in order to parse the path which contains dots.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/path-dedot@3.1.1", + "externalReferences": [ + { + "type": "website", + "url": "https://magiclen.org/path-dedot" + }, + { + "type": "vcs", + "url": "https://github.com/magiclen/path-dedot" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#path-slash@0.2.1", + "author": "rhysd <https://rhysd.github.io>", + "name": "path-slash", + "version": "0.2.1", + "description": "Conversion to/from a file path from/to slash path", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/path-slash@0.2.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rhysd/path-slash" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pathdiff@0.2.3", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "pathdiff", + "version": "0.2.3", + "description": "Library for diffing paths to obtain relative paths", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/pathdiff@0.2.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/pathdiff/" + }, + { + "type": "vcs", + "url": "https://github.com/Manishearth/pathdiff" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#peg-macros@0.8.5", + "author": "Kevin Mehall <km@kevinmehall.net>", + "name": "peg-macros", + "version": "0.8.5", + "description": "Procedural macros for rust-peg. To use rust-peg, see the `peg` crate.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6298ab04c202fa5b5d52ba03269fb7b74550b150323038878fe6c372d8280f71" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/peg-macros@0.8.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/kevinmehall/rust-peg" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#peg-runtime@0.8.5", + "author": "Kevin Mehall <km@kevinmehall.net>", + "name": "peg-runtime", + "version": "0.8.5", + "description": "Runtime support for rust-peg grammars. To use rust-peg, see the `peg` crate.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "132dca9b868d927b35b5dd728167b2dee150eb1ad686008fc71ccb298b776fca" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/peg-runtime@0.8.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/kevinmehall/rust-peg" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#peg@0.8.5", + "author": "Kevin Mehall <km@kevinmehall.net>", + "name": "peg", + "version": "0.8.5", + "description": "A simple Parsing Expression Grammar (PEG) parser generator.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9928cfca101b36ec5163e70049ee5368a8a1c3c6efc9ca9c5f9cc2f816152477" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/peg@0.8.5", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/kevinmehall/rust-peg" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "name": "pep440_rs", + "version": "0.7.3", + "description": "A library for python version numbers and specifiers, implementing PEP 440", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "31095ca1f396e3de32745f42b20deef7bc09077f918b085307e8eab6ddd8fb9c" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR BSD-2-Clause" + } + ], + "purl": "pkg:cargo/pep440_rs@0.7.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/konstin/pep440-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pep508_rs@0.9.2", + "name": "pep508_rs", + "version": "0.9.2", + "description": "A library for python dependency specifiers, better known as PEP 508", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "faee7227064121fcadcd2ff788ea26f0d8f2bd23a0574da11eca23bc935bcc05" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR BSD-2-Clause" + } + ], + "purl": "pkg:cargo/pep508_rs@0.9.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/konstin/pep508_rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#percent-encoding@2.3.2", + "author": "The rust-url developers", + "name": "percent-encoding", + "version": "2.3.2", + "description": "Percent encoding and decoding", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/percent-encoding@2.3.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/servo/rust-url/" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf@0.11.3", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf", + "version": "0.11.3", + "description": "Runtime support for perfect hash function data structures", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf@0.11.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf@0.13.1", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf", + "version": "0.13.1", + "description": "Runtime support for perfect hash function data structures", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf@0.13.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf_codegen@0.11.3", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf_codegen", + "version": "0.11.3", + "description": "Codegen library for PHF types", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf_codegen@0.11.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf_generator@0.11.3", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf_generator", + "version": "0.11.3", + "description": "PHF generation logic", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf_generator@0.11.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.11.3", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf_shared", + "version": "0.11.3", + "description": "Support code shared by PHF libraries", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf_shared@0.11.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.13.1", + "author": "Steven Fackler <sfackler@gmail.com>", + "name": "phf_shared", + "version": "0.13.1", + "description": "Support code shared by PHF libraries", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/phf_shared@0.13.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-phf/rust-phf" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pin-project-lite@0.2.16", + "name": "pin-project-lite", + "version": "0.2.16", + "description": "A lightweight version of pin-project written with declarative macros. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/pin-project-lite@0.2.16", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/taiki-e/pin-project-lite" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pkg-config@0.3.32", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "pkg-config", + "version": "0.3.32", + "description": "A library to run the pkg-config system tool at build time in order to be used in Cargo build scripts. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/pkg-config@0.3.32", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/pkg-config" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/pkg-config-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#portable-atomic-util@0.2.4", + "name": "portable-atomic-util", + "version": "0.2.4", + "description": "Synchronization primitives built with portable-atomic. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/portable-atomic-util@0.2.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/taiki-e/portable-atomic" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#portable-atomic@1.13.1", + "name": "portable-atomic", + "version": "1.13.1", + "description": "Portable atomic types including support for 128-bit atomics, atomic float, etc. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/portable-atomic@1.13.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/taiki-e/portable-atomic" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#potential_utf@0.1.3", + "author": "The ICU4X Project Developers", + "name": "potential_utf", + "version": "0.1.3", + "description": "Unvalidated string and character types", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/potential_utf@0.1.3", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ppv-lite86@0.2.21", + "author": "The CryptoCorrosion Contributors", + "name": "ppv-lite86", + "version": "0.2.21", + "description": "Cross-platform cryptography-oriented low-level SIMD library.", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/ppv-lite86@0.2.21", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/cryptocorrosion/cryptocorrosion" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#prettyplease@0.2.37", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "prettyplease", + "version": "0.2.37", + "description": "A minimal `syn` syntax tree pretty-printer", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/prettyplease@0.2.37", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/prettyplease" + }, + { + "type": "other", + "url": "prettyplease02" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/prettyplease" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#proc-macro-utils@0.10.0", + "name": "proc-macro-utils", + "version": "0.10.0", + "description": "low-level utilities on proc-macro and proc-macro2 types", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "eeaf08a13de400bc215877b5bdc088f241b12eb42f0a548d3390dc1c56bb7071" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/proc-macro-utils@0.10.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/proc-macro-utils" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/proc-macro-utils" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "author": "David Tolnay <dtolnay@gmail.com>, Alex Crichton <alex@alexcrichton.com>", + "name": "proc-macro2", + "version": "1.0.106", + "description": "A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/proc-macro2@1.0.106", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/proc-macro2" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/proc-macro2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#pyproject-toml@0.13.7", + "name": "pyproject-toml", + "version": "0.13.7", + "description": "pyproject.toml parser in Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f6d755483ad14b49e76713b52285235461a5b4f73f17612353e11a5de36a5fd2" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/pyproject-toml@0.13.7", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/PyO3/pyproject-toml-rs.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#quick-junit@0.6.0", + "name": "quick-junit", + "version": "0.6.0", + "description": "Data model, serializer, and deserializer for JUnit/XUnit XML", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e3e64c58c4c88fc1045e8fe98a1b7cec3643187e3dd678f9bbcdd8f12a6933d6" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/quick-junit@0.6.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/quick-junit" + }, + { + "type": "vcs", + "url": "https://github.com/nextest-rs/quick-junit" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#quick-xml@0.38.4", + "name": "quick-xml", + "version": "0.38.4", + "description": "High performance xml reader and writer", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/quick-xml@0.38.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/quick-xml" + }, + { + "type": "vcs", + "url": "https://github.com/tafia/quick-xml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#quote-use-macros@0.8.4", + "name": "quote-use-macros", + "version": "0.8.4", + "description": "Support `use` in procmacros hygienically", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "82ebfb7faafadc06a7ab141a6f67bcfb24cb8beb158c6fe933f2f035afa99f35" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/quote-use-macros@0.8.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/quote-use" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/quote-use" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#quote-use@0.8.4", + "name": "quote-use", + "version": "0.8.4", + "description": "Support `use` in procmacros hygienically", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9619db1197b497a36178cfc736dc96b271fe918875fbf1344c436a7e93d0321e" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/quote-use@0.8.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/quote-use" + }, + { + "type": "vcs", + "url": "https://github.com/ModProg/quote-use" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "quote", + "version": "1.0.45", + "description": "Quasi-quoting macro quote!(...)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/quote@1.0.45", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/quote/" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/quote" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#r-efi@5.3.0", + "name": "r-efi", + "version": "5.3.0", + "description": "UEFI Reference Specification Protocol Constants and Definitions", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0 OR LGPL-2.1-or-later" + } + ], + "purl": "pkg:cargo/r-efi@5.3.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/r-efi/r-efi/wiki" + }, + { + "type": "vcs", + "url": "https://github.com/r-efi/r-efi" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#r-efi@6.0.0", + "name": "r-efi", + "version": "6.0.0", + "description": "UEFI Reference Specification Protocol Constants and Definitions", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0 OR LGPL-2.1-or-later" + } + ], + "purl": "pkg:cargo/r-efi@6.0.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/r-efi/r-efi/wiki" + }, + { + "type": "vcs", + "url": "https://github.com/r-efi/r-efi" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rand@0.10.1", + "author": "The Rand Project Developers, The Rust Project Developers", + "name": "rand", + "version": "0.10.1", + "description": "Random number generators and other randomness functionality. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rand@0.10.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rand" + }, + { + "type": "website", + "url": "https://rust-random.github.io/book" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/rand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rand@0.8.5", + "author": "The Rand Project Developers, The Rust Project Developers", + "name": "rand", + "version": "0.8.5", + "description": "Random number generators and other randomness functionality. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rand@0.8.5", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rand" + }, + { + "type": "website", + "url": "https://rust-random.github.io/book" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/rand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rand_chacha@0.3.1", + "author": "The Rand Project Developers, The Rust Project Developers, The CryptoCorrosion Contributors", + "name": "rand_chacha", + "version": "0.3.1", + "description": "ChaCha random number generator ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rand_chacha@0.3.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rand_chacha" + }, + { + "type": "website", + "url": "https://rust-random.github.io/book" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/rand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.10.0", + "author": "The Rand Project Developers", + "name": "rand_core", + "version": "0.10.0", + "description": "Core random number generation traits and tools for implementation.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rand_core@0.10.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rand_core" + }, + { + "type": "website", + "url": "https://rust-random.github.io/book" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/rand_core" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.6.4", + "author": "The Rand Project Developers, The Rust Project Developers", + "name": "rand_core", + "version": "0.6.4", + "description": "Core random number generator traits and tools for implementation. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rand_core@0.6.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rand_core" + }, + { + "type": "website", + "url": "https://rust-random.github.io/book" + }, + { + "type": "vcs", + "url": "https://github.com/rust-random/rand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rayon-core@1.13.0", + "name": "rayon-core", + "version": "1.13.0", + "description": "Core APIs for Rayon", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rayon-core@1.13.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rayon-core/" + }, + { + "type": "other", + "url": "rayon-core" + }, + { + "type": "vcs", + "url": "https://github.com/rayon-rs/rayon" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rayon@1.11.0", + "name": "rayon", + "version": "1.11.0", + "description": "Simple work-stealing parallelism for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rayon@1.11.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rayon/" + }, + { + "type": "vcs", + "url": "https://github.com/rayon-rs/rayon" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#redox_syscall@0.5.17", + "author": "Jeremy Soller <jackpot51@gmail.com>", + "name": "redox_syscall", + "version": "0.5.17", + "description": "A Rust library to access raw Redox system calls", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/redox_syscall@0.5.17", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/redox_syscall" + }, + { + "type": "vcs", + "url": "https://gitlab.redox-os.org/redox-os/syscall" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#redox_users@0.5.2", + "author": "Jose Narvaez <goyox86@gmail.com>, Wesley Hershberger <mggmugginsmc@gmail.com>", + "name": "redox_users", + "version": "0.5.2", + "description": "A Rust library to access Redox users and groups functionality", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/redox_users@0.5.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/redox_users" + }, + { + "type": "vcs", + "url": "https://gitlab.redox-os.org/redox-os/users" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ref-cast-impl@1.0.25", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "ref-cast-impl", + "version": "1.0.25", + "description": "Derive implementation for ref_cast::RefCast.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/ref-cast-impl@1.0.25", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ref-cast" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/ref-cast" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ref-cast@1.0.25", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "ref-cast", + "version": "1.0.25", + "description": "Safely cast &T to &U where the struct U contains a single field of type T.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/ref-cast@1.0.25", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ref-cast" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/ref-cast" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "author": "The Rust Project Developers, Andrew Gallant <jamslam@gmail.com>", + "name": "regex-automata", + "version": "0.4.14", + "description": "Automata construction and matching using regular expressions.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/regex-automata@0.4.14", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/regex-automata" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/regex/tree/master/regex-automata" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/regex" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10", + "author": "The Rust Project Developers, Andrew Gallant <jamslam@gmail.com>", + "name": "regex-syntax", + "version": "0.8.10", + "description": "A regular expression parser.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/regex-syntax@0.8.10", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/regex-syntax" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/regex/tree/master/regex-syntax" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/regex" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "author": "The Rust Project Developers, Andrew Gallant <jamslam@gmail.com>", + "name": "regex", + "version": "1.12.3", + "description": "An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/regex@1.12.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/regex" + }, + { + "type": "website", + "url": "https://github.com/rust-lang/regex" + }, + { + "type": "vcs", + "url": "https://github.com/rust-lang/regex" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rust-stemmers@1.2.0", + "author": "Jakob Demler <jdemler@curry-software.com>, CurrySoftware <info@curry-software.com>", + "name": "rust-stemmers", + "version": "1.2.0", + "description": "A rust implementation of some popular snowball stemming algorithms", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" + } + ], + "licenses": [ + { + "expression": "MIT OR BSD-3-Clause" + } + ], + "purl": "pkg:cargo/rust-stemmers@1.2.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/CurrySoftware/rust-stemmers" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "author": "The Rust Project Developers", + "name": "rustc-hash", + "version": "2.1.2", + "description": "A speedy, non-cryptographic hashing algorithm used by rustc", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/rustc-hash@2.1.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/rust-lang/rustc-hash" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rustix@1.1.4", + "author": "Dan Gohman <dev@sunfishcode.online>, Jakub Konka <kubkon@jakubkonka.com>", + "name": "rustix", + "version": "1.1.4", + "description": "Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/rustix@1.1.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rustix" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/rustix" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "rustversion", + "version": "1.0.22", + "description": "Conditional compilation according to rustc compiler version", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/rustversion@1.0.22", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/rustversion" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/rustversion" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#ryu@1.0.20", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "ryu", + "version": "1.0.20", + "description": "Fast floating point to string conversion", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR BSL-1.0" + } + ], + "purl": "pkg:cargo/ryu@1.0.20", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/ryu" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/ryu" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#salsa-macro-rules@0.26.1", + "author": "Salsa developers", + "name": "salsa-macro-rules", + "version": "0.26.1", + "description": "Declarative macros for the salsa crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ec256ece77895f4a8d624cecc133dd798c7961a861439740b1c7410a613ee7ba" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/salsa-macro-rules@0.26.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/salsa-rs/salsa" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#salsa-macros@0.26.1", + "author": "Salsa developers", + "name": "salsa-macros", + "version": "0.26.1", + "description": "Procedural macros for the salsa crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "978e5d5c9533ce19b6a58ad91024e1d136f6eec83c4ba98b5ce94c87986c41d8" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/salsa-macros@0.26.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/salsa-rs/salsa" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "author": "Salsa developers", + "name": "salsa", + "version": "0.26.1", + "description": "A generic framework for on-demand, incrementalized computation (experimental)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a07bc2a7df3f8e2306434a172a694d44d14fda738d08aad5f2f7f747d2f06fdc" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/salsa@0.26.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/salsa-rs/salsa" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#same-file@1.0.6", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "same-file", + "version": "1.0.6", + "description": "A simple crate for determining whether two file paths point to the same file. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/same-file@1.0.6", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/same-file" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/same-file" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/same-file" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#schemars@1.2.1", + "author": "Graham Esau <gesau@hotmail.co.uk>", + "name": "schemars", + "version": "1.2.1", + "description": "Generate JSON Schemas from Rust code", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/schemars@1.2.1", + "externalReferences": [ + { + "type": "website", + "url": "https://graham.cool/schemars/" + }, + { + "type": "vcs", + "url": "https://github.com/GREsau/schemars" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#schemars_derive@1.2.1", + "author": "Graham Esau <gesau@hotmail.co.uk>", + "name": "schemars_derive", + "version": "1.2.1", + "description": "Macros for #[derive(JsonSchema)], for use with schemars", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/schemars_derive@1.2.1", + "externalReferences": [ + { + "type": "website", + "url": "https://graham.cool/schemars/" + }, + { + "type": "vcs", + "url": "https://github.com/GREsau/schemars" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#scopeguard@1.2.0", + "author": "bluss", + "name": "scopeguard", + "version": "1.2.0", + "description": "A RAII scope guard that will run a given closure when it goes out of scope, even if the code between panics (assuming unwinding panic). Defines the macros `defer!`, `defer_on_unwind!`, `defer_on_success!` as shorthands for guards with one of the implemented strategies. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/scopeguard@1.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/scopeguard/" + }, + { + "type": "vcs", + "url": "https://github.com/bluss/scopeguard" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#seahash@4.1.0", + "author": "ticki <ticki@users.noreply.github.com>, Tom Almeida <tom@tommoa.me>", + "name": "seahash", + "version": "4.1.0", + "description": "A blazingly fast, portable hash function with proven statistical guarantees.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/seahash@4.1.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/seahash" + }, + { + "type": "vcs", + "url": "https://gitlab.redox-os.org/redox-os/seahash" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#semver@1.0.27", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "semver", + "version": "1.0.27", + "description": "Parser and evaluator for Cargo's flavor of Semantic Versioning", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/semver@1.0.27", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/semver" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/semver" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "author": "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>", + "name": "serde", + "version": "1.0.228", + "description": "A generic serialization/deserialization framework", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde@1.0.228", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde" + }, + { + "type": "website", + "url": "https://serde.rs" + }, + { + "type": "vcs", + "url": "https://github.com/serde-rs/serde" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "author": "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>", + "name": "serde_core", + "version": "1.0.228", + "description": "Serde traits only, with no support for derive -- use the `serde` crate instead", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_core@1.0.228", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_core" + }, + { + "type": "website", + "url": "https://serde.rs" + }, + { + "type": "vcs", + "url": "https://github.com/serde-rs/serde" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228", + "author": "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>", + "name": "serde_derive", + "version": "1.0.228", + "description": "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_derive@1.0.228", + "externalReferences": [ + { + "type": "documentation", + "url": "https://serde.rs/derive.html" + }, + { + "type": "website", + "url": "https://serde.rs" + }, + { + "type": "vcs", + "url": "https://github.com/serde-rs/serde" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_derive_internals@0.29.1", + "author": "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>", + "name": "serde_derive_internals", + "version": "0.29.1", + "description": "AST representation used by Serde derive macros. Unstable.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_derive_internals@0.29.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_derive_internals" + }, + { + "type": "website", + "url": "https://serde.rs" + }, + { + "type": "vcs", + "url": "https://github.com/serde-rs/serde" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "author": "Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>", + "name": "serde_json", + "version": "1.0.149", + "description": "A JSON serialization file format", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_json@1.0.149", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_json" + }, + { + "type": "vcs", + "url": "https://github.com/serde-rs/json" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_repr@0.1.20", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "serde_repr", + "version": "0.1.20", + "description": "Derive Serialize and Deserialize that delegates to the underlying repr of a C-like enum.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_repr@0.1.20", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_repr" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/serde-repr" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_spanned@1.1.1", + "name": "serde_spanned", + "version": "1.1.1", + "description": "Serde-compatible spanned Value", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_spanned@1.1.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_with@3.18.0", + "author": "Jonas Bushart, Marcin Kaźmierczak", + "name": "serde_with", + "version": "3.18.0", + "description": "Custom de/serialization functions for Rust's serde", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_with@3.18.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_with/" + }, + { + "type": "vcs", + "url": "https://github.com/jonasbb/serde_with/" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#serde_with_macros@3.18.0", + "author": "Jonas Bushart", + "name": "serde_with_macros", + "version": "3.18.0", + "description": "proc-macro library for serde_with", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/serde_with_macros@3.18.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/serde_with_macros/" + }, + { + "type": "vcs", + "url": "https://github.com/jonasbb/serde_with/" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#sharded-slab@0.1.7", + "author": "Eliza Weisman <eliza@buoyant.io>", + "name": "sharded-slab", + "version": "0.1.7", + "description": "A lock-free concurrent slab. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/sharded-slab@0.1.7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/sharded-slab/" + }, + { + "type": "website", + "url": "https://github.com/hawkw/sharded-slab" + }, + { + "type": "vcs", + "url": "https://github.com/hawkw/sharded-slab" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#shellexpand@3.1.2", + "author": "Vladimir Matveev <vmatveev@citrine.cc>, Ian Jackson <iwj@torproject.org>", + "name": "shellexpand", + "version": "3.1.2", + "description": "Shell-like expansions in strings", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/shellexpand@3.1.2", + "externalReferences": [ + { + "type": "documentation", + "url": "http://docs.rs/shellexpand/" + }, + { + "type": "vcs", + "url": "https://gitlab.com/ijackson/rust-shellexpand" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#shlex@1.3.0", + "author": "comex <comexk@gmail.com>, Fenhl <fenhl@fenhl.net>, Adrian Taylor <adetaylor@chromium.org>, Alex Touchet <alextouchet@outlook.com>, Daniel Parks <dp+git@oxidized.org>, Garrett Berg <googberg@gmail.com>", + "name": "shlex", + "version": "1.3.0", + "description": "Split a string into shell words, like Python's shlex.", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/shlex@1.3.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/comex/rust-shlex" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#similar@3.1.0", + "author": "Armin Ronacher <armin.ronacher@active-4.com>, Pierre-Étienne Meunier <pe@pijul.org>, Brandon Williams <bwilliams.eng@gmail.com>", + "name": "similar", + "version": "3.1.0", + "description": "A diff library for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "04d93e861ede2e497b47833469b8ec9d5c07fa4c78ce7a00f6eb7dd8168b4b3f" + } + ], + "licenses": [ + { + "expression": "Apache-2.0" + } + ], + "purl": "pkg:cargo/similar@3.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/mitsuhiko/similar" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#siphasher@1.0.1", + "author": "Frank Denis <github@pureftpd.org>", + "name": "siphasher", + "version": "1.0.1", + "description": "SipHash-2-4, SipHash-1-3 and 128-bit variants in pure Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/siphasher@1.0.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/siphasher" + }, + { + "type": "website", + "url": "https://docs.rs/siphasher" + }, + { + "type": "vcs", + "url": "https://github.com/jedisct1/rust-siphash" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "author": "The Servo Project Developers", + "name": "smallvec", + "version": "1.15.1", + "description": "'Small vector' optimization: store up to a small number of items on the stack", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/smallvec@1.15.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/smallvec/" + }, + { + "type": "vcs", + "url": "https://github.com/servo/rust-smallvec" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#stable_deref_trait@1.2.0", + "author": "Robert Grosse <n210241048576@gmail.com>", + "name": "stable_deref_trait", + "version": "1.2.0", + "description": "An unsafe marker trait for types like Box and Rc that dereference to a stable address even when moved, and hence can be used with libraries such as owning_ref and rental. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/stable_deref_trait@1.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/stable_deref_trait/1.2.0/stable_deref_trait" + }, + { + "type": "vcs", + "url": "https://github.com/storyyeller/stable_deref_trait" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0", + "author": "Nikolai Vazquez", + "name": "static_assertions", + "version": "1.1.0", + "description": "Compile-time assertions to ensure that invariants are met.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/static_assertions@1.1.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/static_assertions/" + }, + { + "type": "website", + "url": "https://github.com/nvzqz/static-assertions-rs" + }, + { + "type": "vcs", + "url": "https://github.com/nvzqz/static-assertions-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#strip-ansi-escapes@0.2.1", + "author": "Ted Mielczarek <ted@mielczarek.org>", + "name": "strip-ansi-escapes", + "version": "0.2.1", + "description": "Strip ANSI escape sequences from byte streams.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/strip-ansi-escapes@0.2.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/strip-ansi-escapes" + }, + { + "type": "website", + "url": "https://github.com/luser/strip-ansi-escapes" + }, + { + "type": "vcs", + "url": "https://github.com/luser/strip-ansi-escapes" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#strsim@0.11.1", + "author": "Danny Guo <danny@dannyguo.com>, maxbachmann <oss@maxbachmann.de>", + "name": "strsim", + "version": "0.11.1", + "description": "Implementations of string similarity metrics. Includes Hamming, Levenshtein, OSA, Damerau-Levenshtein, Jaro, Jaro-Winkler, and Sørensen-Dice. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/strsim@0.11.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/strsim/" + }, + { + "type": "website", + "url": "https://github.com/rapidfuzz/strsim-rs" + }, + { + "type": "vcs", + "url": "https://github.com/rapidfuzz/strsim-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "author": "Peter Glotfelty <peter.glotfelty@microsoft.com>", + "name": "strum", + "version": "0.28.0", + "description": "Helpful macros for working with enums and strings", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/strum@0.28.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/strum" + }, + { + "type": "website", + "url": "https://github.com/Peternator7/strum" + }, + { + "type": "vcs", + "url": "https://github.com/Peternator7/strum" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0", + "author": "Peter Glotfelty <peter.glotfelty@microsoft.com>", + "name": "strum_macros", + "version": "0.28.0", + "description": "Helpful macros for working with enums and strings", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/strum_macros@0.28.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/strum" + }, + { + "type": "website", + "url": "https://github.com/Peternator7/strum" + }, + { + "type": "vcs", + "url": "https://github.com/Peternator7/strum" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#supports-hyperlinks@3.2.0", + "author": "Kat Marchán <kzm@zkat.tech>", + "name": "supports-hyperlinks", + "version": "3.2.0", + "description": "Detects whether a terminal supports rendering hyperlinks.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" + } + ], + "licenses": [ + { + "expression": "Apache-2.0" + } + ], + "purl": "pkg:cargo/supports-hyperlinks@3.2.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/supports-hyperlinks" + }, + { + "type": "vcs", + "url": "https://github.com/zkat/supports-hyperlinks" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "syn", + "version": "2.0.117", + "description": "Parser for Rust source code", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/syn@2.0.117", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/syn" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/syn" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#synstructure@0.13.2", + "author": "Nika Layzell <nika@thelayzells.com>", + "name": "synstructure", + "version": "0.13.2", + "description": "Helper methods and macros for custom derives", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/synstructure@0.13.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/synstructure" + }, + { + "type": "vcs", + "url": "https://github.com/mystor/synstructure" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tempfile@3.27.0", + "author": "Steven Allen <steven@stebalien.com>, The Rust Project Developers, Ashley Mannix <ashleymannix@live.com.au>, Jason White <me@jasonwhite.io>", + "name": "tempfile", + "version": "3.27.0", + "description": "A library for managing temporary files and directories.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/tempfile@3.27.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/tempfile" + }, + { + "type": "website", + "url": "https://stebalien.com/projects/tempfile-rs/" + }, + { + "type": "vcs", + "url": "https://github.com/Stebalien/tempfile" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#terminal_size@0.4.3", + "author": "Andrew Chin <achin@eminence32.net>", + "name": "terminal_size", + "version": "0.4.3", + "description": "Gets the size of your Linux or Windows terminal", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/terminal_size@0.4.3", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/terminal_size" + }, + { + "type": "vcs", + "url": "https://github.com/eminence/terminal-size" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#terminfo@0.9.0", + "author": "meh. <meh@schizofreni.co>", + "name": "terminfo", + "version": "0.9.0", + "description": "Terminal information.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" + } + ], + "licenses": [ + { + "expression": "WTFPL" + } + ], + "purl": "pkg:cargo/terminfo@0.9.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/meh/rust-terminfo" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thin-vec@0.2.14", + "author": "Aria Beingessner <a.beingessner@gmail.com>", + "name": "thin-vec", + "version": "0.2.14", + "description": "A vec that takes up less space on the stack", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thin-vec@0.2.14", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/gankra/thin-vec" + }, + { + "type": "vcs", + "url": "https://github.com/gankra/thin-vec" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@1.0.69", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "thiserror-impl", + "version": "1.0.69", + "description": "Implementation detail of the `thiserror` crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thiserror-impl@1.0.69", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/dtolnay/thiserror" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@2.0.18", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "thiserror-impl", + "version": "2.0.18", + "description": "Implementation detail of the `thiserror` crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thiserror-impl@2.0.18", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/dtolnay/thiserror" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror@1.0.69", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "thiserror", + "version": "1.0.69", + "description": "derive(Error)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thiserror@1.0.69", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/thiserror" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/thiserror" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "thiserror", + "version": "2.0.18", + "description": "derive(Error)", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thiserror@2.0.18", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/thiserror" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/thiserror" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#thread_local@1.1.9", + "author": "Amanieu d'Antras <amanieu@gmail.com>", + "name": "thread_local", + "version": "1.1.9", + "description": "Per-object thread-local storage", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/thread_local@1.1.9", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/thread_local/" + }, + { + "type": "vcs", + "url": "https://github.com/Amanieu/thread_local-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tikv-jemalloc-sys@0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7", + "author": "Alex Crichton <alex@alexcrichton.com>, Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>, The TiKV Project Developers", + "name": "tikv-jemalloc-sys", + "version": "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7", + "description": "Rust FFI bindings to jemalloc ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/tikv-jemalloc-sys@0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/tikv-jemallocator-sys" + }, + { + "type": "website", + "url": "https://github.com/tikv/jemallocator" + }, + { + "type": "other", + "url": "jemalloc" + }, + { + "type": "vcs", + "url": "https://github.com/tikv/jemallocator" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tikv-jemallocator@0.6.1", + "author": "Alex Crichton <alex@alexcrichton.com>, Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>, Simon Sapin <simon.sapin@exyr.org>, Steven Fackler <sfackler@gmail.com>, The TiKV Project Developers", + "name": "tikv-jemallocator", + "version": "0.6.1", + "description": "A Rust allocator backed by jemalloc ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0359b4327f954e0567e69fb191cf1436617748813819c94b8cd4a431422d053a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/tikv-jemallocator@0.6.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/jemallocator" + }, + { + "type": "website", + "url": "https://github.com/tikv/jemallocator" + }, + { + "type": "vcs", + "url": "https://github.com/tikv/jemallocator" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tinystr@0.8.3", + "author": "The ICU4X Project Developers", + "name": "tinystr", + "version": "0.8.3", + "description": "A small ASCII-only bounded length string representation.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/tinystr@0.8.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tinyvec@1.10.0", + "author": "Lokathor <zefria@gmail.com>", + "name": "tinyvec", + "version": "1.10.0", + "description": "`tinyvec` provides 100% safe vec-like data structures.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" + } + ], + "licenses": [ + { + "expression": "Zlib OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/tinyvec@1.10.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Lokathor/tinyvec" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tinyvec_macros@0.1.1", + "author": "Soveu <marx.tomasz@gmail.com>", + "name": "tinyvec_macros", + "version": "0.1.1", + "description": "Some macros for tiny containers", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0 OR Zlib" + } + ], + "purl": "pkg:cargo/tinyvec_macros@0.1.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/Soveu/tinyvec_macros" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml@0.9.12+spec-1.1.0", + "name": "toml", + "version": "0.9.12+spec-1.1.0", + "description": "A native Rust encoder and decoder of TOML-formatted files and streams. Provides implementations of the standard Serialize/Deserialize traits for TOML data to facilitate deserializing and serializing Rust structures. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml@0.9.12+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "name": "toml", + "version": "1.1.2+spec-1.1.0", + "description": "A native Rust encoder and decoder of TOML-formatted files and streams. Provides implementations of the standard Serialize/Deserialize traits for TOML data to facilitate deserializing and serializing Rust structures. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml@1.1.2+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@0.7.5+spec-1.1.0", + "name": "toml_datetime", + "version": "0.7.5+spec-1.1.0", + "description": "A TOML-compatible datetime type", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml_datetime@0.7.5+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@1.1.1+spec-1.1.0", + "name": "toml_datetime", + "version": "1.1.1+spec-1.1.0", + "description": "A TOML-compatible datetime type", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml_datetime@1.1.1+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml_parser@1.1.2+spec-1.1.0", + "name": "toml_parser", + "version": "1.1.2+spec-1.1.0", + "description": "Yet another format-preserving TOML parser.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml_parser@1.1.2+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#toml_writer@1.1.1+spec-1.1.0", + "name": "toml_writer", + "version": "1.1.1+spec-1.1.0", + "description": "A low-level interface for writing out TOML ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/toml_writer@1.1.1+spec-1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/toml-rs/toml" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-attributes@0.1.31", + "author": "Tokio Contributors <team@tokio.rs>, Eliza Weisman <eliza@buoyant.io>, David Barsky <dbarsky@amazon.com>", + "name": "tracing-attributes", + "version": "0.1.31", + "description": "Procedural macro attributes for automatically instrumenting functions. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/tracing-attributes@0.1.31", + "externalReferences": [ + { + "type": "website", + "url": "https://tokio.rs" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/tracing" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-core@0.1.36", + "author": "Tokio Contributors <team@tokio.rs>", + "name": "tracing-core", + "version": "0.1.36", + "description": "Core primitives for application-level tracing. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/tracing-core@0.1.36", + "externalReferences": [ + { + "type": "website", + "url": "https://tokio.rs" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/tracing" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-log@0.2.0", + "author": "Tokio Contributors <team@tokio.rs>", + "name": "tracing-log", + "version": "0.2.0", + "description": "Provides compatibility between `tracing` and the `log` crate. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/tracing-log@0.2.0", + "externalReferences": [ + { + "type": "website", + "url": "https://tokio.rs" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/tracing" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-subscriber@0.3.23", + "author": "Eliza Weisman <eliza@buoyant.io>, David Barsky <me@davidbarsky.com>, Tokio Contributors <team@tokio.rs>", + "name": "tracing-subscriber", + "version": "0.3.23", + "description": "Utilities for implementing and composing `tracing` subscribers. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/tracing-subscriber@0.3.23", + "externalReferences": [ + { + "type": "website", + "url": "https://tokio.rs" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/tracing" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "author": "Eliza Weisman <eliza@buoyant.io>, Tokio Contributors <team@tokio.rs>", + "name": "tracing", + "version": "0.1.44", + "description": "Application-level tracing for Rust. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/tracing@0.1.44", + "externalReferences": [ + { + "type": "website", + "url": "https://tokio.rs" + }, + { + "type": "vcs", + "url": "https://github.com/tokio-rs/tracing" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#typed-arena@2.0.2", + "author": "The typed-arena developers", + "name": "typed-arena", + "version": "2.0.2", + "description": "The arena, a fast but limited type of allocator", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/typed-arena@2.0.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/typed-arena" + }, + { + "type": "vcs", + "url": "https://github.com/SimonSapin/rust-typed-arena" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "unicode-ident", + "version": "1.0.24", + "description": "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + } + ], + "licenses": [ + { + "expression": "(MIT OR Apache-2.0) AND Unicode-3.0" + } + ], + "purl": "pkg:cargo/unicode-ident@1.0.24", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/unicode-ident" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/unicode-ident" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-normalization@0.1.24", + "author": "kwantam <kwantam@gmail.com>, Manish Goregaokar <manishsmail@gmail.com>", + "name": "unicode-normalization", + "version": "0.1.24", + "description": "This crate provides functions for normalization of Unicode strings, including Canonical and Compatible Decomposition and Recomposition, as described in Unicode Standard Annex #15. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unicode-normalization@0.1.24", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/unicode-normalization/" + }, + { + "type": "website", + "url": "https://github.com/unicode-rs/unicode-normalization" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-rs/unicode-normalization" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2", + "author": "kwantam <kwantam@gmail.com>, Manish Goregaokar <manishsmail@gmail.com>", + "name": "unicode-width", + "version": "0.2.2", + "description": "Determine displayed width of `char` and `str` types according to Unicode Standard Annex #11 rules. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unicode-width@0.2.2", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/unicode-rs/unicode-width" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-rs/unicode-width" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-xid@0.2.6", + "author": "erick.tryzelaar <erick.tryzelaar@gmail.com>, kwantam <kwantam@gmail.com>, Manish Goregaokar <manishsmail@gmail.com>", + "name": "unicode-xid", + "version": "0.2.6", + "description": "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unicode-xid@0.2.6", + "externalReferences": [ + { + "type": "documentation", + "url": "https://unicode-rs.github.io/unicode-xid" + }, + { + "type": "website", + "url": "https://github.com/unicode-rs/unicode-xid" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-rs/unicode-xid" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode_names2@1.3.0", + "author": "Huon Wilson <dbau.pp@gmail.com>, Kang Seonghoon <public+rust@mearie.org>, Valentin Lorentz <progval+git@progval.net>, Jeong YunWon <jeong@youknowone.org>", + "name": "unicode_names2", + "version": "1.3.0", + "description": "Map characters to and from their name given in the Unicode standard. This goes to great lengths to be as efficient as possible in both time and space, with the full bidirectional tables weighing barely 500 KB but still offering O(1)* look-up in both directions. (*more precisely, O(length of name).) ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d1673eca9782c84de5f81b82e4109dcfb3611c8ba0d52930ec4a9478f547b2dd" + } + ], + "licenses": [ + { + "expression": "(MIT OR Apache-2.0) AND Unicode-DFS-2016" + } + ], + "purl": "pkg:cargo/unicode_names2@1.3.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/unicode_names2/" + }, + { + "type": "website", + "url": "https://github.com/progval/unicode_names2" + }, + { + "type": "vcs", + "url": "https://github.com/progval/unicode_names2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unicode_names2_generator@1.3.0", + "author": "Huon Wilson <dbau.pp@gmail.com>", + "name": "unicode_names2_generator", + "version": "1.3.0", + "description": "Generates the perfect-hash function used by `unicode_names2`. ", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "b91e5b84611016120197efd7dc93ef76774f4e084cd73c9fb3ea4a86c570c56e" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unicode_names2_generator@1.3.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/unicode_names2/" + }, + { + "type": "website", + "url": "https://github.com/progval/unicode_names2" + }, + { + "type": "vcs", + "url": "https://github.com/progval/unicode_names2" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unscanny@0.1.0", + "author": "Laurenz <laurmaedje@gmail.com>", + "name": "unscanny", + "version": "0.1.0", + "description": "Painless string scanning.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unscanny@0.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/typst/unscanny" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#unty@0.0.4", + "author": "Victor Koenders <bincode@trang.ar>", + "name": "unty", + "version": "0.0.4", + "description": "Explicitly types your generics", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/unty@0.0.4", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/bincode-org/unty" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#url@2.5.8", + "author": "The rust-url developers", + "name": "url", + "version": "2.5.8", + "description": "URL library for Rust, based on the WHATWG URL Standard", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/url@2.5.8", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/url" + }, + { + "type": "vcs", + "url": "https://github.com/servo/rust-url" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#urlencoding@2.1.3", + "author": "Kornel <kornel@geekhood.net>, Bertram Truong <b@bertramtruong.com>", + "name": "urlencoding", + "version": "2.1.3", + "description": "A Rust library for doing URL percentage encoding.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/urlencoding@2.1.3", + "externalReferences": [ + { + "type": "website", + "url": "https://lib.rs/urlencoding" + }, + { + "type": "vcs", + "url": "https://github.com/kornelski/rust_urlencoding" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#utf8_iter@1.0.4", + "author": "Henri Sivonen <hsivonen@hsivonen.fi>", + "name": "utf8_iter", + "version": "1.0.4", + "description": "Iterator by char over potentially-invalid UTF-8 in &[u8]", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/utf8_iter@1.0.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/utf8_iter/" + }, + { + "type": "website", + "url": "https://docs.rs/utf8_iter/" + }, + { + "type": "vcs", + "url": "https://github.com/hsivonen/utf8_iter" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#utf8parse@0.2.2", + "author": "Joe Wilm <joe@jwilm.com>, Christian Duerr <contact@christianduerr.com>", + "name": "utf8parse", + "version": "0.2.2", + "description": "Table-driven UTF-8 parser", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/utf8parse@0.2.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/utf8parse/" + }, + { + "type": "vcs", + "url": "https://github.com/alacritty/vte" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#uuid@1.23.0", + "author": "Ashley Mannix<ashleymannix@live.com.au>, Dylan DPC<dylan.dpc@gmail.com>, Hunar Roop Kahlon<hunar.roop@gmail.com>", + "name": "uuid", + "version": "1.23.0", + "description": "A library to generate and parse UUIDs.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/uuid@1.23.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/uuid" + }, + { + "type": "website", + "url": "https://github.com/uuid-rs/uuid" + }, + { + "type": "vcs", + "url": "https://github.com/uuid-rs/uuid" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#valuable@0.1.1", + "name": "valuable", + "version": "0.1.1", + "description": "Object-safe value inspection, used to pass un-typed structured data across trait-object boundaries. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/valuable@0.1.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/tokio-rs/valuable" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#version-ranges@0.1.1", + "name": "version-ranges", + "version": "0.1.1", + "description": "Performance-optimized type for generic version ranges and operations on them.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f8d079415ceb2be83fc355adbadafe401307d5c309c7e6ade6638e6f9f42f42d" + } + ], + "licenses": [ + { + "expression": "MPL-2.0" + } + ], + "purl": "pkg:cargo/version-ranges@0.1.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/pubgrub-rs/pubgrub" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#virtue@0.0.18", + "name": "virtue", + "version": "0.0.18", + "description": "A sinless derive macro helper", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/virtue@0.0.18", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/virtue" + }, + { + "type": "vcs", + "url": "https://github.com/bincode-org/virtue" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#vte@0.14.1", + "author": "Joe Wilm <joe@jwilm.com>, Christian Duerr <contact@christianduerr.com>", + "name": "vte", + "version": "0.14.1", + "description": "Parser for implementing terminal emulators", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/vte@0.14.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/vte/" + }, + { + "type": "vcs", + "url": "https://github.com/alacritty/vte" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "walkdir", + "version": "2.5.0", + "description": "Recursively walk a directory.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/walkdir@2.5.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/walkdir/" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/walkdir" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/walkdir" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasi@0.11.1+wasi-snapshot-preview1", + "author": "The Cranelift Project Developers", + "name": "wasi", + "version": "0.11.1+wasi-snapshot-preview1", + "description": "Experimental WASI API bindings for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasi@0.11.1+wasi-snapshot-preview1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasi" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasi" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasip2@1.0.1+wasi-0.2.4", + "name": "wasip2", + "version": "1.0.1+wasi-0.2.4", + "description": "WASIp2 API bindings for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasip2@1.0.1+wasi-0.2.4", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasip2" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasi-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06", + "name": "wasip3", + "version": "0.4.0+wasi-0.3.0-rc-2026-01-06", + "description": "WASIp3 API bindings for Rust", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasip3" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasi-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro-support@0.2.105", + "author": "The wasm-bindgen Developers", + "name": "wasm-bindgen-macro-support", + "version": "0.2.105", + "description": "Implementation APIs for the `#[wasm_bindgen]` attribute", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/wasm-bindgen-macro-support@0.2.105", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasm-bindgen" + }, + { + "type": "website", + "url": "https://wasm-bindgen.github.io/wasm-bindgen/" + }, + { + "type": "vcs", + "url": "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro@0.2.105", + "author": "The wasm-bindgen Developers", + "name": "wasm-bindgen-macro", + "version": "0.2.105", + "description": "Definition of the `#[wasm_bindgen]` attribute, an internal dependency ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/wasm-bindgen-macro@0.2.105", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasm-bindgen" + }, + { + "type": "website", + "url": "https://wasm-bindgen.github.io/wasm-bindgen/" + }, + { + "type": "vcs", + "url": "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-shared@0.2.105", + "author": "The wasm-bindgen Developers", + "name": "wasm-bindgen-shared", + "version": "0.2.105", + "description": "Shared support between wasm-bindgen and wasm-bindgen cli, an internal dependency. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/wasm-bindgen-shared@0.2.105", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasm-bindgen-shared" + }, + { + "type": "website", + "url": "https://wasm-bindgen.github.io/wasm-bindgen/" + }, + { + "type": "other", + "url": "wasm_bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105", + "author": "The wasm-bindgen Developers", + "name": "wasm-bindgen", + "version": "0.2.105", + "description": "Easy support for interacting between JS and Rust. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/wasm-bindgen@0.2.105", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasm-bindgen" + }, + { + "type": "website", + "url": "https://wasm-bindgen.github.io/wasm-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/wasm-bindgen/wasm-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-encoder@0.244.0", + "author": "Nick Fitzgerald <fitzgen@gmail.com>", + "name": "wasm-encoder", + "version": "0.244.0", + "description": "A low-level WebAssembly encoder. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasm-encoder@0.244.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wasm-encoder" + }, + { + "type": "website", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-metadata@0.244.0", + "name": "wasm-metadata", + "version": "0.244.0", + "description": "Read and manipulate WebAssembly metadata", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasm-metadata@0.244.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0", + "author": "Yury Delendik <ydelendik@mozilla.com>", + "name": "wasmparser", + "version": "0.244.0", + "description": "A simple event-driven library for parsing WebAssembly binary files. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wasmparser@0.244.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#web-time@1.1.0", + "name": "web-time", + "version": "1.1.0", + "description": "Drop-in replacement for std::time for Wasm in browsers", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/web-time@1.1.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/daxpedda/web-time" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#which@8.0.2", + "author": "Harry Fei <tiziyuanfang@gmail.com>, Jacob Kiesel <jake@bitcrafters.co>", + "name": "which", + "version": "8.0.2", + "description": "A Rust equivalent of Unix command \"which\". Locate installed executable in cross platforms.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/which@8.0.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/which/" + }, + { + "type": "vcs", + "url": "https://github.com/harryfei/which-rs.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wild@2.2.1", + "author": "Kornel <kornel@geekhood.net>", + "name": "wild", + "version": "2.2.1", + "description": "Glob (wildcard) expanded command-line arguments on Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a3131afc8c575281e1e80f36ed6a092aa502c08b18ed7524e86fbbb12bb410e1" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wild@2.2.1", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wild" + }, + { + "type": "website", + "url": "https://lib.rs/crates/wild" + }, + { + "type": "vcs", + "url": "https://gitlab.com/kornelski/wild" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#winapi-util@0.1.11", + "author": "Andrew Gallant <jamslam@gmail.com>", + "name": "winapi-util", + "version": "0.1.11", + "description": "A dumping ground for high level safe wrappers over windows-sys.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" + } + ], + "licenses": [ + { + "expression": "Unlicense OR MIT" + } + ], + "purl": "pkg:cargo/winapi-util@0.1.11", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/winapi-util" + }, + { + "type": "website", + "url": "https://github.com/BurntSushi/winapi-util" + }, + { + "type": "vcs", + "url": "https://github.com/BurntSushi/winapi-util" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-core@0.62.0", + "name": "windows-core", + "version": "0.62.0", + "description": "Core type support for COM and Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-core@0.62.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-implement@0.60.0", + "author": "Microsoft", + "name": "windows-implement", + "version": "0.60.0", + "description": "The implement macro for the windows crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-implement@0.60.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-interface@0.59.1", + "author": "Microsoft", + "name": "windows-interface", + "version": "0.59.1", + "description": "The interface macro for the windows crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-interface@0.59.1", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.1.3", + "author": "Microsoft", + "name": "windows-link", + "version": "0.1.3", + "description": "Linking for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-link@0.1.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0", + "name": "windows-link", + "version": "0.2.0", + "description": "Linking for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-link@0.2.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-result@0.4.0", + "name": "windows-result", + "version": "0.4.0", + "description": "Windows error handling", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-result@0.4.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-strings@0.5.0", + "name": "windows-strings", + "version": "0.5.0", + "description": "Windows string types", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-strings@0.5.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.52.0", + "author": "Microsoft", + "name": "windows-sys", + "version": "0.52.0", + "description": "Rust for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-sys@0.52.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.59.0", + "author": "Microsoft", + "name": "windows-sys", + "version": "0.59.0", + "description": "Rust for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-sys@0.59.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2", + "author": "Microsoft", + "name": "windows-sys", + "version": "0.60.2", + "description": "Rust for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-sys@0.60.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0", + "name": "windows-sys", + "version": "0.61.0", + "description": "Rust for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-sys@0.61.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.52.6", + "author": "Microsoft", + "name": "windows-targets", + "version": "0.52.6", + "description": "Import libs for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-targets@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.53.3", + "author": "Microsoft", + "name": "windows-targets", + "version": "0.53.3", + "description": "Import libs for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows-targets@0.53.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.52.6", + "author": "Microsoft", + "name": "windows_aarch64_gnullvm", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_aarch64_gnullvm@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.53.0", + "author": "Microsoft", + "name": "windows_aarch64_gnullvm", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_aarch64_gnullvm@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.52.6", + "author": "Microsoft", + "name": "windows_aarch64_msvc", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_aarch64_msvc@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.53.0", + "author": "Microsoft", + "name": "windows_aarch64_msvc", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_aarch64_msvc@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.52.6", + "author": "Microsoft", + "name": "windows_i686_gnu", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_gnu@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.53.0", + "author": "Microsoft", + "name": "windows_i686_gnu", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_gnu@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.52.6", + "author": "Microsoft", + "name": "windows_i686_gnullvm", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_gnullvm@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.53.0", + "author": "Microsoft", + "name": "windows_i686_gnullvm", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_gnullvm@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.52.6", + "author": "Microsoft", + "name": "windows_i686_msvc", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_msvc@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.53.0", + "author": "Microsoft", + "name": "windows_i686_msvc", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_i686_msvc@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.52.6", + "author": "Microsoft", + "name": "windows_x86_64_gnu", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_gnu@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.53.0", + "author": "Microsoft", + "name": "windows_x86_64_gnu", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_gnu@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.52.6", + "author": "Microsoft", + "name": "windows_x86_64_gnullvm", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_gnullvm@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.53.0", + "author": "Microsoft", + "name": "windows_x86_64_gnullvm", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_gnullvm@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.52.6", + "author": "Microsoft", + "name": "windows_x86_64_msvc", + "version": "0.52.6", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_msvc@0.52.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.53.0", + "author": "Microsoft", + "name": "windows_x86_64_msvc", + "version": "0.53.0", + "description": "Import lib for Windows", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/windows_x86_64_msvc@0.53.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/microsoft/windows-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#winnow@0.7.13", + "name": "winnow", + "version": "0.7.13", + "description": "A byte-oriented, zero-copy, parser combinators library", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/winnow@0.7.13", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/winnow-rs/winnow" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#winnow@1.0.0", + "name": "winnow", + "version": "1.0.0", + "description": "A byte-oriented, zero-copy, parser combinators library", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/winnow@1.0.0", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/winnow-rs/winnow" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-core@0.51.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-bindgen-core", + "version": "0.51.0", + "description": "Low-level support for bindings generation based on WIT files for use with `wit-bindgen-cli` and other languages. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-bindgen-core@0.51.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wit-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wit-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust-macro@0.51.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-bindgen-rust-macro", + "version": "0.51.0", + "description": "Procedural macro paired with the `wit-bindgen` crate. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-bindgen-rust-macro@0.51.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wit-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wit-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust@0.51.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-bindgen-rust", + "version": "0.51.0", + "description": "Rust bindings generator for WIT and the component model, typically used through the `wit-bindgen` crate's `generate!` macro. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-bindgen-rust@0.51.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wit-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wit-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.46.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-bindgen", + "version": "0.46.0", + "description": "Rust bindings generator and runtime support for WIT and the component model. Used when compiling Rust programs to the component model. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-bindgen@0.46.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wit-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wit-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.51.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-bindgen", + "version": "0.51.0", + "description": "Rust bindings generator and runtime support for WIT and the component model. Used when compiling Rust programs to the component model. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-bindgen@0.51.0", + "externalReferences": [ + { + "type": "website", + "url": "https://github.com/bytecodealliance/wit-bindgen" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wit-bindgen" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-component@0.244.0", + "author": "Peter Huene <peter@huene.dev>", + "name": "wit-component", + "version": "0.244.0", + "description": "Tooling for working with `*.wit` and component files together. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-component@0.244.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wit-component" + }, + { + "type": "website", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#wit-parser@0.244.0", + "author": "Alex Crichton <alex@alexcrichton.com>", + "name": "wit-parser", + "version": "0.244.0", + "description": "Tooling for parsing `*.wit` files and working with their contents. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" + } + ], + "licenses": [ + { + "expression": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/wit-parser@0.244.0", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/wit-parser" + }, + { + "type": "website", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser" + }, + { + "type": "vcs", + "url": "https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#writeable@0.6.2", + "author": "The ICU4X Project Developers", + "name": "writeable", + "version": "0.6.2", + "description": "A more efficient alternative to fmt::Display", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/writeable@0.6.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#yoke-derive@0.8.2", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "yoke-derive", + "version": "0.8.2", + "description": "Custom derive for the yoke crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/yoke-derive@0.8.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "yoke", + "version": "0.8.2", + "description": "Abstraction allowing borrowed data to be carried along with the backing data it borrows from", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/yoke@0.8.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerocopy-derive@0.8.27", + "author": "Joshua Liebow-Feeser <joshlf@google.com>, Jack Wrenn <jswrenn@amazon.com>", + "name": "zerocopy-derive", + "version": "0.8.27", + "description": "Custom derive for traits from the zerocopy crate", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" + } + ], + "licenses": [ + { + "expression": "BSD-2-Clause OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/zerocopy-derive@0.8.27", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/google/zerocopy" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerocopy@0.8.27", + "author": "Joshua Liebow-Feeser <joshlf@google.com>, Jack Wrenn <jswrenn@amazon.com>", + "name": "zerocopy", + "version": "0.8.27", + "description": "Zerocopy makes zero-cost memory manipulation effortless. We write \"unsafe\" so you don't have to.", + "scope": "excluded", + "hashes": [ + { + "alg": "SHA-256", + "content": "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" + } + ], + "licenses": [ + { + "expression": "BSD-2-Clause OR Apache-2.0 OR MIT" + } + ], + "purl": "pkg:cargo/zerocopy@0.8.27", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/google/zerocopy" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerofrom-derive@0.1.6", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "zerofrom-derive", + "version": "0.1.6", + "description": "Custom derive for the zerofrom crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/zerofrom-derive@0.1.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "zerofrom", + "version": "0.1.6", + "description": "ZeroFrom trait for constructing", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/zerofrom@0.1.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerotrie@0.2.4", + "author": "The ICU4X Project Developers", + "name": "zerotrie", + "version": "0.2.4", + "description": "A data structure that efficiently maps strings to integers", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/zerotrie@0.2.4", + "externalReferences": [ + { + "type": "website", + "url": "https://icu4x.unicode.org" + }, + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerovec-derive@0.11.3", + "author": "Manish Goregaokar <manishsmail@gmail.com>", + "name": "zerovec-derive", + "version": "0.11.3", + "description": "Custom derive for the zerovec crate", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/zerovec-derive@0.11.3", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6", + "author": "The ICU4X Project Developers", + "name": "zerovec", + "version": "0.11.6", + "description": "Zero-copy vector backed by a byte array", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" + } + ], + "licenses": [ + { + "expression": "Unicode-3.0" + } + ], + "purl": "pkg:cargo/zerovec@0.11.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/unicode-org/icu4x" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zip@0.6.6", + "author": "Mathijs van de Nes <git@mathijs.vd-nes.nl>, Marli Frost <marli@frost.red>, Ryan Levick <ryan.levick@gmail.com>", + "name": "zip", + "version": "0.6.6", + "description": "Library to support the reading and writing of zip files. ", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/zip@0.6.6", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/zip-rs/zip.git" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zmij@1.0.10", + "author": "David Tolnay <dtolnay@gmail.com>", + "name": "zmij", + "version": "1.0.10", + "description": "A double-to-string conversion algorithm based on Schubfach and yy", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "30e0d8dffbae3d840f64bda38e28391faef673a7b5a6017840f2a106c8145868" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/zmij@1.0.10", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/zmij" + }, + { + "type": "vcs", + "url": "https://github.com/dtolnay/zmij" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zstd-safe@5.0.2+zstd.1.5.2", + "author": "Alexandre Bury <alexandre.bury@gmail.com>", + "name": "zstd-safe", + "version": "5.0.2+zstd.1.5.2", + "description": "Safe low-level bindings for the zstd compression library.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/zstd-safe@5.0.2+zstd.1.5.2", + "externalReferences": [ + { + "type": "vcs", + "url": "https://github.com/gyscos/zstd-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zstd-sys@2.0.16+zstd.1.5.7", + "author": "Alexandre Bury <alexandre.bury@gmail.com>", + "name": "zstd-sys", + "version": "2.0.16+zstd.1.5.7", + "description": "Low-level bindings for the zstd compression library.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" + } + ], + "licenses": [ + { + "expression": "MIT OR Apache-2.0" + } + ], + "purl": "pkg:cargo/zstd-sys@2.0.16+zstd.1.5.7", + "externalReferences": [ + { + "type": "other", + "url": "zstd" + }, + { + "type": "vcs", + "url": "https://github.com/gyscos/zstd-rs" + } + ] + }, + { + "type": "library", + "bom-ref": "registry+https://github.com/rust-lang/crates.io-index#zstd@0.11.2+zstd.1.5.2", + "author": "Alexandre Bury <alexandre.bury@gmail.com>", + "name": "zstd", + "version": "0.11.2+zstd.1.5.2", + "description": "Binding for the zstd compression library.", + "scope": "required", + "hashes": [ + { + "alg": "SHA-256", + "content": "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" + } + ], + "licenses": [ + { + "expression": "MIT" + } + ], + "purl": "pkg:cargo/zstd@0.11.2+zstd.1.5.2", + "externalReferences": [ + { + "type": "documentation", + "url": "https://docs.rs/zstd" + }, + { + "type": "vcs", + "url": "https://github.com/gyscos/zstd-rs" + } + ] + } + ], + "dependencies": [ + { + "ref": "git+https://github.com/astral-sh/lsp-types.git?rev=e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c#lsp-types@0.95.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@1.3.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#serde_repr@0.1.20", + "registry+https://github.com/rust-lang/crates.io-index#url@2.5.8" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff#0.15.12", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#argfile@1.0.0", + "registry+https://github.com/rust-lang/crates.io-index#bincode@2.0.1", + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#cachedir@0.3.1", + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#clap_complete_command@0.6.1", + "registry+https://github.com/rust-lang/crates.io-index#clearscreen@4.0.6", + "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#filetime@0.2.27", + "registry+https://github.com/rust-lang/crates.io-index#globwalk@0.9.1", + "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#jiff@0.2.23", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#mimalloc@0.1.48", + "registry+https://github.com/rust-lang/crates.io-index#notify@8.2.0", + "registry+https://github.com/rust-lang/crates.io-index#path-absolutize@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#rayon@1.11.0", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_graph#0.1.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_markdown#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_options_metadata#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_server#0.2.2", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_workspace#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#shellexpand@3.1.2", + "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#tempfile@3.27.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#tikv-jemallocator@0.6.1", + "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0", + "registry+https://github.com/rust-lang/crates.io-index#wild@2.2.1" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_annotate_snippets#0.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#filetime@0.2.27", + "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3", + "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "registry+https://github.com/rust-lang/crates.io-index#seahash@4.1.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#arc-swap@1.9.1", + "registry+https://github.com/rust-lang/crates.io-index#camino@1.2.2", + "registry+https://github.com/rust-lang/crates.io-index#dashmap@6.1.0", + "registry+https://github.com/rust-lang/crates.io-index#dunce@1.0.5", + "registry+https://github.com/rust-lang/crates.io-index#etcetera@0.11.0", + "registry+https://github.com/rust-lang/crates.io-index#filetime@0.2.27", + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "registry+https://github.com/rust-lang/crates.io-index#matchit@0.9.2", + "registry+https://github.com/rust-lang/crates.io-index#path-slash@0.2.1", + "registry+https://github.com/rust-lang/crates.io-index#pathdiff@0.2.3", + "registry+https://github.com/rust-lang/crates.io-index#quick-junit@0.6.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_annotate_snippets#0.1.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_memory_usage#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#similar@3.1.0", + "registry+https://github.com/rust-lang/crates.io-index#supports-hyperlinks@3.2.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "registry+https://github.com/rust-lang/crates.io-index#tracing-subscriber@0.3.23", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_static#0.0.1", + "registry+https://github.com/rust-lang/crates.io-index#web-time@1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#which@8.0.2", + "registry+https://github.com/rust-lang/crates.io-index#zip@0.6.6" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_formatter#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#drop_bomb@0.1.5", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_graph#0.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#schemars@1.2.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_module_resolver#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_site_packages#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#zip@0.6.6" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_index#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#fern@0.7.1", + "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3", + "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.17.0", + "registry+https://github.com/rust-lang/crates.io-index#imperative@1.0.7", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#jiff@0.2.23", + "registry+https://github.com/rust-lang/crates.io-index#libcst@1.8.6", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#natord@1.0.9", + "registry+https://github.com/rust-lang/crates.io-index#path-absolutize@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "registry+https://github.com/rust-lang/crates.io-index#pyproject-toml@0.13.7", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_codegen#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_importer#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_index#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_literal#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_semantic#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#similar@3.1.0", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#typed-arena@2.0.2", + "registry+https://github.com/rust-lang/crates.io-index#unicode-normalization@0.1.24", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2", + "registry+https://github.com/rust-lang/crates.io-index#unicode_names2@1.3.0", + "registry+https://github.com/rust-lang/crates.io-index#url@2.5.8" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_markdown#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_workspace#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_memory_usage#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#rand@0.10.1", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#serde_with@3.18.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#uuid@1.23.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_options_metadata#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_codegen#0.0.0", + "dependsOn": [ + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_literal#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#countme@3.0.1", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_importer#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_codegen#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_index#0.0.0", + "dependsOn": [ + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_literal#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_properties@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1", + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24", + "registry+https://github.com/rust-lang/crates.io-index#unicode-normalization@0.1.24", + "registry+https://github.com/rust-lang/crates.io-index#unicode_names2@1.3.0" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_semantic#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_index#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_server#0.2.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam@0.8.4", + "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "registry+https://github.com/rust-lang/crates.io-index#jod-thread@1.0.0", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#lsp-server@0.7.9", + "git+https://github.com/astral-sh/lsp-types.git?rev=e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c#lsp-types@0.95.1", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_diagnostics#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_markdown#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_notebook#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_codegen#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_index#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_parser#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_workspace#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#shellexpand@3.1.2", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "registry+https://github.com/rust-lang/crates.io-index#tracing-log@0.2.0", + "registry+https://github.com/rust-lang/crates.io-index#tracing-subscriber@0.3.23" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_workspace#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#etcetera@0.11.0", + "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3", + "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#matchit@0.9.2", + "registry+https://github.com/rust-lang/crates.io-index#path-absolutize@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#path-slash@0.2.1", + "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_cache#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_graph#0.1.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_linter#0.15.12", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_options_metadata#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_formatter#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_semantic#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#shellexpand@3.1.2", + "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#unicode-normalization@0.1.24" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_module_resolver#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#camino@1.2.2", + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_memory_usage#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_stdlib#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_site_packages#0.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#camino@1.2.2", + "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_annotate_snippets#0.1.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_db#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_ast#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_python_trivia#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_source_file#0.0.0", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_text_size#0.0.0", + "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_static#0.0.1" + ] + }, + { + "ref": "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ty_static#0.0.1", + "dependsOn": [ + "path+file:///D:/bld/bld/rattler-build_ruff_1778119435/work/crates/ruff_macros#0.0.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#adler2@2.0.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#allocator-api2@0.2.21" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#android_system_properties@0.1.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#annotate-snippets@0.11.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anstream@1.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#anstyle-parse@1.0.0", + "registry+https://github.com/rust-lang/crates.io-index#anstyle-query@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#anstyle-wincon@3.0.10", + "registry+https://github.com/rust-lang/crates.io-index#colorchoice@1.0.4", + "registry+https://github.com/rust-lang/crates.io-index#is_terminal_polyfill@1.70.1", + "registry+https://github.com/rust-lang/crates.io-index#utf8parse@0.2.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-parse@1.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#utf8parse@0.2.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-query@1.1.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle-wincon@3.0.10", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#once_cell_polyfill@1.70.1", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#arc-swap@1.9.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#argfile@1.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#fs-err@3.3.0", + "registry+https://github.com/rust-lang/crates.io-index#os_str_bytes@7.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#attribute-derive-macro@0.10.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#collection_literals@1.0.2", + "registry+https://github.com/rust-lang/crates.io-index#interpolator@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#manyhow@0.11.4", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro-utils@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#quote-use@0.8.4", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#attribute-derive@0.10.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#attribute-derive-macro@0.10.3", + "registry+https://github.com/rust-lang/crates.io-index#derive-where@1.6.0", + "registry+https://github.com/rust-lang/crates.io-index#manyhow@0.11.4", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bincode@2.0.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bincode_derive@2.0.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#unty@0.0.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bincode_derive@2.0.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#virtue@0.0.18" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bitflags@1.3.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#boxcar@0.2.14" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#bumpalo@3.19.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#byteorder@1.5.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#cachedir@0.3.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#tempfile@3.27.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#camino@1.2.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#castaway@0.2.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#find-msvc-tools@0.1.2", + "registry+https://github.com/rust-lang/crates.io-index#jobserver@0.1.34", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#shlex@1.3.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#cfg_aliases@0.2.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#chacha20@0.10.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#cpufeatures@0.3.0", + "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.10.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#chrono@0.4.44", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone@0.1.64", + "registry+https://github.com/rust-lang/crates.io-index#num-traits@0.2.19", + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#clap_builder@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#clap_derive@4.6.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_builder@4.6.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anstream@1.0.0", + "registry+https://github.com/rust-lang/crates.io-index#anstyle@1.0.14", + "registry+https://github.com/rust-lang/crates.io-index#clap_lex@1.0.0", + "registry+https://github.com/rust-lang/crates.io-index#strsim@0.11.1", + "registry+https://github.com/rust-lang/crates.io-index#terminal_size@0.4.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete@4.5.58", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete_command@0.6.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#clap_complete@4.5.58", + "registry+https://github.com/rust-lang/crates.io-index#clap_complete_nushell@4.5.8" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_complete_nushell@4.5.8", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#clap@4.6.0", + "registry+https://github.com/rust-lang/crates.io-index#clap_complete@4.5.58" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_derive@4.6.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clap_lex@1.0.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#clearscreen@4.0.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#nix@0.31.2", + "registry+https://github.com/rust-lang/crates.io-index#terminfo@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#which@8.0.2", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#collection_literals@1.0.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#colorchoice@1.0.4" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#colored@3.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#castaway@0.2.4", + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#itoa@1.0.15", + "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22", + "registry+https://github.com/rust-lang/crates.io-index#ryu@1.0.20", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#core-foundation-sys@0.8.7" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#countme@3.0.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#cpufeatures@0.3.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crc32fast@1.5.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-channel@0.5.15", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-deque@0.8.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-epoch@0.9.18", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-epoch@0.9.18", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-queue@0.3.12", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#crossbeam@0.8.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-channel@0.5.15", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-deque@0.8.6", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-epoch@0.9.18", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-queue@0.3.12", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#darling@0.23.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#darling_core@0.23.0", + "registry+https://github.com/rust-lang/crates.io-index#darling_macro@0.23.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#darling_core@0.23.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#ident_case@1.0.1", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#strsim@0.11.1", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#darling_macro@0.23.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#darling_core@0.23.0", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#dashmap@6.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.14.5", + "registry+https://github.com/rust-lang/crates.io-index#lock_api@0.4.13", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#parking_lot_core@0.9.11" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#derive-where@1.6.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#dirs-sys@0.5.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#option-ext@0.2.0", + "registry+https://github.com/rust-lang/crates.io-index#redox_users@0.5.2", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#dirs@6.0.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#dirs-sys@0.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#drop_bomb@0.1.5" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#dunce@1.0.5" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#dyn-clone@1.0.20" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#either@1.15.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#equivalent@1.0.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#errno@0.3.14", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#etcetera@0.11.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#fastrand@2.3.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#fern@0.7.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#filetime@0.2.27", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#libredox@0.1.10" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#find-msvc-tools@0.1.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#flate2@1.1.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crc32fast@1.5.0", + "registry+https://github.com/rust-lang/crates.io-index#miniz_oxide@0.8.9" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#fnv@1.0.7" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#foldhash@0.1.5" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#form_urlencoded@1.2.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#percent-encoding@2.3.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#fs-err@3.3.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#fsevent-sys@4.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#get-size-derive2@0.8.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#attribute-derive@0.10.3", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#get-size2@0.8.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#get-size-derive2@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.17.0", + "registry+https://github.com/rust-lang/crates.io-index#ordermap@1.2.0", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#getopts@0.2.24", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.2.16", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#wasi@0.11.1+wasi-snapshot-preview1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.3.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#r-efi@5.3.0", + "registry+https://github.com/rust-lang/crates.io-index#wasip2@1.0.1+wasi-0.2.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.4.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#r-efi@6.0.0", + "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#wasip2@1.0.1+wasi-0.2.4", + "registry+https://github.com/rust-lang/crates.io-index#wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#globwalk@0.9.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.14.5" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.15.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#allocator-api2@0.2.21", + "registry+https://github.com/rust-lang/crates.io-index#equivalent@1.0.2", + "registry+https://github.com/rust-lang/crates.io-index#foldhash@0.1.5" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.17.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#equivalent@1.0.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#hashlink@0.10.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.15.5" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone-haiku@0.1.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone@0.1.64", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#android_system_properties@0.1.5", + "registry+https://github.com/rust-lang/crates.io-index#core-foundation-sys@0.8.7", + "registry+https://github.com/rust-lang/crates.io-index#iana-time-zone-haiku@0.1.2", + "registry+https://github.com/rust-lang/crates.io-index#js-sys@0.3.82", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105", + "registry+https://github.com/rust-lang/crates.io-index#windows-core@0.62.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_collections@2.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "registry+https://github.com/rust-lang/crates.io-index#potential_utf@0.1.3", + "registry+https://github.com/rust-lang/crates.io-index#utf8_iter@1.0.4", + "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_locale_core@2.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "registry+https://github.com/rust-lang/crates.io-index#litemap@0.8.0", + "registry+https://github.com/rust-lang/crates.io-index#tinystr@0.8.3", + "registry+https://github.com/rust-lang/crates.io-index#writeable@0.6.2", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer@2.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#icu_collections@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer_data@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_properties@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_provider@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer_data@2.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_properties@2.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#icu_collections@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_locale_core@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_properties_data@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_provider@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#zerotrie@0.2.4", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_properties_data@2.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#icu_provider@2.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "registry+https://github.com/rust-lang/crates.io-index#icu_locale_core@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#writeable@0.6.2", + "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6", + "registry+https://github.com/rust-lang/crates.io-index#zerotrie@0.2.4", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#id-arena@2.3.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ident_case@1.0.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#idna@1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#idna_adapter@1.2.1", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#utf8_iter@1.0.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#idna_adapter@1.2.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#icu_normalizer@2.2.0", + "registry+https://github.com/rust-lang/crates.io-index#icu_properties@2.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ignore@0.4.25", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-deque@0.8.6", + "registry+https://github.com/rust-lang/crates.io-index#globset@0.4.18", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "registry+https://github.com/rust-lang/crates.io-index#same-file@1.0.6", + "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0", + "registry+https://github.com/rust-lang/crates.io-index#winapi-util@0.1.11" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#imperative@1.0.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf@0.13.1", + "registry+https://github.com/rust-lang/crates.io-index#rust-stemmers@1.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#equivalent@1.0.2", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.17.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#inotify-sys@0.1.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#inotify@0.11.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#inotify-sys@0.1.5", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#interpolator@0.5.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#intrusive-collections@0.9.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memoffset@0.9.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#inventory@0.3.24", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#is-macro@0.3.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#is_terminal_polyfill@1.70.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#itertools@0.13.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#either@1.15.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#itertools@0.14.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#either@1.15.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#itoa@1.0.15" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-static@0.2.23", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb-platform@0.1.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb@0.1.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb@0.1.4" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jiff@0.2.23", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#jiff-static@0.2.23", + "registry+https://github.com/rust-lang/crates.io-index#jiff-tzdb-platform@0.1.3", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#portable-atomic@1.13.1", + "registry+https://github.com/rust-lang/crates.io-index#portable-atomic-util@0.2.4", + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jobserver@0.1.34", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.3.4", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#jod-thread@1.0.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#js-sys@0.3.82", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#kqueue-sys@1.0.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@1.3.2", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#kqueue@1.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#kqueue-sys@1.0.4", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#lazy_static@1.5.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#leb128fmt@0.1.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#libcst@1.8.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#annotate-snippets@0.11.5", + "registry+https://github.com/rust-lang/crates.io-index#libcst_derive@1.8.6", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#paste@1.0.15", + "registry+https://github.com/rust-lang/crates.io-index#peg@0.8.5", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#libcst_derive@1.8.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#libmimalloc-sys@0.1.44", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#libredox@0.1.10", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#redox_syscall@0.5.17" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#linux-raw-sys@0.12.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#litemap@0.8.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#lock_api@0.4.13", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0", + "registry+https://github.com/rust-lang/crates.io-index#scopeguard@1.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#lsp-server@0.7.9", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-channel@0.5.15", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#manyhow-macros@0.11.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro-utils@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#manyhow@0.11.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#manyhow-macros@0.11.4", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#matchers@0.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#matchit@0.9.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#memoffset@0.9.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#mimalloc@0.1.48", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libmimalloc-sys@0.1.44" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#minimal-lexical@0.2.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#miniz_oxide@0.8.9", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#adler2@2.0.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#mio@1.0.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#wasi@0.11.1+wasi-snapshot-preview1", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.59.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#natord@1.0.9" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#newtype-uuid@1.3.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#uuid@1.23.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#nix@0.31.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#cfg_aliases@0.2.1", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#nom@7.1.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#minimal-lexical@0.2.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#notify-types@2.0.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#notify@8.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#fsevent-sys@4.1.0", + "registry+https://github.com/rust-lang/crates.io-index#inotify@0.11.0", + "registry+https://github.com/rust-lang/crates.io-index#kqueue@1.1.1", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#mio@1.0.4", + "registry+https://github.com/rust-lang/crates.io-index#notify-types@2.0.0", + "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#nu-ansi-term@0.50.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.52.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#num-traits@0.2.19", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#autocfg@1.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#once_cell_polyfill@1.70.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#option-ext@0.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ordermap@1.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#os_str_bytes@7.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#parking_lot@0.12.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#lock_api@0.4.13", + "registry+https://github.com/rust-lang/crates.io-index#parking_lot_core@0.9.11" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#parking_lot_core@0.9.11", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#redox_syscall@0.5.17", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.52.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#paste@1.0.15" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#path-absolutize@3.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#path-dedot@3.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#path-dedot@3.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#path-slash@0.2.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pathdiff@0.2.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#peg-macros@0.8.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#peg-runtime@0.8.5", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#peg-runtime@0.8.5" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#peg@0.8.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#peg-macros@0.8.5", + "registry+https://github.com/rust-lang/crates.io-index#peg-runtime@0.8.5" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2", + "registry+https://github.com/rust-lang/crates.io-index#unscanny@0.1.0", + "registry+https://github.com/rust-lang/crates.io-index#version-ranges@0.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pep508_rs@0.9.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#boxcar@0.2.14", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#itertools@0.13.0", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@1.0.69", + "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2", + "registry+https://github.com/rust-lang/crates.io-index#url@2.5.8", + "registry+https://github.com/rust-lang/crates.io-index#urlencoding@2.1.3", + "registry+https://github.com/rust-lang/crates.io-index#version-ranges@0.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#percent-encoding@2.3.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf@0.11.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.11.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf@0.13.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.13.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf_codegen@0.11.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf_generator@0.11.3", + "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.11.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf_generator@0.11.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.11.3", + "registry+https://github.com/rust-lang/crates.io-index#rand@0.8.5" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.11.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#siphasher@1.0.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#phf_shared@0.13.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#siphasher@1.0.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pin-project-lite@0.2.16" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pkg-config@0.3.32" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#portable-atomic-util@0.2.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#portable-atomic@1.13.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#portable-atomic@1.13.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#potential_utf@0.1.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ppv-lite86@0.2.21", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#zerocopy@0.8.27" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#prettyplease@0.2.37", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#proc-macro-utils@0.10.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#pyproject-toml@0.13.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#pep440_rs@0.7.3", + "registry+https://github.com/rust-lang/crates.io-index#pep508_rs@0.9.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#toml@0.9.12+spec-1.1.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#quick-junit@0.6.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#chrono@0.4.44", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#newtype-uuid@1.3.2", + "registry+https://github.com/rust-lang/crates.io-index#quick-xml@0.38.4", + "registry+https://github.com/rust-lang/crates.io-index#strip-ansi-escapes@0.2.1", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "registry+https://github.com/rust-lang/crates.io-index#uuid@1.23.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#quick-xml@0.38.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#quote-use-macros@0.8.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro-utils@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#quote-use@0.8.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#quote-use-macros@0.8.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#r-efi@5.3.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#r-efi@6.0.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rand@0.10.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#chacha20@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.4.2", + "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.10.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rand@0.8.5", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#rand_chacha@0.3.1", + "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.6.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rand_chacha@0.3.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#ppv-lite86@0.2.21", + "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.6.4" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.10.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rand_core@0.6.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.2.16" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rayon-core@1.13.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-deque@0.8.6", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rayon@1.11.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#either@1.15.0", + "registry+https://github.com/rust-lang/crates.io-index#rayon-core@1.13.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#redox_syscall@0.5.17", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#redox_users@0.5.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.2.16", + "registry+https://github.com/rust-lang/crates.io-index#libredox@0.1.10", + "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ref-cast-impl@1.0.25", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ref-cast@1.0.25", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#ref-cast-impl@1.0.25" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#regex@1.12.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#aho-corasick@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "registry+https://github.com/rust-lang/crates.io-index#regex-syntax@0.8.10" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rust-stemmers@1.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rustix@1.1.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#errno@0.3.14", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#linux-raw-sys@0.12.1", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#ryu@1.0.20" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#salsa-macro-rules@0.26.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#salsa-macros@0.26.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#synstructure@0.13.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#salsa@0.26.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#boxcar@0.2.14", + "registry+https://github.com/rust-lang/crates.io-index#compact_str@0.9.0", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-queue@0.3.12", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.15.5", + "registry+https://github.com/rust-lang/crates.io-index#hashlink@0.10.0", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#intrusive-collections@0.9.7", + "registry+https://github.com/rust-lang/crates.io-index#inventory@0.3.24", + "registry+https://github.com/rust-lang/crates.io-index#parking_lot@0.12.4", + "registry+https://github.com/rust-lang/crates.io-index#portable-atomic@1.13.1", + "registry+https://github.com/rust-lang/crates.io-index#rustc-hash@2.1.2", + "registry+https://github.com/rust-lang/crates.io-index#salsa-macro-rules@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#salsa-macros@0.26.1", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#thin-vec@0.2.14", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#same-file@1.0.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#winapi-util@0.1.11" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#schemars@1.2.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#dyn-clone@1.0.20", + "registry+https://github.com/rust-lang/crates.io-index#ref-cast@1.0.25", + "registry+https://github.com/rust-lang/crates.io-index#schemars_derive@1.2.1", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#schemars_derive@1.2.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive_internals@0.29.1", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#scopeguard@1.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#seahash@4.1.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#semver@1.0.27" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_derive_internals@0.29.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#itoa@1.0.15", + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#zmij@1.0.10" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_repr@0.1.20", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_spanned@1.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_with@3.18.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_with_macros@3.18.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#serde_with_macros@3.18.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#darling@0.23.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#sharded-slab@0.1.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#lazy_static@1.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#shellexpand@3.1.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#dirs@6.0.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#shlex@1.3.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#similar@3.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bstr@1.12.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#siphasher@1.0.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#stable_deref_trait@1.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#static_assertions@1.1.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#strip-ansi-escapes@0.2.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#vte@0.14.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#strsim@0.11.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#strum@0.28.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#strum_macros@0.28.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#supports-hyperlinks@3.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#synstructure@0.13.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tempfile@3.27.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#fastrand@2.3.0", + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.4.2", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#rustix@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#terminal_size@0.4.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#rustix@1.1.4", + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#terminfo@0.9.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#fnv@1.0.7", + "registry+https://github.com/rust-lang/crates.io-index#nom@7.1.3", + "registry+https://github.com/rust-lang/crates.io-index#phf@0.11.3", + "registry+https://github.com/rust-lang/crates.io-index#phf_codegen@0.11.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thin-vec@0.2.14" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@1.0.69", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@2.0.18", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror@1.0.69", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@1.0.69" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thiserror@2.0.18", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#thiserror-impl@2.0.18" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#thread_local@1.1.9", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tikv-jemalloc-sys@0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38", + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tikv-jemallocator@0.6.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#tikv-jemalloc-sys@0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tinystr@0.8.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tinyvec@1.10.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#tinyvec_macros@0.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tinyvec_macros@0.1.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml@0.9.12+spec-1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_spanned@1.1.1", + "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@0.7.5+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#toml_parser@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#toml_writer@1.1.1+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#winnow@0.7.13" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml@1.1.2+spec-1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_spanned@1.1.1", + "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@1.1.1+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#toml_parser@1.1.2+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#toml_writer@1.1.1+spec-1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#winnow@1.0.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@0.7.5+spec-1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml_datetime@1.1.1+spec-1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#serde_core@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml_parser@1.1.2+spec-1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#winnow@1.0.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#toml_writer@1.1.1+spec-1.1.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-attributes@0.1.31", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-core@0.1.36", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#valuable@0.1.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-log@0.2.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#tracing-core@0.1.36" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tracing-subscriber@0.3.23", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#chrono@0.4.44", + "registry+https://github.com/rust-lang/crates.io-index#matchers@0.2.0", + "registry+https://github.com/rust-lang/crates.io-index#nu-ansi-term@0.50.1", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#regex-automata@0.4.14", + "registry+https://github.com/rust-lang/crates.io-index#sharded-slab@0.1.7", + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1", + "registry+https://github.com/rust-lang/crates.io-index#thread_local@1.1.9", + "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "registry+https://github.com/rust-lang/crates.io-index#tracing-core@0.1.36" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#tracing@0.1.44", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#pin-project-lite@0.2.16", + "registry+https://github.com/rust-lang/crates.io-index#tracing-attributes@0.1.31", + "registry+https://github.com/rust-lang/crates.io-index#tracing-core@0.1.36" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#typed-arena@2.0.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-normalization@0.1.24", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#tinyvec@1.10.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-width@0.2.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode-xid@0.2.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode_names2@1.3.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#phf@0.11.3", + "registry+https://github.com/rust-lang/crates.io-index#unicode_names2_generator@1.3.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unicode_names2_generator@1.3.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#getopts@0.2.24", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#phf_codegen@0.11.3", + "registry+https://github.com/rust-lang/crates.io-index#rand@0.8.5" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unscanny@0.1.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#unty@0.0.4" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#url@2.5.8", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#form_urlencoded@1.2.2", + "registry+https://github.com/rust-lang/crates.io-index#idna@1.1.0", + "registry+https://github.com/rust-lang/crates.io-index#percent-encoding@2.3.2", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#urlencoding@2.1.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#utf8_iter@1.0.4" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#utf8parse@0.2.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#uuid@1.23.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#getrandom@0.4.2", + "registry+https://github.com/rust-lang/crates.io-index#js-sys@0.3.82", + "registry+https://github.com/rust-lang/crates.io-index#rand@0.10.1", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#valuable@0.1.1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#version-ranges@0.1.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#virtue@0.0.18" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#vte@0.14.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#memchr@2.8.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#walkdir@2.5.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#same-file@1.0.6", + "registry+https://github.com/rust-lang/crates.io-index#winapi-util@0.1.11" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasi@0.11.1+wasi-snapshot-preview1" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasip2@1.0.1+wasi-0.2.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.46.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.51.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro-support@0.2.105", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bumpalo@3.19.0", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-shared@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro@0.2.105", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro-support@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-shared@0.2.105", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.24" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.3", + "registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3", + "registry+https://github.com/rust-lang/crates.io-index#rustversion@1.0.22", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-macro@0.2.105", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen-shared@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-encoder@0.244.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#leb128fmt@0.1.0", + "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasm-metadata@0.244.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#wasm-encoder@0.244.0", + "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#hashbrown@0.15.5", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#semver@1.0.27" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#web-time@1.1.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#js-sys@0.3.82", + "registry+https://github.com/rust-lang/crates.io-index#wasm-bindgen@0.2.105" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#which@8.0.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wild@2.2.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#glob@0.3.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#winapi-util@0.1.11", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-core@0.62.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-implement@0.60.0", + "registry+https://github.com/rust-lang/crates.io-index#windows-interface@0.59.1", + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0", + "registry+https://github.com/rust-lang/crates.io-index#windows-result@0.4.0", + "registry+https://github.com/rust-lang/crates.io-index#windows-strings@0.5.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-implement@0.60.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-interface@0.59.1", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.1.3" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-result@0.4.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-strings@0.5.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.52.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.52.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.59.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.52.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.60.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.53.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-sys@0.61.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.2.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.52.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.52.6", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.52.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows-targets@0.53.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#windows-link@0.1.3", + "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.53.0", + "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.53.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_gnullvm@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_aarch64_msvc@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnu@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_gnullvm@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_i686_msvc@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnu@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_gnullvm@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.52.6" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#windows_x86_64_msvc@0.53.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#winnow@0.7.13" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#winnow@1.0.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-core@0.51.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#wit-parser@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust-macro@0.51.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#prettyplease@0.2.37", + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-core@0.51.0", + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust@0.51.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust@0.51.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#heck@0.5.0", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#prettyplease@0.2.37", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#wasm-metadata@0.244.0", + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-core@0.51.0", + "registry+https://github.com/rust-lang/crates.io-index#wit-component@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.46.0" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen@0.51.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#wit-bindgen-rust-macro@0.51.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-component@0.244.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#bitflags@2.11.0", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#wasm-encoder@0.244.0", + "registry+https://github.com/rust-lang/crates.io-index#wasm-metadata@0.244.0", + "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0", + "registry+https://github.com/rust-lang/crates.io-index#wit-parser@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#wit-parser@0.244.0", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#anyhow@1.0.102", + "registry+https://github.com/rust-lang/crates.io-index#id-arena@2.3.0", + "registry+https://github.com/rust-lang/crates.io-index#indexmap@2.14.0", + "registry+https://github.com/rust-lang/crates.io-index#log@0.4.29", + "registry+https://github.com/rust-lang/crates.io-index#semver@1.0.27", + "registry+https://github.com/rust-lang/crates.io-index#serde@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_derive@1.0.228", + "registry+https://github.com/rust-lang/crates.io-index#serde_json@1.0.149", + "registry+https://github.com/rust-lang/crates.io-index#unicode-xid@0.2.6", + "registry+https://github.com/rust-lang/crates.io-index#wasmparser@0.244.0" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#writeable@0.6.2" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#yoke-derive@0.8.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#synstructure@0.13.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#stable_deref_trait@1.2.0", + "registry+https://github.com/rust-lang/crates.io-index#yoke-derive@0.8.2", + "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerocopy-derive@0.8.27", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerocopy@0.8.27", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#zerocopy-derive@0.8.27" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerofrom-derive@0.1.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117", + "registry+https://github.com/rust-lang/crates.io-index#synstructure@0.13.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#zerofrom-derive@0.1.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerotrie@0.2.4", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#displaydoc@0.2.5", + "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerovec-derive@0.11.3", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.106", + "registry+https://github.com/rust-lang/crates.io-index#quote@1.0.45", + "registry+https://github.com/rust-lang/crates.io-index#syn@2.0.117" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zerovec@0.11.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#yoke@0.8.2", + "registry+https://github.com/rust-lang/crates.io-index#zerofrom@0.1.6", + "registry+https://github.com/rust-lang/crates.io-index#zerovec-derive@0.11.3" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zip@0.6.6", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#byteorder@1.5.0", + "registry+https://github.com/rust-lang/crates.io-index#crc32fast@1.5.0", + "registry+https://github.com/rust-lang/crates.io-index#crossbeam-utils@0.8.21", + "registry+https://github.com/rust-lang/crates.io-index#flate2@1.1.2", + "registry+https://github.com/rust-lang/crates.io-index#zstd@0.11.2+zstd.1.5.2" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zmij@1.0.10" + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zstd-safe@5.0.2+zstd.1.5.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#libc@0.2.184", + "registry+https://github.com/rust-lang/crates.io-index#zstd-sys@2.0.16+zstd.1.5.7" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zstd-sys@2.0.16+zstd.1.5.7", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#cc@1.2.38", + "registry+https://github.com/rust-lang/crates.io-index#pkg-config@0.3.32" + ] + }, + { + "ref": "registry+https://github.com/rust-lang/crates.io-index#zstd@0.11.2+zstd.1.5.2", + "dependsOn": [ + "registry+https://github.com/rust-lang/crates.io-index#zstd-safe@5.0.2+zstd.1.5.2" + ] + } + ] +} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/ruff/__init__.py b/micromamba_root/Lib/site-packages/ruff/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07f41420d184b72aadd8e6bcffe67407e25eb2b7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff/__init__.py @@ -0,0 +1,5 @@ +from __future__ import annotations + +from ._find_ruff import find_ruff_bin + +__all__ = ["find_ruff_bin"] diff --git a/micromamba_root/Lib/site-packages/ruff/__main__.py b/micromamba_root/Lib/site-packages/ruff/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..875131923e2f69ed1f6288cbfa27cac5431fb605 --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff/__main__.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +import os +import sys + +from ruff import find_ruff_bin + + +def _run() -> None: + ruff = find_ruff_bin() + + if sys.platform == "win32": + import subprocess + + # Avoid emitting a traceback on interrupt + try: + completed_process = subprocess.run([ruff, *sys.argv[1:]]) + except KeyboardInterrupt: + sys.exit(2) + + sys.exit(completed_process.returncode) + else: + os.execvp(ruff, [ruff, *sys.argv[1:]]) + + +if __name__ == "__main__": + _run() diff --git a/micromamba_root/Lib/site-packages/ruff/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/ruff/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a09f94a3d5bee8c40345e05d8f0fb46317b2ce1e Binary files /dev/null and b/micromamba_root/Lib/site-packages/ruff/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/ruff/__pycache__/__main__.cpython-314.pyc b/micromamba_root/Lib/site-packages/ruff/__pycache__/__main__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db836f49261e7549f70baca48805c946e655f662 Binary files /dev/null and b/micromamba_root/Lib/site-packages/ruff/__pycache__/__main__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/ruff/__pycache__/_find_ruff.cpython-314.pyc b/micromamba_root/Lib/site-packages/ruff/__pycache__/_find_ruff.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11920ac6199de3a5c34125a2accf8f049485979b Binary files /dev/null and b/micromamba_root/Lib/site-packages/ruff/__pycache__/_find_ruff.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/ruff/_find_ruff.py b/micromamba_root/Lib/site-packages/ruff/_find_ruff.py new file mode 100644 index 0000000000000000000000000000000000000000..c0213bb23fde26b3dc2fdd0b28610018cc9086ed --- /dev/null +++ b/micromamba_root/Lib/site-packages/ruff/_find_ruff.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +import os +import sys +import sysconfig + + +class RuffNotFound(FileNotFoundError): ... + + +def find_ruff_bin() -> str: + """Return the ruff binary path.""" + + ruff_exe = "ruff" + sysconfig.get_config_var("EXE") + + targets = [ + # The scripts directory for the current Python + sysconfig.get_path("scripts"), + # The scripts directory for the base prefix + sysconfig.get_path("scripts", vars={"base": sys.base_prefix}), + # Above the package root, e.g., from `pip install --prefix` or `uv run --with` + ( + # On Windows, with module path `<prefix>/Lib/site-packages/ruff` + _join( + _matching_parents(_module_path(), "Lib/site-packages/ruff"), "Scripts" + ) + if sys.platform == "win32" + # On Unix, with module path `<prefix>/lib/python3.13/site-packages/ruff` + else _join( + _matching_parents(_module_path(), "lib/python*/site-packages/ruff"), + "bin", + ) + ), + # Adjacent to the package root, e.g., from `pip install --target` + # with module path `<target>/ruff` + _join(_matching_parents(_module_path(), "ruff"), "bin"), + # The user scheme scripts directory, e.g., `~/.local/bin` + sysconfig.get_path("scripts", scheme=_user_scheme()), + ] + + seen = [] + for target in targets: + if not target: + continue + if target in seen: + continue + seen.append(target) + path = os.path.join(target, ruff_exe) + if os.path.isfile(path): + return path + + locations = "\n".join(f" - {target}" for target in seen) + raise RuffNotFound( + f"Could not find the ruff binary in any of the following locations:\n{locations}\n" + ) + + +def _module_path() -> str | None: + path = os.path.dirname(__file__) + return path + + +def _matching_parents(path: str | None, match: str) -> str | None: + """ + Return the parent directory of `path` after trimming a `match` from the end. + The match is expected to contain `/` as a path separator, while the `path` + is expected to use the platform's path separator (e.g., `os.sep`). The path + components are compared case-insensitively and a `*` wildcard can be used + in the `match`. + """ + from fnmatch import fnmatch + + if not path: + return None + parts = path.split(os.sep) + match_parts = match.split("/") + if len(parts) < len(match_parts): + return None + + if not all( + fnmatch(part, match_part) + for part, match_part in zip(reversed(parts), reversed(match_parts)) + ): + return None + + return os.sep.join(parts[: -len(match_parts)]) + + +def _join(path: str | None, *parts: str) -> str | None: + if not path: + return None + return os.path.join(path, *parts) + + +def _user_scheme() -> str: + if sys.version_info >= (3, 10): + user_scheme = sysconfig.get_preferred_scheme("user") + elif os.name == "nt": + user_scheme = "nt_user" + elif sys.platform == "darwin" and sys._framework: # ty: ignore[unresolved-attribute] + user_scheme = "osx_framework_user" + else: + user_scheme = "posix_user" + return user_scheme diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..95602178538a12057132e1de1163f648fe382f87 --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/METADATA @@ -0,0 +1,52 @@ +Metadata-Version: 2.4 +Name: six +Version: 1.17.0 +Summary: Python 2 and 3 compatibility utilities +Home-page: https://github.com/benjaminp/six +Author: Benjamin Peterson +Author-email: benjamin@python.org +License: MIT +Classifier: Development Status :: 5 - Production/Stable +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.* +License-File: LICENSE +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: home-page +Dynamic: license +Dynamic: license-file +Dynamic: requires-python +Dynamic: summary + +.. image:: https://img.shields.io/pypi/v/six.svg + :target: https://pypi.org/project/six/ + :alt: six on PyPI + +.. image:: https://readthedocs.org/projects/six/badge/?version=latest + :target: https://six.readthedocs.io/ + :alt: six's documentation on Read the Docs + +.. image:: https://img.shields.io/badge/license-MIT-green.svg + :target: https://github.com/benjaminp/six/blob/master/LICENSE + :alt: MIT License badge + +Six is a Python 2 and 3 compatibility library. It provides utility functions +for smoothing over the differences between the Python versions with the goal of +writing Python code that is compatible on both Python versions. See the +documentation for more information on what is provided. + +Six supports Python 2.7 and 3.3+. It is contained in only one Python +file, so it can be easily copied into your project. (The copyright and license +notice must be retained.) + +Online documentation is at https://six.readthedocs.io/. + +Bugs can be reported to https://github.com/benjaminp/six. The code can also +be found there. diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..8343849aeeddffc45846398b56df696fd0457091 --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/RECORD @@ -0,0 +1,10 @@ +__pycache__/six.cpython-39.pyc,, +six-1.17.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +six-1.17.0.dist-info/METADATA,sha256=rGfSwtOMg_OOSSgkH8HU_9ehObiofc3--kMXivTywPU,1837 +six-1.17.0.dist-info/RECORD,, +six-1.17.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +six-1.17.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109 +six-1.17.0.dist-info/direct_url.json,sha256=mJWuajwujpKlqmTFMEQm3aIT3UlFcx1rr4_qCxKANdk,114 +six-1.17.0.dist-info/licenses/LICENSE,sha256=Q3W6IOK5xsTnytKUCmKP2Q6VzD1Q7pKq51VxXYuh-9A,1066 +six-1.17.0.dist-info/top_level.txt,sha256=_iVH_iYEtEXnD8nYGQYpYFUvkUW9sEO1GYbkeKSAais,4 +six.py,sha256=xRyR9wPT1LNpbJI8tf7CE-BeddkhU5O--sfy-mo5BN8,34703 diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..5f133dbb5cfac001f2e84cda817210c03ce6484e --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..1dd5e845e031b6248bfc7ca29aaba66b71218975 --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_six_1753199211/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1cc22a5aa7679ebaa10934212f356823931bdc3e --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/licenses/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2010-2024 Benjamin Peterson + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ffe2fce498955b628014618b28c6bcf152466a4a --- /dev/null +++ b/micromamba_root/Lib/site-packages/six-1.17.0.dist-info/top_level.txt @@ -0,0 +1 @@ +six diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/METADATA b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..f8ba90619486d70d2c33f8eba1a1cd718e6cc151 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/METADATA @@ -0,0 +1,265 @@ +Metadata-Version: 2.4 +Name: tomli +Version: 2.4.1 +Summary: A lil' TOML parser +Keywords: toml +Author-email: Taneli Hukkinen <hukkin@users.noreply.github.com> +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-Expression: MIT +Classifier: Operating System :: MacOS +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: POSIX :: Linux +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Typing :: Typed +License-File: LICENSE +Project-URL: Changelog, https://github.com/hukkin/tomli/blob/master/CHANGELOG.md +Project-URL: Homepage, https://github.com/hukkin/tomli + +[![Build Status](https://github.com/hukkin/tomli/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/hukkin/tomli/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush) +[![codecov.io](https://codecov.io/gh/hukkin/tomli/branch/master/graph/badge.svg)](https://codecov.io/gh/hukkin/tomli) +[![PyPI version](https://img.shields.io/pypi/v/tomli)](https://pypi.org/project/tomli) + +# Tomli + +> A lil' TOML parser + +**Table of Contents** *generated with [mdformat-toc](https://github.com/hukkin/mdformat-toc)* + +<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 --> + +- [Intro](#intro) +- [Installation](#installation) +- [Usage](#usage) + - [Parse a TOML string](#parse-a-toml-string) + - [Parse a TOML file](#parse-a-toml-file) + - [Handle invalid TOML](#handle-invalid-toml) + - [Construct `decimal.Decimal`s from TOML floats](#construct-decimaldecimals-from-toml-floats) + - [Building a `tomli`/`tomllib` compatibility layer](#building-a-tomlitomllib-compatibility-layer) +- [FAQ](#faq) + - [Why this parser?](#why-this-parser) + - [Is comment preserving round-trip parsing supported?](#is-comment-preserving-round-trip-parsing-supported) + - [Is there a `dumps`, `write` or `encode` function?](#is-there-a-dumps-write-or-encode-function) + - [How do TOML types map into Python types?](#how-do-toml-types-map-into-python-types) +- [Performance](#performance) + - [Mypyc generated wheel](#mypyc-generated-wheel) + - [Pure Python](#pure-python) + +<!-- mdformat-toc end --> + +## Intro<a name="intro"></a> + +Tomli is a Python library for parsing [TOML](https://toml.io). +Version 2.4.0 and later are compatible with [TOML v1.1.0](https://toml.io/en/v1.1.0). +Older versions are [TOML v1.0.0](https://toml.io/en/v1.0.0) compatible. + +A version of Tomli, the `tomllib` module, +was added to the standard library in Python 3.11 +via [PEP 680](https://www.python.org/dev/peps/pep-0680/). +Tomli continues to provide a backport on PyPI for Python versions +where the standard library module is not available +and that have not yet reached their end-of-life. + +Tomli uses [mypyc](https://github.com/mypyc/mypyc) +to generate binary wheels for most of the widely used platforms, +so Python 3.11+ users may prefer it over `tomllib` for improved performance. +Pure Python wheels are available on any platform and should perform the same as `tomllib`. + +## Installation<a name="installation"></a> + +```bash +pip install tomli +``` + +## Usage<a name="usage"></a> + +### Parse a TOML string<a name="parse-a-toml-string"></a> + +```python +import tomli + +toml_str = """ +[[players]] +name = "Lehtinen" +number = 26 + +[[players]] +name = "Numminen" +number = 27 +""" + +toml_dict = tomli.loads(toml_str) +assert toml_dict == { + "players": [{"name": "Lehtinen", "number": 26}, {"name": "Numminen", "number": 27}] +} +``` + +### Parse a TOML file<a name="parse-a-toml-file"></a> + +```python +import tomli + +with open("path_to_file/conf.toml", "rb") as f: + toml_dict = tomli.load(f) +``` + +The file must be opened in binary mode (with the `"rb"` flag). +Binary mode will enforce decoding the file as UTF-8 with universal newlines disabled, +both of which are required to correctly parse TOML. + +### Handle invalid TOML<a name="handle-invalid-toml"></a> + +```python +import tomli + +try: + toml_dict = tomli.loads("]] this is invalid TOML [[") +except tomli.TOMLDecodeError: + print("Yep, definitely not valid.") +``` + +Note that error messages are considered informational only. +They should not be assumed to stay constant across Tomli versions. + +### Construct `decimal.Decimal`s from TOML floats<a name="construct-decimaldecimals-from-toml-floats"></a> + +```python +from decimal import Decimal +import tomli + +toml_dict = tomli.loads("precision-matters = 0.982492", parse_float=Decimal) +assert isinstance(toml_dict["precision-matters"], Decimal) +assert toml_dict["precision-matters"] == Decimal("0.982492") +``` + +Note that `decimal.Decimal` can be replaced with another callable that converts a TOML float from string to a Python type. +The `decimal.Decimal` is, however, a practical choice for use cases where float inaccuracies can not be tolerated. + +Illegal types are `dict` and `list`, and their subtypes. +A `ValueError` will be raised if `parse_float` produces illegal types. + +### Building a `tomli`/`tomllib` compatibility layer<a name="building-a-tomlitomllib-compatibility-layer"></a> + +Python versions 3.11+ ship with a version of Tomli: +the `tomllib` standard library module. +To build code that uses the standard library if available, +but still works seamlessly with Python 3.6+, +do the following. + +Instead of a hard Tomli dependency, use the following +[dependency specifier](https://packaging.python.org/en/latest/specifications/dependency-specifiers/) +to only require Tomli when the standard library module is not available: + +``` +tomli >= 1.1.0 ; python_version < "3.11" +``` + +Then, in your code, import a TOML parser using the following fallback mechanism: + +```python +import sys + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + +tomllib.loads("['This parses fine with Python 3.6+']") +``` + +## FAQ<a name="faq"></a> + +### Why this parser?<a name="why-this-parser"></a> + +- it's lil' +- pure Python with zero dependencies +- the fastest pure Python parser [\*](#pure-python): + 14x as fast as [tomlkit](https://pypi.org/project/tomlkit/), + 2.1x as fast as [toml](https://pypi.org/project/toml/) +- outputs [basic data types](#how-do-toml-types-map-into-python-types) only +- 100% spec compliant: passes all tests in + [toml-lang/toml-test](https://github.com/toml-lang/toml-test) + test suite +- thoroughly tested: 100% branch coverage + +### Is comment preserving round-trip parsing supported?<a name="is-comment-preserving-round-trip-parsing-supported"></a> + +No. + +The `tomli.loads` function returns a plain `dict` that is populated with builtin types and types from the standard library only. +Preserving comments requires a custom type to be returned so will not be supported, +at least not by the `tomli.loads` and `tomli.load` functions. + +Look into [TOML Kit](https://github.com/sdispater/tomlkit) if preservation of style is what you need. + +### Is there a `dumps`, `write` or `encode` function?<a name="is-there-a-dumps-write-or-encode-function"></a> + +[Tomli-W](https://github.com/hukkin/tomli-w) is the write-only counterpart of Tomli, providing `dump` and `dumps` functions. + +The core library does not include write capability, as most TOML use cases are read-only, and Tomli intends to be minimal. + +### How do TOML types map into Python types?<a name="how-do-toml-types-map-into-python-types"></a> + +| TOML type | Python type | Details | +| ---------------- | ------------------- | ------------------------------------------------------------ | +| Document Root | `dict` | | +| Key | `str` | | +| String | `str` | | +| Integer | `int` | | +| Float | `float` | | +| Boolean | `bool` | | +| Offset Date-Time | `datetime.datetime` | `tzinfo` attribute set to an instance of `datetime.timezone` | +| Local Date-Time | `datetime.datetime` | `tzinfo` attribute set to `None` | +| Local Date | `datetime.date` | | +| Local Time | `datetime.time` | | +| Array | `list` | | +| Table | `dict` | | +| Inline Table | `dict` | | + +## Performance<a name="performance"></a> + +The `benchmark/` folder in this repository contains a performance benchmark for comparing the various Python TOML parsers. + +Below are the results for commit [064e492](https://github.com/hukkin/tomli/tree/064e492919b2338def788753b8c981c9131334c0). + +### Mypyc generated wheel<a name="mypyc-generated-wheel"></a> + +```console +foo@bar:~/dev/tomli$ python --version +Python 3.14.2 +foo@bar:~/dev/tomli$ pip freeze +pytomlpp==1.1.0 +rtoml==0.13.0 +toml==0.10.2 +tomli @ file:///home/foo/dev/tomli +tomlkit==0.13.3 +foo@bar:~/dev/tomli$ python benchmark/run.py +Parsing data.toml 5000 times: +------------------------------------------------------ + parser | exec time | performance (more is better) +-----------+------------+----------------------------- + rtoml | 0.328 s | baseline (100%) + pytomlpp | 0.365 s | 89.75% + tomli | 0.838 s | 39.12% + toml | 3.01 s | 10.90% + tomlkit | 20.7 s | 1.59% +``` + +### Pure Python<a name="pure-python"></a> + +```console +foo@bar:~/dev/tomli$ python benchmark/run.py +Parsing data.toml 5000 times: +------------------------------------------------------ + parser | exec time | performance (more is better) +-----------+------------+----------------------------- + rtoml | 0.323 s | baseline (100%) + pytomlpp | 0.365 s | 88.40% + tomli | 1.44 s | 22.36% + toml | 3.03 s | 10.65% + tomlkit | 20.6 s | 1.57% +``` + diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/RECORD b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..e57715b5518869d2fe4ccaf605136f1f060c6bd5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/RECORD @@ -0,0 +1,16 @@ +tomli-2.4.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +tomli-2.4.1.dist-info/METADATA,sha256=srP98lZrujExBqv0qAb5whf4-BRYfxAXxJTUkHmgpoM,10463 +tomli-2.4.1.dist-info/RECORD,, +tomli-2.4.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +tomli-2.4.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82 +tomli-2.4.1.dist-info/direct_url.json,sha256=MMzvQ9hTIkth8UmOgODUm1QFf75BQs4qquFa-bd1JYg,116 +tomli-2.4.1.dist-info/licenses/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072 +tomli/__init__.py,sha256=nrBC18DbXRTCFo7ElG5BDeWpHJzOhokvXk215GM8Z2I,314 +tomli/__pycache__/__init__.cpython-310.pyc,, +tomli/__pycache__/_parser.cpython-310.pyc,, +tomli/__pycache__/_re.cpython-310.pyc,, +tomli/__pycache__/_types.cpython-310.pyc,, +tomli/_parser.py,sha256=pBIjTIa_cQs2HglDJ2lh8OJfptfDa6eg5-7Iej4BjHs,26440 +tomli/_re.py,sha256=oSNZ_ilFI6chEuQ01YRSoUydBQr_okF_mSdHTkFmv90,3396 +tomli/_types.py,sha256=-GTG2VUqkpxwMqzmVO4F7ybKddIbAnuAHXfmWQcTi3Q,254 +tomli/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26 diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/WHEEL b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d8b9936dad9ab2513fa6979f411560d3b6b57e37 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.12.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..ab11d4483d77ce11ce1199f81fd8b7e9cc6664a9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_tomli_1774492402/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e859590f886cd78344206af1a8ccb3080d4385e0 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli-2.4.1.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Taneli Hukkinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/tomli/__init__.py b/micromamba_root/Lib/site-packages/tomli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ebe90013092f032a79946b153eea68ef9865b0f2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli/__init__.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021 Taneli Hukkinen +# Licensed to PSF under a Contributor Agreement. + +__all__ = ("loads", "load", "TOMLDecodeError") +__version__ = "2.4.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT + +from ._parser import TOMLDecodeError, load, loads diff --git a/micromamba_root/Lib/site-packages/tomli/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/tomli/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16ca55c49dbae9c2a87fffc9c12c26caa3048554 Binary files /dev/null and b/micromamba_root/Lib/site-packages/tomli/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/tomli/__pycache__/_parser.cpython-314.pyc b/micromamba_root/Lib/site-packages/tomli/__pycache__/_parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8401724f7a407ad50556255b403d0bc5bd423b09 Binary files /dev/null and b/micromamba_root/Lib/site-packages/tomli/__pycache__/_parser.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/tomli/__pycache__/_re.cpython-314.pyc b/micromamba_root/Lib/site-packages/tomli/__pycache__/_re.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9baa5cb563631747b7aa37868ef970ad0790667b Binary files /dev/null and b/micromamba_root/Lib/site-packages/tomli/__pycache__/_re.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/tomli/__pycache__/_types.cpython-314.pyc b/micromamba_root/Lib/site-packages/tomli/__pycache__/_types.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a9dc11ef3887b04480594c352ab2b56c58c67bd Binary files /dev/null and b/micromamba_root/Lib/site-packages/tomli/__pycache__/_types.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/tomli/_parser.py b/micromamba_root/Lib/site-packages/tomli/_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..41b06418805bdfe2b5fba390566aaa4d274f829e --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli/_parser.py @@ -0,0 +1,793 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021 Taneli Hukkinen +# Licensed to PSF under a Contributor Agreement. + +from __future__ import annotations + +import sys +from types import MappingProxyType + +from ._re import ( + RE_DATETIME, + RE_LOCALTIME, + RE_NUMBER, + match_to_datetime, + match_to_localtime, + match_to_number, +) + +TYPE_CHECKING = False +if TYPE_CHECKING: + from collections.abc import Iterable + from typing import IO, Any, Final + + from ._types import Key, ParseFloat, Pos + +# Inline tables/arrays are implemented using recursion. Pathologically +# nested documents cause pure Python to raise RecursionError (which is OK), +# but mypyc binary wheels will crash unrecoverably (not OK). According to +# mypyc docs this will be fixed in the future: +# https://mypyc.readthedocs.io/en/latest/differences_from_python.html#stack-overflows +# Before mypyc's fix is in, recursion needs to be limited by this library. +# Choosing `sys.getrecursionlimit()` as maximum inline table/array nesting +# level, as it allows more nesting than pure Python, but still seems a far +# lower number than where mypyc binaries crash. +MAX_INLINE_NESTING: Final = sys.getrecursionlimit() + +# Pathologically excessive number of parts in a key runs into quadratic +# behavior (e.g. in Flags.is_). +# Even if keys aren't currently parsed using recursion, they name a +# recursive structure, so it makes sense to limit it using getrecursionlimit() +# and RecursionError. +MAX_KEY_PARTS: Final = sys.getrecursionlimit() + +ASCII_CTRL: Final = frozenset(chr(i) for i in range(32)) | frozenset(chr(127)) + +# Neither of these sets include quotation mark or backslash. They are +# currently handled as separate cases in the parser functions. +ILLEGAL_BASIC_STR_CHARS: Final = ASCII_CTRL - frozenset("\t") +ILLEGAL_MULTILINE_BASIC_STR_CHARS: Final = ASCII_CTRL - frozenset("\t\n") + +ILLEGAL_LITERAL_STR_CHARS: Final = ILLEGAL_BASIC_STR_CHARS +ILLEGAL_MULTILINE_LITERAL_STR_CHARS: Final = ILLEGAL_MULTILINE_BASIC_STR_CHARS + +ILLEGAL_COMMENT_CHARS: Final = ILLEGAL_BASIC_STR_CHARS + +TOML_WS: Final = frozenset(" \t") +TOML_WS_AND_NEWLINE: Final = TOML_WS | frozenset("\n") +BARE_KEY_CHARS: Final = frozenset( + "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789" "-_" +) +KEY_INITIAL_CHARS: Final = BARE_KEY_CHARS | frozenset("\"'") +HEXDIGIT_CHARS: Final = frozenset("abcdef" "ABCDEF" "0123456789") + +BASIC_STR_ESCAPE_REPLACEMENTS: Final = MappingProxyType( + { + "\\b": "\u0008", # backspace + "\\t": "\u0009", # tab + "\\n": "\u000a", # linefeed + "\\f": "\u000c", # form feed + "\\r": "\u000d", # carriage return + "\\e": "\u001b", # escape + '\\"': "\u0022", # quote + "\\\\": "\u005c", # backslash + } +) + + +class DEPRECATED_DEFAULT: + """Sentinel to be used as default arg during deprecation + period of TOMLDecodeError's free-form arguments.""" + + +class TOMLDecodeError(ValueError): + """An error raised if a document is not valid TOML. + + Adds the following attributes to ValueError: + msg: The unformatted error message + doc: The TOML document being parsed + pos: The index of doc where parsing failed + lineno: The line corresponding to pos + colno: The column corresponding to pos + """ + + def __init__( + self, + msg: str | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, + doc: str | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, + pos: Pos | type[DEPRECATED_DEFAULT] = DEPRECATED_DEFAULT, + *args: Any, + ): + if ( + args + or not isinstance(msg, str) + or not isinstance(doc, str) + or not isinstance(pos, int) + ): + import warnings + + warnings.warn( + "Free-form arguments for TOMLDecodeError are deprecated. " + "Please set 'msg' (str), 'doc' (str) and 'pos' (int) arguments only.", + DeprecationWarning, + stacklevel=2, + ) + if pos is not DEPRECATED_DEFAULT: + args = pos, *args + if doc is not DEPRECATED_DEFAULT: + args = doc, *args + if msg is not DEPRECATED_DEFAULT: + args = msg, *args + ValueError.__init__(self, *args) + return + + lineno = doc.count("\n", 0, pos) + 1 + if lineno == 1: + colno = pos + 1 + else: + colno = pos - doc.rindex("\n", 0, pos) + + if pos >= len(doc): + coord_repr = "end of document" + else: + coord_repr = f"line {lineno}, column {colno}" + errmsg = f"{msg} (at {coord_repr})" + ValueError.__init__(self, errmsg) + + self.msg = msg + self.doc = doc + self.pos = pos + self.lineno = lineno + self.colno = colno + + +def load(__fp: IO[bytes], *, parse_float: ParseFloat = float) -> dict[str, Any]: + """Parse TOML from a binary file object.""" + b = __fp.read() + try: + s = b.decode() + except AttributeError: + raise TypeError( + "File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`" + ) from None + return loads(s, parse_float=parse_float) + + +def loads(__s: str, *, parse_float: ParseFloat = float) -> dict[str, Any]: + """Parse TOML from a string.""" + + # The spec allows converting "\r\n" to "\n", even in string + # literals. Let's do so to simplify parsing. + try: + src = __s.replace("\r\n", "\n") + except (AttributeError, TypeError): + raise TypeError( + f"Expected str object, not '{type(__s).__qualname__}'" + ) from None + pos = 0 + out = Output() + header: Key = () + parse_float = make_safe_parse_float(parse_float) + + # Parse one statement at a time + # (typically means one line in TOML source) + while True: + # 1. Skip line leading whitespace + pos = skip_chars(src, pos, TOML_WS) + + # 2. Parse rules. Expect one of the following: + # - end of file + # - end of line + # - comment + # - key/value pair + # - append dict to list (and move to its namespace) + # - create dict (and move to its namespace) + # Skip trailing whitespace when applicable. + try: + char = src[pos] + except IndexError: + break + if char == "\n": + pos += 1 + continue + if char in KEY_INITIAL_CHARS: + pos = key_value_rule(src, pos, out, header, parse_float) + pos = skip_chars(src, pos, TOML_WS) + elif char == "[": + try: + second_char: str | None = src[pos + 1] + except IndexError: + second_char = None + out.flags.finalize_pending() + if second_char == "[": + pos, header = create_list_rule(src, pos, out) + else: + pos, header = create_dict_rule(src, pos, out) + pos = skip_chars(src, pos, TOML_WS) + elif char != "#": + raise TOMLDecodeError("Invalid statement", src, pos) + + # 3. Skip comment + pos = skip_comment(src, pos) + + # 4. Expect end of line or end of file + try: + char = src[pos] + except IndexError: + break + if char != "\n": + raise TOMLDecodeError( + "Expected newline or end of document after a statement", src, pos + ) + pos += 1 + + return out.data.dict + + +class Flags: + """Flags that map to parsed keys/namespaces.""" + + # Marks an immutable namespace (inline array or inline table). + FROZEN: Final = 0 + # Marks a nest that has been explicitly created and can no longer + # be opened using the "[table]" syntax. + EXPLICIT_NEST: Final = 1 + + def __init__(self) -> None: + self._flags: dict[str, dict[Any, Any]] = {} + self._pending_flags: set[tuple[Key, int]] = set() + + def add_pending(self, key: Key, flag: int) -> None: + self._pending_flags.add((key, flag)) + + def finalize_pending(self) -> None: + for key, flag in self._pending_flags: + self.set(key, flag, recursive=False) + self._pending_flags.clear() + + def unset_all(self, key: Key) -> None: + cont = self._flags + for k in key[:-1]: + if k not in cont: + return + cont = cont[k]["nested"] + cont.pop(key[-1], None) + + def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003 + cont = self._flags + key_parent, key_stem = key[:-1], key[-1] + for k in key_parent: + if k not in cont: + cont[k] = {"flags": set(), "recursive_flags": set(), "nested": {}} + cont = cont[k]["nested"] + if key_stem not in cont: + cont[key_stem] = {"flags": set(), "recursive_flags": set(), "nested": {}} + cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag) + + def is_(self, key: Key, flag: int) -> bool: + if not key: + return False # document root has no flags + cont = self._flags + for k in key[:-1]: + if k not in cont: + return False + inner_cont = cont[k] + if flag in inner_cont["recursive_flags"]: + return True + cont = inner_cont["nested"] + key_stem = key[-1] + if key_stem in cont: + inner_cont = cont[key_stem] + return flag in inner_cont["flags"] or flag in inner_cont["recursive_flags"] + return False + + +class NestedDict: + def __init__(self) -> None: + # The parsed content of the TOML document + self.dict: dict[str, Any] = {} + + def get_or_create_nest( + self, + key: Key, + *, + access_lists: bool = True, + ) -> dict[str, Any]: + cont: Any = self.dict + for k in key: + if k not in cont: + cont[k] = {} + cont = cont[k] + if access_lists and isinstance(cont, list): + cont = cont[-1] + if not isinstance(cont, dict): + raise KeyError("There is no nest behind this key") + return cont # type: ignore[no-any-return] + + def append_nest_to_list(self, key: Key) -> None: + cont = self.get_or_create_nest(key[:-1]) + last_key = key[-1] + if last_key in cont: + list_ = cont[last_key] + if not isinstance(list_, list): + raise KeyError("An object other than list found behind this key") + list_.append({}) + else: + cont[last_key] = [{}] + + +class Output: + def __init__(self) -> None: + self.data = NestedDict() + self.flags = Flags() + + +def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos: + try: + while src[pos] in chars: + pos += 1 + except IndexError: + pass + return pos + + +def skip_until( + src: str, + pos: Pos, + expect: str, + *, + error_on: frozenset[str], + error_on_eof: bool, +) -> Pos: + try: + new_pos = src.index(expect, pos) + except ValueError: + new_pos = len(src) + if error_on_eof: + raise TOMLDecodeError(f"Expected {expect!r}", src, new_pos) from None + + if not error_on.isdisjoint(src[pos:new_pos]): + while src[pos] not in error_on: + pos += 1 + raise TOMLDecodeError(f"Found invalid character {src[pos]!r}", src, pos) + return new_pos + + +def skip_comment(src: str, pos: Pos) -> Pos: + try: + char: str | None = src[pos] + except IndexError: + char = None + if char == "#": + return skip_until( + src, pos + 1, "\n", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False + ) + return pos + + +def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos: + while True: + pos_before_skip = pos + pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) + pos = skip_comment(src, pos) + if pos == pos_before_skip: + return pos + + +def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: + pos += 1 # Skip "[" + pos = skip_chars(src, pos, TOML_WS) + pos, key = parse_key(src, pos) + + if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN): + raise TOMLDecodeError(f"Cannot declare {key} twice", src, pos) + out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) + try: + out.data.get_or_create_nest(key) + except KeyError: + raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None + + if not src.startswith("]", pos): + raise TOMLDecodeError( + "Expected ']' at the end of a table declaration", src, pos + ) + return pos + 1, key + + +def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: + pos += 2 # Skip "[[" + pos = skip_chars(src, pos, TOML_WS) + pos, key = parse_key(src, pos) + + if out.flags.is_(key, Flags.FROZEN): + raise TOMLDecodeError(f"Cannot mutate immutable namespace {key}", src, pos) + # Free the namespace now that it points to another empty list item... + out.flags.unset_all(key) + # ...but this key precisely is still prohibited from table declaration + out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) + try: + out.data.append_nest_to_list(key) + except KeyError: + raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None + + if not src.startswith("]]", pos): + raise TOMLDecodeError( + "Expected ']]' at the end of an array declaration", src, pos + ) + return pos + 2, key + + +def key_value_rule( + src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat +) -> Pos: + pos, key, value = parse_key_value_pair(src, pos, parse_float, nest_lvl=0) + key_parent, key_stem = key[:-1], key[-1] + abs_key_parent = header + key_parent + + relative_path_cont_keys = (header + key[:i] for i in range(1, len(key))) + for cont_key in relative_path_cont_keys: + # Check that dotted key syntax does not redefine an existing table + if out.flags.is_(cont_key, Flags.EXPLICIT_NEST): + raise TOMLDecodeError(f"Cannot redefine namespace {cont_key}", src, pos) + # Containers in the relative path can't be opened with the table syntax or + # dotted key/value syntax in following table sections. + out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST) + + if out.flags.is_(abs_key_parent, Flags.FROZEN): + raise TOMLDecodeError( + f"Cannot mutate immutable namespace {abs_key_parent}", src, pos + ) + + try: + nest = out.data.get_or_create_nest(abs_key_parent) + except KeyError: + raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None + if key_stem in nest: + raise TOMLDecodeError("Cannot overwrite a value", src, pos) + # Mark inline table and array namespaces recursively immutable + if isinstance(value, (dict, list)): + out.flags.set(header + key, Flags.FROZEN, recursive=True) + nest[key_stem] = value + return pos + + +def parse_key_value_pair( + src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int +) -> tuple[Pos, Key, Any]: + pos, key = parse_key(src, pos) + try: + char: str | None = src[pos] + except IndexError: + char = None + if char != "=": + raise TOMLDecodeError("Expected '=' after a key in a key/value pair", src, pos) + pos += 1 + pos = skip_chars(src, pos, TOML_WS) + pos, value = parse_value(src, pos, parse_float, nest_lvl) + return pos, key, value + + +def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]: + pos, key_part = parse_key_part(src, pos) + key: Key = (key_part,) + pos = skip_chars(src, pos, TOML_WS) + while True: + try: + char: str | None = src[pos] + except IndexError: + char = None + if char != ".": + return pos, key + pos += 1 + pos = skip_chars(src, pos, TOML_WS) + pos, key_part = parse_key_part(src, pos) + key += (key_part,) + if len(key) > MAX_KEY_PARTS: + raise RecursionError( + f"TOML key has more than the allowed {MAX_KEY_PARTS} parts" + ) + pos = skip_chars(src, pos, TOML_WS) + + +def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]: + try: + char: str | None = src[pos] + except IndexError: + char = None + if char in BARE_KEY_CHARS: + start_pos = pos + pos = skip_chars(src, pos, BARE_KEY_CHARS) + return pos, src[start_pos:pos] + if char == "'": + return parse_literal_str(src, pos) + if char == '"': + return parse_one_line_basic_str(src, pos) + raise TOMLDecodeError("Invalid initial character for a key part", src, pos) + + +def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]: + pos += 1 + return parse_basic_str(src, pos, multiline=False) + + +def parse_array( + src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int +) -> tuple[Pos, list[Any]]: + pos += 1 + array: list[Any] = [] + + pos = skip_comments_and_array_ws(src, pos) + if src.startswith("]", pos): + return pos + 1, array + while True: + pos, val = parse_value(src, pos, parse_float, nest_lvl) + array.append(val) + pos = skip_comments_and_array_ws(src, pos) + + c = src[pos : pos + 1] + if c == "]": + return pos + 1, array + if c != ",": + raise TOMLDecodeError("Unclosed array", src, pos) + pos += 1 + + pos = skip_comments_and_array_ws(src, pos) + if src.startswith("]", pos): + return pos + 1, array + + +def parse_inline_table( + src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int +) -> tuple[Pos, dict[str, Any]]: + pos += 1 + nested_dict = NestedDict() + flags = Flags() + + pos = skip_comments_and_array_ws(src, pos) + if src.startswith("}", pos): + return pos + 1, nested_dict.dict + while True: + pos, key, value = parse_key_value_pair(src, pos, parse_float, nest_lvl) + key_parent, key_stem = key[:-1], key[-1] + if flags.is_(key, Flags.FROZEN): + raise TOMLDecodeError(f"Cannot mutate immutable namespace {key}", src, pos) + try: + nest = nested_dict.get_or_create_nest(key_parent, access_lists=False) + except KeyError: + raise TOMLDecodeError("Cannot overwrite a value", src, pos) from None + if key_stem in nest: + raise TOMLDecodeError(f"Duplicate inline table key {key_stem!r}", src, pos) + nest[key_stem] = value + pos = skip_comments_and_array_ws(src, pos) + c = src[pos : pos + 1] + if c == "}": + return pos + 1, nested_dict.dict + if c != ",": + raise TOMLDecodeError("Unclosed inline table", src, pos) + pos += 1 + pos = skip_comments_and_array_ws(src, pos) + if src.startswith("}", pos): + return pos + 1, nested_dict.dict + if isinstance(value, (dict, list)): + flags.set(key, Flags.FROZEN, recursive=True) + + +def parse_basic_str_escape( + src: str, pos: Pos, *, multiline: bool = False +) -> tuple[Pos, str]: + escape_id = src[pos : pos + 2] + pos += 2 + if multiline and escape_id in {"\\ ", "\\\t", "\\\n"}: + # Skip whitespace until next non-whitespace character or end of + # the doc. Error if non-whitespace is found before newline. + if escape_id != "\\\n": + pos = skip_chars(src, pos, TOML_WS) + try: + char = src[pos] + except IndexError: + return pos, "" + if char != "\n": + raise TOMLDecodeError("Unescaped '\\' in a string", src, pos) + pos += 1 + pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) + return pos, "" + if escape_id == "\\x": + return parse_hex_char(src, pos, 2) + if escape_id == "\\u": + return parse_hex_char(src, pos, 4) + if escape_id == "\\U": + return parse_hex_char(src, pos, 8) + try: + return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id] + except KeyError: + raise TOMLDecodeError("Unescaped '\\' in a string", src, pos) from None + + +def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]: + return parse_basic_str_escape(src, pos, multiline=True) + + +def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]: + hex_str = src[pos : pos + hex_len] + if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str): + raise TOMLDecodeError("Invalid hex value", src, pos) + pos += hex_len + hex_int = int(hex_str, 16) + if not is_unicode_scalar_value(hex_int): + raise TOMLDecodeError( + "Escaped character is not a Unicode scalar value", src, pos + ) + return pos, chr(hex_int) + + +def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]: + pos += 1 # Skip starting apostrophe + start_pos = pos + pos = skip_until( + src, pos, "'", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True + ) + return pos + 1, src[start_pos:pos] # Skip ending apostrophe + + +def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]: + pos += 3 + if src.startswith("\n", pos): + pos += 1 + + if literal: + delim = "'" + end_pos = skip_until( + src, + pos, + "'''", + error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS, + error_on_eof=True, + ) + result = src[pos:end_pos] + pos = end_pos + 3 + else: + delim = '"' + pos, result = parse_basic_str(src, pos, multiline=True) + + # Add at maximum two extra apostrophes/quotes if the end sequence + # is 4 or 5 chars long instead of just 3. + if not src.startswith(delim, pos): + return pos, result + pos += 1 + if not src.startswith(delim, pos): + return pos, result + delim + pos += 1 + return pos, result + (delim * 2) + + +def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]: + if multiline: + error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS + parse_escapes = parse_basic_str_escape_multiline + else: + error_on = ILLEGAL_BASIC_STR_CHARS + parse_escapes = parse_basic_str_escape + result = "" + start_pos = pos + while True: + try: + char = src[pos] + except IndexError: + raise TOMLDecodeError("Unterminated string", src, pos) from None + if char == '"': + if not multiline: + return pos + 1, result + src[start_pos:pos] + if src.startswith('"""', pos): + return pos + 3, result + src[start_pos:pos] + pos += 1 + continue + if char == "\\": + result += src[start_pos:pos] + pos, parsed_escape = parse_escapes(src, pos) + result += parsed_escape + start_pos = pos + continue + if char in error_on: + raise TOMLDecodeError(f"Illegal character {char!r}", src, pos) + pos += 1 + + +def parse_value( + src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int +) -> tuple[Pos, Any]: + if nest_lvl > MAX_INLINE_NESTING: + # Pure Python should have raised RecursionError already. + # This ensures mypyc binaries eventually do the same. + raise RecursionError( # pragma: no cover + "TOML inline arrays/tables are nested more than the allowed" + f" {MAX_INLINE_NESTING} levels" + ) + + try: + char: str | None = src[pos] + except IndexError: + char = None + + # IMPORTANT: order conditions based on speed of checking and likelihood + + # Basic strings + if char == '"': + if src.startswith('"""', pos): + return parse_multiline_str(src, pos, literal=False) + return parse_one_line_basic_str(src, pos) + + # Literal strings + if char == "'": + if src.startswith("'''", pos): + return parse_multiline_str(src, pos, literal=True) + return parse_literal_str(src, pos) + + # Booleans + if char == "t": + if src.startswith("true", pos): + return pos + 4, True + if char == "f": + if src.startswith("false", pos): + return pos + 5, False + + # Arrays + if char == "[": + return parse_array(src, pos, parse_float, nest_lvl + 1) + + # Inline tables + if char == "{": + return parse_inline_table(src, pos, parse_float, nest_lvl + 1) + + # Dates and times + datetime_match = RE_DATETIME.match(src, pos) + if datetime_match: + try: + datetime_obj = match_to_datetime(datetime_match) + except ValueError as e: + raise TOMLDecodeError("Invalid date or datetime", src, pos) from e + return datetime_match.end(), datetime_obj + localtime_match = RE_LOCALTIME.match(src, pos) + if localtime_match: + return localtime_match.end(), match_to_localtime(localtime_match) + + # Integers and "normal" floats. + # The regex will greedily match any type starting with a decimal + # char, so needs to be located after handling of dates and times. + number_match = RE_NUMBER.match(src, pos) + if number_match: + return number_match.end(), match_to_number(number_match, parse_float) + + # Special floats + first_three = src[pos : pos + 3] + if first_three in {"inf", "nan"}: + return pos + 3, parse_float(first_three) + first_four = src[pos : pos + 4] + if first_four in {"-inf", "+inf", "-nan", "+nan"}: + return pos + 4, parse_float(first_four) + + raise TOMLDecodeError("Invalid value", src, pos) + + +def is_unicode_scalar_value(codepoint: int) -> bool: + return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111) + + +def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat: + """A decorator to make `parse_float` safe. + + `parse_float` must not return dicts or lists, because these types + would be mixed with parsed TOML tables and arrays, thus confusing + the parser. The returned decorated callable raises `ValueError` + instead of returning illegal types. + """ + # The default `float` callable never returns illegal types. Optimize it. + if parse_float is float: + return float + + def safe_parse_float(float_str: str) -> Any: + float_value = parse_float(float_str) + if isinstance(float_value, (dict, list)): + raise ValueError("parse_float must not return dicts or lists") + return float_value + + return safe_parse_float diff --git a/micromamba_root/Lib/site-packages/tomli/_re.py b/micromamba_root/Lib/site-packages/tomli/_re.py new file mode 100644 index 0000000000000000000000000000000000000000..fc374ed63d3e3742a97134349fc25b14223ab57b --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli/_re.py @@ -0,0 +1,119 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021 Taneli Hukkinen +# Licensed to PSF under a Contributor Agreement. + +from __future__ import annotations + +from datetime import date, datetime, time, timedelta, timezone, tzinfo +from functools import lru_cache +import re + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Any, Final + + from ._types import ParseFloat + +_TIME_RE_STR: Final = r""" +([01][0-9]|2[0-3]) # hours +:([0-5][0-9]) # minutes +(?: + :([0-5][0-9]) # optional seconds + (?:\.([0-9]{1,6})[0-9]*)? # optional fractions of a second +)? +""" + +RE_NUMBER: Final = re.compile( + r""" +0 +(?: + x[0-9A-Fa-f](?:_?[0-9A-Fa-f])* # hex + | + b[01](?:_?[01])* # bin + | + o[0-7](?:_?[0-7])* # oct +) +| +[+-]?(?:0|[1-9](?:_?[0-9])*) # dec, integer part +(?P<floatpart> + (?:\.[0-9](?:_?[0-9])*)? # optional fractional part + (?:[eE][+-]?[0-9](?:_?[0-9])*)? # optional exponent part +) +""", + flags=re.VERBOSE, +) +RE_LOCALTIME: Final = re.compile(_TIME_RE_STR, flags=re.VERBOSE) +RE_DATETIME: Final = re.compile( + rf""" +([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27 +(?: + [Tt ] + {_TIME_RE_STR} + (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset +)? +""", + flags=re.VERBOSE, +) + + +def match_to_datetime(match: re.Match[str]) -> datetime | date: + """Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. + + Raises ValueError if the match does not correspond to a valid date + or datetime. + """ + ( + year_str, + month_str, + day_str, + hour_str, + minute_str, + sec_str, + micros_str, + zulu_time, + offset_sign_str, + offset_hour_str, + offset_minute_str, + ) = match.groups() + year, month, day = int(year_str), int(month_str), int(day_str) + if hour_str is None: + return date(year, month, day) + hour, minute = int(hour_str), int(minute_str) + sec = int(sec_str) if sec_str else 0 + micros = int(micros_str.ljust(6, "0")) if micros_str else 0 + if offset_sign_str: + tz: tzinfo | None = cached_tz( + offset_hour_str, offset_minute_str, offset_sign_str + ) + elif zulu_time: + tz = timezone.utc + else: # local date-time + tz = None + return datetime(year, month, day, hour, minute, sec, micros, tzinfo=tz) + + +# No need to limit cache size. This is only ever called on input +# that matched RE_DATETIME, so there is an implicit bound of +# 24 (hours) * 60 (minutes) * 2 (offset direction) = 2880. +@lru_cache(maxsize=None) +def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone: + sign = 1 if sign_str == "+" else -1 + return timezone( + timedelta( + hours=sign * int(hour_str), + minutes=sign * int(minute_str), + ) + ) + + +def match_to_localtime(match: re.Match[str]) -> time: + hour_str, minute_str, sec_str, micros_str = match.groups() + sec = int(sec_str) if sec_str else 0 + micros = int(micros_str.ljust(6, "0")) if micros_str else 0 + return time(int(hour_str), int(minute_str), sec, micros) + + +def match_to_number(match: re.Match[str], parse_float: ParseFloat) -> Any: + if match.group("floatpart"): + return parse_float(match.group()) + return int(match.group(), 0) diff --git a/micromamba_root/Lib/site-packages/tomli/_types.py b/micromamba_root/Lib/site-packages/tomli/_types.py new file mode 100644 index 0000000000000000000000000000000000000000..d949412e03b29d70592c7721fe747e5085c2e280 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli/_types.py @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2021 Taneli Hukkinen +# Licensed to PSF under a Contributor Agreement. + +from typing import Any, Callable, Tuple + +# Type annotations +ParseFloat = Callable[[str], Any] +Key = Tuple[str, ...] +Pos = int diff --git a/micromamba_root/Lib/site-packages/tomli/py.typed b/micromamba_root/Lib/site-packages/tomli/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..7632ecf77545c5e5501cb3fc5719df0761104ca2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/tomli/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..b09cb50e1f9a42a8eb58a4339cbdb26250368375 --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/METADATA @@ -0,0 +1,72 @@ +Metadata-Version: 2.4 +Name: typing_extensions +Version: 4.15.0 +Summary: Backported and Experimental Type Hints for Python 3.9+ +Keywords: annotations,backport,checker,checking,function,hinting,hints,type,typechecking,typehinting,typehints,typing +Author-email: "Guido van Rossum, Jukka Lehtosalo, Łukasz Langa, Michael Lee" <levkivskyi@gmail.com> +Requires-Python: >=3.9 +Description-Content-Type: text/markdown +License-Expression: PSF-2.0 +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Software Development +License-File: LICENSE +Project-URL: Bug Tracker, https://github.com/python/typing_extensions/issues +Project-URL: Changes, https://github.com/python/typing_extensions/blob/main/CHANGELOG.md +Project-URL: Documentation, https://typing-extensions.readthedocs.io/ +Project-URL: Home, https://github.com/python/typing_extensions +Project-URL: Q & A, https://github.com/python/typing/discussions +Project-URL: Repository, https://github.com/python/typing_extensions + +# Typing Extensions + +[![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing) + +[Documentation](https://typing-extensions.readthedocs.io/en/latest/#) – +[PyPI](https://pypi.org/project/typing-extensions/) + +## Overview + +The `typing_extensions` module serves two related purposes: + +- Enable use of new type system features on older Python versions. For example, + `typing.TypeGuard` is new in Python 3.10, but `typing_extensions` allows + users on previous Python versions to use it too. +- Enable experimentation with new type system PEPs before they are accepted and + added to the `typing` module. + +`typing_extensions` is treated specially by static type checkers such as +mypy and pyright. Objects defined in `typing_extensions` are treated the same +way as equivalent forms in `typing`. + +`typing_extensions` uses +[Semantic Versioning](https://semver.org/). The +major version will be incremented only for backwards-incompatible changes. +Therefore, it's safe to depend +on `typing_extensions` like this: `typing_extensions ~=x.y`, +where `x.y` is the first version that includes all features you need. +[This](https://packaging.python.org/en/latest/specifications/version-specifiers/#compatible-release) +is equivalent to `typing_extensions >=x.y, <(x+1)`. Do not depend on `~= x.y.z` +unless you really know what you're doing; that defeats the purpose of +semantic versioning. + +## Included items + +See [the documentation](https://typing-extensions.readthedocs.io/en/latest/#) for a +complete listing of module contents. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/python/typing_extensions/blob/main/CONTRIBUTING.md) +for how to contribute to `typing_extensions`. + diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..a4e936b4dc85ba16f1b4c4076be014e5223c3ada --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/RECORD @@ -0,0 +1,9 @@ +__pycache__/typing_extensions.cpython-310.pyc,, +typing_extensions-4.15.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +typing_extensions-4.15.0.dist-info/METADATA,sha256=wTg3j-jxiTSsmd4GBTXFPsbBOu7WXpTDJkHafuMZKnI,3259 +typing_extensions-4.15.0.dist-info/RECORD,, +typing_extensions-4.15.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +typing_extensions-4.15.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82 +typing_extensions-4.15.0.dist-info/direct_url.json,sha256=kuRrGpu_r-HRs_vOEs6D5yCaP4RBTepu9w4I0T4Lh5A,128 +typing_extensions-4.15.0.dist-info/licenses/LICENSE,sha256=Oy-B_iHRgcSZxZolbI4ZaEVdZonSaaqFNzv7avQdo78,13936 +typing_extensions.py,sha256=Qz0R0XDTok0usGXrwb_oSM6n49fOaFZ6tSvqLUwvftg,160429 diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d8b9936dad9ab2513fa6979f411560d3b6b57e37 --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.12.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..88eed1de697b0b1da6b89ae0d0d18de58777a33d --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_typing_extensions_1756220668/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f26bcf4d2de6eb136e31006ca3ab447d5e488adf --- /dev/null +++ b/micromamba_root/Lib/site-packages/typing_extensions-4.15.0.dist-info/licenses/LICENSE @@ -0,0 +1,279 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..9c7a4703f89e94e7c3391dc4e71ed9d1931e8936 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/METADATA @@ -0,0 +1,163 @@ +Metadata-Version: 2.4 +Name: urllib3 +Version: 2.7.0 +Summary: HTTP library with thread-safe connection pooling, file post, and more. +Project-URL: Changelog, https://github.com/urllib3/urllib3/blob/main/CHANGES.rst +Project-URL: Documentation, https://urllib3.readthedocs.io +Project-URL: Code, https://github.com/urllib3/urllib3 +Project-URL: Issue tracker, https://github.com/urllib3/urllib3/issues +Author-email: Andrey Petrov <andrey.petrov@shazow.net> +Maintainer-email: Seth Michael Larson <sethmichaellarson@gmail.com>, Quentin Pradet <quentin@pradet.me>, Illia Volochii <illia.volochii@gmail.com> +License-Expression: MIT +License-File: LICENSE.txt +Keywords: filepost,http,httplib,https,pooling,ssl,threadsafe,urllib +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Internet :: WWW/HTTP +Classifier: Topic :: Software Development :: Libraries +Requires-Python: >=3.10 +Provides-Extra: brotli +Requires-Dist: brotli>=1.2.0; (platform_python_implementation == 'CPython') and extra == 'brotli' +Requires-Dist: brotlicffi>=1.2.0.0; (platform_python_implementation != 'CPython') and extra == 'brotli' +Provides-Extra: h2 +Requires-Dist: h2<5,>=4; extra == 'h2' +Provides-Extra: socks +Requires-Dist: pysocks!=1.5.7,<2.0,>=1.5.6; extra == 'socks' +Provides-Extra: zstd +Requires-Dist: backports-zstd>=1.0.0; (python_version < '3.14') and extra == 'zstd' +Description-Content-Type: text/markdown + +<h1 align="center"> + +![urllib3](https://github.com/urllib3/urllib3/raw/main/docs/_static/banner_github.svg) + +</h1> + +<p align="center"> + <a href="https://pypi.org/project/urllib3"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/urllib3.svg?maxAge=86400" /></a> + <a href="https://pypi.org/project/urllib3"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/urllib3.svg?maxAge=86400" /></a> + <a href="https://discord.gg/urllib3"><img alt="Join our Discord" src="https://img.shields.io/discord/756342717725933608?color=%237289da&label=discord" /></a> + <a href="https://github.com/urllib3/urllib3/actions?query=workflow%3ACI"><img alt="Coverage Status" src="https://img.shields.io/badge/coverage-100%25-success" /></a> + <a href="https://github.com/urllib3/urllib3/actions/workflows/ci.yml?query=branch%3Amain"><img alt="Build Status on GitHub" src="https://github.com/urllib3/urllib3/actions/workflows/ci.yml/badge.svg?branch:main&workflow:CI" /></a> + <a href="https://urllib3.readthedocs.io"><img alt="Documentation Status" src="https://readthedocs.org/projects/urllib3/badge/?version=latest" /></a><br> + <a href="https://deps.dev/pypi/urllib3"><img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/urllib3/urllib3/badge" /></a> + <a href="https://slsa.dev"><img alt="SLSA 3" src="https://slsa.dev/images/gh-badge-level3.svg" /></a> + <a href="https://bestpractices.coreinfrastructure.org/projects/6227"><img alt="CII Best Practices" src="https://bestpractices.coreinfrastructure.org/projects/6227/badge" /></a> +</p> + +urllib3 is a powerful, *user-friendly* HTTP client for Python. +urllib3 brings many critical features that are missing from the Python +standard libraries: + +- Thread safety. +- Connection pooling. +- Client-side SSL/TLS verification. +- File uploads with multipart encoding. +- Helpers for retrying requests and dealing with HTTP redirects. +- Support for gzip, deflate, brotli, and zstd encoding. +- Proxy support for HTTP and SOCKS. +- 100% test coverage. + +... and many more features, but most importantly: Our maintainers have a 15+ +year track record of maintaining urllib3 with the highest code standards and +attention to security and safety. + +[Much of the Python ecosystem already uses urllib3](https://urllib3.readthedocs.io/en/stable/#who-uses) +and you should too. + + +## Installing + +urllib3 can be installed with [pip](https://pip.pypa.io): + +```bash +$ python -m pip install urllib3 +``` + +Alternatively, you can grab the latest source code from [GitHub](https://github.com/urllib3/urllib3): + +```bash +$ git clone https://github.com/urllib3/urllib3.git +$ cd urllib3 +$ pip install . +``` + +## Getting Started + +urllib3 is easy to use: + +```python3 +>>> import urllib3 +>>> resp = urllib3.request("GET", "http://httpbin.org/robots.txt") +>>> resp.status +200 +>>> resp.data +b"User-agent: *\nDisallow: /deny\n" +``` + +urllib3 has usage and reference documentation at [urllib3.readthedocs.io](https://urllib3.readthedocs.io). + + +## Community + +urllib3 has a [community Discord channel](https://discord.gg/urllib3) for asking questions and +collaborating with other contributors. Drop by and say hello 👋 + + +## Contributing + +urllib3 happily accepts contributions. Please see our +[contributing documentation](https://urllib3.readthedocs.io/en/latest/contributing.html) +for some tips on getting started. + + +## Security Disclosures + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure with maintainers. + + +## Maintainers + +Meet our maintainers since 2008: + +- Current Lead: [@illia-v](https://github.com/illia-v) (Illia Volochii) +- [@sethmlarson](https://github.com/sethmlarson) (Seth M. Larson) +- [@pquentin](https://github.com/pquentin) (Quentin Pradet) +- [@theacodes](https://github.com/theacodes) (Thea Flowers) +- [@haikuginger](https://github.com/haikuginger) (Jess Shapiro) +- [@lukasa](https://github.com/lukasa) (Cory Benfield) +- [@sigmavirus24](https://github.com/sigmavirus24) (Ian Stapleton Cordasco) +- [@shazow](https://github.com/shazow) (Andrey Petrov) + +👋 + + +## Sponsorship + +If your company benefits from this library, please consider [sponsoring its +development](https://urllib3.readthedocs.io/en/latest/sponsors.html). + + +## For Enterprise + +Professional support for urllib3 is available as part of the [Tidelift +Subscription][1]. Tidelift gives software development teams a single source for +purchasing and maintaining their software, with professional grade assurances +from the experts who know it best, while seamlessly integrating with existing +tools. + +[1]: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..86528889d0634a7615f43f0536a39f6da73655d5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/RECORD @@ -0,0 +1,81 @@ +urllib3-2.7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +urllib3-2.7.0.dist-info/METADATA,sha256=ZhR4VtMLu2vtAcbOMybQ9I2E7V8oasF3YzoUhrgurOU,6852 +urllib3-2.7.0.dist-info/RECORD,, +urllib3-2.7.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +urllib3-2.7.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87 +urllib3-2.7.0.dist-info/direct_url.json,sha256=HIEaKQOr-7bs9TDjSn7u34fQAdbLNIYRF1ycpNEJsqE,103 +urllib3-2.7.0.dist-info/licenses/LICENSE.txt,sha256=Ew46ZNX91dCWp1JpRjSn2d8oRGnehuVzIQAmgEHj1oY,1093 +urllib3/__init__.py,sha256=JMo1tg1nIV1AeJ2vENC_Txfl0e5h6Gzl9DGVk1rWRbo,6979 +urllib3/__pycache__/__init__.cpython-310.pyc,, +urllib3/__pycache__/_base_connection.cpython-310.pyc,, +urllib3/__pycache__/_collections.cpython-310.pyc,, +urllib3/__pycache__/_request_methods.cpython-310.pyc,, +urllib3/__pycache__/_version.cpython-310.pyc,, +urllib3/__pycache__/connection.cpython-310.pyc,, +urllib3/__pycache__/connectionpool.cpython-310.pyc,, +urllib3/__pycache__/exceptions.cpython-310.pyc,, +urllib3/__pycache__/fields.cpython-310.pyc,, +urllib3/__pycache__/filepost.cpython-310.pyc,, +urllib3/__pycache__/poolmanager.cpython-310.pyc,, +urllib3/__pycache__/response.cpython-310.pyc,, +urllib3/_base_connection.py,sha256=HzcSEHexgDrRUr60jNniB2KQjdw97SedD5luRfHtCXg,5580 +urllib3/_collections.py,sha256=aOVm2mKilvuvT1efAGtkA7pi65C1NC3HJfpFxvYBS8A,17522 +urllib3/_request_methods.py,sha256=gCeF85SO_UU4WoPwYHIoz_tw-eM_EVOkLFp8OFsC7DA,9931 +urllib3/_version.py,sha256=egp6dAw7S80JrGAUNYGJNY3iqzeSzC4Vs5c3SnC3SIY,704 +urllib3/connection.py,sha256=Zos3qxKDW9-GQ6aVqfBQVRM5soB0IjHxY_xXWpJaFTI,42786 +urllib3/connectionpool.py,sha256=sGFnddXYwlx7KC4JCP1gKvdNGLNK-YTCJDdGACGj3Y8,44164 +urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +urllib3/contrib/__pycache__/__init__.cpython-310.pyc,, +urllib3/contrib/__pycache__/pyopenssl.cpython-310.pyc,, +urllib3/contrib/__pycache__/socks.cpython-310.pyc,, +urllib3/contrib/emscripten/__init__.py,sha256=wyXve8rmqX7s2KqRQBxD5Wl48jzWPn5-1u_XoQBELVc,836 +urllib3/contrib/emscripten/__pycache__/__init__.cpython-310.pyc,, +urllib3/contrib/emscripten/__pycache__/connection.cpython-310.pyc,, +urllib3/contrib/emscripten/__pycache__/fetch.cpython-310.pyc,, +urllib3/contrib/emscripten/__pycache__/request.cpython-310.pyc,, +urllib3/contrib/emscripten/__pycache__/response.cpython-310.pyc,, +urllib3/contrib/emscripten/connection.py,sha256=giElsBoUsKVURbZzb8GCrJmqW23Xnvj2aNyQVF42slg,8960 +urllib3/contrib/emscripten/emscripten_fetch_worker.js,sha256=z1k3zZ4_hDKd3-tN7wzz8LHjHC2pxN_uu8B3k9D9A3c,3677 +urllib3/contrib/emscripten/fetch.py,sha256=5xcd--viFxZd2nBy0aK73dtJ9Tsh1yYZU_SUXwnwibk,23520 +urllib3/contrib/emscripten/request.py,sha256=mL28szy1KvE3NJhWor5jNmarp8gwplDU-7gwGZY5g0Q,566 +urllib3/contrib/emscripten/response.py,sha256=CDpY0GFoluR3IxECkM2gH5uDfYDM0EL1FWr7B76wtgM,9719 +urllib3/contrib/pyopenssl.py,sha256=XZY-QzyT7s8d43qisA4o-eSZYBeIkPyBMZhtj2kkLZs,19734 +urllib3/contrib/socks.py,sha256=rSuklfha4-vto-8qSLhSPmf5lmRPIYuqdAxKe9bg2RA,7639 +urllib3/exceptions.py,sha256=hQPHoqo4yw46esNSVkciVQXVUgAxWAglsh6MbyQta-Q,9945 +urllib3/fields.py,sha256=aGLFAVZpVU-FbJlllve4Ahg0-pH9ZZBQ2Iz7lfpkjkM,10801 +urllib3/filepost.py,sha256=U8eNZ-mpKKHhrlbHEEiTxxgK16IejhEa7uz42yqA_dI,2388 +urllib3/http2/__init__.py,sha256=xzrASH7R5ANRkPJOot5lGnATOq3KKuyXzI42rcnwmqs,1741 +urllib3/http2/__pycache__/__init__.cpython-310.pyc,, +urllib3/http2/__pycache__/connection.cpython-310.pyc,, +urllib3/http2/__pycache__/probe.cpython-310.pyc,, +urllib3/http2/connection.py,sha256=bHMH6fNvatwXPrKqrcn74yA3pUWcqPDppnK1LcKCbP8,12578 +urllib3/http2/probe.py,sha256=nnAkqbhAakOiF75rz7W0udZ38Eeh_uD8fjV74N73FEI,3014 +urllib3/poolmanager.py,sha256=c0rh0rcUC1t5tDGuUeGIgAzlErasPOwWwLiB67lX8pM,23895 +urllib3/py.typed,sha256=UaCuPFa3H8UAakbt-5G8SPacldTOGvJv18pPjUJ5gDY,93 +urllib3/response.py,sha256=9SX4BkkdoLgsx1ne6hpt-5PncrnDzPzeqC1DaShSc-M,53219 +urllib3/util/__init__.py,sha256=-qeS0QceivazvBEKDNFCAI-6ACcdDOE4TMvo7SLNlAQ,1001 +urllib3/util/__pycache__/__init__.cpython-310.pyc,, +urllib3/util/__pycache__/connection.cpython-310.pyc,, +urllib3/util/__pycache__/proxy.cpython-310.pyc,, +urllib3/util/__pycache__/request.cpython-310.pyc,, +urllib3/util/__pycache__/response.cpython-310.pyc,, +urllib3/util/__pycache__/retry.cpython-310.pyc,, +urllib3/util/__pycache__/ssl_.cpython-310.pyc,, +urllib3/util/__pycache__/ssl_match_hostname.cpython-310.pyc,, +urllib3/util/__pycache__/ssltransport.cpython-310.pyc,, +urllib3/util/__pycache__/timeout.cpython-310.pyc,, +urllib3/util/__pycache__/url.cpython-310.pyc,, +urllib3/util/__pycache__/util.cpython-310.pyc,, +urllib3/util/__pycache__/wait.cpython-310.pyc,, +urllib3/util/connection.py,sha256=JjO722lzHlzLXPTkr9ZWBdhseXnMVjMSb1DJLVrXSnQ,4444 +urllib3/util/proxy.py,sha256=seP8-Q5B6bB0dMtwPj-YcZZQ30vHuLqRu-tI0JZ2fzs,1148 +urllib3/util/request.py,sha256=itpnC8ug7D4nVfDmGUCRMlgkARUQ13r_XMxSnzTwmpE,8363 +urllib3/util/response.py,sha256=vQE639uoEhj1vpjEdxu5lNIhJCSUZkd7pqllUI0BZOA,3374 +urllib3/util/retry.py,sha256=2YnSX-_FecMShD61Mx5s68J0_btUHZrrc_BkFVRS1P4,19577 +urllib3/util/ssl_.py,sha256=Oqe3rIhUU3e3GVgZob2hxmR8Q0ZDhrhESPlPP_GLaVQ,17742 +urllib3/util/ssl_match_hostname.py,sha256=Ft44KJzTzGMmKff_ZXP91li2V4WhmvEy16PKBcv4vZk,5479 +urllib3/util/ssltransport.py,sha256=Ez4O8pR_vT8dan_FvqBYS6dgDfBXEMfVfrzcdUoWfi4,8847 +urllib3/util/timeout.py,sha256=4eT1FVeZZU7h7mYD1Jq2OXNe4fxekdNvhoWUkZusRpA,10346 +urllib3/util/url.py,sha256=WRh-TMYXosmgp8m8lT4H5spoHw5yUjlcMCfU53AkoAs,15205 +urllib3/util/util.py,sha256=j3lbZK1jPyiwD34T8IgJzdWEZVT-4E-0vYIJi9UjeNA,1146 +urllib3/util/wait.py,sha256=_ph8IrUR3sqPqi0OopQgJUlH4wzkGeM5CiyA7XGGtmI,4423 diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..b1b94fd58e7e9ed0ef3449473bc48de68afcc3fe --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.29.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..13ed5e9e40f084b808014ddee0708a7072bac327 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/urllib3_1778188571305/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..e6183d0276b26c5b87aecccf8d0d5bcd7b1148d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3-2.7.0.dist-info/licenses/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2008-2020 Andrey Petrov and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/urllib3/__init__.py b/micromamba_root/Lib/site-packages/urllib3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3fe782c8a45bbabcf240f3cac4303ac12b0ec274 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/__init__.py @@ -0,0 +1,211 @@ +""" +Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more +""" + +from __future__ import annotations + +# Set default logging handler to avoid "No handler found" warnings. +import logging +import sys +import typing +import warnings +from logging import NullHandler + +from . import exceptions +from ._base_connection import _TYPE_BODY +from ._collections import HTTPHeaderDict +from ._version import __version__ +from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url +from .filepost import _TYPE_FIELDS, encode_multipart_formdata +from .poolmanager import PoolManager, ProxyManager, proxy_from_url +from .response import BaseHTTPResponse, HTTPResponse +from .util.request import make_headers +from .util.retry import Retry +from .util.timeout import Timeout + +# Ensure that Python is compiled with OpenSSL 1.1.1+ +# If the 'ssl' module isn't available at all that's +# fine, we only care if the module is available. +try: + import ssl +except ImportError: + pass +else: + if not ssl.OPENSSL_VERSION.startswith("OpenSSL "): # Defensive: + warnings.warn( + "urllib3 v2 only supports OpenSSL 1.1.1+, currently " + f"the 'ssl' module is compiled with {ssl.OPENSSL_VERSION!r}. " + "See: https://github.com/urllib3/urllib3/issues/3020", + exceptions.NotOpenSSLWarning, + ) + elif ssl.OPENSSL_VERSION_INFO < (1, 1, 1): # Defensive: + raise ImportError( + "urllib3 v2 only supports OpenSSL 1.1.1+, currently " + f"the 'ssl' module is compiled with {ssl.OPENSSL_VERSION!r}. " + "See: https://github.com/urllib3/urllib3/issues/2168" + ) + +__author__ = "Andrey Petrov (andrey.petrov@shazow.net)" +__license__ = "MIT" +__version__ = __version__ + +__all__ = ( + "HTTPConnectionPool", + "HTTPHeaderDict", + "HTTPSConnectionPool", + "PoolManager", + "ProxyManager", + "HTTPResponse", + "Retry", + "Timeout", + "add_stderr_logger", + "connection_from_url", + "disable_warnings", + "encode_multipart_formdata", + "make_headers", + "proxy_from_url", + "request", + "BaseHTTPResponse", +) + +logging.getLogger(__name__).addHandler(NullHandler()) + + +def add_stderr_logger( + level: int = logging.DEBUG, +) -> logging.StreamHandler[typing.TextIO]: + """ + Helper for quickly adding a StreamHandler to the logger. Useful for + debugging. + + Returns the handler after adding it. + """ + # This method needs to be in this __init__.py to get the __name__ correct + # even if urllib3 is vendored within another package. + logger = logging.getLogger(__name__) + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s")) + logger.addHandler(handler) + logger.setLevel(level) + logger.debug("Added a stderr logging handler to logger: %s", __name__) + return handler + + +# ... Clean up. +del NullHandler + + +# All warning filters *must* be appended unless you're really certain that they +# shouldn't be: otherwise, it's very hard for users to use most Python +# mechanisms to silence them. +# SecurityWarning's always go off by default. +warnings.simplefilter("always", exceptions.SecurityWarning, append=True) +# InsecurePlatformWarning's don't vary between requests, so we keep it default. +warnings.simplefilter("default", exceptions.InsecurePlatformWarning, append=True) + + +def disable_warnings(category: type[Warning] = exceptions.HTTPWarning) -> None: + """ + Helper for quickly disabling all urllib3 warnings. + """ + warnings.simplefilter("ignore", category) + + +_DEFAULT_POOL = PoolManager() + + +def request( + method: str, + url: str, + *, + body: _TYPE_BODY | None = None, + fields: _TYPE_FIELDS | None = None, + headers: typing.Mapping[str, str] | None = None, + preload_content: bool | None = True, + decode_content: bool | None = True, + redirect: bool | None = True, + retries: Retry | bool | int | None = None, + timeout: Timeout | float | int | None = 3, + json: typing.Any | None = None, +) -> BaseHTTPResponse: + """ + A convenience, top-level request method. It uses a module-global ``PoolManager`` instance. + Therefore, its side effects could be shared across dependencies relying on it. + To avoid side effects create a new ``PoolManager`` instance and use it instead. + The method does not accept low-level ``**urlopen_kw`` keyword arguments. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param body: + Data to send in the request body, either :class:`str`, :class:`bytes`, + an iterable of :class:`str`/:class:`bytes`, or a file-like object. + + :param fields: + Data to encode and send in the request body. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. + + :param bool preload_content: + If True, the response's body will be preloaded into memory. + + :param bool decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param redirect: + If True, automatically handle redirects (status codes 301, 302, + 303, 307, 308). Each redirect counts as a retry. Disabling retries + will disable redirect, too. + + :param retries: + Configure the number of retries to allow before raising a + :class:`~urllib3.exceptions.MaxRetryError` exception. + + If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a + :class:`~urllib3.util.retry.Retry` object for fine-grained control + over different types of retries. + Pass an integer number to retry connection errors that many times, + but no other types of errors. Pass zero to never retry. + + If ``False``, then retries are disabled and any exception is raised + immediately. Also, instead of raising a MaxRetryError on redirects, + the redirect response will be returned. + + :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. + + :param timeout: + If specified, overrides the default timeout for this one + request. It may be a float (in seconds) or an instance of + :class:`urllib3.util.Timeout`. + + :param json: + Data to encode and send as JSON with UTF-encoded in the request body. + The ``"Content-Type"`` header will be set to ``"application/json"`` + unless specified otherwise. + """ + + return _DEFAULT_POOL.request( + method, + url, + body=body, + fields=fields, + headers=headers, + preload_content=preload_content, + decode_content=decode_content, + redirect=redirect, + retries=retries, + timeout=timeout, + json=json, + ) + + +if sys.platform == "emscripten": + from .contrib.emscripten import inject_into_urllib3 # noqa: 401 + + inject_into_urllib3() diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b8d80ec240be4911e199b07835489244fcf25e1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/_base_connection.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_base_connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00afebec65939a85ec296f329fc54793602bd82d Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_base_connection.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/_collections.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_collections.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b2122f703a4bd2439178d846457f46c5fab32c1 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_collections.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/_request_methods.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_request_methods.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfbb82d05954c1acdad68d568d22fd3de4f844c2 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_request_methods.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/_version.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_version.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6adbfa24d92bef2b96df5d998a57a4f83f339dcb Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/_version.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/connection.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..551db71fa5be0cfcf61d9a16ef8abdc1fab06758 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/connectionpool.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/connectionpool.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e7b92b2c6c3633e8f349a778021b62de58b2a97 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/connectionpool.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/exceptions.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/exceptions.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa921da254959678d41bcefd1cdca63aaf211399 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/exceptions.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/fields.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/fields.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17c6281cb265996022884692a26b9465d9f670bb Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/fields.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/filepost.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/filepost.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3935e4c7329d4c1137939c823e6f35b95b88b764 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/filepost.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/poolmanager.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/poolmanager.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d306027531e77a1491a2d34e6076b0c5b6e90909 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/poolmanager.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/__pycache__/response.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/__pycache__/response.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..206f5e40fbee54614db4f54bd6de33355040ebec Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/__pycache__/response.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/_base_connection.py b/micromamba_root/Lib/site-packages/urllib3/_base_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..992ec1657a9d0a98354b56b2a55d54b75db0eaa3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/_base_connection.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +import typing + +from .util.connection import _TYPE_SOCKET_OPTIONS +from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT +from .util.url import Url + +_TYPE_BODY = typing.Union[ + bytes, typing.IO[typing.Any], typing.Iterable[bytes | str], str +] + + +class ProxyConfig(typing.NamedTuple): + ssl_context: ssl.SSLContext | None + use_forwarding_for_https: bool + assert_hostname: None | str | typing.Literal[False] + assert_fingerprint: str | None + + +class _ResponseOptions(typing.NamedTuple): + # TODO: Remove this in favor of a better + # HTTP request/response lifecycle tracking. + request_method: str + request_url: str + preload_content: bool + decode_content: bool + enforce_content_length: bool + + +if typing.TYPE_CHECKING: + import ssl + from typing import Protocol + + from .response import BaseHTTPResponse + + class BaseHTTPConnection(Protocol): + default_port: typing.ClassVar[int] + default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS] + + host: str + port: int + timeout: None | ( + float + ) # Instance doesn't store _DEFAULT_TIMEOUT, must be resolved. + blocksize: int + source_address: tuple[str, int] | None + socket_options: _TYPE_SOCKET_OPTIONS | None + + proxy: Url | None + proxy_config: ProxyConfig | None + + is_verified: bool + proxy_is_verified: bool | None + + def __init__( + self, + host: str, + port: int | None = None, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 8192, + socket_options: _TYPE_SOCKET_OPTIONS | None = ..., + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + ) -> None: ... + + def set_tunnel( + self, + host: str, + port: int | None = None, + headers: typing.Mapping[str, str] | None = None, + scheme: str = "http", + ) -> None: ... + + def connect(self) -> None: ... + + def request( + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + # We know *at least* botocore is depending on the order of the + # first 3 parameters so to be safe we only mark the later ones + # as keyword-only to ensure we have space to extend. + *, + chunked: bool = False, + preload_content: bool = True, + decode_content: bool = True, + enforce_content_length: bool = True, + ) -> None: ... + + def getresponse(self) -> BaseHTTPResponse: ... + + def close(self) -> None: ... + + @property + def is_closed(self) -> bool: + """Whether the connection either is brand new or has been previously closed. + If this property is True then both ``is_connected`` and ``has_connected_to_proxy`` + properties must be False. + """ + + @property + def is_connected(self) -> bool: + """Whether the connection is actively connected to any origin (proxy or target)""" + + @property + def has_connected_to_proxy(self) -> bool: + """Whether the connection has successfully connected to its proxy. + This returns False if no proxy is in use. Used to determine whether + errors are coming from the proxy layer or from tunnelling to the target origin. + """ + + class BaseHTTPSConnection(BaseHTTPConnection, Protocol): + default_port: typing.ClassVar[int] + default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS] + + # Certificate verification methods + cert_reqs: int | str | None + assert_hostname: None | str | typing.Literal[False] + assert_fingerprint: str | None + ssl_context: ssl.SSLContext | None + + # Trusted CAs + ca_certs: str | None + ca_cert_dir: str | None + ca_cert_data: None | str | bytes + + # TLS version + ssl_minimum_version: int | None + ssl_maximum_version: int | None + ssl_version: int | str | None # Deprecated + + # Client certificates + cert_file: str | None + key_file: str | None + key_password: str | None + + def __init__( + self, + host: str, + port: int | None = None, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 16384, + socket_options: _TYPE_SOCKET_OPTIONS | None = ..., + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + cert_reqs: int | str | None = None, + assert_hostname: None | str | typing.Literal[False] = None, + assert_fingerprint: str | None = None, + server_hostname: str | None = None, + ssl_context: ssl.SSLContext | None = None, + ca_certs: str | None = None, + ca_cert_dir: str | None = None, + ca_cert_data: None | str | bytes = None, + ssl_minimum_version: int | None = None, + ssl_maximum_version: int | None = None, + ssl_version: int | str | None = None, # Deprecated + cert_file: str | None = None, + key_file: str | None = None, + key_password: str | None = None, + ) -> None: ... diff --git a/micromamba_root/Lib/site-packages/urllib3/_collections.py b/micromamba_root/Lib/site-packages/urllib3/_collections.py new file mode 100644 index 0000000000000000000000000000000000000000..ee9ca662b625ce6b0a4743d05a186301b9a30ee6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/_collections.py @@ -0,0 +1,486 @@ +from __future__ import annotations + +import typing +from collections import OrderedDict +from enum import Enum, auto +from threading import RLock + +if typing.TYPE_CHECKING: + # We can only import Protocol if TYPE_CHECKING because it's a development + # dependency, and is not available at runtime. + from typing import Protocol + + from typing_extensions import Self + + class HasGettableStringKeys(Protocol): + def keys(self) -> typing.Iterator[str]: ... + + def __getitem__(self, key: str) -> str: ... + + +__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"] + + +# Key type +_KT = typing.TypeVar("_KT") +# Value type +_VT = typing.TypeVar("_VT") +# Default type +_DT = typing.TypeVar("_DT") + +ValidHTTPHeaderSource = typing.Union[ + "HTTPHeaderDict", + typing.Mapping[str, str], + typing.Iterable[tuple[str, str]], + "HasGettableStringKeys", +] + + +class _Sentinel(Enum): + not_passed = auto() + + +def ensure_can_construct_http_header_dict( + potential: object, +) -> ValidHTTPHeaderSource | None: + if isinstance(potential, HTTPHeaderDict): + return potential + elif isinstance(potential, typing.Mapping): + # Full runtime checking of the contents of a Mapping is expensive, so for the + # purposes of typechecking, we assume that any Mapping is the right shape. + return typing.cast(typing.Mapping[str, str], potential) + elif isinstance(potential, typing.Iterable): + # Similarly to Mapping, full runtime checking of the contents of an Iterable is + # expensive, so for the purposes of typechecking, we assume that any Iterable + # is the right shape. + return typing.cast(typing.Iterable[tuple[str, str]], potential) + elif hasattr(potential, "keys") and hasattr(potential, "__getitem__"): + return typing.cast("HasGettableStringKeys", potential) + else: + return None + + +class RecentlyUsedContainer(typing.Generic[_KT, _VT], typing.MutableMapping[_KT, _VT]): + """ + Provides a thread-safe dict-like container which maintains up to + ``maxsize`` keys while throwing away the least-recently-used keys beyond + ``maxsize``. + + :param maxsize: + Maximum number of recent elements to retain. + + :param dispose_func: + Every time an item is evicted from the container, + ``dispose_func(value)`` is called. Callback which will get called + """ + + _container: typing.OrderedDict[_KT, _VT] + _maxsize: int + dispose_func: typing.Callable[[_VT], None] | None + lock: RLock + + def __init__( + self, + maxsize: int = 10, + dispose_func: typing.Callable[[_VT], None] | None = None, + ) -> None: + super().__init__() + self._maxsize = maxsize + self.dispose_func = dispose_func + self._container = OrderedDict() + self.lock = RLock() + + def __getitem__(self, key: _KT) -> _VT: + # Re-insert the item, moving it to the end of the eviction line. + with self.lock: + item = self._container.pop(key) + self._container[key] = item + return item + + def __setitem__(self, key: _KT, value: _VT) -> None: + evicted_item = None + with self.lock: + # Possibly evict the existing value of 'key' + try: + # If the key exists, we'll overwrite it, which won't change the + # size of the pool. Because accessing a key should move it to + # the end of the eviction line, we pop it out first. + evicted_item = key, self._container.pop(key) + self._container[key] = value + except KeyError: + # When the key does not exist, we insert the value first so that + # evicting works in all cases, including when self._maxsize is 0 + self._container[key] = value + if len(self._container) > self._maxsize: + # If we didn't evict an existing value, and we've hit our maximum + # size, then we have to evict the least recently used item from + # the beginning of the container. + evicted_item = self._container.popitem(last=False) + + # After releasing the lock on the pool, dispose of any evicted value. + if evicted_item is not None and self.dispose_func: + _, evicted_value = evicted_item + self.dispose_func(evicted_value) + + def __delitem__(self, key: _KT) -> None: + with self.lock: + value = self._container.pop(key) + + if self.dispose_func: + self.dispose_func(value) + + def __len__(self) -> int: + with self.lock: + return len(self._container) + + def __iter__(self) -> typing.NoReturn: + raise NotImplementedError( + "Iteration over this class is unlikely to be threadsafe." + ) + + def clear(self) -> None: + with self.lock: + # Copy pointers to all values, then wipe the mapping + values = list(self._container.values()) + self._container.clear() + + if self.dispose_func: + for value in values: + self.dispose_func(value) + + def keys(self) -> set[_KT]: # type: ignore[override] + with self.lock: + return set(self._container.keys()) + + +class HTTPHeaderDictItemView(set[tuple[str, str]]): + """ + HTTPHeaderDict is unusual for a Mapping[str, str] in that it has two modes of + address. + + If we directly try to get an item with a particular name, we will get a string + back that is the concatenated version of all the values: + + >>> d['X-Header-Name'] + 'Value1, Value2, Value3' + + However, if we iterate over an HTTPHeaderDict's items, we will optionally combine + these values based on whether combine=True was called when building up the dictionary + + >>> d = HTTPHeaderDict({"A": "1", "B": "foo"}) + >>> d.add("A", "2", combine=True) + >>> d.add("B", "bar") + >>> list(d.items()) + [ + ('A', '1, 2'), + ('B', 'foo'), + ('B', 'bar'), + ] + + This class conforms to the interface required by the MutableMapping ABC while + also giving us the nonstandard iteration behavior we want; items with duplicate + keys, ordered by time of first insertion. + """ + + _headers: HTTPHeaderDict + + def __init__(self, headers: HTTPHeaderDict) -> None: + self._headers = headers + + def __len__(self) -> int: + return len(list(self._headers.iteritems())) + + def __iter__(self) -> typing.Iterator[tuple[str, str]]: + return self._headers.iteritems() + + def __contains__(self, item: object) -> bool: + if isinstance(item, tuple) and len(item) == 2: + passed_key, passed_val = item + if isinstance(passed_key, str) and isinstance(passed_val, str): + return self._headers._has_value_for_header(passed_key, passed_val) + return False + + +class HTTPHeaderDict(typing.MutableMapping[str, str]): + """ + :param headers: + An iterable of field-value pairs. Must not contain multiple field names + when compared case-insensitively. + + :param kwargs: + Additional field-value pairs to pass in to ``dict.update``. + + A ``dict`` like container for storing HTTP Headers. + + Field names are stored and compared case-insensitively in compliance with + RFC 7230. Iteration provides the first case-sensitive key seen for each + case-insensitive pair. + + Using ``__setitem__`` syntax overwrites fields that compare equal + case-insensitively in order to maintain ``dict``'s api. For fields that + compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add`` + in a loop. + + If multiple fields that are equal case-insensitively are passed to the + constructor or ``.update``, the behavior is undefined and some will be + lost. + + >>> headers = HTTPHeaderDict() + >>> headers.add('Set-Cookie', 'foo=bar') + >>> headers.add('set-cookie', 'baz=quxx') + >>> headers['content-length'] = '7' + >>> headers['SET-cookie'] + 'foo=bar, baz=quxx' + >>> headers['Content-Length'] + '7' + """ + + _container: typing.MutableMapping[str, list[str]] + + def __init__(self, headers: ValidHTTPHeaderSource | None = None, **kwargs: str): + super().__init__() + self._container = {} # 'dict' is insert-ordered + if headers is not None: + if isinstance(headers, HTTPHeaderDict): + self._copy_from(headers) + else: + self.extend(headers) + if kwargs: + self.extend(kwargs) + + def __setitem__(self, key: str, val: str) -> None: + # avoid a bytes/str comparison by decoding before httplib + if isinstance(key, bytes): + key = key.decode("latin-1") + self._container[key.lower()] = [key, val] + + def __getitem__(self, key: str) -> str: + if isinstance(key, bytes): + key = key.decode("latin-1") + val = self._container[key.lower()] + return ", ".join(val[1:]) + + def __delitem__(self, key: str) -> None: + if isinstance(key, bytes): + key = key.decode("latin-1") + del self._container[key.lower()] + + def __contains__(self, key: object) -> bool: + if isinstance(key, bytes): + key = key.decode("latin-1") + if isinstance(key, str): + return key.lower() in self._container + return False + + def setdefault(self, key: str, default: str = "") -> str: + return super().setdefault(key, default) + + def __eq__(self, other: object) -> bool: + maybe_constructable = ensure_can_construct_http_header_dict(other) + if maybe_constructable is None: + return False + else: + other_as_http_header_dict = type(self)(maybe_constructable) + + return {k.lower(): v for k, v in self.itermerged()} == { + k.lower(): v for k, v in other_as_http_header_dict.itermerged() + } + + def __ne__(self, other: object) -> bool: + return not self.__eq__(other) + + def __len__(self) -> int: + return len(self._container) + + def __iter__(self) -> typing.Iterator[str]: + # Only provide the originally cased names + for vals in self._container.values(): + yield vals[0] + + def discard(self, key: str) -> None: + try: + del self[key] + except KeyError: + pass + + def add(self, key: str, val: str, *, combine: bool = False) -> None: + """Adds a (name, value) pair, doesn't overwrite the value if it already + exists. + + If this is called with combine=True, instead of adding a new header value + as a distinct item during iteration, this will instead append the value to + any existing header value with a comma. If no existing header value exists + for the key, then the value will simply be added, ignoring the combine parameter. + + >>> headers = HTTPHeaderDict(foo='bar') + >>> headers.add('Foo', 'baz') + >>> headers['foo'] + 'bar, baz' + >>> list(headers.items()) + [('foo', 'bar'), ('foo', 'baz')] + >>> headers.add('foo', 'quz', combine=True) + >>> list(headers.items()) + [('foo', 'bar, baz, quz')] + """ + # avoid a bytes/str comparison by decoding before httplib + if isinstance(key, bytes): + key = key.decode("latin-1") + key_lower = key.lower() + new_vals = [key, val] + # Keep the common case aka no item present as fast as possible + vals = self._container.setdefault(key_lower, new_vals) + if new_vals is not vals: + # if there are values here, then there is at least the initial + # key/value pair + assert len(vals) >= 2 + if combine: + vals[-1] = vals[-1] + ", " + val + else: + vals.append(val) + + def extend(self, *args: ValidHTTPHeaderSource, **kwargs: str) -> None: + """Generic import function for any type of header-like object. + Adapted version of MutableMapping.update in order to insert items + with self.add instead of self.__setitem__ + """ + if len(args) > 1: + raise TypeError( + f"extend() takes at most 1 positional arguments ({len(args)} given)" + ) + other = args[0] if len(args) >= 1 else () + + if isinstance(other, HTTPHeaderDict): + for key, val in other.iteritems(): + self.add(key, val) + elif isinstance(other, typing.Mapping): + for key, val in other.items(): + self.add(key, val) + elif isinstance(other, typing.Iterable): + for key, value in other: + self.add(key, value) + elif hasattr(other, "keys") and hasattr(other, "__getitem__"): + # THIS IS NOT A TYPESAFE BRANCH + # In this branch, the object has a `keys` attr but is not a Mapping or any of + # the other types indicated in the method signature. We do some stuff with + # it as though it partially implements the Mapping interface, but we're not + # doing that stuff safely AT ALL. + for key in other.keys(): + self.add(key, other[key]) + + for key, value in kwargs.items(): + self.add(key, value) + + @typing.overload + def getlist(self, key: str) -> list[str]: ... + + @typing.overload + def getlist(self, key: str, default: _DT) -> list[str] | _DT: ... + + def getlist( + self, key: str, default: _Sentinel | _DT = _Sentinel.not_passed + ) -> list[str] | _DT: + """Returns a list of all the values for the named field. Returns an + empty list if the key doesn't exist.""" + if isinstance(key, bytes): + key = key.decode("latin-1") + try: + vals = self._container[key.lower()] + except KeyError: + if default is _Sentinel.not_passed: + # _DT is unbound; empty list is instance of List[str] + return [] + # _DT is bound; default is instance of _DT + return default + else: + # _DT may or may not be bound; vals[1:] is instance of List[str], which + # meets our external interface requirement of `Union[List[str], _DT]`. + return vals[1:] + + def _prepare_for_method_change(self) -> Self: + """ + Remove content-specific header fields before changing the request + method to GET or HEAD according to RFC 9110, Section 15.4. + """ + content_specific_headers = [ + "Content-Encoding", + "Content-Language", + "Content-Location", + "Content-Type", + "Content-Length", + "Digest", + "Last-Modified", + ] + for header in content_specific_headers: + self.discard(header) + return self + + # Backwards compatibility for httplib + getheaders = getlist + getallmatchingheaders = getlist + iget = getlist + + # Backwards compatibility for http.cookiejar + get_all = getlist + + def __repr__(self) -> str: + return f"{type(self).__name__}({dict(self.itermerged())})" + + def _copy_from(self, other: HTTPHeaderDict) -> None: + for key in other: + val = other.getlist(key) + self._container[key.lower()] = [key, *val] + + def copy(self) -> Self: + clone = type(self)() + clone._copy_from(self) + return clone + + def iteritems(self) -> typing.Iterator[tuple[str, str]]: + """Iterate over all header lines, including duplicate ones.""" + for key in self: + vals = self._container[key.lower()] + for val in vals[1:]: + yield vals[0], val + + def itermerged(self) -> typing.Iterator[tuple[str, str]]: + """Iterate over all headers, merging duplicate ones together.""" + for key in self: + val = self._container[key.lower()] + yield val[0], ", ".join(val[1:]) + + def items(self) -> HTTPHeaderDictItemView: # type: ignore[override] + return HTTPHeaderDictItemView(self) + + def _has_value_for_header(self, header_name: str, potential_value: str) -> bool: + if header_name in self: + return potential_value in self._container[header_name.lower()][1:] + return False + + def __ior__(self, other: object) -> HTTPHeaderDict: + # Supports extending a header dict in-place using operator |= + # combining items with add instead of __setitem__ + maybe_constructable = ensure_can_construct_http_header_dict(other) + if maybe_constructable is None: + return NotImplemented + self.extend(maybe_constructable) + return self + + def __or__(self, other: object) -> Self: + # Supports merging header dicts using operator | + # combining items with add instead of __setitem__ + maybe_constructable = ensure_can_construct_http_header_dict(other) + if maybe_constructable is None: + return NotImplemented + result = self.copy() + result.extend(maybe_constructable) + return result + + def __ror__(self, other: object) -> Self: + # Supports merging header dicts using operator | when other is on left side + # combining items with add instead of __setitem__ + maybe_constructable = ensure_can_construct_http_header_dict(other) + if maybe_constructable is None: + return NotImplemented + result = type(self)(maybe_constructable) + result.extend(self) + return result diff --git a/micromamba_root/Lib/site-packages/urllib3/_request_methods.py b/micromamba_root/Lib/site-packages/urllib3/_request_methods.py new file mode 100644 index 0000000000000000000000000000000000000000..297c271bf401c1cb48c6225f8822e78f58c3ca56 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/_request_methods.py @@ -0,0 +1,278 @@ +from __future__ import annotations + +import json as _json +import typing +from urllib.parse import urlencode + +from ._base_connection import _TYPE_BODY +from ._collections import HTTPHeaderDict +from .filepost import _TYPE_FIELDS, encode_multipart_formdata +from .response import BaseHTTPResponse + +__all__ = ["RequestMethods"] + +_TYPE_ENCODE_URL_FIELDS = typing.Union[ + typing.Sequence[tuple[str, typing.Union[str, bytes]]], + typing.Mapping[str, typing.Union[str, bytes]], +] + + +class RequestMethods: + """ + Convenience mixin for classes who implement a :meth:`urlopen` method, such + as :class:`urllib3.HTTPConnectionPool` and + :class:`urllib3.PoolManager`. + + Provides behavior for making common types of HTTP request methods and + decides which type of request field encoding to use. + + Specifically, + + :meth:`.request_encode_url` is for sending requests whose fields are + encoded in the URL (such as GET, HEAD, DELETE). + + :meth:`.request_encode_body` is for sending requests whose fields are + encoded in the *body* of the request using multipart or www-form-urlencoded + (such as for POST, PUT, PATCH). + + :meth:`.request` is for making any kind of request, it will look up the + appropriate encoding format and use one of the above two methods to make + the request. + + Initializer parameters: + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + """ + + _encode_url_methods = {"DELETE", "GET", "HEAD", "OPTIONS"} + + def __init__(self, headers: typing.Mapping[str, str] | None = None) -> None: + self.headers = headers or {} + + def urlopen( + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + encode_multipart: bool = True, + multipart_boundary: str | None = None, + **kw: typing.Any, + ) -> BaseHTTPResponse: # Abstract + raise NotImplementedError( + "Classes extending RequestMethods must implement " + "their own ``urlopen`` method." + ) + + def request( + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + fields: _TYPE_FIELDS | None = None, + headers: typing.Mapping[str, str] | None = None, + json: typing.Any | None = None, + **urlopen_kw: typing.Any, + ) -> BaseHTTPResponse: + """ + Make a request using :meth:`urlopen` with the appropriate encoding of + ``fields`` based on the ``method`` used. + + This is a convenience method that requires the least amount of manual + effort. It can be used in most situations, while still having the + option to drop down to more specific methods when necessary, such as + :meth:`request_encode_url`, :meth:`request_encode_body`, + or even the lowest level :meth:`urlopen`. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param body: + Data to send in the request body, either :class:`str`, :class:`bytes`, + an iterable of :class:`str`/:class:`bytes`, or a file-like object. + + :param fields: + Data to encode and send in the URL or request body, depending on ``method``. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + + :param json: + Data to encode and send as JSON with UTF-encoded in the request body. + The ``"Content-Type"`` header will be set to ``"application/json"`` + unless specified otherwise. + """ + method = method.upper() + + if json is not None and body is not None: + raise TypeError( + "request got values for both 'body' and 'json' parameters which are mutually exclusive" + ) + + if json is not None: + if headers is None: + headers = self.headers + + if not ("content-type" in map(str.lower, headers.keys())): + headers = HTTPHeaderDict(headers) + headers["Content-Type"] = "application/json" + + body = _json.dumps(json, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + + if body is not None: + urlopen_kw["body"] = body + + if method in self._encode_url_methods: + return self.request_encode_url( + method, + url, + fields=fields, # type: ignore[arg-type] + headers=headers, + **urlopen_kw, + ) + else: + return self.request_encode_body( + method, url, fields=fields, headers=headers, **urlopen_kw + ) + + def request_encode_url( + self, + method: str, + url: str, + fields: _TYPE_ENCODE_URL_FIELDS | None = None, + headers: typing.Mapping[str, str] | None = None, + **urlopen_kw: str, + ) -> BaseHTTPResponse: + """ + Make a request using :meth:`urlopen` with the ``fields`` encoded in + the url. This is useful for request methods like GET, HEAD, DELETE, etc. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param fields: + Data to encode and send in the URL. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + """ + if headers is None: + headers = self.headers + + extra_kw: dict[str, typing.Any] = {"headers": headers} + extra_kw.update(urlopen_kw) + + if fields: + url += "?" + urlencode(fields) + + return self.urlopen(method, url, **extra_kw) + + def request_encode_body( + self, + method: str, + url: str, + fields: _TYPE_FIELDS | None = None, + headers: typing.Mapping[str, str] | None = None, + encode_multipart: bool = True, + multipart_boundary: str | None = None, + **urlopen_kw: str, + ) -> BaseHTTPResponse: + """ + Make a request using :meth:`urlopen` with the ``fields`` encoded in + the body. This is useful for request methods like POST, PUT, PATCH, etc. + + When ``encode_multipart=True`` (default), then + :func:`urllib3.encode_multipart_formdata` is used to encode + the payload with the appropriate content type. Otherwise + :func:`urllib.parse.urlencode` is used with the + 'application/x-www-form-urlencoded' content type. + + Multipart encoding must be used when posting files, and it's reasonably + safe to use it in other times too. However, it may break request + signing, such as with OAuth. + + Supports an optional ``fields`` parameter of key/value strings AND + key/filetuple. A filetuple is a (filename, data, MIME type) tuple where + the MIME type is optional. For example:: + + fields = { + 'foo': 'bar', + 'fakefile': ('foofile.txt', 'contents of foofile'), + 'realfile': ('barfile.txt', open('realfile').read()), + 'typedfile': ('bazfile.bin', open('bazfile').read(), + 'image/jpeg'), + 'nonamefile': 'contents of nonamefile field', + } + + When uploading a file, providing a filename (the first parameter of the + tuple) is optional but recommended to best mimic behavior of browsers. + + Note that if ``headers`` are supplied, the 'Content-Type' header will + be overwritten because it depends on the dynamic random boundary string + which is used to compose the body of the request. The random boundary + string can be explicitly set with the ``multipart_boundary`` parameter. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param fields: + Data to encode and send in the request body. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + + :param encode_multipart: + If True, encode the ``fields`` using the multipart/form-data MIME + format. + + :param multipart_boundary: + If not specified, then a random boundary will be generated using + :func:`urllib3.filepost.choose_boundary`. + """ + if headers is None: + headers = self.headers + + extra_kw: dict[str, typing.Any] = {"headers": HTTPHeaderDict(headers)} + body: bytes | str + + if fields: + if "body" in urlopen_kw: + raise TypeError( + "request got values for both 'fields' and 'body', can only specify one." + ) + + if encode_multipart: + body, content_type = encode_multipart_formdata( + fields, boundary=multipart_boundary + ) + else: + body, content_type = ( + urlencode(fields), # type: ignore[arg-type] + "application/x-www-form-urlencoded", + ) + + extra_kw["body"] = body + extra_kw["headers"].setdefault("Content-Type", content_type) + + extra_kw.update(urlopen_kw) + + return self.urlopen(method, url, **extra_kw) diff --git a/micromamba_root/Lib/site-packages/urllib3/_version.py b/micromamba_root/Lib/site-packages/urllib3/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..3a0f258937d62582b724dcd1651d02a38754d6a6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/_version.py @@ -0,0 +1,34 @@ +# file generated by setuptools-scm +# don't change, don't track in version control + +__all__ = [ + "__version__", + "__version_tuple__", + "version", + "version_tuple", + "__commit_id__", + "commit_id", +] + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple + from typing import Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] + COMMIT_ID = Union[str, None] +else: + VERSION_TUPLE = object + COMMIT_ID = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE +commit_id: COMMIT_ID +__commit_id__: COMMIT_ID + +__version__ = version = '2.7.0' +__version_tuple__ = version_tuple = (2, 7, 0) + +__commit_id__ = commit_id = None diff --git a/micromamba_root/Lib/site-packages/urllib3/connection.py b/micromamba_root/Lib/site-packages/urllib3/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..84e1dab9452d18ad0a2020c55f1966f4920f56c2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/connection.py @@ -0,0 +1,1099 @@ +from __future__ import annotations + +import datetime +import http.client +import logging +import os +import re +import socket +import sys +import threading +import typing +import warnings +from http.client import HTTPConnection as _HTTPConnection +from http.client import HTTPException as HTTPException # noqa: F401 +from http.client import ResponseNotReady +from socket import timeout as SocketTimeout + +if typing.TYPE_CHECKING: + from .response import HTTPResponse + from .util.ssl_ import _TYPE_PEER_CERT_RET_DICT + from .util.ssltransport import SSLTransport + +from ._collections import HTTPHeaderDict +from .http2 import probe as http2_probe +from .util.response import assert_header_parsing +from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT, Timeout +from .util.util import to_str +from .util.wait import wait_for_read + +try: # Compiled with SSL? + import ssl + + BaseSSLError = ssl.SSLError +except (ImportError, AttributeError): + ssl = None # type: ignore[assignment] + + class BaseSSLError(BaseException): # type: ignore[no-redef] + pass + + +from ._base_connection import _TYPE_BODY +from ._base_connection import ProxyConfig as ProxyConfig +from ._base_connection import _ResponseOptions as _ResponseOptions +from ._version import __version__ +from .exceptions import ( + ConnectTimeoutError, + HeaderParsingError, + NameResolutionError, + NewConnectionError, + ProxyError, + SystemTimeWarning, +) +from .util import SKIP_HEADER, SKIPPABLE_HEADERS, connection, ssl_ +from .util.request import body_to_chunks +from .util.ssl_ import assert_fingerprint as _assert_fingerprint +from .util.ssl_ import ( + create_urllib3_context, + is_ipaddress, + resolve_cert_reqs, + resolve_ssl_version, + ssl_wrap_socket, +) +from .util.ssl_match_hostname import CertificateError, match_hostname +from .util.url import Url + +# Not a no-op, we're adding this to the namespace so it can be imported. +ConnectionError = ConnectionError +BrokenPipeError = BrokenPipeError + + +log = logging.getLogger(__name__) + +port_by_scheme = {"http": 80, "https": 443} + +# When it comes time to update this value as a part of regular maintenance +# (ie test_recent_date is failing) update it to ~6 months before the current date. +RECENT_DATE = datetime.date(2025, 1, 1) + +_CONTAINS_CONTROL_CHAR_RE = re.compile(r"[^-!#$%&'*+.^_`|~0-9a-zA-Z]") + + +class HTTPConnection(_HTTPConnection): + """ + Based on :class:`http.client.HTTPConnection` but provides an extra constructor + backwards-compatibility layer between older and newer Pythons. + + Additional keyword parameters are used to configure attributes of the connection. + Accepted parameters include: + + - ``source_address``: Set the source address for the current connection. + - ``socket_options``: Set specific options on the underlying socket. If not specified, then + defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling + Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy. + + For example, if you wish to enable TCP Keep Alive in addition to the defaults, + you might pass: + + .. code-block:: python + + HTTPConnection.default_socket_options + [ + (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), + ] + + Or you may want to disable the defaults by passing an empty list (e.g., ``[]``). + """ + + default_port: typing.ClassVar[int] = port_by_scheme["http"] # type: ignore[misc] + + #: Disable Nagle's algorithm by default. + #: ``[(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)]`` + default_socket_options: typing.ClassVar[connection._TYPE_SOCKET_OPTIONS] = [ + (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) + ] + + #: Whether this connection verifies the host's certificate. + is_verified: bool = False + + #: Whether this proxy connection verified the proxy host's certificate. + # If no proxy is currently connected to the value will be ``None``. + proxy_is_verified: bool | None = None + + blocksize: int + source_address: tuple[str, int] | None + socket_options: connection._TYPE_SOCKET_OPTIONS | None + + _has_connected_to_proxy: bool + _response_options: _ResponseOptions | None + _tunnel_host: str | None + _tunnel_port: int | None + _tunnel_scheme: str | None + + def __init__( + self, + host: str, + port: int | None = None, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 16384, + socket_options: None | ( + connection._TYPE_SOCKET_OPTIONS + ) = default_socket_options, + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + ) -> None: + super().__init__( + host=host, + port=port, + timeout=Timeout.resolve_default_timeout(timeout), + source_address=source_address, + blocksize=blocksize, + ) + self.socket_options = socket_options + self.proxy = proxy + self.proxy_config = proxy_config + + self._has_connected_to_proxy = False + self._response_options = None + self._tunnel_host: str | None = None + self._tunnel_port: int | None = None + self._tunnel_scheme: str | None = None + + def __str__(self) -> str: + return f"{type(self).__name__}(host={self.host!r}, port={self.port!r})" + + def __repr__(self) -> str: + return f"<{self} at {id(self):#x}>" + + @property + def host(self) -> str: + """ + Getter method to remove any trailing dots that indicate the hostname is an FQDN. + + In general, SSL certificates don't include the trailing dot indicating a + fully-qualified domain name, and thus, they don't validate properly when + checked against a domain name that includes the dot. In addition, some + servers may not expect to receive the trailing dot when provided. + + However, the hostname with trailing dot is critical to DNS resolution; doing a + lookup with the trailing dot will properly only resolve the appropriate FQDN, + whereas a lookup without a trailing dot will search the system's search domain + list. Thus, it's important to keep the original host around for use only in + those cases where it's appropriate (i.e., when doing DNS lookup to establish the + actual TCP connection across which we're going to send HTTP requests). + """ + return self._dns_host.rstrip(".") + + @host.setter + def host(self, value: str) -> None: + """ + Setter for the `host` property. + + We assume that only urllib3 uses the _dns_host attribute; httplib itself + only uses `host`, and it seems reasonable that other libraries follow suit. + """ + self._dns_host = value + + def _new_conn(self) -> socket.socket: + """Establish a socket connection and set nodelay settings on it. + + :return: New socket connection. + """ + try: + sock = connection.create_connection( + (self._dns_host, self.port), + self.timeout, + source_address=self.source_address, + socket_options=self.socket_options, + ) + except socket.gaierror as e: + raise NameResolutionError(self.host, self, e) from e + except SocketTimeout as e: + raise ConnectTimeoutError( + self, + f"Connection to {self.host} timed out. (connect timeout={self.timeout})", + ) from e + + except OSError as e: + raise NewConnectionError( + self, f"Failed to establish a new connection: {e}" + ) from e + + sys.audit("http.client.connect", self, self.host, self.port) + + return sock + + def set_tunnel( + self, + host: str, + port: int | None = None, + headers: typing.Mapping[str, str] | None = None, + scheme: str = "http", + ) -> None: + if scheme not in ("http", "https"): + raise ValueError( + f"Invalid proxy scheme for tunneling: {scheme!r}, must be either 'http' or 'https'" + ) + super().set_tunnel(host, port=port, headers=headers) + self._tunnel_scheme = scheme + + if sys.version_info < (3, 11, 9) or ((3, 12) <= sys.version_info < (3, 12, 3)): + # Taken from python/cpython#100986 which was backported in 3.11.9 and 3.12.3. + # When using connection_from_host, host will come without brackets. + def _wrap_ipv6(self, ip: bytes) -> bytes: + if b":" in ip and ip[0] != b"["[0]: + return b"[" + ip + b"]" + return ip + + if sys.version_info < (3, 11, 9): + # `_tunnel` copied from 3.11.13 backporting + # https://github.com/python/cpython/commit/0d4026432591d43185568dd31cef6a034c4b9261 + # and https://github.com/python/cpython/commit/6fbc61070fda2ffb8889e77e3b24bca4249ab4d1 + def _tunnel(self) -> None: + _MAXLINE = http.client._MAXLINE # type: ignore[attr-defined] + connect = b"CONNECT %s:%d HTTP/1.0\r\n" % ( # type: ignore[str-format] + self._wrap_ipv6(self._tunnel_host.encode("ascii")), # type: ignore[union-attr] + self._tunnel_port, + ) + headers = [connect] + for header, value in self._tunnel_headers.items(): # type: ignore[attr-defined] + headers.append(f"{header}: {value}\r\n".encode("latin-1")) + headers.append(b"\r\n") + # Making a single send() call instead of one per line encourages + # the host OS to use a more optimal packet size instead of + # potentially emitting a series of small packets. + self.send(b"".join(headers)) + del headers + + response = self.response_class(self.sock, method=self._method) # type: ignore[attr-defined] + try: + (version, code, message) = response._read_status() # type: ignore[attr-defined] + + if code != http.HTTPStatus.OK: + self.close() + raise OSError( + f"Tunnel connection failed: {code} {message.strip()}" + ) + while True: + line = response.fp.readline(_MAXLINE + 1) + if len(line) > _MAXLINE: + raise http.client.LineTooLong("header line") + if not line: + # for sites which EOF without sending a trailer + break + if line in (b"\r\n", b"\n", b""): + break + + if self.debuglevel > 0: + print("header:", line.decode()) + finally: + response.close() + + elif (3, 12) <= sys.version_info < (3, 12, 3): + # `_tunnel` copied from 3.12.11 backporting + # https://github.com/python/cpython/commit/23aef575c7629abcd4aaf028ebd226fb41a4b3c8 + def _tunnel(self) -> None: # noqa: F811 + connect = b"CONNECT %s:%d HTTP/1.1\r\n" % ( # type: ignore[str-format] + self._wrap_ipv6(self._tunnel_host.encode("idna")), # type: ignore[union-attr] + self._tunnel_port, + ) + headers = [connect] + for header, value in self._tunnel_headers.items(): # type: ignore[attr-defined] + headers.append(f"{header}: {value}\r\n".encode("latin-1")) + headers.append(b"\r\n") + # Making a single send() call instead of one per line encourages + # the host OS to use a more optimal packet size instead of + # potentially emitting a series of small packets. + self.send(b"".join(headers)) + del headers + + response = self.response_class(self.sock, method=self._method) # type: ignore[attr-defined] + try: + (version, code, message) = response._read_status() # type: ignore[attr-defined] + + self._raw_proxy_headers = http.client._read_headers(response.fp) # type: ignore[attr-defined] + + if self.debuglevel > 0: + for header in self._raw_proxy_headers: + print("header:", header.decode()) + + if code != http.HTTPStatus.OK: + self.close() + raise OSError( + f"Tunnel connection failed: {code} {message.strip()}" + ) + + finally: + response.close() + + def connect(self) -> None: + self.sock = self._new_conn() + if self._tunnel_host: + # If we're tunneling it means we're connected to our proxy. + self._has_connected_to_proxy = True + + # TODO: Fix tunnel so it doesn't depend on self.sock state. + self._tunnel() + + # If there's a proxy to be connected to we are fully connected. + # This is set twice (once above and here) due to forwarding proxies + # not using tunnelling. + self._has_connected_to_proxy = bool(self.proxy) + + if self._has_connected_to_proxy: + self.proxy_is_verified = False + + @property + def is_closed(self) -> bool: + return self.sock is None + + @property + def is_connected(self) -> bool: + if self.sock is None: + return False + return not wait_for_read(self.sock, timeout=0.0) + + @property + def has_connected_to_proxy(self) -> bool: + return self._has_connected_to_proxy + + @property + def proxy_is_forwarding(self) -> bool: + """ + Return True if a forwarding proxy is configured, else return False + """ + return bool(self.proxy) and self._tunnel_host is None + + @property + def proxy_is_tunneling(self) -> bool: + """ + Return True if a tunneling proxy is configured, else return False + """ + return self._tunnel_host is not None + + def close(self) -> None: + try: + super().close() + finally: + # Reset all stateful properties so connection + # can be re-used without leaking prior configs. + self.sock = None + self.is_verified = False + self.proxy_is_verified = None + self._has_connected_to_proxy = False + self._response_options = None + self._tunnel_host = None + self._tunnel_port = None + self._tunnel_scheme = None + + def putrequest( + self, + method: str, + url: str, + skip_host: bool = False, + skip_accept_encoding: bool = False, + ) -> None: + """""" + # Empty docstring because the indentation of CPython's implementation + # is broken but we don't want this method in our documentation. + match = _CONTAINS_CONTROL_CHAR_RE.search(method) + if match: + raise ValueError( + f"Method cannot contain non-token characters {method!r} (found at least {match.group()!r})" + ) + + return super().putrequest( + method, url, skip_host=skip_host, skip_accept_encoding=skip_accept_encoding + ) + + def putheader(self, header: str, *values: str) -> None: # type: ignore[override] + """""" + if not any(isinstance(v, str) and v == SKIP_HEADER for v in values): + super().putheader(header, *values) + elif to_str(header.lower()) not in SKIPPABLE_HEADERS: + skippable_headers = "', '".join( + [str.title(header) for header in sorted(SKIPPABLE_HEADERS)] + ) + raise ValueError( + f"urllib3.util.SKIP_HEADER only supports '{skippable_headers}'" + ) + + # `request` method's signature intentionally violates LSP. + # urllib3's API is different from `http.client.HTTPConnection` and the subclassing is only incidental. + def request( # type: ignore[override] + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + *, + chunked: bool = False, + preload_content: bool = True, + decode_content: bool = True, + enforce_content_length: bool = True, + ) -> None: + # Update the inner socket's timeout value to send the request. + # This only triggers if the connection is re-used. + if self.sock is not None: + self.sock.settimeout(self.timeout) + + # Store these values to be fed into the HTTPResponse + # object later. TODO: Remove this in favor of a real + # HTTP lifecycle mechanism. + + # We have to store these before we call .request() + # because sometimes we can still salvage a response + # off the wire even if we aren't able to completely + # send the request body. + self._response_options = _ResponseOptions( + request_method=method, + request_url=url, + preload_content=preload_content, + decode_content=decode_content, + enforce_content_length=enforce_content_length, + ) + + if headers is None: + headers = {} + header_keys = frozenset(to_str(k.lower()) for k in headers) + skip_accept_encoding = "accept-encoding" in header_keys + skip_host = "host" in header_keys + self.putrequest( + method, url, skip_accept_encoding=skip_accept_encoding, skip_host=skip_host + ) + + # Transform the body into an iterable of sendall()-able chunks + # and detect if an explicit Content-Length is doable. + chunks_and_cl = body_to_chunks(body, method=method, blocksize=self.blocksize) + chunks = chunks_and_cl.chunks + content_length = chunks_and_cl.content_length + + # When chunked is explicit set to 'True' we respect that. + if chunked: + if "transfer-encoding" not in header_keys: + self.putheader("Transfer-Encoding", "chunked") + else: + # Detect whether a framing mechanism is already in use. If so + # we respect that value, otherwise we pick chunked vs content-length + # depending on the type of 'body'. + if "content-length" in header_keys: + chunked = False + elif "transfer-encoding" in header_keys: + chunked = True + + # Otherwise we go off the recommendation of 'body_to_chunks()'. + else: + chunked = False + if content_length is None: + if chunks is not None: + chunked = True + self.putheader("Transfer-Encoding", "chunked") + else: + self.putheader("Content-Length", str(content_length)) + + # Now that framing headers are out of the way we send all the other headers. + if "user-agent" not in header_keys: + self.putheader("User-Agent", _get_default_user_agent()) + for header, value in headers.items(): + self.putheader(header, value) + self.endheaders() + + # If we're given a body we start sending that in chunks. + if chunks is not None: + for chunk in chunks: + # Sending empty chunks isn't allowed for TE: chunked + # as it indicates the end of the body. + if not chunk: + continue + if isinstance(chunk, str): + chunk = chunk.encode("utf-8") + if chunked: + self.send(b"%x\r\n%b\r\n" % (len(chunk), chunk)) + else: + self.send(chunk) + + # Regardless of whether we have a body or not, if we're in + # chunked mode we want to send an explicit empty chunk. + if chunked: + self.send(b"0\r\n\r\n") + + def request_chunked( + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + ) -> None: + """ + Alternative to the common request method, which sends the + body with chunked encoding and not as one block + """ + warnings.warn( + "HTTPConnection.request_chunked() is deprecated and will be removed " + "in urllib3 v3.0. Instead use HTTPConnection.request(..., chunked=True).", + category=FutureWarning, + stacklevel=2, + ) + self.request(method, url, body=body, headers=headers, chunked=True) + + def getresponse( # type: ignore[override] + self, + ) -> HTTPResponse: + """ + Get the response from the server. + + If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by the response_class variable. + + If a request has not been sent or if a previous response has not be handled, ResponseNotReady is raised. If the HTTP response indicates that the connection should be closed, then it will be closed before the response is returned. When the connection is closed, the underlying socket is closed. + """ + # Raise the same error as http.client.HTTPConnection + if self._response_options is None: + raise ResponseNotReady() + + # Reset this attribute for being used again. + resp_options = self._response_options + self._response_options = None + + # Since the connection's timeout value may have been updated + # we need to set the timeout on the socket. + self.sock.settimeout(self.timeout) + + # This is needed here to avoid circular import errors + from .response import HTTPResponse + + # Save a reference to the shutdown function before ownership is passed + # to httplib_response + # TODO should we implement it everywhere? + _shutdown = getattr(self.sock, "shutdown", None) + + # Get the response from http.client.HTTPConnection + httplib_response = super().getresponse() + + try: + assert_header_parsing(httplib_response.msg) + except (HeaderParsingError, TypeError) as hpe: + log.warning( + "Failed to parse headers (url=%s): %s", + _url_from_connection(self, resp_options.request_url), + hpe, + exc_info=True, + ) + + headers = HTTPHeaderDict(httplib_response.msg.items()) + + response = HTTPResponse( + body=httplib_response, + headers=headers, + status=httplib_response.status, + version=httplib_response.version, + version_string=getattr(self, "_http_vsn_str", "HTTP/?"), + reason=httplib_response.reason, + preload_content=resp_options.preload_content, + decode_content=resp_options.decode_content, + original_response=httplib_response, + enforce_content_length=resp_options.enforce_content_length, + request_method=resp_options.request_method, + request_url=resp_options.request_url, + sock_shutdown=_shutdown, + ) + return response + + +class HTTPSConnection(HTTPConnection): + """ + Many of the parameters to this constructor are passed to the underlying SSL + socket by means of :py:func:`urllib3.util.ssl_wrap_socket`. + """ + + default_port = port_by_scheme["https"] # type: ignore[misc] + + cert_reqs: int | str | None = None + ca_certs: str | None = None + ca_cert_dir: str | None = None + ca_cert_data: None | str | bytes = None + ssl_version: int | str | None = None + ssl_minimum_version: int | None = None + ssl_maximum_version: int | None = None + assert_fingerprint: str | None = None + _connect_callback: typing.Callable[..., None] | None = None + + def __init__( + self, + host: str, + port: int | None = None, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 16384, + socket_options: None | ( + connection._TYPE_SOCKET_OPTIONS + ) = HTTPConnection.default_socket_options, + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + cert_reqs: int | str | None = None, + assert_hostname: None | str | typing.Literal[False] = None, + assert_fingerprint: str | None = None, + server_hostname: str | None = None, + ssl_context: ssl.SSLContext | None = None, + ca_certs: str | None = None, + ca_cert_dir: str | None = None, + ca_cert_data: None | str | bytes = None, + ssl_minimum_version: int | None = None, + ssl_maximum_version: int | None = None, + ssl_version: int | str | None = None, # Deprecated + cert_file: str | None = None, + key_file: str | None = None, + key_password: str | None = None, + ) -> None: + super().__init__( + host, + port=port, + timeout=timeout, + source_address=source_address, + blocksize=blocksize, + socket_options=socket_options, + proxy=proxy, + proxy_config=proxy_config, + ) + + self.key_file = key_file + self.cert_file = cert_file + self.key_password = key_password + self.ssl_context = ssl_context + self.server_hostname = server_hostname + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + self.ssl_version = ssl_version + self.ssl_minimum_version = ssl_minimum_version + self.ssl_maximum_version = ssl_maximum_version + self.ca_certs = ca_certs and os.path.expanduser(ca_certs) + self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir) + self.ca_cert_data = ca_cert_data + + # cert_reqs depends on ssl_context so calculate last. + if cert_reqs is None: + if self.ssl_context is not None: + cert_reqs = self.ssl_context.verify_mode + else: + cert_reqs = resolve_cert_reqs(None) + self.cert_reqs = cert_reqs + self._connect_callback = None + + def set_cert( + self, + key_file: str | None = None, + cert_file: str | None = None, + cert_reqs: int | str | None = None, + key_password: str | None = None, + ca_certs: str | None = None, + assert_hostname: None | str | typing.Literal[False] = None, + assert_fingerprint: str | None = None, + ca_cert_dir: str | None = None, + ca_cert_data: None | str | bytes = None, + ) -> None: + """ + This method should only be called once, before the connection is used. + """ + warnings.warn( + "HTTPSConnection.set_cert() is deprecated and will be removed " + "in urllib3 v3.0. Instead provide the parameters to the " + "HTTPSConnection constructor.", + category=FutureWarning, + stacklevel=2, + ) + + # If cert_reqs is not provided we'll assume CERT_REQUIRED unless we also + # have an SSLContext object in which case we'll use its verify_mode. + if cert_reqs is None: + if self.ssl_context is not None: + cert_reqs = self.ssl_context.verify_mode + else: + cert_reqs = resolve_cert_reqs(None) + + self.key_file = key_file + self.cert_file = cert_file + self.cert_reqs = cert_reqs + self.key_password = key_password + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + self.ca_certs = ca_certs and os.path.expanduser(ca_certs) + self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir) + self.ca_cert_data = ca_cert_data + + def connect(self) -> None: + # Today we don't need to be doing this step before the /actual/ socket + # connection, however in the future we'll need to decide whether to + # create a new socket or re-use an existing "shared" socket as a part + # of the HTTP/2 handshake dance. + if self._tunnel_host is not None and self._tunnel_port is not None: + probe_http2_host = self._tunnel_host + probe_http2_port = self._tunnel_port + else: + probe_http2_host = self.host + probe_http2_port = self.port + + # Check if the target origin supports HTTP/2. + # If the value comes back as 'None' it means that the current thread + # is probing for HTTP/2 support. Otherwise, we're waiting for another + # probe to complete, or we get a value right away. + target_supports_http2: bool | None + if "h2" in ssl_.ALPN_PROTOCOLS: + target_supports_http2 = http2_probe.acquire_and_get( + host=probe_http2_host, port=probe_http2_port + ) + else: + # If HTTP/2 isn't going to be offered it doesn't matter if + # the target supports HTTP/2. Don't want to make a probe. + target_supports_http2 = False + + if self._connect_callback is not None: + self._connect_callback( + "before connect", + thread_id=threading.get_ident(), + target_supports_http2=target_supports_http2, + ) + + try: + sock: socket.socket | ssl.SSLSocket + self.sock = sock = self._new_conn() + server_hostname: str = self.host + tls_in_tls = False + + # Do we need to establish a tunnel? + if self.proxy_is_tunneling: + # We're tunneling to an HTTPS origin so need to do TLS-in-TLS. + if self._tunnel_scheme == "https": + # _connect_tls_proxy will verify and assign proxy_is_verified + self.sock = sock = self._connect_tls_proxy(self.host, sock) + tls_in_tls = True + elif self._tunnel_scheme == "http": + self.proxy_is_verified = False + + # If we're tunneling it means we're connected to our proxy. + self._has_connected_to_proxy = True + + self._tunnel() + # Override the host with the one we're requesting data from. + server_hostname = typing.cast(str, self._tunnel_host) + + if self.server_hostname is not None: + server_hostname = self.server_hostname + + is_time_off = datetime.date.today() < RECENT_DATE + if is_time_off: + warnings.warn( + ( + f"System time is way off (before {RECENT_DATE}). This will probably " + "lead to SSL verification errors" + ), + SystemTimeWarning, + ) + + # Remove trailing '.' from fqdn hostnames to allow certificate validation + server_hostname_rm_dot = server_hostname.rstrip(".") + + sock_and_verified = _ssl_wrap_socket_and_match_hostname( + sock=sock, + cert_reqs=self.cert_reqs, + ssl_version=self.ssl_version, + ssl_minimum_version=self.ssl_minimum_version, + ssl_maximum_version=self.ssl_maximum_version, + ca_certs=self.ca_certs, + ca_cert_dir=self.ca_cert_dir, + ca_cert_data=self.ca_cert_data, + cert_file=self.cert_file, + key_file=self.key_file, + key_password=self.key_password, + server_hostname=server_hostname_rm_dot, + ssl_context=self.ssl_context, + tls_in_tls=tls_in_tls, + assert_hostname=self.assert_hostname, + assert_fingerprint=self.assert_fingerprint, + ) + self.sock = sock_and_verified.socket + + # If an error occurs during connection/handshake we may need to release + # our lock so another connection can probe the origin. + except BaseException: + if self._connect_callback is not None: + self._connect_callback( + "after connect failure", + thread_id=threading.get_ident(), + target_supports_http2=target_supports_http2, + ) + + if target_supports_http2 is None: + http2_probe.set_and_release( + host=probe_http2_host, port=probe_http2_port, supports_http2=None + ) + raise + + # If this connection doesn't know if the origin supports HTTP/2 + # we report back to the HTTP/2 probe our result. + if target_supports_http2 is None: + supports_http2 = sock_and_verified.socket.selected_alpn_protocol() == "h2" + http2_probe.set_and_release( + host=probe_http2_host, + port=probe_http2_port, + supports_http2=supports_http2, + ) + + # Forwarding proxies can never have a verified target since + # the proxy is the one doing the verification. Should instead + # use a CONNECT tunnel in order to verify the target. + # See: https://github.com/urllib3/urllib3/issues/3267. + if self.proxy_is_forwarding: + self.is_verified = False + else: + self.is_verified = sock_and_verified.is_verified + + # If there's a proxy to be connected to we are fully connected. + # This is set twice (once above and here) due to forwarding proxies + # not using tunnelling. + self._has_connected_to_proxy = bool(self.proxy) + + # Set `self.proxy_is_verified` unless it's already set while + # establishing a tunnel. + if self._has_connected_to_proxy and self.proxy_is_verified is None: + self.proxy_is_verified = sock_and_verified.is_verified + + def _connect_tls_proxy(self, hostname: str, sock: socket.socket) -> ssl.SSLSocket: + """ + Establish a TLS connection to the proxy using the provided SSL context. + """ + # `_connect_tls_proxy` is called when self._tunnel_host is truthy. + proxy_config = typing.cast(ProxyConfig, self.proxy_config) + ssl_context = proxy_config.ssl_context + sock_and_verified = _ssl_wrap_socket_and_match_hostname( + sock, + cert_reqs=self.cert_reqs, + ssl_version=self.ssl_version, + ssl_minimum_version=self.ssl_minimum_version, + ssl_maximum_version=self.ssl_maximum_version, + ca_certs=self.ca_certs, + ca_cert_dir=self.ca_cert_dir, + ca_cert_data=self.ca_cert_data, + server_hostname=hostname, + ssl_context=ssl_context, + assert_hostname=proxy_config.assert_hostname, + assert_fingerprint=proxy_config.assert_fingerprint, + # Features that aren't implemented for proxies yet: + cert_file=None, + key_file=None, + key_password=None, + tls_in_tls=False, + ) + self.proxy_is_verified = sock_and_verified.is_verified + return sock_and_verified.socket # type: ignore[return-value] + + +class _WrappedAndVerifiedSocket(typing.NamedTuple): + """ + Wrapped socket and whether the connection is + verified after the TLS handshake + """ + + socket: ssl.SSLSocket | SSLTransport + is_verified: bool + + +def _ssl_wrap_socket_and_match_hostname( + sock: socket.socket, + *, + cert_reqs: None | str | int, + ssl_version: None | str | int, + ssl_minimum_version: int | None, + ssl_maximum_version: int | None, + cert_file: str | None, + key_file: str | None, + key_password: str | None, + ca_certs: str | None, + ca_cert_dir: str | None, + ca_cert_data: None | str | bytes, + assert_hostname: None | str | typing.Literal[False], + assert_fingerprint: str | None, + server_hostname: str | None, + ssl_context: ssl.SSLContext | None, + tls_in_tls: bool = False, +) -> _WrappedAndVerifiedSocket: + """Logic for constructing an SSLContext from all TLS parameters, passing + that down into ssl_wrap_socket, and then doing certificate verification + either via hostname or fingerprint. This function exists to guarantee + that both proxies and targets have the same behavior when connecting via TLS. + """ + default_ssl_context = False + if ssl_context is None: + default_ssl_context = True + context = create_urllib3_context( + ssl_version=resolve_ssl_version(ssl_version), + ssl_minimum_version=ssl_minimum_version, + ssl_maximum_version=ssl_maximum_version, + cert_reqs=resolve_cert_reqs(cert_reqs), + ) + else: + context = ssl_context + + context.verify_mode = resolve_cert_reqs(cert_reqs) + + # In some cases, we want to verify hostnames ourselves + if ( + # `ssl` can't verify fingerprints or alternate hostnames + assert_fingerprint + or assert_hostname + # assert_hostname can be set to False to disable hostname checking + or assert_hostname is False + # We still support OpenSSL 1.0.2, which prevents us from verifying + # hostnames easily: https://github.com/pyca/pyopenssl/pull/933 + or ssl_.IS_PYOPENSSL + or not ssl_.HAS_NEVER_CHECK_COMMON_NAME + ): + context.check_hostname = False + + # Try to load OS default certs if none are given. We need to do the hasattr() check + # for custom pyOpenSSL SSLContext objects because they don't support + # load_default_certs(). + if ( + not ca_certs + and not ca_cert_dir + and not ca_cert_data + and default_ssl_context + and hasattr(context, "load_default_certs") + ): + context.load_default_certs() + + # Ensure that IPv6 addresses are in the proper format and don't have a + # scope ID. Python's SSL module fails to recognize scoped IPv6 addresses + # and interprets them as DNS hostnames. + if server_hostname is not None: + normalized = server_hostname.strip("[]") + if "%" in normalized: + normalized = normalized[: normalized.rfind("%")] + if is_ipaddress(normalized): + server_hostname = normalized + + ssl_sock = ssl_wrap_socket( + sock=sock, + keyfile=key_file, + certfile=cert_file, + key_password=key_password, + ca_certs=ca_certs, + ca_cert_dir=ca_cert_dir, + ca_cert_data=ca_cert_data, + server_hostname=server_hostname, + ssl_context=context, + tls_in_tls=tls_in_tls, + ) + + try: + if assert_fingerprint: + _assert_fingerprint( + ssl_sock.getpeercert(binary_form=True), assert_fingerprint + ) + elif ( + context.verify_mode != ssl.CERT_NONE + and not context.check_hostname + and assert_hostname is not False + ): + cert: _TYPE_PEER_CERT_RET_DICT = ssl_sock.getpeercert() # type: ignore[assignment] + + # Need to signal to our match_hostname whether to use 'commonName' or not. + # If we're using our own constructed SSLContext we explicitly set 'False' + # because PyPy hard-codes 'True' from SSLContext.hostname_checks_common_name. + if default_ssl_context: + hostname_checks_common_name = False + else: + hostname_checks_common_name = ( + getattr(context, "hostname_checks_common_name", False) or False + ) + + _match_hostname( + cert, + assert_hostname or server_hostname, # type: ignore[arg-type] + hostname_checks_common_name, + ) + + return _WrappedAndVerifiedSocket( + socket=ssl_sock, + is_verified=context.verify_mode == ssl.CERT_REQUIRED + or bool(assert_fingerprint), + ) + except BaseException: + ssl_sock.close() + raise + + +def _match_hostname( + cert: _TYPE_PEER_CERT_RET_DICT | None, + asserted_hostname: str, + hostname_checks_common_name: bool = False, +) -> None: + # Our upstream implementation of ssl.match_hostname() + # only applies this normalization to IP addresses so it doesn't + # match DNS SANs so we do the same thing! + stripped_hostname = asserted_hostname.strip("[]") + if is_ipaddress(stripped_hostname): + asserted_hostname = stripped_hostname + + try: + match_hostname(cert, asserted_hostname, hostname_checks_common_name) + except CertificateError as e: + log.warning( + "Certificate did not match expected hostname: %s. Certificate: %s", + asserted_hostname, + cert, + ) + # Add cert to exception and reraise so client code can inspect + # the cert when catching the exception, if they want to + e._peer_cert = cert # type: ignore[attr-defined] + raise + + +def _wrap_proxy_error(err: Exception, proxy_scheme: str | None) -> ProxyError: + # Look for the phrase 'wrong version number', if found + # then we should warn the user that we're very sure that + # this proxy is HTTP-only and they have a configuration issue. + error_normalized = " ".join(re.split("[^a-z]", str(err).lower())) + is_likely_http_proxy = ( + "wrong version number" in error_normalized + or "unknown protocol" in error_normalized + or "record layer failure" in error_normalized + ) + http_proxy_warning = ( + ". Your proxy appears to only use HTTP and not HTTPS, " + "try changing your proxy URL to be HTTP. See: " + "https://urllib3.readthedocs.io/en/latest/advanced-usage.html" + "#https-proxy-error-http-proxy" + ) + new_err = ProxyError( + f"Unable to connect to proxy" + f"{http_proxy_warning if is_likely_http_proxy and proxy_scheme == 'https' else ''}", + err, + ) + new_err.__cause__ = err + return new_err + + +def _get_default_user_agent() -> str: + return f"python-urllib3/{__version__}" + + +class DummyConnection: + """Used to detect a failed ConnectionCls import.""" + + +if not ssl: + HTTPSConnection = DummyConnection # type: ignore[misc, assignment] # noqa: F811 + + +VerifiedHTTPSConnection = HTTPSConnection + + +def _url_from_connection( + conn: HTTPConnection | HTTPSConnection, path: str | None = None +) -> str: + """Returns the URL from a given connection. This is mainly used for testing and logging.""" + + scheme = "https" if isinstance(conn, HTTPSConnection) else "http" + + return Url(scheme=scheme, host=conn.host, port=conn.port, path=path).url diff --git a/micromamba_root/Lib/site-packages/urllib3/connectionpool.py b/micromamba_root/Lib/site-packages/urllib3/connectionpool.py new file mode 100644 index 0000000000000000000000000000000000000000..70fbc5e725aee571654b1a58748537fa167b498d --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/connectionpool.py @@ -0,0 +1,1191 @@ +from __future__ import annotations + +import errno +import logging +import queue +import sys +import typing +import warnings +import weakref +from socket import timeout as SocketTimeout +from types import TracebackType + +from ._base_connection import _TYPE_BODY +from ._collections import HTTPHeaderDict +from ._request_methods import RequestMethods +from .connection import ( + BaseSSLError, + BrokenPipeError, + DummyConnection, + HTTPConnection, + HTTPException, + HTTPSConnection, + ProxyConfig, + _wrap_proxy_error, +) +from .connection import port_by_scheme as port_by_scheme +from .exceptions import ( + ClosedPoolError, + EmptyPoolError, + FullPoolError, + HostChangedError, + InsecureRequestWarning, + LocationValueError, + MaxRetryError, + NewConnectionError, + ProtocolError, + ProxyError, + ReadTimeoutError, + SSLError, + TimeoutError, +) +from .response import BaseHTTPResponse +from .util.connection import is_connection_dropped +from .util.proxy import connection_requires_http_tunnel +from .util.request import _TYPE_BODY_POSITION, set_file_position +from .util.retry import Retry +from .util.ssl_match_hostname import CertificateError +from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_DEFAULT, Timeout +from .util.url import Url, _encode_target +from .util.url import _normalize_host as normalize_host +from .util.url import parse_url +from .util.util import to_str + +if typing.TYPE_CHECKING: + import ssl + + from typing_extensions import Self + + from ._base_connection import BaseHTTPConnection, BaseHTTPSConnection + +log = logging.getLogger(__name__) + +_TYPE_TIMEOUT = typing.Union[Timeout, float, _TYPE_DEFAULT, None] + + +# Pool objects +class ConnectionPool: + """ + Base class for all connection pools, such as + :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`. + + .. note:: + ConnectionPool.urlopen() does not normalize or percent-encode target URIs + which is useful if your target server doesn't support percent-encoded + target URIs. + """ + + scheme: str | None = None + QueueCls = queue.LifoQueue + + def __init__(self, host: str, port: int | None = None) -> None: + if not host: + raise LocationValueError("No host specified.") + + self.host = _normalize_host(host, scheme=self.scheme) + self.port = port + + # This property uses 'normalize_host()' (not '_normalize_host()') + # to avoid removing square braces around IPv6 addresses. + # This value is sent to `HTTPConnection.set_tunnel()` if called + # because square braces are required for HTTP CONNECT tunneling. + self._tunnel_host = normalize_host(host, scheme=self.scheme).lower() + + def __str__(self) -> str: + return f"{type(self).__name__}(host={self.host!r}, port={self.port!r})" + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> typing.Literal[False]: + self.close() + # Return False to re-raise any potential exceptions + return False + + def close(self) -> None: + """ + Close all pooled connections and disable the pool. + """ + + +# This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252 +_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK} + + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + """ + Thread-safe connection pool for one host. + + :param host: + Host used for this HTTP Connection (e.g. "localhost"), passed into + :class:`http.client.HTTPConnection`. + + :param port: + Port used for this HTTP Connection (None is equivalent to 80), passed + into :class:`http.client.HTTPConnection`. + + :param timeout: + Socket timeout in seconds for each individual connection. This can + be a float or integer, which sets the timeout for the HTTP request, + or an instance of :class:`urllib3.util.Timeout` which gives you more + fine-grained control over request timeouts. After the constructor has + been parsed, this is always a `urllib3.util.Timeout` object. + + :param maxsize: + Number of connections to save that can be reused. More than 1 is useful + in multithreaded situations. If ``block`` is set to False, more + connections will be created but they will not be saved once they've + been used. + + :param block: + If set to True, no more than ``maxsize`` connections will be used at + a time. When no free connections are available, the call will block + until a connection has been released. This is a useful side effect for + particular multithreaded situations where one does not want to use more + than maxsize connections per host to prevent flooding. + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + + :param retries: + Retry configuration to use by default with requests in this pool. + + :param _proxy: + Parsed proxy URL, should not be used directly, instead, see + :class:`urllib3.ProxyManager` + + :param _proxy_headers: + A dictionary with proxy headers, should not be used directly, + instead, see :class:`urllib3.ProxyManager` + + :param \\**conn_kw: + Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`, + :class:`urllib3.connection.HTTPSConnection` instances. + """ + + scheme = "http" + ConnectionCls: type[BaseHTTPConnection] | type[BaseHTTPSConnection] = HTTPConnection + + def __init__( + self, + host: str, + port: int | None = None, + timeout: _TYPE_TIMEOUT | None = _DEFAULT_TIMEOUT, + maxsize: int = 1, + block: bool = False, + headers: typing.Mapping[str, str] | None = None, + retries: Retry | bool | int | None = None, + _proxy: Url | None = None, + _proxy_headers: typing.Mapping[str, str] | None = None, + _proxy_config: ProxyConfig | None = None, + **conn_kw: typing.Any, + ): + ConnectionPool.__init__(self, host, port) + RequestMethods.__init__(self, headers) + + if not isinstance(timeout, Timeout): + timeout = Timeout.from_float(timeout) + + if retries is None: + retries = Retry.DEFAULT + + self.timeout = timeout + self.retries = retries + + self.pool: queue.LifoQueue[typing.Any] | None = self.QueueCls(maxsize) + self.block = block + + self.proxy = _proxy + self.proxy_headers = _proxy_headers or {} + self.proxy_config = _proxy_config + + # Fill the queue up so that doing get() on it will block properly + for _ in range(maxsize): + self.pool.put(None) + + # These are mostly for testing and debugging purposes. + self.num_connections = 0 + self.num_requests = 0 + self.conn_kw = conn_kw + + if self.proxy: + # Enable Nagle's algorithm for proxies, to avoid packet fragmentation. + # Defaulting `socket_options` to an empty list avoids it defaulting to + # ``HTTPConnection.default_socket_options``. + self.conn_kw.setdefault("socket_options", []) + + self.conn_kw["proxy"] = self.proxy + self.conn_kw["proxy_config"] = self.proxy_config + + # Do not pass 'self' as callback to 'finalize'. + # Then the 'finalize' would keep an endless living (leak) to self. + # By just passing a reference to the pool allows the garbage collector + # to free self if nobody else has a reference to it. + pool = self.pool + + # Close all the HTTPConnections in the pool before the + # HTTPConnectionPool object is garbage collected. + weakref.finalize(self, _close_pool_connections, pool) + + def _new_conn(self) -> BaseHTTPConnection: + """ + Return a fresh :class:`HTTPConnection`. + """ + self.num_connections += 1 + log.debug( + "Starting new HTTP connection (%d): %s:%s", + self.num_connections, + self.host, + self.port or "80", + ) + + conn = self.ConnectionCls( + host=self.host, + port=self.port, + timeout=self.timeout.connect_timeout, + **self.conn_kw, + ) + return conn + + def _get_conn(self, timeout: float | None = None) -> BaseHTTPConnection: + """ + Get a connection. Will return a pooled connection if one is available. + + If no connections are available and :prop:`.block` is ``False``, then a + fresh connection is returned. + + :param timeout: + Seconds to wait before giving up and raising + :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and + :prop:`.block` is ``True``. + """ + conn = None + + if self.pool is None: + raise ClosedPoolError(self, "Pool is closed.") + + try: + conn = self.pool.get(block=self.block, timeout=timeout) + + except AttributeError: # self.pool is None + raise ClosedPoolError(self, "Pool is closed.") from None # Defensive: + + except queue.Empty: + if self.block: + raise EmptyPoolError( + self, + "Pool is empty and a new connection can't be opened due to blocking mode.", + ) from None + pass # Oh well, we'll create a new connection then + + # If this is a persistent connection, check if it got disconnected + if conn and is_connection_dropped(conn): + log.debug("Resetting dropped connection: %s", self.host) + conn.close() + + return conn or self._new_conn() + + def _put_conn(self, conn: BaseHTTPConnection | None) -> None: + """ + Put a connection back into the pool. + + :param conn: + Connection object for the current host and port as returned by + :meth:`._new_conn` or :meth:`._get_conn`. + + If the pool is already full, the connection is closed and discarded + because we exceeded maxsize. If connections are discarded frequently, + then maxsize should be increased. + + If the pool is closed, then the connection will be closed and discarded. + """ + if self.pool is not None: + try: + self.pool.put(conn, block=False) + return # Everything is dandy, done. + except AttributeError: + # self.pool is None. + pass + except queue.Full: + # Connection never got put back into the pool, close it. + if conn: + conn.close() + + if self.block: + # This should never happen if you got the conn from self._get_conn + raise FullPoolError( + self, + "Pool reached maximum size and no more connections are allowed.", + ) from None + + log.warning( + "Connection pool is full, discarding connection: %s. Connection pool size: %s", + self.host, + self.pool.qsize(), + ) + + # Connection never got put back into the pool, close it. + if conn: + conn.close() + + def _validate_conn(self, conn: BaseHTTPConnection) -> None: + """ + Called right before a request is made, after the socket is created. + """ + + def _prepare_proxy(self, conn: BaseHTTPConnection) -> None: + # Nothing to do for HTTP connections. + pass + + def _get_timeout(self, timeout: _TYPE_TIMEOUT) -> Timeout: + """Helper that always returns a :class:`urllib3.util.Timeout`""" + if timeout is _DEFAULT_TIMEOUT: + return self.timeout.clone() + + if isinstance(timeout, Timeout): + return timeout.clone() + else: + # User passed us an int/float. This is for backwards compatibility, + # can be removed later + return Timeout.from_float(timeout) + + def _raise_timeout( + self, + err: BaseSSLError | OSError | SocketTimeout, + url: str, + timeout_value: _TYPE_TIMEOUT | None, + ) -> None: + """Is the error actually a timeout? Will raise a ReadTimeout or pass""" + + if isinstance(err, SocketTimeout): + raise ReadTimeoutError( + self, url, f"Read timed out. (read timeout={timeout_value})" + ) from err + + # See the above comment about EAGAIN in Python 3. + if hasattr(err, "errno") and err.errno in _blocking_errnos: + raise ReadTimeoutError( + self, url, f"Read timed out. (read timeout={timeout_value})" + ) from err + + def _make_request( + self, + conn: BaseHTTPConnection, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + retries: Retry | None = None, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + chunked: bool = False, + response_conn: BaseHTTPConnection | None = None, + preload_content: bool = True, + decode_content: bool = True, + enforce_content_length: bool = True, + ) -> BaseHTTPResponse: + """ + Perform a request on a given urllib connection object taken from our + pool. + + :param conn: + a connection from one of our connection pools + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param body: + Data to send in the request body, either :class:`str`, :class:`bytes`, + an iterable of :class:`str`/:class:`bytes`, or a file-like object. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + + :param retries: + Configure the number of retries to allow before raising a + :class:`~urllib3.exceptions.MaxRetryError` exception. + + Pass ``None`` to retry until you receive a response. Pass a + :class:`~urllib3.util.retry.Retry` object for fine-grained control + over different types of retries. + Pass an integer number to retry connection errors that many times, + but no other types of errors. Pass zero to never retry. + + If ``False``, then retries are disabled and any exception is raised + immediately. Also, instead of raising a MaxRetryError on redirects, + the redirect response will be returned. + + :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. + + :param timeout: + If specified, overrides the default timeout for this one + request. It may be a float (in seconds) or an instance of + :class:`urllib3.util.Timeout`. + + :param chunked: + If True, urllib3 will send the body using chunked transfer + encoding. Otherwise, urllib3 will send the body using the standard + content-length form. Defaults to False. + + :param response_conn: + Set this to ``None`` if you will handle releasing the connection or + set the connection to have the response release it. + + :param preload_content: + If True, the response's body will be preloaded during construction. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param enforce_content_length: + Enforce content length checking. Body returned by server must match + value of Content-Length header, if present. Otherwise, raise error. + """ + self.num_requests += 1 + + timeout_obj = self._get_timeout(timeout) + timeout_obj.start_connect() + conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout) + + try: + # Trigger any extra validation we need to do. + try: + self._validate_conn(conn) + except (SocketTimeout, BaseSSLError) as e: + self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) + raise + + # _validate_conn() starts the connection to an HTTPS proxy + # so we need to wrap errors with 'ProxyError' here too. + except ( + OSError, + NewConnectionError, + TimeoutError, + BaseSSLError, + CertificateError, + SSLError, + ) as e: + new_e: Exception = e + if isinstance(e, (BaseSSLError, CertificateError)): + new_e = SSLError(e) + # If the connection didn't successfully connect to it's proxy + # then there + if isinstance( + new_e, (OSError, NewConnectionError, TimeoutError, SSLError) + ) and (conn and conn.proxy and not conn.has_connected_to_proxy): + new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) + raise new_e + + # conn.request() calls http.client.*.request, not the method in + # urllib3.request. It also calls makefile (recv) on the socket. + try: + conn.request( + method, + url, + body=body, + headers=headers, + chunked=chunked, + preload_content=preload_content, + decode_content=decode_content, + enforce_content_length=enforce_content_length, + ) + + # We are swallowing BrokenPipeError (errno.EPIPE) since the server is + # legitimately able to close the connection after sending a valid response. + # With this behaviour, the received response is still readable. + except BrokenPipeError: + pass + except OSError as e: + # MacOS/Linux + # EPROTOTYPE and ECONNRESET are needed on macOS + # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ + # Condition changed later to emit ECONNRESET instead of only EPROTOTYPE. + if e.errno != errno.EPROTOTYPE and e.errno != errno.ECONNRESET: + raise + + # Reset the timeout for the recv() on the socket + read_timeout = timeout_obj.read_timeout + + if not conn.is_closed: + # In Python 3 socket.py will catch EAGAIN and return None when you + # try and read into the file pointer created by http.client, which + # instead raises a BadStatusLine exception. Instead of catching + # the exception and assuming all BadStatusLine exceptions are read + # timeouts, check for a zero timeout before making the request. + if read_timeout == 0: + raise ReadTimeoutError( + self, url, f"Read timed out. (read timeout={read_timeout})" + ) + conn.timeout = read_timeout + + # Receive the response from the server + try: + response = conn.getresponse() + except (BaseSSLError, OSError) as e: + self._raise_timeout(err=e, url=url, timeout_value=read_timeout) + raise + + # Set properties that are used by the pooling layer. + response.retries = retries + response._connection = response_conn # type: ignore[attr-defined] + response._pool = self # type: ignore[attr-defined] + + log.debug( + '%s://%s:%s "%s %s %s" %s %s', + self.scheme, + self.host, + self.port, + method, + url, + response.version_string, + response.status, + response.length_remaining, + ) + + return response + + def close(self) -> None: + """ + Close all pooled connections and disable the pool. + """ + if self.pool is None: + return + # Disable access to the pool + old_pool, self.pool = self.pool, None + + # Close all the HTTPConnections in the pool. + _close_pool_connections(old_pool) + + def is_same_host(self, url: str) -> bool: + """ + Check if the given ``url`` is a member of the same host as this + connection pool. + """ + if url.startswith("/"): + return True + + # TODO: Add optional support for socket.gethostbyname checking. + scheme, _, host, port, *_ = parse_url(url) + scheme = scheme or "http" + if host is not None: + host = _normalize_host(host, scheme=scheme) + + # Use explicit default port for comparison when none is given + if self.port and not port: + port = port_by_scheme.get(scheme) + elif not self.port and port == port_by_scheme.get(scheme): + port = None + + return (scheme, host, port) == (self.scheme, self.host, self.port) + + def urlopen( # type: ignore[override] + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + retries: Retry | bool | int | None = None, + redirect: bool = True, + assert_same_host: bool = True, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + pool_timeout: int | None = None, + release_conn: bool | None = None, + chunked: bool = False, + body_pos: _TYPE_BODY_POSITION | None = None, + preload_content: bool = True, + decode_content: bool = True, + **response_kw: typing.Any, + ) -> BaseHTTPResponse: + """ + Get a connection from the pool and perform an HTTP request. This is the + lowest level call for making a request, so you'll need to specify all + the raw details. + + .. note:: + + More commonly, it's appropriate to use a convenience method + such as :meth:`request`. + + .. note:: + + `release_conn` will only behave as expected if + `preload_content=False` because we want to make + `preload_content=False` the default behaviour someday soon without + breaking backwards compatibility. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param url: + The URL to perform the request on. + + :param body: + Data to send in the request body, either :class:`str`, :class:`bytes`, + an iterable of :class:`str`/:class:`bytes`, or a file-like object. + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + + :param retries: + Configure the number of retries to allow before raising a + :class:`~urllib3.exceptions.MaxRetryError` exception. + + If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a + :class:`~urllib3.util.retry.Retry` object for fine-grained control + over different types of retries. + Pass an integer number to retry connection errors that many times, + but no other types of errors. Pass zero to never retry. + + If ``False``, then retries are disabled and any exception is raised + immediately. Also, instead of raising a MaxRetryError on redirects, + the redirect response will be returned. + + :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. + + :param redirect: + If True, automatically handle redirects (status codes 301, 302, + 303, 307, 308). Each redirect counts as a retry. Disabling retries + will disable redirect, too. + + :param assert_same_host: + If ``True``, will make sure that the host of the pool requests is + consistent else will raise HostChangedError. When ``False``, you can + use the pool on an HTTP proxy and request foreign hosts. + + :param timeout: + If specified, overrides the default timeout for this one + request. It may be a float (in seconds) or an instance of + :class:`urllib3.util.Timeout`. + + :param pool_timeout: + If set and the pool is set to block=True, then this method will + block for ``pool_timeout`` seconds and raise EmptyPoolError if no + connection is available within the time period. + + :param bool preload_content: + If True, the response's body will be preloaded into memory. + + :param bool decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param release_conn: + If False, then the urlopen call will not release the connection + back into the pool once a response is received (but will release if + you read the entire contents of the response such as when + `preload_content=True`). This is useful if you're not preloading + the response's content immediately. You will need to call + ``r.release_conn()`` on the response ``r`` to return the connection + back into the pool. If None, it takes the value of ``preload_content`` + which defaults to ``True``. + + :param bool chunked: + If True, urllib3 will send the body using chunked transfer + encoding. Otherwise, urllib3 will send the body using the standard + content-length form. Defaults to False. + + :param int body_pos: + Position to seek to in file-like body in the event of a retry or + redirect. Typically this won't need to be set because urllib3 will + auto-populate the value when needed. + """ + # Ensure that the URL we're connecting to is properly encoded + if url.startswith("/"): + # URLs starting with / are inherently schemeless. + url = to_str(_encode_target(url)) + destination_scheme = None + else: + parsed_url = parse_url(url) + destination_scheme = parsed_url.scheme + url = to_str(parsed_url.url) + + if headers is None: + headers = self.headers + + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect, default=self.retries) + + if release_conn is None: + release_conn = preload_content + + # Check host + if assert_same_host and not self.is_same_host(url): + raise HostChangedError(self, url, retries) + + conn = None + + # Track whether `conn` needs to be released before + # returning/raising/recursing. Update this variable if necessary, and + # leave `release_conn` constant throughout the function. That way, if + # the function recurses, the original value of `release_conn` will be + # passed down into the recursive call, and its value will be respected. + # + # See issue #651 [1] for details. + # + # [1] <https://github.com/urllib3/urllib3/issues/651> + release_this_conn = release_conn + + http_tunnel_required = connection_requires_http_tunnel( + self.proxy, self.proxy_config, destination_scheme + ) + + # Merge the proxy headers. Only done when not using HTTP CONNECT. We + # have to copy the headers dict so we can safely change it without those + # changes being reflected in anyone else's copy. + if not http_tunnel_required: + headers = headers.copy() # type: ignore[attr-defined] + headers.update(self.proxy_headers) # type: ignore[union-attr] + + # Must keep the exception bound to a separate variable or else Python 3 + # complains about UnboundLocalError. + err = None + + # Keep track of whether we cleanly exited the except block. This + # ensures we do proper cleanup in finally. + clean_exit = False + + # Rewind body position, if needed. Record current position + # for future rewinds in the event of a redirect/retry. + body_pos = set_file_position(body, body_pos) + + try: + # Request a connection from the queue. + timeout_obj = self._get_timeout(timeout) + conn = self._get_conn(timeout=pool_timeout) + + conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] + + # Is this a closed/new connection that requires CONNECT tunnelling? + if self.proxy is not None and http_tunnel_required and conn.is_closed: + try: + self._prepare_proxy(conn) + except (BaseSSLError, OSError, SocketTimeout) as e: + self._raise_timeout( + err=e, url=self.proxy.url, timeout_value=conn.timeout + ) + raise + + # If we're going to release the connection in ``finally:``, then + # the response doesn't need to know about the connection. Otherwise + # it will also try to release it and we'll have a double-release + # mess. + response_conn = conn if not release_conn else None + + # Make the request on the HTTPConnection object + response = self._make_request( + conn, + method, + url, + timeout=timeout_obj, + body=body, + headers=headers, + chunked=chunked, + retries=retries, + response_conn=response_conn, + preload_content=preload_content, + decode_content=decode_content, + **response_kw, + ) + + # Everything went great! + clean_exit = True + + except EmptyPoolError: + # Didn't get a connection from the pool, no need to clean up + clean_exit = True + release_this_conn = False + raise + + except ( + TimeoutError, + HTTPException, + OSError, + ProtocolError, + BaseSSLError, + SSLError, + CertificateError, + ProxyError, + ) as e: + # Discard the connection for these exceptions. It will be + # replaced during the next _get_conn() call. + clean_exit = False + new_e: Exception = e + if isinstance(e, (BaseSSLError, CertificateError)): + new_e = SSLError(e) + if isinstance( + new_e, + ( + OSError, + NewConnectionError, + TimeoutError, + SSLError, + HTTPException, + ), + ) and (conn and conn.proxy and not conn.has_connected_to_proxy): + new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) + elif isinstance(new_e, (OSError, HTTPException)): + new_e = ProtocolError("Connection aborted.", new_e) + + retries = retries.increment( + method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] + ) + retries.sleep() + + # Keep track of the error for the retry warning. + err = e + + finally: + if not clean_exit: + # We hit some kind of exception, handled or otherwise. We need + # to throw the connection away unless explicitly told not to. + # Close the connection, set the variable to None, and make sure + # we put the None back in the pool to avoid leaking it. + if conn: + conn.close() + conn = None + release_this_conn = True + + if release_this_conn: + # Put the connection back to be reused. If the connection is + # expired then it will be None, which will get replaced with a + # fresh connection during _get_conn. + self._put_conn(conn) + + if not conn: + # Try again + log.warning( + "Retrying (%r) after connection broken by '%r': %s", retries, err, url + ) + return self.urlopen( + method, + url, + body, + headers, + retries, + redirect, + assert_same_host, + timeout=timeout, + pool_timeout=pool_timeout, + release_conn=release_conn, + chunked=chunked, + body_pos=body_pos, + preload_content=preload_content, + decode_content=decode_content, + **response_kw, + ) + + # Handle redirect? + redirect_location = redirect and response.get_redirect_location() + if redirect_location: + if response.status == 303: + # Change the method according to RFC 9110, Section 15.4.4. + method = "GET" + # And lose the body not to transfer anything sensitive. + body = None + headers = HTTPHeaderDict(headers)._prepare_for_method_change() + + # Strip headers marked as unsafe to forward to the redirected location. + # Check remove_headers_on_redirect to avoid a potential network call within + # self.is_same_host() which may use socket.gethostbyname() in the future. + if retries.remove_headers_on_redirect and not self.is_same_host( + redirect_location + ): + new_headers = headers.copy() # type: ignore[union-attr] + for header in headers: + if header.lower() in retries.remove_headers_on_redirect: + new_headers.pop(header, None) + headers = new_headers + + try: + retries = retries.increment(method, url, response=response, _pool=self) + except MaxRetryError: + if retries.raise_on_redirect: + response.drain_conn() + raise + return response + + response.drain_conn() + retries.sleep_for_retry(response) + log.debug("Redirecting %s -> %s", url, redirect_location) + return self.urlopen( + method, + redirect_location, + body, + headers, + retries=retries, + redirect=redirect, + assert_same_host=assert_same_host, + timeout=timeout, + pool_timeout=pool_timeout, + release_conn=release_conn, + chunked=chunked, + body_pos=body_pos, + preload_content=preload_content, + decode_content=decode_content, + **response_kw, + ) + + # Check if we should retry the HTTP response. + has_retry_after = bool(response.headers.get("Retry-After")) + if retries.is_retry(method, response.status, has_retry_after): + try: + retries = retries.increment(method, url, response=response, _pool=self) + except MaxRetryError: + if retries.raise_on_status: + response.drain_conn() + raise + return response + + response.drain_conn() + retries.sleep(response) + log.debug("Retry: %s", url) + return self.urlopen( + method, + url, + body, + headers, + retries=retries, + redirect=redirect, + assert_same_host=assert_same_host, + timeout=timeout, + pool_timeout=pool_timeout, + release_conn=release_conn, + chunked=chunked, + body_pos=body_pos, + preload_content=preload_content, + decode_content=decode_content, + **response_kw, + ) + + return response + + +class HTTPSConnectionPool(HTTPConnectionPool): + """ + Same as :class:`.HTTPConnectionPool`, but HTTPS. + + :class:`.HTTPSConnection` uses one of ``assert_fingerprint``, + ``assert_hostname`` and ``host`` in this order to verify connections. + If ``assert_hostname`` is False, no verification is done. + + The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``, + ``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl` + is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade + the connection socket into an SSL socket. + """ + + scheme = "https" + ConnectionCls: type[BaseHTTPSConnection] = HTTPSConnection + + def __init__( + self, + host: str, + port: int | None = None, + timeout: _TYPE_TIMEOUT | None = _DEFAULT_TIMEOUT, + maxsize: int = 1, + block: bool = False, + headers: typing.Mapping[str, str] | None = None, + retries: Retry | bool | int | None = None, + _proxy: Url | None = None, + _proxy_headers: typing.Mapping[str, str] | None = None, + key_file: str | None = None, + cert_file: str | None = None, + cert_reqs: int | str | None = None, + key_password: str | None = None, + ca_certs: str | None = None, + ssl_version: int | str | None = None, + ssl_minimum_version: ssl.TLSVersion | None = None, + ssl_maximum_version: ssl.TLSVersion | None = None, + assert_hostname: str | typing.Literal[False] | None = None, + assert_fingerprint: str | None = None, + ca_cert_dir: str | None = None, + **conn_kw: typing.Any, + ) -> None: + super().__init__( + host, + port, + timeout, + maxsize, + block, + headers, + retries, + _proxy, + _proxy_headers, + **conn_kw, + ) + + self.key_file = key_file + self.cert_file = cert_file + self.cert_reqs = cert_reqs + self.key_password = key_password + self.ca_certs = ca_certs + self.ca_cert_dir = ca_cert_dir + self.ssl_version = ssl_version + self.ssl_minimum_version = ssl_minimum_version + self.ssl_maximum_version = ssl_maximum_version + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + + def _prepare_proxy(self, conn: HTTPSConnection) -> None: # type: ignore[override] + """Establishes a tunnel connection through HTTP CONNECT.""" + if self.proxy and self.proxy.scheme == "https": + tunnel_scheme = "https" + else: + tunnel_scheme = "http" + + conn.set_tunnel( + scheme=tunnel_scheme, + host=self._tunnel_host, + port=self.port, + headers=self.proxy_headers, + ) + conn.connect() + + def _new_conn(self) -> BaseHTTPSConnection: + """ + Return a fresh :class:`urllib3.connection.HTTPConnection`. + """ + self.num_connections += 1 + log.debug( + "Starting new HTTPS connection (%d): %s:%s", + self.num_connections, + self.host, + self.port or "443", + ) + + if not self.ConnectionCls or self.ConnectionCls is DummyConnection: # type: ignore[comparison-overlap] + raise ImportError( + "Can't connect to HTTPS URL because the SSL module is not available." + ) + + actual_host: str = self.host + actual_port = self.port + if self.proxy is not None and self.proxy.host is not None: + actual_host = self.proxy.host + actual_port = self.proxy.port + + return self.ConnectionCls( + host=actual_host, + port=actual_port, + timeout=self.timeout.connect_timeout, + cert_file=self.cert_file, + key_file=self.key_file, + key_password=self.key_password, + cert_reqs=self.cert_reqs, + ca_certs=self.ca_certs, + ca_cert_dir=self.ca_cert_dir, + assert_hostname=self.assert_hostname, + assert_fingerprint=self.assert_fingerprint, + ssl_version=self.ssl_version, + ssl_minimum_version=self.ssl_minimum_version, + ssl_maximum_version=self.ssl_maximum_version, + **self.conn_kw, + ) + + def _validate_conn(self, conn: BaseHTTPConnection) -> None: + """ + Called right before a request is made, after the socket is created. + """ + super()._validate_conn(conn) + + # Force connect early to allow us to validate the connection. + if conn.is_closed: + conn.connect() + + # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791 + if not conn.is_verified and not conn.proxy_is_verified: + warnings.warn( + ( + f"Unverified HTTPS request is being made to host '{conn.host}'. " + "Adding certificate verification is strongly advised. See: " + "https://urllib3.readthedocs.io/en/latest/advanced-usage.html" + "#tls-warnings" + ), + InsecureRequestWarning, + ) + + +def connection_from_url(url: str, **kw: typing.Any) -> HTTPConnectionPool: + """ + Given a url, return an :class:`.ConnectionPool` instance of its host. + + This is a shortcut for not having to parse out the scheme, host, and port + of the url before creating an :class:`.ConnectionPool` instance. + + :param url: + Absolute URL string that must include the scheme. Port is optional. + + :param \\**kw: + Passes additional parameters to the constructor of the appropriate + :class:`.ConnectionPool`. Useful for specifying things like + timeout, maxsize, headers, etc. + + Example:: + + >>> conn = connection_from_url('http://google.com/') + >>> r = conn.request('GET', '/') + """ + scheme, _, host, port, *_ = parse_url(url) + scheme = scheme or "http" + port = port or port_by_scheme.get(scheme, 80) + if scheme == "https": + return HTTPSConnectionPool(host, port=port, **kw) # type: ignore[arg-type] + else: + return HTTPConnectionPool(host, port=port, **kw) # type: ignore[arg-type] + + +@typing.overload +def _normalize_host(host: None, scheme: str | None) -> None: ... + + +@typing.overload +def _normalize_host(host: str, scheme: str | None) -> str: ... + + +def _normalize_host(host: str | None, scheme: str | None) -> str | None: + """ + Normalize hosts for comparisons and use with sockets. + """ + + host = normalize_host(host, scheme) + + # httplib doesn't like it when we include brackets in IPv6 addresses + # Specifically, if we include brackets but also pass the port then + # httplib crazily doubles up the square brackets on the Host header. + # Instead, we need to make sure we never pass ``None`` as the port. + # However, for backward compatibility reasons we can't actually + # *assert* that. See http://bugs.python.org/issue28539 + if host and host.startswith("[") and host.endswith("]"): + host = host[1:-1] + return host + + +def _url_from_pool( + pool: HTTPConnectionPool | HTTPSConnectionPool, path: str | None = None +) -> str: + """Returns the URL from a given connection pool. This is mainly used for testing and logging.""" + return Url(scheme=pool.scheme, host=pool.host, port=pool.port, path=path).url + + +def _close_pool_connections(pool: queue.LifoQueue[typing.Any]) -> None: + """Drains a queue of connections and closes each one.""" + try: + while True: + conn = pool.get(block=False) + if conn: + conn.close() + except queue.Empty: + pass # Done. diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/__init__.py b/micromamba_root/Lib/site-packages/urllib3/contrib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fc7c572bf14b71eda952440d651e74b2f1c0c0e Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f24fc2f4aa0735551617f518fb33333e4561843 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/socks.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/socks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a7e8037d552838be54a6c28e28a4c80679870cf Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/__pycache__/socks.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__init__.py b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e5b62b25e932566f7ae7599c1cedec2b8f30d95b --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__init__.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +import urllib3.connection + +from ...connectionpool import HTTPConnectionPool, HTTPSConnectionPool +from .connection import EmscriptenHTTPConnection, EmscriptenHTTPSConnection + + +def inject_into_urllib3() -> None: + # override connection classes to use emscripten specific classes + # n.b. mypy complains about the overriding of classes below + # if it isn't ignored + HTTPConnectionPool.ConnectionCls = EmscriptenHTTPConnection + HTTPSConnectionPool.ConnectionCls = EmscriptenHTTPSConnection + urllib3.connection.HTTPConnection = EmscriptenHTTPConnection # type: ignore[misc,assignment] + urllib3.connection.HTTPSConnection = EmscriptenHTTPSConnection # type: ignore[misc,assignment] + urllib3.connection.VerifiedHTTPSConnection = EmscriptenHTTPSConnection # type: ignore[assignment] diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3b568361e3a9c4f44a3ffa4283c0e399eae395a Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/connection.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9629c368a1487da2cf425ca8abd0eeaced09fabb Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/fetch.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/fetch.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3045add35283c5c790c07ab7c6f12f166d4a07b Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/fetch.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/request.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/request.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13324ae6ea86cba49b88312907e73a845d64fdad Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/request.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/response.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/response.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f99276caf0ea37f2b2d042663959692fe148501 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/__pycache__/response.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/connection.py b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..63f79dd3be803db09671c909f79316c3f65d6916 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/connection.py @@ -0,0 +1,260 @@ +from __future__ import annotations + +import os +import typing + +# use http.client.HTTPException for consistency with non-emscripten +from http.client import HTTPException as HTTPException # noqa: F401 +from http.client import ResponseNotReady + +from ..._base_connection import _TYPE_BODY +from ...connection import HTTPConnection, ProxyConfig, port_by_scheme +from ...exceptions import TimeoutError +from ...response import BaseHTTPResponse +from ...util.connection import _TYPE_SOCKET_OPTIONS +from ...util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT +from ...util.url import Url +from .fetch import _RequestError, _TimeoutError, send_request, send_streaming_request +from .request import EmscriptenRequest +from .response import EmscriptenHttpResponseWrapper, EmscriptenResponse + +if typing.TYPE_CHECKING: + from ..._base_connection import BaseHTTPConnection, BaseHTTPSConnection + + +class EmscriptenHTTPConnection: + default_port: typing.ClassVar[int] = port_by_scheme["http"] + default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS] + + timeout: None | (float) + + host: str + port: int + blocksize: int + source_address: tuple[str, int] | None + socket_options: _TYPE_SOCKET_OPTIONS | None + + proxy: Url | None + proxy_config: ProxyConfig | None + + is_verified: bool = False + proxy_is_verified: bool | None = None + + response_class: type[BaseHTTPResponse] = EmscriptenHttpResponseWrapper + _response: EmscriptenResponse | None + + def __init__( + self, + host: str, + port: int = 0, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 8192, + socket_options: _TYPE_SOCKET_OPTIONS | None = None, + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + ) -> None: + self.host = host + self.port = port + self.timeout = timeout if isinstance(timeout, float) else 0.0 + self.scheme = "http" + self._closed = True + self._response = None + # ignore these things because we don't + # have control over that stuff + self.proxy = None + self.proxy_config = None + self.blocksize = blocksize + self.source_address = None + self.socket_options = None + self.is_verified = False + + def set_tunnel( + self, + host: str, + port: int | None = 0, + headers: typing.Mapping[str, str] | None = None, + scheme: str = "http", + ) -> None: + pass + + def connect(self) -> None: + pass + + def request( + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + # We know *at least* botocore is depending on the order of the + # first 3 parameters so to be safe we only mark the later ones + # as keyword-only to ensure we have space to extend. + *, + chunked: bool = False, + preload_content: bool = True, + decode_content: bool = True, + enforce_content_length: bool = True, + ) -> None: + self._closed = False + if url.startswith("/"): + if self.port is not None: + port = f":{self.port}" + else: + port = "" + # no scheme / host / port included, make a full url + url = f"{self.scheme}://{self.host}{port}{url}" + request = EmscriptenRequest( + url=url, + method=method, + timeout=self.timeout if self.timeout else 0, + decode_content=decode_content, + ) + request.set_body(body) + if headers: + for k, v in headers.items(): + request.set_header(k, v) + self._response = None + try: + if not preload_content: + self._response = send_streaming_request(request) + if self._response is None: + self._response = send_request(request) + except _TimeoutError as e: + raise TimeoutError(e.message) from e + except _RequestError as e: + raise HTTPException(e.message) from e + + def getresponse(self) -> BaseHTTPResponse: + if self._response is not None: + return EmscriptenHttpResponseWrapper( + internal_response=self._response, + url=self._response.request.url, + connection=self, + ) + else: + raise ResponseNotReady() + + def close(self) -> None: + self._closed = True + self._response = None + + @property + def is_closed(self) -> bool: + """Whether the connection either is brand new or has been previously closed. + If this property is True then both ``is_connected`` and ``has_connected_to_proxy`` + properties must be False. + """ + return self._closed + + @property + def is_connected(self) -> bool: + """Whether the connection is actively connected to any origin (proxy or target)""" + return True + + @property + def has_connected_to_proxy(self) -> bool: + """Whether the connection has successfully connected to its proxy. + This returns False if no proxy is in use. Used to determine whether + errors are coming from the proxy layer or from tunnelling to the target origin. + """ + return False + + +class EmscriptenHTTPSConnection(EmscriptenHTTPConnection): + default_port = port_by_scheme["https"] + # all this is basically ignored, as browser handles https + cert_reqs: int | str | None = None + ca_certs: str | None = None + ca_cert_dir: str | None = None + ca_cert_data: None | str | bytes = None + cert_file: str | None + key_file: str | None + key_password: str | None + ssl_context: typing.Any | None + ssl_version: int | str | None = None + ssl_minimum_version: int | None = None + ssl_maximum_version: int | None = None + assert_hostname: None | str | typing.Literal[False] + assert_fingerprint: str | None = None + + def __init__( + self, + host: str, + port: int = 0, + *, + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + blocksize: int = 16384, + socket_options: ( + None | _TYPE_SOCKET_OPTIONS + ) = HTTPConnection.default_socket_options, + proxy: Url | None = None, + proxy_config: ProxyConfig | None = None, + cert_reqs: int | str | None = None, + assert_hostname: None | str | typing.Literal[False] = None, + assert_fingerprint: str | None = None, + server_hostname: str | None = None, + ssl_context: typing.Any | None = None, + ca_certs: str | None = None, + ca_cert_dir: str | None = None, + ca_cert_data: None | str | bytes = None, + ssl_minimum_version: int | None = None, + ssl_maximum_version: int | None = None, + ssl_version: int | str | None = None, # Deprecated + cert_file: str | None = None, + key_file: str | None = None, + key_password: str | None = None, + ) -> None: + super().__init__( + host, + port=port, + timeout=timeout, + source_address=source_address, + blocksize=blocksize, + socket_options=socket_options, + proxy=proxy, + proxy_config=proxy_config, + ) + self.scheme = "https" + + self.key_file = key_file + self.cert_file = cert_file + self.key_password = key_password + self.ssl_context = ssl_context + self.server_hostname = server_hostname + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + self.ssl_version = ssl_version + self.ssl_minimum_version = ssl_minimum_version + self.ssl_maximum_version = ssl_maximum_version + self.ca_certs = ca_certs and os.path.expanduser(ca_certs) + self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir) + self.ca_cert_data = ca_cert_data + + self.cert_reqs = None + + # The browser will automatically verify all requests. + # We have no control over that setting. + self.is_verified = True + + def set_cert( + self, + key_file: str | None = None, + cert_file: str | None = None, + cert_reqs: int | str | None = None, + key_password: str | None = None, + ca_certs: str | None = None, + assert_hostname: None | str | typing.Literal[False] = None, + assert_fingerprint: str | None = None, + ca_cert_dir: str | None = None, + ca_cert_data: None | str | bytes = None, + ) -> None: + pass + + +# verify that this class implements BaseHTTP(s) connection correctly +if typing.TYPE_CHECKING: + _supports_http_protocol: BaseHTTPConnection = EmscriptenHTTPConnection("", 0) + _supports_https_protocol: BaseHTTPSConnection = EmscriptenHTTPSConnection("", 0) diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js new file mode 100644 index 0000000000000000000000000000000000000000..faf141e1fa4113a0c14480d1681ddecb9678ced4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js @@ -0,0 +1,110 @@ +let Status = { + SUCCESS_HEADER: -1, + SUCCESS_EOF: -2, + ERROR_TIMEOUT: -3, + ERROR_EXCEPTION: -4, +}; + +let connections = new Map(); +let nextConnectionID = 1; +const encoder = new TextEncoder(); + +self.addEventListener("message", async function (event) { + if (event.data.close) { + let connectionID = event.data.close; + connections.delete(connectionID); + return; + } else if (event.data.getMore) { + let connectionID = event.data.getMore; + let { curOffset, value, reader, intBuffer, byteBuffer } = + connections.get(connectionID); + // if we still have some in buffer, then just send it back straight away + if (!value || curOffset >= value.length) { + // read another buffer if required + try { + let readResponse = await reader.read(); + + if (readResponse.done) { + // read everything - clear connection and return + connections.delete(connectionID); + Atomics.store(intBuffer, 0, Status.SUCCESS_EOF); + Atomics.notify(intBuffer, 0); + // finished reading successfully + // return from event handler + return; + } + curOffset = 0; + connections.get(connectionID).value = readResponse.value; + value = readResponse.value; + } catch (error) { + console.log("Request exception:", error); + let errorBytes = encoder.encode(error.message); + let written = errorBytes.length; + byteBuffer.set(errorBytes); + intBuffer[1] = written; + Atomics.store(intBuffer, 0, Status.ERROR_EXCEPTION); + Atomics.notify(intBuffer, 0); + } + } + + // send as much buffer as we can + let curLen = value.length - curOffset; + if (curLen > byteBuffer.length) { + curLen = byteBuffer.length; + } + byteBuffer.set(value.subarray(curOffset, curOffset + curLen), 0); + + Atomics.store(intBuffer, 0, curLen); // store current length in bytes + Atomics.notify(intBuffer, 0); + curOffset += curLen; + connections.get(connectionID).curOffset = curOffset; + + return; + } else { + // start fetch + let connectionID = nextConnectionID; + nextConnectionID += 1; + const intBuffer = new Int32Array(event.data.buffer); + const byteBuffer = new Uint8Array(event.data.buffer, 8); + try { + const response = await fetch(event.data.url, event.data.fetchParams); + // return the headers first via textencoder + var headers = []; + for (const pair of response.headers.entries()) { + headers.push([pair[0], pair[1]]); + } + let headerObj = { + headers: headers, + status: response.status, + connectionID, + }; + const headerText = JSON.stringify(headerObj); + let headerBytes = encoder.encode(headerText); + let written = headerBytes.length; + byteBuffer.set(headerBytes); + intBuffer[1] = written; + // make a connection + connections.set(connectionID, { + reader: response.body.getReader(), + intBuffer: intBuffer, + byteBuffer: byteBuffer, + value: undefined, + curOffset: 0, + }); + // set header ready + Atomics.store(intBuffer, 0, Status.SUCCESS_HEADER); + Atomics.notify(intBuffer, 0); + // all fetching after this goes through a new postmessage call with getMore + // this allows for parallel requests + } catch (error) { + console.log("Request exception:", error); + let errorBytes = encoder.encode(error.message); + let written = errorBytes.length; + byteBuffer.set(errorBytes); + intBuffer[1] = written; + Atomics.store(intBuffer, 0, Status.ERROR_EXCEPTION); + Atomics.notify(intBuffer, 0); + } + } +}); +self.postMessage({ inited: true }); diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/fetch.py b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/fetch.py new file mode 100644 index 0000000000000000000000000000000000000000..612cfddc4c28d2f0edf47522278fa6d9b7906623 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/fetch.py @@ -0,0 +1,726 @@ +""" +Support for streaming http requests in emscripten. + +A few caveats - + +If your browser (or Node.js) has WebAssembly JavaScript Promise Integration enabled +https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md +*and* you launch pyodide using `pyodide.runPythonAsync`, this will fetch data using the +JavaScript asynchronous fetch api (wrapped via `pyodide.ffi.call_sync`). In this case +timeouts and streaming should just work. + +Otherwise, it uses a combination of XMLHttpRequest and a web-worker for streaming. + +This approach has several caveats: + +Firstly, you can't do streaming http in the main UI thread, because atomics.wait isn't allowed. +Streaming only works if you're running pyodide in a web worker. + +Secondly, this uses an extra web worker and SharedArrayBuffer to do the asynchronous fetch +operation, so it requires that you have crossOriginIsolation enabled, by serving over https +(or from localhost) with the two headers below set: + + Cross-Origin-Opener-Policy: same-origin + Cross-Origin-Embedder-Policy: require-corp + +You can tell if cross origin isolation is successfully enabled by looking at the global crossOriginIsolated variable in +JavaScript console. If it isn't, streaming requests will fallback to XMLHttpRequest, i.e. getting the whole +request into a buffer and then returning it. it shows a warning in the JavaScript console in this case. + +Finally, the webworker which does the streaming fetch is created on initial import, but will only be started once +control is returned to javascript. Call `await wait_for_streaming_ready()` to wait for streaming fetch. + +NB: in this code, there are a lot of JavaScript objects. They are named js_* +to make it clear what type of object they are. +""" + +from __future__ import annotations + +import io +import json +from email.parser import Parser +from importlib.resources import files +from typing import TYPE_CHECKING, Any + +import js # type: ignore[import-not-found] +from pyodide.ffi import ( # type: ignore[import-not-found] + JsArray, + JsException, + JsProxy, + to_js, +) + +if TYPE_CHECKING: + from typing_extensions import Buffer + +from .request import EmscriptenRequest +from .response import EmscriptenResponse + +""" +There are some headers that trigger unintended CORS preflight requests. +See also https://github.com/koenvo/pyodide-http/issues/22 +""" +HEADERS_TO_IGNORE = ("user-agent",) + +SUCCESS_HEADER = -1 +SUCCESS_EOF = -2 +ERROR_TIMEOUT = -3 +ERROR_EXCEPTION = -4 + + +class _RequestError(Exception): + def __init__( + self, + message: str | None = None, + *, + request: EmscriptenRequest | None = None, + response: EmscriptenResponse | None = None, + ): + self.request = request + self.response = response + self.message = message + super().__init__(self.message) + + +class _StreamingError(_RequestError): + pass + + +class _TimeoutError(_RequestError): + pass + + +def _obj_from_dict(dict_val: dict[str, Any]) -> JsProxy: + return to_js(dict_val, dict_converter=js.Object.fromEntries) + + +class _ReadStream(io.RawIOBase): + def __init__( + self, + int_buffer: JsArray, + byte_buffer: JsArray, + timeout: float, + worker: JsProxy, + connection_id: int, + request: EmscriptenRequest, + ): + self.int_buffer = int_buffer + self.byte_buffer = byte_buffer + self.read_pos = 0 + self.read_len = 0 + self.connection_id = connection_id + self.worker = worker + self.timeout = int(1000 * timeout) if timeout > 0 else None + self.is_live = True + self._is_closed = False + self.request: EmscriptenRequest | None = request + + def __del__(self) -> None: + self.close() + + # this is compatible with _base_connection + def is_closed(self) -> bool: + return self._is_closed + + # for compatibility with RawIOBase + @property + def closed(self) -> bool: + return self.is_closed() + + def close(self) -> None: + if self.is_closed(): + return + self.read_len = 0 + self.read_pos = 0 + self.int_buffer = None + self.byte_buffer = None + self._is_closed = True + self.request = None + if self.is_live: + self.worker.postMessage(_obj_from_dict({"close": self.connection_id})) + self.is_live = False + super().close() + + def readable(self) -> bool: + return True + + def writable(self) -> bool: + return False + + def seekable(self) -> bool: + return False + + def readinto(self, byte_obj: Buffer) -> int: + if not self.int_buffer: + raise _StreamingError( + "No buffer for stream in _ReadStream.readinto", + request=self.request, + response=None, + ) + if self.read_len == 0: + # wait for the worker to send something + js.Atomics.store(self.int_buffer, 0, ERROR_TIMEOUT) + self.worker.postMessage(_obj_from_dict({"getMore": self.connection_id})) + if ( + js.Atomics.wait(self.int_buffer, 0, ERROR_TIMEOUT, self.timeout) + == "timed-out" + ): + raise _TimeoutError + data_len = self.int_buffer[0] + if data_len > 0: + self.read_len = data_len + self.read_pos = 0 + elif data_len == ERROR_EXCEPTION: + string_len = self.int_buffer[1] + # decode the error string + js_decoder = js.TextDecoder.new() + json_str = js_decoder.decode(self.byte_buffer.slice(0, string_len)) + raise _StreamingError( + f"Exception thrown in fetch: {json_str}", + request=self.request, + response=None, + ) + else: + # EOF, free the buffers and return zero + # and free the request + self.is_live = False + self.close() + return 0 + # copy from int32array to python bytes + ret_length = min(self.read_len, len(memoryview(byte_obj))) + subarray = self.byte_buffer.subarray( + self.read_pos, self.read_pos + ret_length + ).to_py() + memoryview(byte_obj)[0:ret_length] = subarray + self.read_len -= ret_length + self.read_pos += ret_length + return ret_length + + +class _StreamingFetcher: + def __init__(self) -> None: + # make web-worker and data buffer on startup + self.streaming_ready = False + streaming_worker_code = ( + files(__package__) + .joinpath("emscripten_fetch_worker.js") + .read_text(encoding="utf-8") + ) + js_data_blob = js.Blob.new( + to_js([streaming_worker_code], create_pyproxies=False), + _obj_from_dict({"type": "application/javascript"}), + ) + + def promise_resolver(js_resolve_fn: JsProxy, js_reject_fn: JsProxy) -> None: + def onMsg(e: JsProxy) -> None: + self.streaming_ready = True + js_resolve_fn(e) + + def onErr(e: JsProxy) -> None: + js_reject_fn(e) # Defensive: never happens in ci + + self.js_worker.onmessage = onMsg + self.js_worker.onerror = onErr + + js_data_url = js.URL.createObjectURL(js_data_blob) + self.js_worker = js.globalThis.Worker.new(js_data_url) + self.js_worker_ready_promise = js.globalThis.Promise.new(promise_resolver) + + def send(self, request: EmscriptenRequest) -> EmscriptenResponse: + headers = { + k: v for k, v in request.headers.items() if k not in HEADERS_TO_IGNORE + } + + body = request.body + fetch_data = {"headers": headers, "body": to_js(body), "method": request.method} + # start the request off in the worker + timeout = int(1000 * request.timeout) if request.timeout > 0 else None + js_shared_buffer = js.SharedArrayBuffer.new(1048576) + js_int_buffer = js.Int32Array.new(js_shared_buffer) + js_byte_buffer = js.Uint8Array.new(js_shared_buffer, 8) + + js.Atomics.store(js_int_buffer, 0, ERROR_TIMEOUT) + js.Atomics.notify(js_int_buffer, 0) + js_absolute_url = js.URL.new(request.url, js.location).href + self.js_worker.postMessage( + _obj_from_dict( + { + "buffer": js_shared_buffer, + "url": js_absolute_url, + "fetchParams": fetch_data, + } + ) + ) + # wait for the worker to send something + js.Atomics.wait(js_int_buffer, 0, ERROR_TIMEOUT, timeout) + if js_int_buffer[0] == ERROR_TIMEOUT: + raise _TimeoutError( + "Timeout connecting to streaming request", + request=request, + response=None, + ) + elif js_int_buffer[0] == SUCCESS_HEADER: + # got response + # header length is in second int of intBuffer + string_len = js_int_buffer[1] + # decode the rest to a JSON string + js_decoder = js.TextDecoder.new() + # this does a copy (the slice) because decode can't work on shared array + # for some silly reason + json_str = js_decoder.decode(js_byte_buffer.slice(0, string_len)) + # get it as an object + response_obj = json.loads(json_str) + return EmscriptenResponse( + request=request, + status_code=response_obj["status"], + headers=response_obj["headers"], + body=_ReadStream( + js_int_buffer, + js_byte_buffer, + request.timeout, + self.js_worker, + response_obj["connectionID"], + request, + ), + ) + elif js_int_buffer[0] == ERROR_EXCEPTION: + string_len = js_int_buffer[1] + # decode the error string + js_decoder = js.TextDecoder.new() + json_str = js_decoder.decode(js_byte_buffer.slice(0, string_len)) + raise _StreamingError( + f"Exception thrown in fetch: {json_str}", request=request, response=None + ) + else: + raise _StreamingError( + f"Unknown status from worker in fetch: {js_int_buffer[0]}", + request=request, + response=None, + ) + + +class _JSPIReadStream(io.RawIOBase): + """ + A read stream that uses pyodide.ffi.run_sync to read from a JavaScript fetch + response. This requires support for WebAssembly JavaScript Promise Integration + in the containing browser, and for pyodide to be launched via runPythonAsync. + + :param js_read_stream: + The JavaScript stream reader + + :param timeout: + Timeout in seconds + + :param request: + The request we're handling + + :param response: + The response this stream relates to + + :param js_abort_controller: + A JavaScript AbortController object, used for timeouts + """ + + def __init__( + self, + js_read_stream: Any, + timeout: float, + request: EmscriptenRequest, + response: EmscriptenResponse, + js_abort_controller: Any, # JavaScript AbortController for timeouts + ): + self.js_read_stream = js_read_stream + self.timeout = timeout + self._is_closed = False + self._is_done = False + self.request: EmscriptenRequest | None = request + self.response: EmscriptenResponse | None = response + self.current_buffer = None + self.current_buffer_pos = 0 + self.js_abort_controller = js_abort_controller + + def __del__(self) -> None: + self.close() + + # this is compatible with _base_connection + def is_closed(self) -> bool: + return self._is_closed + + # for compatibility with RawIOBase + @property + def closed(self) -> bool: + return self.is_closed() + + def close(self) -> None: + if self.is_closed(): + return + self.read_len = 0 + self.read_pos = 0 + self.js_read_stream.cancel() + self.js_read_stream = None + self._is_closed = True + self._is_done = True + self.request = None + self.response = None + super().close() + + def readable(self) -> bool: + return True + + def writable(self) -> bool: + return False + + def seekable(self) -> bool: + return False + + def _get_next_buffer(self) -> bool: + result_js = _run_sync_with_timeout( + self.js_read_stream.read(), + self.timeout, + self.js_abort_controller, + request=self.request, + response=self.response, + ) + if result_js.done: + self._is_done = True + return False + else: + self.current_buffer = result_js.value.to_py() + self.current_buffer_pos = 0 + return True + + def readinto(self, byte_obj: Buffer) -> int: + if self.current_buffer is None: + if not self._get_next_buffer() or self.current_buffer is None: + self.close() + return 0 + ret_length = min( + len(byte_obj), len(self.current_buffer) - self.current_buffer_pos + ) + byte_obj[0:ret_length] = self.current_buffer[ + self.current_buffer_pos : self.current_buffer_pos + ret_length + ] + self.current_buffer_pos += ret_length + if self.current_buffer_pos == len(self.current_buffer): + self.current_buffer = None + return ret_length + + +# check if we are in a worker or not +def is_in_browser_main_thread() -> bool: + return hasattr(js, "window") and hasattr(js, "self") and js.self == js.window + + +def is_cross_origin_isolated() -> bool: + return hasattr(js, "crossOriginIsolated") and js.crossOriginIsolated + + +def is_in_node() -> bool: + return ( + hasattr(js, "process") + and hasattr(js.process, "release") + and hasattr(js.process.release, "name") + and js.process.release.name == "node" + ) + + +def is_worker_available() -> bool: + return hasattr(js, "Worker") and hasattr(js, "Blob") + + +_fetcher: _StreamingFetcher | None = None + +if is_worker_available() and ( + (is_cross_origin_isolated() and not is_in_browser_main_thread()) + and (not is_in_node()) +): + _fetcher = _StreamingFetcher() +else: + _fetcher = None + + +NODE_JSPI_ERROR = ( + "urllib3 only works in Node.js with pyodide.runPythonAsync" + " and requires the flag --experimental-wasm-stack-switching in " + " versions of node <24." +) + + +def send_streaming_request(request: EmscriptenRequest) -> EmscriptenResponse | None: + if has_jspi(): + return send_jspi_request(request, True) + elif is_in_node(): + raise _RequestError( + message=NODE_JSPI_ERROR, + request=request, + response=None, + ) + + if _fetcher and streaming_ready(): + return _fetcher.send(request) + else: + _show_streaming_warning() + return None + + +_SHOWN_TIMEOUT_WARNING = False + + +def _show_timeout_warning() -> None: + global _SHOWN_TIMEOUT_WARNING + if not _SHOWN_TIMEOUT_WARNING: + _SHOWN_TIMEOUT_WARNING = True + message = "Warning: Timeout is not available on main browser thread" + js.console.warn(message) + + +_SHOWN_STREAMING_WARNING = False + + +def _show_streaming_warning() -> None: + global _SHOWN_STREAMING_WARNING + if not _SHOWN_STREAMING_WARNING: + _SHOWN_STREAMING_WARNING = True + message = "Can't stream HTTP requests because: \n" + if not is_cross_origin_isolated(): + message += " Page is not cross-origin isolated\n" + if is_in_browser_main_thread(): + message += " Python is running in main browser thread\n" + if not is_worker_available(): + message += " Worker or Blob classes are not available in this environment." # Defensive: this is always False in browsers that we test in + if streaming_ready() is False: + message += """ Streaming fetch worker isn't ready. If you want to be sure that streaming fetch +is working, you need to call: 'await urllib3.contrib.emscripten.fetch.wait_for_streaming_ready()`""" + from js import console + + console.warn(message) + + +def send_request(request: EmscriptenRequest) -> EmscriptenResponse: + if has_jspi(): + return send_jspi_request(request, False) + elif is_in_node(): + raise _RequestError( + message=NODE_JSPI_ERROR, + request=request, + response=None, + ) + try: + js_xhr = js.XMLHttpRequest.new() + + if not is_in_browser_main_thread(): + js_xhr.responseType = "arraybuffer" + if request.timeout: + js_xhr.timeout = int(request.timeout * 1000) + else: + js_xhr.overrideMimeType("text/plain; charset=ISO-8859-15") + if request.timeout: + # timeout isn't available on the main thread - show a warning in console + # if it is set + _show_timeout_warning() + + js_xhr.open(request.method, request.url, False) + for name, value in request.headers.items(): + if name.lower() not in HEADERS_TO_IGNORE: + js_xhr.setRequestHeader(name, value) + + js_xhr.send(to_js(request.body)) + + headers = dict(Parser().parsestr(js_xhr.getAllResponseHeaders())) + + if not is_in_browser_main_thread(): + body = js_xhr.response.to_py().tobytes() + else: + body = js_xhr.response.encode("ISO-8859-15") + return EmscriptenResponse( + status_code=js_xhr.status, headers=headers, body=body, request=request + ) + except JsException as err: + if err.name == "TimeoutError": + raise _TimeoutError(err.message, request=request) + elif err.name == "NetworkError": + raise _RequestError(err.message, request=request) + else: + # general http error + raise _RequestError(err.message, request=request) + + +def send_jspi_request( + request: EmscriptenRequest, streaming: bool +) -> EmscriptenResponse: + """ + Send a request using WebAssembly JavaScript Promise Integration + to wrap the asynchronous JavaScript fetch api (experimental). + + :param request: + Request to send + + :param streaming: + Whether to stream the response + + :return: The response object + :rtype: EmscriptenResponse + """ + timeout = request.timeout + js_abort_controller = js.AbortController.new() + headers = {k: v for k, v in request.headers.items() if k not in HEADERS_TO_IGNORE} + req_body = request.body + fetch_data = { + "headers": headers, + "body": to_js(req_body), + "method": request.method, + "signal": js_abort_controller.signal, + } + # Node.js returns the whole response (unlike opaqueredirect in browsers), + # so urllib3 can set `redirect: manual` to control redirects itself. + # https://stackoverflow.com/a/78524615 + if _is_node_js(): + fetch_data["redirect"] = "manual" + # Call JavaScript fetch (async api, returns a promise) + fetcher_promise_js = js.fetch(request.url, _obj_from_dict(fetch_data)) + # Now suspend WebAssembly until we resolve that promise + # or time out. + response_js = _run_sync_with_timeout( + fetcher_promise_js, + timeout, + js_abort_controller, + request=request, + response=None, + ) + headers = {} + header_iter = response_js.headers.entries() + while True: + iter_value_js = header_iter.next() + if getattr(iter_value_js, "done", False): + break + else: + headers[str(iter_value_js.value[0])] = str(iter_value_js.value[1]) + status_code = response_js.status + body: bytes | io.RawIOBase = b"" + + response = EmscriptenResponse( + status_code=status_code, headers=headers, body=b"", request=request + ) + if streaming: + # get via inputstream + if response_js.body is not None: + # get a reader from the fetch response + body_stream_js = response_js.body.getReader() + body = _JSPIReadStream( + body_stream_js, timeout, request, response, js_abort_controller + ) + else: + # get directly via arraybuffer + # n.b. this is another async JavaScript call. + body = _run_sync_with_timeout( + response_js.arrayBuffer(), + timeout, + js_abort_controller, + request=request, + response=response, + ).to_py() + response.body = body + return response + + +def _run_sync_with_timeout( + promise: Any, + timeout: float, + js_abort_controller: Any, + request: EmscriptenRequest | None, + response: EmscriptenResponse | None, +) -> Any: + """ + Await a JavaScript promise synchronously with a timeout which is implemented + via the AbortController + + :param promise: + Javascript promise to await + + :param timeout: + Timeout in seconds + + :param js_abort_controller: + A JavaScript AbortController object, used on timeout + + :param request: + The request being handled + + :param response: + The response being handled (if it exists yet) + + :raises _TimeoutError: If the request times out + :raises _RequestError: If the request raises a JavaScript exception + + :return: The result of awaiting the promise. + """ + timer_id = None + if timeout > 0: + timer_id = js.setTimeout( + js_abort_controller.abort.bind(js_abort_controller), int(timeout * 1000) + ) + try: + from pyodide.ffi import run_sync + + # run_sync here uses WebAssembly JavaScript Promise Integration to + # suspend python until the JavaScript promise resolves. + return run_sync(promise) + except JsException as err: + if err.name == "AbortError": + raise _TimeoutError( + message="Request timed out", request=request, response=response + ) + else: + raise _RequestError(message=err.message, request=request, response=response) + finally: + if timer_id is not None: + js.clearTimeout(timer_id) + + +def has_jspi() -> bool: + """ + Return true if jspi can be used. + + This requires both browser support and also WebAssembly + to be in the correct state - i.e. that the javascript + call into python was async not sync. + + :return: True if jspi can be used. + :rtype: bool + """ + try: + from pyodide.ffi import can_run_sync, run_sync # noqa: F401 + + return bool(can_run_sync()) + except ImportError: + return False + + +def _is_node_js() -> bool: + """ + Check if we are in Node.js. + + :return: True if we are in Node.js. + :rtype: bool + """ + return ( + hasattr(js, "process") + and hasattr(js.process, "release") + # According to the Node.js documentation, the release name is always "node". + and js.process.release.name == "node" + ) + + +def streaming_ready() -> bool | None: + if _fetcher: + return _fetcher.streaming_ready + else: + return None # no fetcher, return None to signify that + + +async def wait_for_streaming_ready() -> bool: + if _fetcher: + await _fetcher.js_worker_ready_promise + return True + else: + return False diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/request.py b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/request.py new file mode 100644 index 0000000000000000000000000000000000000000..e692e692bd0d38f6a0677992a6993fc68050dff3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/request.py @@ -0,0 +1,22 @@ +from __future__ import annotations + +from dataclasses import dataclass, field + +from ..._base_connection import _TYPE_BODY + + +@dataclass +class EmscriptenRequest: + method: str + url: str + params: dict[str, str] | None = None + body: _TYPE_BODY | None = None + headers: dict[str, str] = field(default_factory=dict) + timeout: float = 0 + decode_content: bool = True + + def set_header(self, name: str, value: str) -> None: + self.headers[name.capitalize()] = value + + def set_body(self, body: _TYPE_BODY | None) -> None: + self.body = body diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/response.py b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/response.py new file mode 100644 index 0000000000000000000000000000000000000000..ec1e1dbe83722c5fb16290a852859252ae616826 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/emscripten/response.py @@ -0,0 +1,281 @@ +from __future__ import annotations + +import json as _json +import logging +import typing +from contextlib import contextmanager +from dataclasses import dataclass +from http.client import HTTPException as HTTPException +from io import BytesIO, IOBase + +from ...exceptions import InvalidHeader, TimeoutError +from ...response import BaseHTTPResponse +from ...util.retry import Retry +from .request import EmscriptenRequest + +if typing.TYPE_CHECKING: + from ..._base_connection import BaseHTTPConnection, BaseHTTPSConnection + +log = logging.getLogger(__name__) + + +@dataclass +class EmscriptenResponse: + status_code: int + headers: dict[str, str] + body: IOBase | bytes + request: EmscriptenRequest + + +class EmscriptenHttpResponseWrapper(BaseHTTPResponse): + def __init__( + self, + internal_response: EmscriptenResponse, + url: str | None = None, + connection: BaseHTTPConnection | BaseHTTPSConnection | None = None, + ): + self._pool = None # set by pool class + self._body = None + self._uncached_read_occurred = False + self._response = internal_response + self._url = url + self._connection = connection + self._closed = False + super().__init__( + headers=internal_response.headers, + status=internal_response.status_code, + request_url=url, + version=0, + version_string="HTTP/?", + reason="", + decode_content=True, + ) + self.length_remaining = self._init_length(self._response.request.method) + self.length_is_certain = False + + @property + def url(self) -> str | None: + return self._url + + @url.setter + def url(self, url: str | None) -> None: + self._url = url + + @property + def connection(self) -> BaseHTTPConnection | BaseHTTPSConnection | None: + return self._connection + + @property + def retries(self) -> Retry | None: + return self._retries + + @retries.setter + def retries(self, retries: Retry | None) -> None: + # Override the request_url if retries has a redirect location. + self._retries = retries + + def stream( + self, amt: int | None = 2**16, decode_content: bool | None = None + ) -> typing.Generator[bytes]: + """ + A generator wrapper for the read() method. A call will block until + ``amt`` bytes have been read from the connection or until the + connection is closed. + + :param amt: + How much of the content to read. The generator will return up to + much data per iteration, but may return less. This is particularly + likely when using compressed data. However, the empty string will + never be returned. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + while True: + data = self.read(amt=amt, decode_content=decode_content) + + if data: + yield data + else: + break + + def _init_length(self, request_method: str | None) -> int | None: + length: int | None + content_length: str | None = self.headers.get("content-length") + + if content_length is not None: + try: + # RFC 7230 section 3.3.2 specifies multiple content lengths can + # be sent in a single Content-Length header + # (e.g. Content-Length: 42, 42). This line ensures the values + # are all valid ints and that as long as the `set` length is 1, + # all values are the same. Otherwise, the header is invalid. + lengths = {int(val) for val in content_length.split(",")} + if len(lengths) > 1: + raise InvalidHeader( + "Content-Length contained multiple " + "unmatching values (%s)" % content_length + ) + length = lengths.pop() + except ValueError: + length = None + else: + if length < 0: + length = None + + else: # if content_length is None + length = None + + # Check for responses that shouldn't include a body + if ( + self.status in (204, 304) + or 100 <= self.status < 200 + or request_method == "HEAD" + ): + length = 0 + + return length + + def read( + self, + amt: int | None = None, + decode_content: bool | None = None, # ignored because browser decodes always + cache_content: bool = False, + ) -> bytes: + if ( + self._closed + or self._response is None + or (isinstance(self._response.body, IOBase) and self._response.body.closed) + ): + return b"" + + with self._error_catcher(): + # body has been preloaded as a string by XmlHttpRequest + if not isinstance(self._response.body, IOBase): + self.length_remaining = len(self._response.body) + self.length_is_certain = True + # wrap body in IOStream + self._response.body = BytesIO(self._response.body) + if amt is not None and amt >= 0: + # don't cache partial content + cache_content = False + data = self._response.body.read(amt) + self._uncached_read_occurred = True + else: # read all we can (and cache it) + data = self._response.body.read() + if cache_content and not self._uncached_read_occurred: + self._body = data + else: + self._uncached_read_occurred = True + if self.length_remaining is not None: + self.length_remaining = max(self.length_remaining - len(data), 0) + if len(data) == 0 or ( + self.length_is_certain and self.length_remaining == 0 + ): + # definitely finished reading, close response stream + self._response.body.close() + return typing.cast(bytes, data) + + def read_chunked( + self, + amt: int | None = None, + decode_content: bool | None = None, + ) -> typing.Generator[bytes]: + # chunked is handled by browser + while True: + bytes = self.read(amt, decode_content) + if not bytes: + break + yield bytes + + def release_conn(self) -> None: + if not self._pool or not self._connection: + return None + + self._pool._put_conn(self._connection) + self._connection = None + + def drain_conn(self) -> None: + self.close() + + @property + def data(self) -> bytes: + if self._body: + return self._body + else: + return self.read(cache_content=True) + + def json(self) -> typing.Any: + """ + Deserializes the body of the HTTP response as a Python object. + + The body of the HTTP response must be encoded using UTF-8, as per + `RFC 8529 Section 8.1 <https://www.rfc-editor.org/rfc/rfc8259#section-8.1>`_. + + To use a custom JSON decoder pass the result of :attr:`HTTPResponse.data` to + your custom decoder instead. + + If the body of the HTTP response is not decodable to UTF-8, a + `UnicodeDecodeError` will be raised. If the body of the HTTP response is not a + valid JSON document, a `json.JSONDecodeError` will be raised. + + Read more :ref:`here <json_content>`. + + :returns: The body of the HTTP response as a Python object. + """ + data = self.data.decode("utf-8") + return _json.loads(data) + + def close(self) -> None: + if not self._closed: + if isinstance(self._response.body, IOBase): + self._response.body.close() + if self._connection: + self._connection.close() + self._connection = None + self._closed = True + + @contextmanager + def _error_catcher(self) -> typing.Generator[None]: + """ + Catch Emscripten specific exceptions thrown by fetch.py, + instead re-raising urllib3 variants, so that low-level exceptions + are not leaked in the high-level api. + + On exit, release the connection back to the pool. + """ + from .fetch import _RequestError, _TimeoutError # avoid circular import + + clean_exit = False + + try: + yield + # If no exception is thrown, we should avoid cleaning up + # unnecessarily. + clean_exit = True + except _TimeoutError as e: + raise TimeoutError(str(e)) + except _RequestError as e: + raise HTTPException(str(e)) + finally: + # If we didn't terminate cleanly, we need to throw away our + # connection. + if not clean_exit: + # The response may not be closed but we're not going to use it + # anymore so close it now + if ( + isinstance(self._response.body, IOBase) + and not self._response.body.closed + ): + self._response.body.close() + # release the connection back to the pool + self.release_conn() + else: + # If we have read everything from the response stream, + # return the connection back to the pool. + if ( + isinstance(self._response.body, IOBase) + and self._response.body.closed + ): + self.release_conn() diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/pyopenssl.py b/micromamba_root/Lib/site-packages/urllib3/contrib/pyopenssl.py new file mode 100644 index 0000000000000000000000000000000000000000..f06b8599920fdcf6b8a2f869141378709a30c84c --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/pyopenssl.py @@ -0,0 +1,563 @@ +""" +Module for using pyOpenSSL as a TLS backend. This module was relevant before +the standard library ``ssl`` module supported SNI, but now that we've dropped +support for Python 2.7 all relevant Python versions support SNI so +**this module is no longer recommended**. + +This needs the following packages installed: + +* `pyOpenSSL`_ (tested with 19.0.0) +* `cryptography`_ (minimum 2.3, from pyopenssl) +* `idna`_ (minimum 2.1, from cryptography) + +However, pyOpenSSL depends on cryptography, so while we use all three directly here we +end up having relatively few packages required. + +You can install them with the following command: + +.. code-block:: bash + + $ python -m pip install pyopenssl cryptography idna + +To activate certificate checking, call +:func:`~urllib3.contrib.pyopenssl.inject_into_urllib3` from your Python code +before you begin making HTTP requests. This can be done in a ``sitecustomize`` +module, or at any other time before your application begins using ``urllib3``, +like this: + +.. code-block:: python + + try: + import urllib3.contrib.pyopenssl + urllib3.contrib.pyopenssl.inject_into_urllib3() + except ImportError: + pass + +.. _pyopenssl: https://www.pyopenssl.org +.. _cryptography: https://cryptography.io +.. _idna: https://github.com/kjd/idna +""" + +from __future__ import annotations + +import OpenSSL.SSL # type: ignore[import-not-found] +from cryptography import x509 + +try: + from cryptography.x509 import UnsupportedExtension # type: ignore[attr-defined] +except ImportError: + # UnsupportedExtension is gone in cryptography >= 2.1.0 + class UnsupportedExtension(Exception): # type: ignore[no-redef] + pass + + +import logging +import ssl +import typing +from io import BytesIO +from socket import socket as socket_cls + +from .. import util + +if typing.TYPE_CHECKING: + from OpenSSL.crypto import X509 # type: ignore[import-not-found] + + +__all__ = ["inject_into_urllib3", "extract_from_urllib3"] + +# Map from urllib3 to PyOpenSSL compatible parameter-values. +_openssl_versions: dict[int, int] = { + util.ssl_.PROTOCOL_TLS: OpenSSL.SSL.SSLv23_METHOD, # type: ignore[attr-defined] + util.ssl_.PROTOCOL_TLS_CLIENT: OpenSSL.SSL.SSLv23_METHOD, # type: ignore[attr-defined] + ssl.PROTOCOL_TLSv1: OpenSSL.SSL.TLSv1_METHOD, +} + +if hasattr(ssl, "PROTOCOL_TLSv1_1") and hasattr(OpenSSL.SSL, "TLSv1_1_METHOD"): + _openssl_versions[ssl.PROTOCOL_TLSv1_1] = OpenSSL.SSL.TLSv1_1_METHOD + +if hasattr(ssl, "PROTOCOL_TLSv1_2") and hasattr(OpenSSL.SSL, "TLSv1_2_METHOD"): + _openssl_versions[ssl.PROTOCOL_TLSv1_2] = OpenSSL.SSL.TLSv1_2_METHOD + + +_stdlib_to_openssl_verify = { + ssl.CERT_NONE: OpenSSL.SSL.VERIFY_NONE, + ssl.CERT_OPTIONAL: OpenSSL.SSL.VERIFY_PEER, + ssl.CERT_REQUIRED: OpenSSL.SSL.VERIFY_PEER + + OpenSSL.SSL.VERIFY_FAIL_IF_NO_PEER_CERT, +} +_openssl_to_stdlib_verify = {v: k for k, v in _stdlib_to_openssl_verify.items()} + +# The SSLvX values are the most likely to be missing in the future +# but we check them all just to be sure. +_OP_NO_SSLv2_OR_SSLv3: int = getattr(OpenSSL.SSL, "OP_NO_SSLv2", 0) | getattr( + OpenSSL.SSL, "OP_NO_SSLv3", 0 +) +_OP_NO_TLSv1: int = getattr(OpenSSL.SSL, "OP_NO_TLSv1", 0) +_OP_NO_TLSv1_1: int = getattr(OpenSSL.SSL, "OP_NO_TLSv1_1", 0) +_OP_NO_TLSv1_2: int = getattr(OpenSSL.SSL, "OP_NO_TLSv1_2", 0) +_OP_NO_TLSv1_3: int = getattr(OpenSSL.SSL, "OP_NO_TLSv1_3", 0) + +_openssl_to_ssl_minimum_version: dict[int, int] = { + ssl.TLSVersion.MINIMUM_SUPPORTED: _OP_NO_SSLv2_OR_SSLv3, + ssl.TLSVersion.TLSv1: _OP_NO_SSLv2_OR_SSLv3, + ssl.TLSVersion.TLSv1_1: _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1, + ssl.TLSVersion.TLSv1_2: _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1 | _OP_NO_TLSv1_1, + ssl.TLSVersion.TLSv1_3: ( + _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1 | _OP_NO_TLSv1_1 | _OP_NO_TLSv1_2 + ), + ssl.TLSVersion.MAXIMUM_SUPPORTED: ( + _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1 | _OP_NO_TLSv1_1 | _OP_NO_TLSv1_2 + ), +} +_openssl_to_ssl_maximum_version: dict[int, int] = { + ssl.TLSVersion.MINIMUM_SUPPORTED: ( + _OP_NO_SSLv2_OR_SSLv3 + | _OP_NO_TLSv1 + | _OP_NO_TLSv1_1 + | _OP_NO_TLSv1_2 + | _OP_NO_TLSv1_3 + ), + ssl.TLSVersion.TLSv1: ( + _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1_1 | _OP_NO_TLSv1_2 | _OP_NO_TLSv1_3 + ), + ssl.TLSVersion.TLSv1_1: _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1_2 | _OP_NO_TLSv1_3, + ssl.TLSVersion.TLSv1_2: _OP_NO_SSLv2_OR_SSLv3 | _OP_NO_TLSv1_3, + ssl.TLSVersion.TLSv1_3: _OP_NO_SSLv2_OR_SSLv3, + ssl.TLSVersion.MAXIMUM_SUPPORTED: _OP_NO_SSLv2_OR_SSLv3, +} + +# OpenSSL will only write 16K at a time +SSL_WRITE_BLOCKSIZE = 16384 + +orig_util_SSLContext = util.ssl_.SSLContext + + +log = logging.getLogger(__name__) + + +def inject_into_urllib3() -> None: + "Monkey-patch urllib3 with PyOpenSSL-backed SSL-support." + + _validate_dependencies_met() + + util.SSLContext = PyOpenSSLContext # type: ignore[assignment] + util.ssl_.SSLContext = PyOpenSSLContext # type: ignore[assignment] + util.IS_PYOPENSSL = True + util.ssl_.IS_PYOPENSSL = True + + +def extract_from_urllib3() -> None: + "Undo monkey-patching by :func:`inject_into_urllib3`." + + util.SSLContext = orig_util_SSLContext + util.ssl_.SSLContext = orig_util_SSLContext + util.IS_PYOPENSSL = False + util.ssl_.IS_PYOPENSSL = False + + +def _validate_dependencies_met() -> None: + """ + Verifies that PyOpenSSL's package-level dependencies have been met. + Throws `ImportError` if they are not met. + """ + # Method added in `cryptography==1.1`; not available in older versions + from cryptography.x509.extensions import Extensions + + if getattr(Extensions, "get_extension_for_class", None) is None: + raise ImportError( + "'cryptography' module missing required functionality. " + "Try upgrading to v1.3.4 or newer." + ) + + # pyOpenSSL 0.14 and above use cryptography for OpenSSL bindings. The _x509 + # attribute is only present on those versions. + from OpenSSL.crypto import X509 + + x509 = X509() + if getattr(x509, "_x509", None) is None: + raise ImportError( + "'pyOpenSSL' module missing required functionality. " + "Try upgrading to v0.14 or newer." + ) + + +def _dnsname_to_stdlib(name: str) -> str | None: + """ + Converts a dNSName SubjectAlternativeName field to the form used by the + standard library on the given Python version. + + Cryptography produces a dNSName as a unicode string that was idna-decoded + from ASCII bytes. We need to idna-encode that string to get it back, and + then on Python 3 we also need to convert to unicode via UTF-8 (the stdlib + uses PyUnicode_FromStringAndSize on it, which decodes via UTF-8). + + If the name cannot be idna-encoded then we return None signalling that + the name given should be skipped. + """ + + def idna_encode(name: str) -> bytes | None: + """ + Borrowed wholesale from the Python Cryptography Project. It turns out + that we can't just safely call `idna.encode`: it can explode for + wildcard names. This avoids that problem. + """ + import idna + + try: + for prefix in ["*.", "."]: + if name.startswith(prefix): + name = name[len(prefix) :] + return prefix.encode("ascii") + idna.encode(name) + return idna.encode(name) + except idna.core.IDNAError: + return None + + # Don't send IPv6 addresses through the IDNA encoder. + if ":" in name: + return name + + encoded_name = idna_encode(name) + if encoded_name is None: + return None + return encoded_name.decode("utf-8") + + +def get_subj_alt_name(peer_cert: X509) -> list[tuple[str, str]]: + """ + Given an PyOpenSSL certificate, provides all the subject alternative names. + """ + cert = peer_cert.to_cryptography() + + # We want to find the SAN extension. Ask Cryptography to locate it (it's + # faster than looping in Python) + try: + ext = cert.extensions.get_extension_for_class(x509.SubjectAlternativeName).value + except x509.ExtensionNotFound: + # No such extension, return the empty list. + return [] + except ( + x509.DuplicateExtension, + UnsupportedExtension, + x509.UnsupportedGeneralNameType, + UnicodeError, + ) as e: + # A problem has been found with the quality of the certificate. Assume + # no SAN field is present. + log.warning( + "A problem was encountered with the certificate that prevented " + "urllib3 from finding the SubjectAlternativeName field. This can " + "affect certificate validation. The error was %s", + e, + ) + return [] + + # We want to return dNSName and iPAddress fields. We need to cast the IPs + # back to strings because the match_hostname function wants them as + # strings. + # Sadly the DNS names need to be idna encoded and then, on Python 3, UTF-8 + # decoded. This is pretty frustrating, but that's what the standard library + # does with certificates, and so we need to attempt to do the same. + # We also want to skip over names which cannot be idna encoded. + names = [ + ("DNS", name) + for name in map(_dnsname_to_stdlib, ext.get_values_for_type(x509.DNSName)) + if name is not None + ] + names.extend( + ("IP Address", str(name)) for name in ext.get_values_for_type(x509.IPAddress) + ) + + return names + + +class WrappedSocket: + """API-compatibility wrapper for Python OpenSSL's Connection-class.""" + + def __init__( + self, + connection: OpenSSL.SSL.Connection, + socket: socket_cls, + suppress_ragged_eofs: bool = True, + ) -> None: + self.connection = connection + self.socket = socket + self.suppress_ragged_eofs = suppress_ragged_eofs + self._io_refs = 0 + self._closed = False + + def fileno(self) -> int: + return self.socket.fileno() + + # Copy-pasted from Python 3.5 source code + def _decref_socketios(self) -> None: + if self._io_refs > 0: + self._io_refs -= 1 + if self._closed: + self.close() + + def recv(self, *args: typing.Any, **kwargs: typing.Any) -> bytes: + try: + data = self.connection.recv(*args, **kwargs) + except OpenSSL.SSL.SysCallError as e: + if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): + return b"" + else: + raise OSError(e.args[0], str(e)) from e + except OpenSSL.SSL.ZeroReturnError: + if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: + return b"" + else: + raise + except OpenSSL.SSL.WantReadError as e: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): + raise TimeoutError("The read operation timed out") from e + else: + return self.recv(*args, **kwargs) + + # TLS 1.3 post-handshake authentication + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"read error: {e!r}") from e + else: + return data # type: ignore[no-any-return] + + def recv_into(self, *args: typing.Any, **kwargs: typing.Any) -> int: + try: + return self.connection.recv_into(*args, **kwargs) # type: ignore[no-any-return] + except OpenSSL.SSL.SysCallError as e: + if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"): + return 0 + else: + raise OSError(e.args[0], str(e)) from e + except OpenSSL.SSL.ZeroReturnError: + if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: + return 0 + else: + raise + except OpenSSL.SSL.WantReadError as e: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): + raise TimeoutError("The read operation timed out") from e + else: + return self.recv_into(*args, **kwargs) + + # TLS 1.3 post-handshake authentication + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"read error: {e!r}") from e + + def settimeout(self, timeout: float) -> None: + return self.socket.settimeout(timeout) + + def _send_until_done(self, data: bytes) -> int: + while True: + try: + return self.connection.send(data) # type: ignore[no-any-return] + except OpenSSL.SSL.WantWriteError as e: + if not util.wait_for_write(self.socket, self.socket.gettimeout()): + raise TimeoutError() from e + continue + except OpenSSL.SSL.SysCallError as e: + raise OSError(e.args[0], str(e)) from e + + def sendall(self, data: bytes) -> None: + total_sent = 0 + while total_sent < len(data): + sent = self._send_until_done( + data[total_sent : total_sent + SSL_WRITE_BLOCKSIZE] + ) + total_sent += sent + + def shutdown(self, how: int) -> None: + try: + self.connection.shutdown() + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"shutdown error: {e!r}") from e + + def close(self) -> None: + self._closed = True + if self._io_refs <= 0: + self._real_close() + + def _real_close(self) -> None: + try: + return self.connection.close() # type: ignore[no-any-return] + except OpenSSL.SSL.Error: + return + + def getpeercert( + self, binary_form: bool = False + ) -> dict[str, list[typing.Any]] | None: + x509 = self.connection.get_peer_certificate() + + if not x509: + return x509 # type: ignore[no-any-return] + + if binary_form: + return OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_ASN1, x509) # type: ignore[no-any-return] + + return { + "subject": ((("commonName", x509.get_subject().CN),),), # type: ignore[dict-item] + "subjectAltName": get_subj_alt_name(x509), + } + + def version(self) -> str: + return self.connection.get_protocol_version_name() # type: ignore[no-any-return] + + def selected_alpn_protocol(self) -> str | None: + alpn_proto = self.connection.get_alpn_proto_negotiated() + return alpn_proto.decode() if alpn_proto else None + + +WrappedSocket.makefile = socket_cls.makefile # type: ignore[attr-defined] + + +class PyOpenSSLContext: + """ + I am a wrapper class for the PyOpenSSL ``Context`` object. I am responsible + for translating the interface of the standard library ``SSLContext`` object + to calls into PyOpenSSL. + """ + + def __init__(self, protocol: int) -> None: + self.protocol = _openssl_versions[protocol] + self._ctx = OpenSSL.SSL.Context(self.protocol) + self._options = 0 + self.check_hostname = False + self._minimum_version: int = ssl.TLSVersion.MINIMUM_SUPPORTED + self._maximum_version: int = ssl.TLSVersion.MAXIMUM_SUPPORTED + self._verify_flags: int = ssl.VERIFY_X509_TRUSTED_FIRST + + @property + def options(self) -> int: + return self._options + + @options.setter + def options(self, value: int) -> None: + self._options = value + self._set_ctx_options() + + @property + def verify_flags(self) -> int: + return self._verify_flags + + @verify_flags.setter + def verify_flags(self, value: int) -> None: + self._verify_flags = value + self._ctx.get_cert_store().set_flags(self._verify_flags) + + @property + def verify_mode(self) -> int: + return _openssl_to_stdlib_verify[self._ctx.get_verify_mode()] + + @verify_mode.setter + def verify_mode(self, value: ssl.VerifyMode) -> None: + self._ctx.set_verify(_stdlib_to_openssl_verify[value], _verify_callback) + + def set_default_verify_paths(self) -> None: + self._ctx.set_default_verify_paths() + + def set_ciphers(self, ciphers: bytes | str) -> None: + if isinstance(ciphers, str): + ciphers = ciphers.encode("utf-8") + self._ctx.set_cipher_list(ciphers) + + def load_verify_locations( + self, + cafile: str | None = None, + capath: str | None = None, + cadata: bytes | None = None, + ) -> None: + if cafile is not None: + cafile = cafile.encode("utf-8") # type: ignore[assignment] + if capath is not None: + capath = capath.encode("utf-8") # type: ignore[assignment] + try: + self._ctx.load_verify_locations(cafile, capath) + if cadata is not None: + self._ctx.load_verify_locations(BytesIO(cadata)) + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"unable to load trusted certificates: {e!r}") from e + + def load_cert_chain( + self, + certfile: str, + keyfile: str | None = None, + password: str | None = None, + ) -> None: + try: + self._ctx.use_certificate_chain_file(certfile) + if password is not None: + if not isinstance(password, bytes): + password = password.encode("utf-8") # type: ignore[assignment] + self._ctx.set_passwd_cb(lambda *_: password) + self._ctx.use_privatekey_file(keyfile or certfile) + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"Unable to load certificate chain: {e!r}") from e + + def set_alpn_protocols(self, protocols: list[bytes | str]) -> None: + protocols = [util.util.to_bytes(p, "ascii") for p in protocols] + return self._ctx.set_alpn_protos(protocols) # type: ignore[no-any-return] + + def wrap_socket( + self, + sock: socket_cls, + server_side: bool = False, + do_handshake_on_connect: bool = True, + suppress_ragged_eofs: bool = True, + server_hostname: bytes | str | None = None, + ) -> WrappedSocket: + cnx = OpenSSL.SSL.Connection(self._ctx, sock) + + # If server_hostname is an IP, don't use it for SNI, per RFC6066 Section 3 + if server_hostname and not util.ssl_.is_ipaddress(server_hostname): + if isinstance(server_hostname, str): + server_hostname = server_hostname.encode("utf-8") + cnx.set_tlsext_host_name(server_hostname) + + cnx.set_connect_state() + + while True: + try: + cnx.do_handshake() + except OpenSSL.SSL.WantReadError as e: + if not util.wait_for_read(sock, sock.gettimeout()): + raise TimeoutError("select timed out") from e + continue + except OpenSSL.SSL.Error as e: + raise ssl.SSLError(f"bad handshake: {e!r}") from e + break + + return WrappedSocket(cnx, sock) + + def _set_ctx_options(self) -> None: + self._ctx.set_options( + self._options + | _openssl_to_ssl_minimum_version[self._minimum_version] + | _openssl_to_ssl_maximum_version[self._maximum_version] + ) + + @property + def minimum_version(self) -> int: + return self._minimum_version + + @minimum_version.setter + def minimum_version(self, minimum_version: int) -> None: + self._minimum_version = minimum_version + self._set_ctx_options() + + @property + def maximum_version(self) -> int: + return self._maximum_version + + @maximum_version.setter + def maximum_version(self, maximum_version: int) -> None: + self._maximum_version = maximum_version + self._set_ctx_options() + + +def _verify_callback( + cnx: OpenSSL.SSL.Connection, + x509: X509, + err_no: int, + err_depth: int, + return_code: int, +) -> bool: + return err_no == 0 diff --git a/micromamba_root/Lib/site-packages/urllib3/contrib/socks.py b/micromamba_root/Lib/site-packages/urllib3/contrib/socks.py new file mode 100644 index 0000000000000000000000000000000000000000..d37da8fc2049a7b3f7e18d2f64e79c205cfe3d3e --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/contrib/socks.py @@ -0,0 +1,228 @@ +""" +This module contains provisional support for SOCKS proxies from within +urllib3. This module supports SOCKS4, SOCKS4A (an extension of SOCKS4), and +SOCKS5. To enable its functionality, either install PySocks or install this +module with the ``socks`` extra. + +The SOCKS implementation supports the full range of urllib3 features. It also +supports the following SOCKS features: + +- SOCKS4A (``proxy_url='socks4a://...``) +- SOCKS4 (``proxy_url='socks4://...``) +- SOCKS5 with remote DNS (``proxy_url='socks5h://...``) +- SOCKS5 with local DNS (``proxy_url='socks5://...``) +- Usernames and passwords for the SOCKS proxy + +.. note:: + It is recommended to use ``socks5h://`` or ``socks4a://`` schemes in + your ``proxy_url`` to ensure that DNS resolution is done from the remote + server instead of client-side when connecting to a domain name. + +SOCKS4 supports IPv4 and domain names with the SOCKS4A extension. SOCKS5 +supports IPv4, IPv6, and domain names. + +When connecting to a SOCKS4 proxy the ``username`` portion of the ``proxy_url`` +will be sent as the ``userid`` section of the SOCKS request: + +.. code-block:: python + + proxy_url="socks4a://<userid>@proxy-host" + +When connecting to a SOCKS5 proxy the ``username`` and ``password`` portion +of the ``proxy_url`` will be sent as the username/password to authenticate +with the proxy: + +.. code-block:: python + + proxy_url="socks5h://<username>:<password>@proxy-host" + +""" + +from __future__ import annotations + +try: + import socks # type: ignore[import-untyped] +except ImportError: + import warnings + + from ..exceptions import DependencyWarning + + warnings.warn( + ( + "SOCKS support in urllib3 requires the installation of optional " + "dependencies: specifically, PySocks. For more information, see " + "https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies" + ), + DependencyWarning, + ) + raise + +import typing +from socket import timeout as SocketTimeout + +from ..connection import HTTPConnection, HTTPSConnection +from ..connectionpool import HTTPConnectionPool, HTTPSConnectionPool +from ..exceptions import ConnectTimeoutError, NewConnectionError +from ..poolmanager import PoolManager +from ..util.url import parse_url + +try: + import ssl +except ImportError: + ssl = None # type: ignore[assignment] + + +class _TYPE_SOCKS_OPTIONS(typing.TypedDict): + socks_version: int + proxy_host: str | None + proxy_port: str | None + username: str | None + password: str | None + rdns: bool + + +class SOCKSConnection(HTTPConnection): + """ + A plain-text HTTP connection that connects via a SOCKS proxy. + """ + + def __init__( + self, + _socks_options: _TYPE_SOCKS_OPTIONS, + *args: typing.Any, + **kwargs: typing.Any, + ) -> None: + self._socks_options = _socks_options + super().__init__(*args, **kwargs) + + def _new_conn(self) -> socks.socksocket: + """ + Establish a new connection via the SOCKS proxy. + """ + extra_kw: dict[str, typing.Any] = {} + if self.source_address: + extra_kw["source_address"] = self.source_address + + if self.socket_options: + extra_kw["socket_options"] = self.socket_options + + try: + conn = socks.create_connection( + (self.host, self.port), + proxy_type=self._socks_options["socks_version"], + proxy_addr=self._socks_options["proxy_host"], + proxy_port=self._socks_options["proxy_port"], + proxy_username=self._socks_options["username"], + proxy_password=self._socks_options["password"], + proxy_rdns=self._socks_options["rdns"], + timeout=self.timeout, + **extra_kw, + ) + + except SocketTimeout as e: + raise ConnectTimeoutError( + self, + f"Connection to {self.host} timed out. (connect timeout={self.timeout})", + ) from e + + except socks.ProxyError as e: + # This is fragile as hell, but it seems to be the only way to raise + # useful errors here. + if e.socket_err: + error = e.socket_err + if isinstance(error, SocketTimeout): + raise ConnectTimeoutError( + self, + f"Connection to {self.host} timed out. (connect timeout={self.timeout})", + ) from e + else: + # Adding `from e` messes with coverage somehow, so it's omitted. + # See #2386. + raise NewConnectionError( + self, f"Failed to establish a new connection: {error}" + ) + else: # Defensive: see https://github.com/urllib3/urllib3/pull/3728#pullrequestreview-3816302703 + raise NewConnectionError( + self, f"Failed to establish a new connection: {e}" + ) from e + + except OSError as e: # Defensive: PySocks should catch all these. + raise NewConnectionError( + self, f"Failed to establish a new connection: {e}" + ) from e + + return conn + + +# We don't need to duplicate the Verified/Unverified distinction from +# urllib3/connection.py here because the HTTPSConnection will already have been +# correctly set to either the Verified or Unverified form by that module. This +# means the SOCKSHTTPSConnection will automatically be the correct type. +class SOCKSHTTPSConnection(SOCKSConnection, HTTPSConnection): + pass + + +class SOCKSHTTPConnectionPool(HTTPConnectionPool): + ConnectionCls = SOCKSConnection + + +class SOCKSHTTPSConnectionPool(HTTPSConnectionPool): + ConnectionCls = SOCKSHTTPSConnection + + +class SOCKSProxyManager(PoolManager): + """ + A version of the urllib3 ProxyManager that routes connections via the + defined SOCKS proxy. + """ + + pool_classes_by_scheme = { + "http": SOCKSHTTPConnectionPool, + "https": SOCKSHTTPSConnectionPool, + } + + def __init__( + self, + proxy_url: str, + username: str | None = None, + password: str | None = None, + num_pools: int = 10, + headers: typing.Mapping[str, str] | None = None, + **connection_pool_kw: typing.Any, + ): + parsed = parse_url(proxy_url) + + if username is None and password is None and parsed.auth is not None: + split = parsed.auth.split(":") + if len(split) == 2: + username, password = split + if parsed.scheme == "socks5": + socks_version = socks.PROXY_TYPE_SOCKS5 + rdns = False + elif parsed.scheme == "socks5h": + socks_version = socks.PROXY_TYPE_SOCKS5 + rdns = True + elif parsed.scheme == "socks4": + socks_version = socks.PROXY_TYPE_SOCKS4 + rdns = False + elif parsed.scheme == "socks4a": + socks_version = socks.PROXY_TYPE_SOCKS4 + rdns = True + else: + raise ValueError(f"Unable to determine SOCKS version from {proxy_url}") + + self.proxy_url = proxy_url + + socks_options = { + "socks_version": socks_version, + "proxy_host": parsed.host, + "proxy_port": parsed.port, + "username": username, + "password": password, + "rdns": rdns, + } + connection_pool_kw["_socks_options"] = socks_options + + super().__init__(num_pools, headers, **connection_pool_kw) + + self.pool_classes_by_scheme = SOCKSProxyManager.pool_classes_by_scheme diff --git a/micromamba_root/Lib/site-packages/urllib3/exceptions.py b/micromamba_root/Lib/site-packages/urllib3/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..3d7e9b93d307ffe7d54868122227a165cc98383c --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/exceptions.py @@ -0,0 +1,335 @@ +from __future__ import annotations + +import socket +import typing +import warnings +from email.errors import MessageDefect +from http.client import IncompleteRead as httplib_IncompleteRead + +if typing.TYPE_CHECKING: + from .connection import HTTPConnection + from .connectionpool import ConnectionPool + from .response import HTTPResponse + from .util.retry import Retry + +# Base Exceptions + + +class HTTPError(Exception): + """Base exception used by this module.""" + + +class HTTPWarning(Warning): + """Base warning used by this module.""" + + +_TYPE_REDUCE_RESULT = tuple[typing.Callable[..., object], tuple[object, ...]] + + +class PoolError(HTTPError): + """Base exception for errors caused within a pool.""" + + def __init__(self, pool: ConnectionPool, message: str) -> None: + self.pool = pool + self._message = message + super().__init__(f"{pool}: {message}") + + def __reduce__(self) -> _TYPE_REDUCE_RESULT: + # For pickling purposes. + return self.__class__, (None, self._message) + + +class RequestError(PoolError): + """Base exception for PoolErrors that have associated URLs.""" + + def __init__(self, pool: ConnectionPool, url: str | None, message: str) -> None: + self.url = url + super().__init__(pool, message) + + def __reduce__(self) -> _TYPE_REDUCE_RESULT: + # For pickling purposes. + return self.__class__, (None, self.url, self._message) + + +class SSLError(HTTPError): + """Raised when SSL certificate fails in an HTTPS connection.""" + + +class ProxyError(HTTPError): + """Raised when the connection to a proxy fails.""" + + # The original error is also available as __cause__. + original_error: Exception + + def __init__(self, message: str, error: Exception) -> None: + super().__init__(message, error) + self.original_error = error + + +class DecodeError(HTTPError): + """Raised when automatic decoding based on Content-Type fails.""" + + +class ProtocolError(HTTPError): + """Raised when something unexpected happens mid-request/response.""" + + +#: Renamed to ProtocolError but aliased for backwards compatibility. +ConnectionError = ProtocolError + + +# Leaf Exceptions + + +class MaxRetryError(RequestError): + """Raised when the maximum number of retries is exceeded. + + :param pool: The connection pool + :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` + :param str url: The requested Url + :param reason: The underlying error + :type reason: :class:`Exception` + + """ + + def __init__( + self, pool: ConnectionPool, url: str | None, reason: Exception | None = None + ) -> None: + self.reason = reason + + message = f"Max retries exceeded with url: {url} (Caused by {reason!r})" + + super().__init__(pool, url, message) + + def __reduce__(self) -> _TYPE_REDUCE_RESULT: + # For pickling purposes. + return self.__class__, (None, self.url, self.reason) + + +class HostChangedError(RequestError): + """Raised when an existing pool gets a request for a foreign host.""" + + def __init__( + self, pool: ConnectionPool, url: str, retries: Retry | int = 3 + ) -> None: + message = f"Tried to open a foreign host with url: {url}" + super().__init__(pool, url, message) + self.retries = retries + + +class TimeoutStateError(HTTPError): + """Raised when passing an invalid state to a timeout""" + + +class TimeoutError(HTTPError): + """Raised when a socket timeout error occurs. + + Catching this error will catch both :exc:`ReadTimeoutErrors + <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`. + """ + + +class ReadTimeoutError(TimeoutError, RequestError): + """Raised when a socket timeout occurs while receiving data from a server""" + + +# This timeout error does not have a URL attached and needs to inherit from the +# base HTTPError +class ConnectTimeoutError(TimeoutError): + """Raised when a socket timeout occurs while connecting to a server""" + + +class NewConnectionError(ConnectTimeoutError, HTTPError): + """Raised when we fail to establish a new connection. Usually ECONNREFUSED.""" + + def __init__(self, conn: HTTPConnection, message: str) -> None: + self.conn = conn + self._message = message + super().__init__(f"{conn}: {message}") + + def __reduce__(self) -> _TYPE_REDUCE_RESULT: + # For pickling purposes. + return self.__class__, (None, self._message) + + @property + def pool(self) -> HTTPConnection: + warnings.warn( + "The 'pool' property is deprecated and will be removed " + "in urllib3 v3.0. Use 'conn' instead.", + FutureWarning, + stacklevel=2, + ) + + return self.conn + + +class NameResolutionError(NewConnectionError): + """Raised when host name resolution fails.""" + + def __init__(self, host: str, conn: HTTPConnection, reason: socket.gaierror): + message = f"Failed to resolve '{host}' ({reason})" + self._host = host + self._reason = reason + super().__init__(conn, message) + + def __reduce__(self) -> _TYPE_REDUCE_RESULT: + # For pickling purposes. + return self.__class__, (self._host, None, self._reason) + + +class EmptyPoolError(PoolError): + """Raised when a pool runs out of connections and no more are allowed.""" + + +class FullPoolError(PoolError): + """Raised when we try to add a connection to a full pool in blocking mode.""" + + +class ClosedPoolError(PoolError): + """Raised when a request enters a pool after the pool has been closed.""" + + +class LocationValueError(ValueError, HTTPError): + """Raised when there is something wrong with a given URL input.""" + + +class LocationParseError(LocationValueError): + """Raised when get_host or similar fails to parse the URL input.""" + + def __init__(self, location: str) -> None: + message = f"Failed to parse: {location}" + super().__init__(message) + + self.location = location + + +class URLSchemeUnknown(LocationValueError): + """Raised when a URL input has an unsupported scheme.""" + + def __init__(self, scheme: str): + message = f"Not supported URL scheme {scheme}" + super().__init__(message) + + self.scheme = scheme + + +class ResponseError(HTTPError): + """Used as a container for an error reason supplied in a MaxRetryError.""" + + GENERIC_ERROR = "too many error responses" + SPECIFIC_ERROR = "too many {status_code} error responses" + + +class SecurityWarning(HTTPWarning): + """Warned when performing security reducing actions""" + + +class InsecureRequestWarning(SecurityWarning): + """Warned when making an unverified HTTPS request.""" + + +class NotOpenSSLWarning(SecurityWarning): + """Warned when using unsupported SSL library""" + + +class SystemTimeWarning(SecurityWarning): + """Warned when system time is suspected to be wrong""" + + +class InsecurePlatformWarning(SecurityWarning): + """Warned when certain TLS/SSL configuration is not available on a platform.""" + + +class DependencyWarning(HTTPWarning): + """ + Warned when an attempt is made to import a module with missing optional + dependencies. + """ + + +class ResponseNotChunked(ProtocolError, ValueError): + """Response needs to be chunked in order to read it as chunks.""" + + +class BodyNotHttplibCompatible(HTTPError): + """ + Body should be :class:`http.client.HTTPResponse` like + (have an fp attribute which returns raw chunks) for read_chunked(). + """ + + +class IncompleteRead(HTTPError, httplib_IncompleteRead): + """ + Response length doesn't match expected Content-Length + + Subclass of :class:`http.client.IncompleteRead` to allow int value + for ``partial`` to avoid creating large objects on streamed reads. + """ + + partial: int # type: ignore[assignment] + expected: int + + def __init__(self, partial: int, expected: int) -> None: + self.partial = partial + self.expected = expected + + def __repr__(self) -> str: + return "IncompleteRead(%i bytes read, %i more expected)" % ( + self.partial, + self.expected, + ) + + +class InvalidChunkLength(HTTPError, httplib_IncompleteRead): + """Invalid chunk length in a chunked response.""" + + def __init__(self, response: HTTPResponse, length: bytes) -> None: + self.partial: int = response.tell() # type: ignore[assignment] + self.expected: int | None = response.length_remaining + self.response = response + self.length = length + + def __repr__(self) -> str: + return "InvalidChunkLength(got length %r, %i bytes read)" % ( + self.length, + self.partial, + ) + + +class InvalidHeader(HTTPError): + """The header provided was somehow invalid.""" + + +class ProxySchemeUnknown(AssertionError, URLSchemeUnknown): + """ProxyManager does not support the supplied scheme""" + + # TODO(t-8ch): Stop inheriting from AssertionError in v2.0. + + def __init__(self, scheme: str | None) -> None: + # 'localhost' is here because our URL parser parses + # localhost:8080 -> scheme=localhost, remove if we fix this. + if scheme == "localhost": + scheme = None + if scheme is None: + message = "Proxy URL had no scheme, should start with http:// or https://" + else: + message = f"Proxy URL had unsupported scheme {scheme}, should use http:// or https://" + super().__init__(message) + + +class ProxySchemeUnsupported(ValueError): + """Fetching HTTPS resources through HTTPS proxies is unsupported""" + + +class HeaderParsingError(HTTPError): + """Raised by assert_header_parsing, but we convert it to a log.warning statement.""" + + def __init__( + self, defects: list[MessageDefect], unparsed_data: bytes | str | None + ) -> None: + message = f"{defects or 'Unknown'}, unparsed data: {unparsed_data!r}" + super().__init__(message) + + +class UnrewindableBodyError(HTTPError): + """urllib3 encountered an error when trying to rewind a body""" diff --git a/micromamba_root/Lib/site-packages/urllib3/fields.py b/micromamba_root/Lib/site-packages/urllib3/fields.py new file mode 100644 index 0000000000000000000000000000000000000000..fe68e177324bc67f145091e464556a69b89bcda7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/fields.py @@ -0,0 +1,341 @@ +from __future__ import annotations + +import email.utils +import mimetypes +import typing + +_TYPE_FIELD_VALUE = typing.Union[str, bytes] +_TYPE_FIELD_VALUE_TUPLE = typing.Union[ + _TYPE_FIELD_VALUE, + tuple[str, _TYPE_FIELD_VALUE], + tuple[str, _TYPE_FIELD_VALUE, str], +] + + +def guess_content_type( + filename: str | None, default: str = "application/octet-stream" +) -> str: + """ + Guess the "Content-Type" of a file. + + :param filename: + The filename to guess the "Content-Type" of using :mod:`mimetypes`. + :param default: + If no "Content-Type" can be guessed, default to `default`. + """ + if filename: + return mimetypes.guess_type(filename)[0] or default + return default + + +def format_header_param_rfc2231(name: str, value: _TYPE_FIELD_VALUE) -> str: + """ + Helper function to format and quote a single header parameter using the + strategy defined in RFC 2231. + + Particularly useful for header parameters which might contain + non-ASCII values, like file names. This follows + `RFC 2388 Section 4.4 <https://tools.ietf.org/html/rfc2388#section-4.4>`_. + + :param name: + The name of the parameter, a string expected to be ASCII only. + :param value: + The value of the parameter, provided as ``bytes`` or `str``. + :returns: + An RFC-2231-formatted unicode string. + + .. deprecated:: 2.0.0 + Will be removed in urllib3 v3.0. This is not valid for + ``multipart/form-data`` header parameters. + """ + import warnings + + warnings.warn( + "'format_header_param_rfc2231' is insecure, deprecated and will be " + "removed in urllib3 v3.0. This is not valid for " + "multipart/form-data header parameters.", + FutureWarning, + stacklevel=2, + ) + + if isinstance(value, bytes): + value = value.decode("utf-8") + + if not any(ch in value for ch in '"\\\r\n'): + result = f'{name}="{value}"' + try: + result.encode("ascii") + except (UnicodeEncodeError, UnicodeDecodeError): + pass + else: + return result + + value = email.utils.encode_rfc2231(value, "utf-8") + value = f"{name}*={value}" + + return value + + +def format_multipart_header_param(name: str, value: _TYPE_FIELD_VALUE) -> str: + """ + Format and quote a single multipart header parameter. + + This follows the `WHATWG HTML Standard`_ as of 2021/06/10, matching + the behavior of current browser and curl versions. Values are + assumed to be UTF-8. The ``\\n``, ``\\r``, and ``"`` characters are + percent encoded. + + .. _WHATWG HTML Standard: + https://html.spec.whatwg.org/multipage/ + form-control-infrastructure.html#multipart-form-data + + :param name: + The name of the parameter, an ASCII-only ``str``. + :param value: + The value of the parameter, a ``str`` or UTF-8 encoded + ``bytes``. + :returns: + A string ``name="value"`` with the escaped value. + + .. versionchanged:: 2.0.0 + Matches the WHATWG HTML Standard as of 2021/06/10. Control + characters are no longer percent encoded. + + .. versionchanged:: 2.0.0 + Renamed from ``format_header_param_html5`` and + ``format_header_param``. The old names will be removed in + urllib3 v3.0. + """ + if isinstance(value, bytes): + value = value.decode("utf-8") + + # percent encode \n \r " + value = value.translate({10: "%0A", 13: "%0D", 34: "%22"}) + return f'{name}="{value}"' + + +def format_header_param_html5(name: str, value: _TYPE_FIELD_VALUE) -> str: + """ + .. deprecated:: 2.0.0 + Renamed to :func:`format_multipart_header_param`. Will be + removed in urllib3 v3.0. + """ + import warnings + + warnings.warn( + "'format_header_param_html5' has been renamed to " + "'format_multipart_header_param'. The old name will be " + "removed in urllib3 v3.0.", + FutureWarning, + stacklevel=2, + ) + return format_multipart_header_param(name, value) + + +def format_header_param(name: str, value: _TYPE_FIELD_VALUE) -> str: + """ + .. deprecated:: 2.0.0 + Renamed to :func:`format_multipart_header_param`. Will be + removed in urllib3 v3.0. + """ + import warnings + + warnings.warn( + "'format_header_param' has been renamed to " + "'format_multipart_header_param'. The old name will be " + "removed in urllib3 v3.0.", + FutureWarning, + stacklevel=2, + ) + return format_multipart_header_param(name, value) + + +class RequestField: + """ + A data container for request body parameters. + + :param name: + The name of this request field. Must be unicode. + :param data: + The data/value body. + :param filename: + An optional filename of the request field. Must be unicode. + :param headers: + An optional dict-like object of headers to initially use for the field. + + .. versionchanged:: 2.0.0 + The ``header_formatter`` parameter is deprecated and will + be removed in urllib3 v3.0. + """ + + def __init__( + self, + name: str, + data: _TYPE_FIELD_VALUE, + filename: str | None = None, + headers: typing.Mapping[str, str] | None = None, + header_formatter: typing.Callable[[str, _TYPE_FIELD_VALUE], str] | None = None, + ): + self._name = name + self._filename = filename + self.data = data + self.headers: dict[str, str | None] = {} + if headers: + self.headers = dict(headers) + + if header_formatter is not None: + import warnings + + warnings.warn( + "The 'header_formatter' parameter is deprecated and " + "will be removed in urllib3 v3.0.", + FutureWarning, + stacklevel=2, + ) + self.header_formatter = header_formatter + else: + self.header_formatter = format_multipart_header_param + + @classmethod + def from_tuples( + cls, + fieldname: str, + value: _TYPE_FIELD_VALUE_TUPLE, + header_formatter: typing.Callable[[str, _TYPE_FIELD_VALUE], str] | None = None, + ) -> RequestField: + """ + A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. + + Supports constructing :class:`~urllib3.fields.RequestField` from + parameter of key/value strings AND key/filetuple. A filetuple is a + (filename, data, MIME type) tuple where the MIME type is optional. + For example:: + + 'foo': 'bar', + 'fakefile': ('foofile.txt', 'contents of foofile'), + 'realfile': ('barfile.txt', open('realfile').read()), + 'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'), + 'nonamefile': 'contents of nonamefile field', + + Field names and filenames must be unicode. + """ + filename: str | None + content_type: str | None + data: _TYPE_FIELD_VALUE + + if isinstance(value, tuple): + if len(value) == 3: + filename, data, content_type = value + else: + filename, data = value + content_type = guess_content_type(filename) + else: + filename = None + content_type = None + data = value + + request_param = cls( + fieldname, data, filename=filename, header_formatter=header_formatter + ) + request_param.make_multipart(content_type=content_type) + + return request_param + + def _render_part(self, name: str, value: _TYPE_FIELD_VALUE) -> str: + """ + Override this method to change how each multipart header + parameter is formatted. By default, this calls + :func:`format_multipart_header_param`. + + :param name: + The name of the parameter, an ASCII-only ``str``. + :param value: + The value of the parameter, a ``str`` or UTF-8 encoded + ``bytes``. + + :meta public: + """ + return self.header_formatter(name, value) + + def _render_parts( + self, + header_parts: ( + dict[str, _TYPE_FIELD_VALUE | None] + | typing.Sequence[tuple[str, _TYPE_FIELD_VALUE | None]] + ), + ) -> str: + """ + Helper function to format and quote a single header. + + Useful for single headers that are composed of multiple items. E.g., + 'Content-Disposition' fields. + + :param header_parts: + A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format + as `k1="v1"; k2="v2"; ...`. + """ + iterable: typing.Iterable[tuple[str, _TYPE_FIELD_VALUE | None]] + + parts = [] + if isinstance(header_parts, dict): + iterable = header_parts.items() + else: + iterable = header_parts + + for name, value in iterable: + if value is not None: + parts.append(self._render_part(name, value)) + + return "; ".join(parts) + + def render_headers(self) -> str: + """ + Renders the headers for this request field. + """ + lines = [] + + sort_keys = ["Content-Disposition", "Content-Type", "Content-Location"] + for sort_key in sort_keys: + if self.headers.get(sort_key, False): + lines.append(f"{sort_key}: {self.headers[sort_key]}") + + for header_name, header_value in self.headers.items(): + if header_name not in sort_keys: + if header_value: + lines.append(f"{header_name}: {header_value}") + + lines.append("\r\n") + return "\r\n".join(lines) + + def make_multipart( + self, + content_disposition: str | None = None, + content_type: str | None = None, + content_location: str | None = None, + ) -> None: + """ + Makes this request field into a multipart request field. + + This method overrides "Content-Disposition", "Content-Type" and + "Content-Location" headers to the request parameter. + + :param content_disposition: + The 'Content-Disposition' of the request body. Defaults to 'form-data' + :param content_type: + The 'Content-Type' of the request body. + :param content_location: + The 'Content-Location' of the request body. + + """ + content_disposition = (content_disposition or "form-data") + "; ".join( + [ + "", + self._render_parts( + (("name", self._name), ("filename", self._filename)) + ), + ] + ) + + self.headers["Content-Disposition"] = content_disposition + self.headers["Content-Type"] = content_type + self.headers["Content-Location"] = content_location diff --git a/micromamba_root/Lib/site-packages/urllib3/filepost.py b/micromamba_root/Lib/site-packages/urllib3/filepost.py new file mode 100644 index 0000000000000000000000000000000000000000..14f70b05b4778f91137e4a9e7059d7514aa44d28 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/filepost.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +import binascii +import codecs +import os +import typing +from io import BytesIO + +from .fields import _TYPE_FIELD_VALUE_TUPLE, RequestField + +writer = codecs.lookup("utf-8")[3] + +_TYPE_FIELDS_SEQUENCE = typing.Sequence[ + typing.Union[tuple[str, _TYPE_FIELD_VALUE_TUPLE], RequestField] +] +_TYPE_FIELDS = typing.Union[ + _TYPE_FIELDS_SEQUENCE, + typing.Mapping[str, _TYPE_FIELD_VALUE_TUPLE], +] + + +def choose_boundary() -> str: + """ + Our embarrassingly-simple replacement for mimetools.choose_boundary. + """ + return binascii.hexlify(os.urandom(16)).decode() + + +def iter_field_objects(fields: _TYPE_FIELDS) -> typing.Iterable[RequestField]: + """ + Iterate over fields. + + Supports list of (k, v) tuples and dicts, and lists of + :class:`~urllib3.fields.RequestField`. + + """ + iterable: typing.Iterable[RequestField | tuple[str, _TYPE_FIELD_VALUE_TUPLE]] + + if isinstance(fields, typing.Mapping): + iterable = fields.items() + else: + iterable = fields + + for field in iterable: + if isinstance(field, RequestField): + yield field + else: + yield RequestField.from_tuples(*field) + + +def encode_multipart_formdata( + fields: _TYPE_FIELDS, boundary: str | None = None +) -> tuple[bytes, str]: + """ + Encode a dictionary of ``fields`` using the multipart/form-data MIME format. + + :param fields: + Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). + Values are processed by :func:`urllib3.fields.RequestField.from_tuples`. + + :param boundary: + If not specified, then a random boundary will be generated using + :func:`urllib3.filepost.choose_boundary`. + """ + body = BytesIO() + if boundary is None: + boundary = choose_boundary() + + for field in iter_field_objects(fields): + body.write(f"--{boundary}\r\n".encode("latin-1")) + + writer(body).write(field.render_headers()) + data = field.data + + if isinstance(data, int): + data = str(data) # Backwards compatibility + + if isinstance(data, str): + writer(body).write(data) + else: + body.write(data) + + body.write(b"\r\n") + + body.write(f"--{boundary}--\r\n".encode("latin-1")) + + content_type = f"multipart/form-data; boundary={boundary}" + + return body.getvalue(), content_type diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/__init__.py b/micromamba_root/Lib/site-packages/urllib3/http2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..133e1d8f237f6fddd557ae1c0e0cf738f7cc2748 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/http2/__init__.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from importlib.metadata import version + +__all__ = [ + "inject_into_urllib3", + "extract_from_urllib3", +] + +import typing + +orig_HTTPSConnection: typing.Any = None + + +def inject_into_urllib3() -> None: + # First check if h2 version is valid + h2_version = version("h2") + if not h2_version.startswith("4."): + raise ImportError( + "urllib3 v2 supports h2 version 4.x.x, currently " + f"the 'h2' module is compiled with {h2_version!r}. " + "See: https://github.com/urllib3/urllib3/issues/3290" + ) + + # Import here to avoid circular dependencies. + from .. import connection as urllib3_connection + from .. import util as urllib3_util + from ..connectionpool import HTTPSConnectionPool + from ..util import ssl_ as urllib3_util_ssl + from .connection import HTTP2Connection + + global orig_HTTPSConnection + orig_HTTPSConnection = urllib3_connection.HTTPSConnection + + HTTPSConnectionPool.ConnectionCls = HTTP2Connection + urllib3_connection.HTTPSConnection = HTTP2Connection # type: ignore[misc] + + # TODO: Offer 'http/1.1' as well, but for testing purposes this is handy. + urllib3_util.ALPN_PROTOCOLS = ["h2"] + urllib3_util_ssl.ALPN_PROTOCOLS = ["h2"] + + +def extract_from_urllib3() -> None: + from .. import connection as urllib3_connection + from .. import util as urllib3_util + from ..connectionpool import HTTPSConnectionPool + from ..util import ssl_ as urllib3_util_ssl + + HTTPSConnectionPool.ConnectionCls = orig_HTTPSConnection + urllib3_connection.HTTPSConnection = orig_HTTPSConnection # type: ignore[misc] + + urllib3_util.ALPN_PROTOCOLS = ["http/1.1"] + urllib3_util_ssl.ALPN_PROTOCOLS = ["http/1.1"] diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89f2e9c6ad95988e0cac14450aedc9cd499c9e86 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/connection.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a72cf87e8a8252e293dcb6629cd608d473d905f0 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/probe.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/probe.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a952551584beede6f75c30b064b3fd53fa0239fe Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/http2/__pycache__/probe.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/connection.py b/micromamba_root/Lib/site-packages/urllib3/http2/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..0a026da0a8357e324ded47b82b24042713b9bf06 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/http2/connection.py @@ -0,0 +1,356 @@ +from __future__ import annotations + +import logging +import re +import threading +import types +import typing + +import h2.config +import h2.connection +import h2.events + +from .._base_connection import _TYPE_BODY +from .._collections import HTTPHeaderDict +from ..connection import HTTPSConnection, _get_default_user_agent +from ..exceptions import ConnectionError +from ..response import BaseHTTPResponse + +orig_HTTPSConnection = HTTPSConnection + +T = typing.TypeVar("T") + +log = logging.getLogger(__name__) + +RE_IS_LEGAL_HEADER_NAME = re.compile(rb"^[!#$%&'*+\-.^_`|~0-9a-z]+$") +RE_IS_ILLEGAL_HEADER_VALUE = re.compile(rb"[\0\x00\x0a\x0d\r\n]|^[ \r\n\t]|[ \r\n\t]$") + + +def _is_legal_header_name(name: bytes) -> bool: + """ + "An implementation that validates fields according to the definitions in Sections + 5.1 and 5.5 of [HTTP] only needs an additional check that field names do not + include uppercase characters." (https://httpwg.org/specs/rfc9113.html#n-field-validity) + + `http.client._is_legal_header_name` does not validate the field name according to the + HTTP 1.1 spec, so we do that here, in addition to checking for uppercase characters. + + This does not allow for the `:` character in the header name, so should not + be used to validate pseudo-headers. + """ + return bool(RE_IS_LEGAL_HEADER_NAME.match(name)) + + +def _is_illegal_header_value(value: bytes) -> bool: + """ + "A field value MUST NOT contain the zero value (ASCII NUL, 0x00), line feed + (ASCII LF, 0x0a), or carriage return (ASCII CR, 0x0d) at any position. A field + value MUST NOT start or end with an ASCII whitespace character (ASCII SP or HTAB, + 0x20 or 0x09)." (https://httpwg.org/specs/rfc9113.html#n-field-validity) + """ + return bool(RE_IS_ILLEGAL_HEADER_VALUE.search(value)) + + +class _LockedObject(typing.Generic[T]): + """ + A wrapper class that hides a specific object behind a lock. + The goal here is to provide a simple way to protect access to an object + that cannot safely be simultaneously accessed from multiple threads. The + intended use of this class is simple: take hold of it with a context + manager, which returns the protected object. + """ + + __slots__ = ( + "lock", + "_obj", + ) + + def __init__(self, obj: T): + self.lock = threading.RLock() + self._obj = obj + + def __enter__(self) -> T: + self.lock.acquire() + return self._obj + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: types.TracebackType | None, + ) -> None: + self.lock.release() + + +class HTTP2Connection(HTTPSConnection): + def __init__( + self, host: str, port: int | None = None, **kwargs: typing.Any + ) -> None: + self._h2_conn = self._new_h2_conn() + self._h2_stream: int | None = None + self._headers: list[tuple[bytes, bytes]] = [] + + if "proxy" in kwargs or "proxy_config" in kwargs: # Defensive: + raise NotImplementedError("Proxies aren't supported with HTTP/2") + + super().__init__(host, port, **kwargs) + + if self._tunnel_host is not None: + raise NotImplementedError("Tunneling isn't supported with HTTP/2") + + def _new_h2_conn(self) -> _LockedObject[h2.connection.H2Connection]: + config = h2.config.H2Configuration(client_side=True) + return _LockedObject(h2.connection.H2Connection(config=config)) + + def connect(self) -> None: + super().connect() + with self._h2_conn as conn: + conn.initiate_connection() + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + + def putrequest( # type: ignore[override] + self, + method: str, + url: str, + **kwargs: typing.Any, + ) -> None: + """putrequest + This deviates from the HTTPConnection method signature since we never need to override + sending accept-encoding headers or the host header. + """ + if "skip_host" in kwargs: + raise NotImplementedError("`skip_host` isn't supported") + if "skip_accept_encoding" in kwargs: + raise NotImplementedError("`skip_accept_encoding` isn't supported") + + self._request_url = url or "/" + self._validate_path(url) # type: ignore[attr-defined] + + if ":" in self.host: + authority = f"[{self.host}]:{self.port or 443}" + else: + authority = f"{self.host}:{self.port or 443}" + + self._headers.append((b":scheme", b"https")) + self._headers.append((b":method", method.encode())) + self._headers.append((b":authority", authority.encode())) + self._headers.append((b":path", url.encode())) + + with self._h2_conn as conn: + self._h2_stream = conn.get_next_available_stream_id() + + def putheader(self, header: str | bytes, *values: str | bytes) -> None: # type: ignore[override] + # TODO SKIPPABLE_HEADERS from urllib3 are ignored. + header = header.encode() if isinstance(header, str) else header + header = header.lower() # A lot of upstream code uses capitalized headers. + if not _is_legal_header_name(header): + raise ValueError(f"Illegal header name {str(header)}") + + for value in values: + value = value.encode() if isinstance(value, str) else value + if _is_illegal_header_value(value): + raise ValueError(f"Illegal header value {str(value)}") + self._headers.append((header, value)) + + def endheaders(self, message_body: typing.Any = None) -> None: # type: ignore[override] + if self._h2_stream is None: + raise ConnectionError("Must call `putrequest` first.") + + with self._h2_conn as conn: + conn.send_headers( + stream_id=self._h2_stream, + headers=self._headers, + end_stream=(message_body is None), + ) + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + self._headers = [] # Reset headers for the next request. + + def send(self, data: typing.Any) -> None: + """Send data to the server. + `data` can be: `str`, `bytes`, an iterable, or file-like objects + that support a .read() method. + """ + if self._h2_stream is None: + raise ConnectionError("Must call `putrequest` first.") + + with self._h2_conn as conn: + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + + if hasattr(data, "read"): # file-like objects + while True: + chunk = data.read(self.blocksize) + if not chunk: + break + if isinstance(chunk, str): + chunk = chunk.encode() + conn.send_data(self._h2_stream, chunk, end_stream=False) + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + conn.end_stream(self._h2_stream) + return + + if isinstance(data, str): # str -> bytes + data = data.encode() + + try: + if isinstance(data, bytes): + conn.send_data(self._h2_stream, data, end_stream=True) + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + else: + for chunk in data: + conn.send_data(self._h2_stream, chunk, end_stream=False) + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + conn.end_stream(self._h2_stream) + except TypeError: + raise TypeError( + "`data` should be str, bytes, iterable, or file. got %r" + % type(data) + ) + + def set_tunnel( + self, + host: str, + port: int | None = None, + headers: typing.Mapping[str, str] | None = None, + scheme: str = "http", + ) -> None: + raise NotImplementedError( + "HTTP/2 does not support setting up a tunnel through a proxy" + ) + + def getresponse( # type: ignore[override] + self, + ) -> HTTP2Response: + status = None + data = bytearray() + with self._h2_conn as conn: + end_stream = False + while not end_stream: + # TODO: Arbitrary read value. + if received_data := self.sock.recv(65535): + events = conn.receive_data(received_data) + for event in events: + if isinstance(event, h2.events.ResponseReceived): + headers = HTTPHeaderDict() + for header, value in event.headers: + if header == b":status": + status = int(value.decode()) + else: + headers.add( + header.decode("ascii"), value.decode("ascii") + ) + + elif isinstance(event, h2.events.DataReceived): + data += event.data + conn.acknowledge_received_data( + event.flow_controlled_length, event.stream_id + ) + + elif isinstance(event, h2.events.StreamEnded): + end_stream = True + + if data_to_send := conn.data_to_send(): + self.sock.sendall(data_to_send) + + assert status is not None + return HTTP2Response( + status=status, + headers=headers, + request_url=self._request_url, + data=bytes(data), + ) + + def request( # type: ignore[override] + self, + method: str, + url: str, + body: _TYPE_BODY | None = None, + headers: typing.Mapping[str, str] | None = None, + *, + preload_content: bool = True, + decode_content: bool = True, + enforce_content_length: bool = True, + **kwargs: typing.Any, + ) -> None: + """Send an HTTP/2 request""" + if "chunked" in kwargs: + # TODO this is often present from upstream. + # raise NotImplementedError("`chunked` isn't supported with HTTP/2") + pass + + if self.sock is not None: + self.sock.settimeout(self.timeout) + + self.putrequest(method, url) + + headers = headers or {} + for k, v in headers.items(): + if k.lower() == "transfer-encoding" and v == "chunked": + continue + else: + self.putheader(k, v) + + if b"user-agent" not in dict(self._headers): + self.putheader(b"user-agent", _get_default_user_agent()) + + if body: + self.endheaders(message_body=body) + self.send(body) + else: + self.endheaders() + + def close(self) -> None: + with self._h2_conn as conn: + try: + conn.close_connection() + if data := conn.data_to_send(): + self.sock.sendall(data) + except Exception: + pass + + # Reset all our HTTP/2 connection state. + self._h2_conn = self._new_h2_conn() + self._h2_stream = None + self._headers = [] + + super().close() + + +class HTTP2Response(BaseHTTPResponse): + # TODO: This is a woefully incomplete response object, but works for non-streaming. + def __init__( + self, + status: int, + headers: HTTPHeaderDict, + request_url: str, + data: bytes, + decode_content: bool = False, # TODO: support decoding + ) -> None: + super().__init__( + status=status, + headers=headers, + # Following CPython, we map HTTP versions to major * 10 + minor integers + version=20, + version_string="HTTP/2", + # No reason phrase in HTTP/2 + reason=None, + decode_content=decode_content, + request_url=request_url, + ) + self._data = data + self.length_remaining = 0 + + @property + def data(self) -> bytes: + return self._data + + def get_redirect_location(self) -> None: + return None + + def close(self) -> None: + pass diff --git a/micromamba_root/Lib/site-packages/urllib3/http2/probe.py b/micromamba_root/Lib/site-packages/urllib3/http2/probe.py new file mode 100644 index 0000000000000000000000000000000000000000..9ea900764f0885eafaac9454523417d86e33df2d --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/http2/probe.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +import threading + + +class _HTTP2ProbeCache: + __slots__ = ( + "_lock", + "_cache_locks", + "_cache_values", + ) + + def __init__(self) -> None: + self._lock = threading.Lock() + self._cache_locks: dict[tuple[str, int], threading.RLock] = {} + self._cache_values: dict[tuple[str, int], bool | None] = {} + + def acquire_and_get(self, host: str, port: int) -> bool | None: + # By the end of this block we know that + # _cache_[values,locks] is available. + value = None + with self._lock: + key = (host, port) + try: + value = self._cache_values[key] + # If it's a known value we return right away. + if value is not None: + return value + except KeyError: + self._cache_locks[key] = threading.RLock() + self._cache_values[key] = None + + # If the value is unknown, we acquire the lock to signal + # to the requesting thread that the probe is in progress + # or that the current thread needs to return their findings. + key_lock = self._cache_locks[key] + key_lock.acquire() + try: + # If the by the time we get the lock the value has been + # updated we want to return the updated value. + value = self._cache_values[key] + + # In case an exception like KeyboardInterrupt is raised here. + except BaseException as e: # Defensive: + assert not isinstance(e, KeyError) # KeyError shouldn't be possible. + key_lock.release() + raise + + return value + + def set_and_release( + self, host: str, port: int, supports_http2: bool | None + ) -> None: + key = (host, port) + key_lock = self._cache_locks[key] + with key_lock: # Uses an RLock, so can be locked again from same thread. + if supports_http2 is None and self._cache_values[key] is not None: + raise ValueError( + "Cannot reset HTTP/2 support for origin after value has been set." + ) # Defensive: not expected in normal usage + + self._cache_values[key] = supports_http2 + key_lock.release() + + def _values(self) -> dict[tuple[str, int], bool | None]: + """This function is for testing purposes only. Gets the current state of the probe cache""" + with self._lock: + return {k: v for k, v in self._cache_values.items()} + + def _reset(self) -> None: + """This function is for testing purposes only. Reset the cache values""" + with self._lock: + self._cache_locks = {} + self._cache_values = {} + + +_HTTP2_PROBE_CACHE = _HTTP2ProbeCache() + +set_and_release = _HTTP2_PROBE_CACHE.set_and_release +acquire_and_get = _HTTP2_PROBE_CACHE.acquire_and_get +_values = _HTTP2_PROBE_CACHE._values +_reset = _HTTP2_PROBE_CACHE._reset + +__all__ = [ + "set_and_release", + "acquire_and_get", +] diff --git a/micromamba_root/Lib/site-packages/urllib3/poolmanager.py b/micromamba_root/Lib/site-packages/urllib3/poolmanager.py new file mode 100644 index 0000000000000000000000000000000000000000..8f2c56745cdf5ee206767e22fd61c2fb6bc21e55 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/poolmanager.py @@ -0,0 +1,653 @@ +from __future__ import annotations + +import functools +import logging +import typing +import warnings +from types import TracebackType +from urllib.parse import urljoin + +from ._collections import HTTPHeaderDict, RecentlyUsedContainer +from ._request_methods import RequestMethods +from .connection import ProxyConfig +from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme +from .exceptions import ( + LocationValueError, + MaxRetryError, + ProxySchemeUnknown, + URLSchemeUnknown, +) +from .response import BaseHTTPResponse +from .util.connection import _TYPE_SOCKET_OPTIONS +from .util.proxy import connection_requires_http_tunnel +from .util.retry import Retry +from .util.timeout import Timeout +from .util.url import Url, parse_url + +if typing.TYPE_CHECKING: + import ssl + + from typing_extensions import Self + +__all__ = ["PoolManager", "ProxyManager", "proxy_from_url"] + + +log = logging.getLogger(__name__) + +SSL_KEYWORDS = ( + "key_file", + "cert_file", + "cert_reqs", + "ca_certs", + "ca_cert_data", + "ssl_version", + "ssl_minimum_version", + "ssl_maximum_version", + "ca_cert_dir", + "ssl_context", + "key_password", + "server_hostname", +) +# Default value for `blocksize` - a new parameter introduced to +# http.client.HTTPConnection & http.client.HTTPSConnection in Python 3.7 +_DEFAULT_BLOCKSIZE = 16384 + + +class PoolKey(typing.NamedTuple): + """ + All known keyword arguments that could be provided to the pool manager, its + pools, or the underlying connections. + + All custom key schemes should include the fields in this key at a minimum. + """ + + key_scheme: str + key_host: str + key_port: int | None + key_timeout: Timeout | float | int | None + key_retries: Retry | bool | int | None + key_block: bool | None + key_source_address: tuple[str, int] | None + key_key_file: str | None + key_key_password: str | None + key_cert_file: str | None + key_cert_reqs: str | None + key_ca_certs: str | None + key_ca_cert_data: str | bytes | None + key_ssl_version: int | str | None + key_ssl_minimum_version: ssl.TLSVersion | None + key_ssl_maximum_version: ssl.TLSVersion | None + key_ca_cert_dir: str | None + key_ssl_context: ssl.SSLContext | None + key_maxsize: int | None + key_headers: frozenset[tuple[str, str]] | None + key__proxy: Url | None + key__proxy_headers: frozenset[tuple[str, str]] | None + key__proxy_config: ProxyConfig | None + key_socket_options: _TYPE_SOCKET_OPTIONS | None + key__socks_options: frozenset[tuple[str, str]] | None + key_assert_hostname: bool | str | None + key_assert_fingerprint: str | None + key_server_hostname: str | None + key_blocksize: int | None + + +def _default_key_normalizer( + key_class: type[PoolKey], request_context: dict[str, typing.Any] +) -> PoolKey: + """ + Create a pool key out of a request context dictionary. + + According to RFC 3986, both the scheme and host are case-insensitive. + Therefore, this function normalizes both before constructing the pool + key for an HTTPS request. If you wish to change this behaviour, provide + alternate callables to ``key_fn_by_scheme``. + + :param key_class: + The class to use when constructing the key. This should be a namedtuple + with the ``scheme`` and ``host`` keys at a minimum. + :type key_class: namedtuple + :param request_context: + A dictionary-like object that contain the context for a request. + :type request_context: dict + + :return: A namedtuple that can be used as a connection pool key. + :rtype: PoolKey + """ + # Since we mutate the dictionary, make a copy first + context = request_context.copy() + context["scheme"] = context["scheme"].lower() + context["host"] = context["host"].lower() + + # These are both dictionaries and need to be transformed into frozensets + for key in ("headers", "_proxy_headers", "_socks_options"): + if key in context and context[key] is not None: + context[key] = frozenset(context[key].items()) + + # The socket_options key may be a list and needs to be transformed into a + # tuple. + socket_opts = context.get("socket_options") + if socket_opts is not None: + context["socket_options"] = tuple(socket_opts) + + # Map the kwargs to the names in the namedtuple - this is necessary since + # namedtuples can't have fields starting with '_'. + for key in list(context.keys()): + context["key_" + key] = context.pop(key) + + # Default to ``None`` for keys missing from the context + for field in key_class._fields: + if field not in context: + context[field] = None + + # Default key_blocksize to _DEFAULT_BLOCKSIZE if missing from the context + if context.get("key_blocksize") is None: + context["key_blocksize"] = _DEFAULT_BLOCKSIZE + + return key_class(**context) + + +#: A dictionary that maps a scheme to a callable that creates a pool key. +#: This can be used to alter the way pool keys are constructed, if desired. +#: Each PoolManager makes a copy of this dictionary so they can be configured +#: globally here, or individually on the instance. +key_fn_by_scheme = { + "http": functools.partial(_default_key_normalizer, PoolKey), + "https": functools.partial(_default_key_normalizer, PoolKey), +} + +pool_classes_by_scheme = {"http": HTTPConnectionPool, "https": HTTPSConnectionPool} + + +class PoolManager(RequestMethods): + """ + Allows for arbitrary requests while transparently keeping track of + necessary connection pools for you. + + :param num_pools: + Number of connection pools to cache before discarding the least + recently used pool. + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + + :param \\**connection_pool_kw: + Additional parameters are used to create fresh + :class:`urllib3.connectionpool.ConnectionPool` instances. + + Example: + + .. code-block:: python + + import urllib3 + + http = urllib3.PoolManager(num_pools=2) + + resp1 = http.request("GET", "https://google.com/") + resp2 = http.request("GET", "https://google.com/mail") + resp3 = http.request("GET", "https://yahoo.com/") + + print(len(http.pools)) + # 2 + + """ + + proxy: Url | None = None + proxy_config: ProxyConfig | None = None + + def __init__( + self, + num_pools: int = 10, + headers: typing.Mapping[str, str] | None = None, + **connection_pool_kw: typing.Any, + ) -> None: + super().__init__(headers) + # PoolManager handles redirects itself in PoolManager.urlopen(). + # It always passes redirect=False to the underlying connection pool to + # suppress per-pool redirect handling. If the user supplied a non-Retry + # value (int/bool/etc) for retries and we let the pool normalize it + # while redirect=False, the resulting Retry object would have redirect + # handling disabled, which can interfere with PoolManager's own + # redirect logic. Normalize here so redirects remain governed solely by + # PoolManager logic. + if "retries" in connection_pool_kw: + retries = connection_pool_kw["retries"] + if not isinstance(retries, Retry): + retries = Retry.from_int(retries) + connection_pool_kw = connection_pool_kw.copy() + connection_pool_kw["retries"] = retries + self.connection_pool_kw = connection_pool_kw + + self.pools: RecentlyUsedContainer[PoolKey, HTTPConnectionPool] + self.pools = RecentlyUsedContainer(num_pools) + + # Locally set the pool classes and keys so other PoolManagers can + # override them. + self.pool_classes_by_scheme = pool_classes_by_scheme + self.key_fn_by_scheme = key_fn_by_scheme.copy() + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> typing.Literal[False]: + self.clear() + # Return False to re-raise any potential exceptions + return False + + def _new_pool( + self, + scheme: str, + host: str, + port: int, + request_context: dict[str, typing.Any] | None = None, + ) -> HTTPConnectionPool: + """ + Create a new :class:`urllib3.connectionpool.ConnectionPool` based on host, port, scheme, and + any additional pool keyword arguments. + + If ``request_context`` is provided, it is provided as keyword arguments + to the pool class used. This method is used to actually create the + connection pools handed out by :meth:`connection_from_url` and + companion methods. It is intended to be overridden for customization. + """ + pool_cls: type[HTTPConnectionPool] = self.pool_classes_by_scheme[scheme] + if request_context is None: + request_context = self.connection_pool_kw.copy() + + # Default blocksize to _DEFAULT_BLOCKSIZE if missing or explicitly + # set to 'None' in the request_context. + if request_context.get("blocksize") is None: + request_context["blocksize"] = _DEFAULT_BLOCKSIZE + + # Although the context has everything necessary to create the pool, + # this function has historically only used the scheme, host, and port + # in the positional args. When an API change is acceptable these can + # be removed. + for key in ("scheme", "host", "port"): + request_context.pop(key, None) + + if scheme == "http": + for kw in SSL_KEYWORDS: + request_context.pop(kw, None) + + return pool_cls(host, port, **request_context) + + def clear(self) -> None: + """ + Empty our store of pools and direct them all to close. + + This will not affect in-flight connections, but they will not be + re-used after completion. + """ + self.pools.clear() + + def connection_from_host( + self, + host: str | None, + port: int | None = None, + scheme: str | None = "http", + pool_kwargs: dict[str, typing.Any] | None = None, + ) -> HTTPConnectionPool: + """ + Get a :class:`urllib3.connectionpool.ConnectionPool` based on the host, port, and scheme. + + If ``port`` isn't given, it will be derived from the ``scheme`` using + ``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is + provided, it is merged with the instance's ``connection_pool_kw`` + variable and used to create the new connection pool, if one is + needed. + """ + + if not host: + raise LocationValueError("No host specified.") + + request_context = self._merge_pool_kwargs(pool_kwargs) + request_context["scheme"] = scheme or "http" + if not port: + port = port_by_scheme.get(request_context["scheme"].lower(), 80) + request_context["port"] = port + request_context["host"] = host + + return self.connection_from_context(request_context) + + def connection_from_context( + self, request_context: dict[str, typing.Any] + ) -> HTTPConnectionPool: + """ + Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context. + + ``request_context`` must at least contain the ``scheme`` key and its + value must be a key in ``key_fn_by_scheme`` instance variable. + """ + if "strict" in request_context: + warnings.warn( + "The 'strict' parameter is no longer needed on Python 3+. " + "This will raise an error in urllib3 v3.0.", + FutureWarning, + ) + request_context.pop("strict") + + scheme = request_context["scheme"].lower() + pool_key_constructor = self.key_fn_by_scheme.get(scheme) + if not pool_key_constructor: + raise URLSchemeUnknown(scheme) + pool_key = pool_key_constructor(request_context) + + return self.connection_from_pool_key(pool_key, request_context=request_context) + + def connection_from_pool_key( + self, pool_key: PoolKey, request_context: dict[str, typing.Any] + ) -> HTTPConnectionPool: + """ + Get a :class:`urllib3.connectionpool.ConnectionPool` based on the provided pool key. + + ``pool_key`` should be a namedtuple that only contains immutable + objects. At a minimum it must have the ``scheme``, ``host``, and + ``port`` fields. + """ + with self.pools.lock: + # If the scheme, host, or port doesn't match existing open + # connections, open a new ConnectionPool. + pool = self.pools.get(pool_key) + if pool: + return pool + + # Make a fresh ConnectionPool of the desired type + scheme = request_context["scheme"] + host = request_context["host"] + port = request_context["port"] + pool = self._new_pool(scheme, host, port, request_context=request_context) + self.pools[pool_key] = pool + + return pool + + def connection_from_url( + self, url: str, pool_kwargs: dict[str, typing.Any] | None = None + ) -> HTTPConnectionPool: + """ + Similar to :func:`urllib3.connectionpool.connection_from_url`. + + If ``pool_kwargs`` is not provided and a new pool needs to be + constructed, ``self.connection_pool_kw`` is used to initialize + the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs`` + is provided, it is used instead. Note that if a new pool does not + need to be created for the request, the provided ``pool_kwargs`` are + not used. + """ + u = parse_url(url) + return self.connection_from_host( + u.host, port=u.port, scheme=u.scheme, pool_kwargs=pool_kwargs + ) + + def _merge_pool_kwargs( + self, override: dict[str, typing.Any] | None + ) -> dict[str, typing.Any]: + """ + Merge a dictionary of override values for self.connection_pool_kw. + + This does not modify self.connection_pool_kw and returns a new dict. + Any keys in the override dictionary with a value of ``None`` are + removed from the merged dictionary. + """ + base_pool_kwargs = self.connection_pool_kw.copy() + if override: + for key, value in override.items(): + if value is None: + try: + del base_pool_kwargs[key] + except KeyError: + pass + else: + base_pool_kwargs[key] = value + return base_pool_kwargs + + def _proxy_requires_url_absolute_form(self, parsed_url: Url) -> bool: + """ + Indicates if the proxy requires the complete destination URL in the + request. Normally this is only needed when not using an HTTP CONNECT + tunnel. + """ + if self.proxy is None: + return False + + return not connection_requires_http_tunnel( + self.proxy, self.proxy_config, parsed_url.scheme + ) + + def urlopen( # type: ignore[override] + self, method: str, url: str, redirect: bool = True, **kw: typing.Any + ) -> BaseHTTPResponse: + """ + Same as :meth:`urllib3.HTTPConnectionPool.urlopen` + with custom cross-host redirect logic and only sends the request-uri + portion of the ``url``. + + The given ``url`` parameter must be absolute, such that an appropriate + :class:`urllib3.connectionpool.ConnectionPool` can be chosen for it. + """ + u = parse_url(url) + + if u.scheme is None: + warnings.warn( + "URLs without a scheme (ie 'https://') are deprecated and will raise an error " + "in urllib3 v3.0. To avoid this FutureWarning ensure all URLs " + "start with 'https://' or 'http://'. Read more in this issue: " + "https://github.com/urllib3/urllib3/issues/2920", + category=FutureWarning, + stacklevel=2, + ) + + conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme) + + kw["assert_same_host"] = False + kw["redirect"] = False + + if "headers" not in kw: + kw["headers"] = self.headers + + if self._proxy_requires_url_absolute_form(u): + response = conn.urlopen(method, url, **kw) + else: + response = conn.urlopen(method, u.request_uri, **kw) + + redirect_location = redirect and response.get_redirect_location() + if not redirect_location: + return response + + # Support relative URLs for redirecting. + redirect_location = urljoin(url, redirect_location) + + if response.status == 303: + # Change the method according to RFC 9110, Section 15.4.4. + method = "GET" + # And lose the body not to transfer anything sensitive. + kw["body"] = None + kw["headers"] = HTTPHeaderDict(kw["headers"])._prepare_for_method_change() + + retries = kw.get("retries", response.retries) + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect) + + # Strip headers marked as unsafe to forward to the redirected location. + # Check remove_headers_on_redirect to avoid a potential network call within + # conn.is_same_host() which may use socket.gethostbyname() in the future. + if retries.remove_headers_on_redirect and not conn.is_same_host( + redirect_location + ): + new_headers = kw["headers"].copy() + for header in kw["headers"]: + if header.lower() in retries.remove_headers_on_redirect: + new_headers.pop(header, None) + kw["headers"] = new_headers + + try: + retries = retries.increment(method, url, response=response, _pool=conn) + except MaxRetryError: + if retries.raise_on_redirect: + response.drain_conn() + raise + return response + + kw["retries"] = retries + kw["redirect"] = redirect + + log.info("Redirecting %s -> %s", url, redirect_location) + + response.drain_conn() + return self.urlopen(method, redirect_location, **kw) + + +class ProxyManager(PoolManager): + """ + Behaves just like :class:`PoolManager`, but sends all requests through + the defined proxy, using the CONNECT method for HTTPS URLs. + + :param proxy_url: + The URL of the proxy to be used. + + :param proxy_headers: + A dictionary containing headers that will be sent to the proxy. In case + of HTTP they are being sent with each request, while in the + HTTPS/CONNECT case they are sent only once. Could be used for proxy + authentication. + + :param proxy_ssl_context: + The proxy SSL context is used to establish the TLS connection to the + proxy when using HTTPS proxies. + + :param use_forwarding_for_https: + (Defaults to False) If set to True will forward requests to the HTTPS + proxy to be made on behalf of the client instead of creating a TLS + tunnel via the CONNECT method. **Enabling this flag means that request + and response headers and content will be visible from the HTTPS proxy** + whereas tunneling keeps request and response headers and content + private. IP address, target hostname, SNI, and port are always visible + to an HTTPS proxy even when this flag is disabled. + + :param proxy_assert_hostname: + The hostname of the certificate to verify against. + + :param proxy_assert_fingerprint: + The fingerprint of the certificate to verify against. + + Example: + + .. code-block:: python + + import urllib3 + + proxy = urllib3.ProxyManager("https://localhost:3128/") + + resp1 = proxy.request("GET", "http://google.com/") + resp2 = proxy.request("GET", "http://httpbin.org/") + + # One pool was shared by both plain HTTP requests. + print(len(proxy.pools)) + # 1 + + resp3 = proxy.request("GET", "https://httpbin.org/") + resp4 = proxy.request("GET", "https://twitter.com/") + + # A separate pool was added for each HTTPS target. + print(len(proxy.pools)) + # 3 + + """ + + def __init__( + self, + proxy_url: str, + num_pools: int = 10, + headers: typing.Mapping[str, str] | None = None, + proxy_headers: typing.Mapping[str, str] | None = None, + proxy_ssl_context: ssl.SSLContext | None = None, + use_forwarding_for_https: bool = False, + proxy_assert_hostname: None | str | typing.Literal[False] = None, + proxy_assert_fingerprint: str | None = None, + **connection_pool_kw: typing.Any, + ) -> None: + if isinstance(proxy_url, HTTPConnectionPool): + str_proxy_url = f"{proxy_url.scheme}://{proxy_url.host}:{proxy_url.port}" + else: + str_proxy_url = proxy_url + proxy = parse_url(str_proxy_url) + + if proxy.scheme not in ("http", "https"): + raise ProxySchemeUnknown(proxy.scheme) + + if not proxy.port: + port = port_by_scheme.get(proxy.scheme, 80) + proxy = proxy._replace(port=port) + + self.proxy = proxy + self.proxy_headers = proxy_headers or {} + self.proxy_ssl_context = proxy_ssl_context + self.proxy_config = ProxyConfig( + proxy_ssl_context, + use_forwarding_for_https, + proxy_assert_hostname, + proxy_assert_fingerprint, + ) + + connection_pool_kw["_proxy"] = self.proxy + connection_pool_kw["_proxy_headers"] = self.proxy_headers + connection_pool_kw["_proxy_config"] = self.proxy_config + + super().__init__(num_pools, headers, **connection_pool_kw) + + def connection_from_host( + self, + host: str | None, + port: int | None = None, + scheme: str | None = "http", + pool_kwargs: dict[str, typing.Any] | None = None, + ) -> HTTPConnectionPool: + if scheme == "https": + return super().connection_from_host( + host, port, scheme, pool_kwargs=pool_kwargs + ) + + return super().connection_from_host( + self.proxy.host, self.proxy.port, self.proxy.scheme, pool_kwargs=pool_kwargs # type: ignore[union-attr] + ) + + def _set_proxy_headers( + self, url: str, headers: typing.Mapping[str, str] | None = None + ) -> typing.Mapping[str, str]: + """ + Sets headers needed by proxies: specifically, the Accept and Host + headers. Only sets headers not provided by the user. + """ + headers_ = {"Accept": "*/*"} + + netloc = parse_url(url).netloc + if netloc: + headers_["Host"] = netloc + + if headers: + headers_.update(headers) + return headers_ + + def urlopen( # type: ignore[override] + self, method: str, url: str, redirect: bool = True, **kw: typing.Any + ) -> BaseHTTPResponse: + "Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute." + u = parse_url(url) + if not connection_requires_http_tunnel(self.proxy, self.proxy_config, u.scheme): + # For connections using HTTP CONNECT, httplib sets the necessary + # headers on the CONNECT to the proxy. If we're not using CONNECT, + # we'll definitely need to set 'Host' at the very least. + headers = kw.get("headers", self.headers) + kw["headers"] = self._set_proxy_headers(url, headers) + + return super().urlopen(method, url, redirect=redirect, **kw) + + +def proxy_from_url(url: str, **kw: typing.Any) -> ProxyManager: + return ProxyManager(proxy_url=url, **kw) diff --git a/micromamba_root/Lib/site-packages/urllib3/py.typed b/micromamba_root/Lib/site-packages/urllib3/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..5f3ea3d919363f08ab03edbc85b6099bc4df5647 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/py.typed @@ -0,0 +1,2 @@ +# Instruct type checkers to look for inline type annotations in this package. +# See PEP 561. diff --git a/micromamba_root/Lib/site-packages/urllib3/response.py b/micromamba_root/Lib/site-packages/urllib3/response.py new file mode 100644 index 0000000000000000000000000000000000000000..e9246b75e36215b7f956700aa4cb363e8423e526 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/response.py @@ -0,0 +1,1493 @@ +from __future__ import annotations + +import collections +import io +import json as _json +import logging +import socket +import sys +import typing +import warnings +import zlib +from contextlib import contextmanager +from http.client import HTTPMessage as _HttplibHTTPMessage +from http.client import HTTPResponse as _HttplibHTTPResponse +from socket import timeout as SocketTimeout + +if typing.TYPE_CHECKING: + from ._base_connection import BaseHTTPConnection + +try: + try: + import brotlicffi as brotli # type: ignore[import-not-found] + except ImportError: + import brotli # type: ignore[import-not-found] +except ImportError: + brotli = None + +from . import util +from ._base_connection import _TYPE_BODY +from ._collections import HTTPHeaderDict +from .connection import BaseSSLError, HTTPConnection, HTTPException +from .exceptions import ( + BodyNotHttplibCompatible, + DecodeError, + DependencyWarning, + HTTPError, + IncompleteRead, + InvalidChunkLength, + InvalidHeader, + ProtocolError, + ReadTimeoutError, + ResponseNotChunked, + SSLError, +) +from .util.response import is_fp_closed, is_response_to_head +from .util.retry import Retry + +if typing.TYPE_CHECKING: + from .connectionpool import HTTPConnectionPool + +log = logging.getLogger(__name__) + + +class ContentDecoder: + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + raise NotImplementedError() + + @property + def has_unconsumed_tail(self) -> bool: + raise NotImplementedError() + + def flush(self) -> bytes: + raise NotImplementedError() + + +class DeflateDecoder(ContentDecoder): + def __init__(self) -> None: + self._first_try = True + self._first_try_data = b"" + self._unfed_data = b"" + self._obj = zlib.decompressobj() + + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + data = self._unfed_data + data + self._unfed_data = b"" + if not data and not self._obj.unconsumed_tail: + return data + original_max_length = max_length + if original_max_length < 0: + max_length = 0 + elif original_max_length == 0: + # We should not pass 0 to the zlib decompressor because 0 is + # the default value that will make zlib decompress without a + # length limit. + # Data should be stored for subsequent calls. + self._unfed_data = data + return b"" + + # Subsequent calls always reuse `self._obj`. zlib requires + # passing the unconsumed tail if decompression is to continue. + if not self._first_try: + return self._obj.decompress( + self._obj.unconsumed_tail + data, max_length=max_length + ) + + # First call tries with RFC 1950 ZLIB format. + self._first_try_data += data + try: + decompressed = self._obj.decompress(data, max_length=max_length) + if decompressed: + self._first_try = False + self._first_try_data = b"" + return decompressed + # On failure, it falls back to RFC 1951 DEFLATE format. + except zlib.error: + self._first_try = False + self._obj = zlib.decompressobj(-zlib.MAX_WBITS) + try: + return self.decompress( + self._first_try_data, max_length=original_max_length + ) + finally: + self._first_try_data = b"" + + @property + def has_unconsumed_tail(self) -> bool: + return bool(self._unfed_data) or ( + bool(self._obj.unconsumed_tail) and not self._first_try + ) + + def flush(self) -> bytes: + return self._obj.flush() + + +class GzipDecoderState: + FIRST_MEMBER = 0 + OTHER_MEMBERS = 1 + SWALLOW_DATA = 2 + + +class GzipDecoder(ContentDecoder): + def __init__(self) -> None: + self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + self._state = GzipDecoderState.FIRST_MEMBER + self._unconsumed_tail = b"" + + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + ret = bytearray() + if self._state == GzipDecoderState.SWALLOW_DATA: + return bytes(ret) + + if max_length == 0: + # We should not pass 0 to the zlib decompressor because 0 is + # the default value that will make zlib decompress without a + # length limit. + # Data should be stored for subsequent calls. + self._unconsumed_tail += data + return b"" + + # zlib requires passing the unconsumed tail to the subsequent + # call if decompression is to continue. + data = self._unconsumed_tail + data + if not data and self._obj.eof: + return bytes(ret) + + while True: + try: + ret += self._obj.decompress( + data, max_length=max(max_length - len(ret), 0) + ) + except zlib.error: + previous_state = self._state + # Ignore data after the first error + self._state = GzipDecoderState.SWALLOW_DATA + self._unconsumed_tail = b"" + if previous_state == GzipDecoderState.OTHER_MEMBERS: + # Allow trailing garbage acceptable in other gzip clients + return bytes(ret) + raise + + self._unconsumed_tail = data = ( + self._obj.unconsumed_tail or self._obj.unused_data + ) + if max_length > 0 and len(ret) >= max_length: + break + + if not data: + return bytes(ret) + # When the end of a gzip member is reached, a new decompressor + # must be created for unused (possibly future) data. + if self._obj.eof: + self._state = GzipDecoderState.OTHER_MEMBERS + self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + + return bytes(ret) + + @property + def has_unconsumed_tail(self) -> bool: + return bool(self._unconsumed_tail) + + def flush(self) -> bytes: + return self._obj.flush() + + +if brotli is not None: + + class BrotliDecoder(ContentDecoder): + # Supports both 'brotlipy' and 'Brotli' packages + # since they share an import name. The top branches + # are for 'brotlipy' and bottom branches for 'Brotli' + def __init__(self) -> None: + self._obj = brotli.Decompressor() + if hasattr(self._obj, "decompress"): + setattr(self, "_decompress", self._obj.decompress) + else: + setattr(self, "_decompress", self._obj.process) + + # Requires Brotli >= 1.2.0 for `output_buffer_limit`. + def _decompress(self, data: bytes, output_buffer_limit: int = -1) -> bytes: + raise NotImplementedError() + + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + try: + if max_length > 0: + return self._decompress(data, output_buffer_limit=max_length) + else: + return self._decompress(data) + except TypeError: + # Fallback for Brotli/brotlicffi/brotlipy versions without + # the `output_buffer_limit` parameter. + warnings.warn( + "Brotli >= 1.2.0 is required to prevent decompression bombs.", + DependencyWarning, + ) + return self._decompress(data) + + @property + def has_unconsumed_tail(self) -> bool: + try: + return not self._obj.can_accept_more_data() + except AttributeError: + return False + + def flush(self) -> bytes: + if hasattr(self._obj, "flush"): + return self._obj.flush() # type: ignore[no-any-return] + return b"" + + +try: + if sys.version_info >= (3, 14): + from compression import zstd + else: + from backports import zstd +except ImportError: + HAS_ZSTD = False +else: + HAS_ZSTD = True + + class ZstdDecoder(ContentDecoder): + def __init__(self) -> None: + self._obj = zstd.ZstdDecompressor() + + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + if not data and not self.has_unconsumed_tail: + return b"" + if self._obj.eof: + data = self._obj.unused_data + data + self._obj = zstd.ZstdDecompressor() + part = self._obj.decompress(data, max_length=max_length) + length = len(part) + data_parts = [part] + # Every loop iteration is supposed to read data from a separate frame. + # The loop breaks when: + # - enough data is read; + # - no more unused data is available; + # - end of the last read frame has not been reached (i.e., + # more data has to be fed). + while ( + self._obj.eof + and self._obj.unused_data + and (max_length < 0 or length < max_length) + ): + unused_data = self._obj.unused_data + if not self._obj.needs_input: + self._obj = zstd.ZstdDecompressor() + part = self._obj.decompress( + unused_data, + max_length=(max_length - length) if max_length > 0 else -1, + ) + if part_length := len(part): + data_parts.append(part) + length += part_length + elif self._obj.needs_input: + break + return b"".join(data_parts) + + @property + def has_unconsumed_tail(self) -> bool: + return not (self._obj.needs_input or self._obj.eof) or bool( + self._obj.unused_data + ) + + def flush(self) -> bytes: + if not self._obj.eof: + raise DecodeError("Zstandard data is incomplete") + return b"" + + +class MultiDecoder(ContentDecoder): + """ + From RFC7231: + If one or more encodings have been applied to a representation, the + sender that applied the encodings MUST generate a Content-Encoding + header field that lists the content codings in the order in which + they were applied. + """ + + # Maximum allowed number of chained HTTP encodings in the + # Content-Encoding header. + max_decode_links = 5 + + def __init__(self, modes: str) -> None: + encodings = [m.strip() for m in modes.split(",")] + if len(encodings) > self.max_decode_links: + raise DecodeError( + "Too many content encodings in the chain: " + f"{len(encodings)} > {self.max_decode_links}" + ) + self._decoders = [_get_decoder(e) for e in encodings] + + def flush(self) -> bytes: + return self._decoders[0].flush() + + def decompress(self, data: bytes, max_length: int = -1) -> bytes: + if max_length <= 0: + for d in reversed(self._decoders): + data = d.decompress(data) + return data + + ret = bytearray() + # Every while loop iteration goes through all decoders once. + # It exits when enough data is read or no more data can be read. + # It is possible that the while loop iteration does not produce + # any data because we retrieve up to `max_length` from every + # decoder, and the amount of bytes may be insufficient for the + # next decoder to produce enough/any output. + while True: + any_data = False + for d in reversed(self._decoders): + data = d.decompress(data, max_length=max_length - len(ret)) + if data: + any_data = True + # We should not break when no data is returned because + # next decoders may produce data even with empty input. + ret += data + if not any_data or len(ret) >= max_length: + return bytes(ret) + data = b"" + + @property + def has_unconsumed_tail(self) -> bool: + return any(d.has_unconsumed_tail for d in self._decoders) + + +def _get_decoder(mode: str) -> ContentDecoder: + if "," in mode: + return MultiDecoder(mode) + + # According to RFC 9110 section 8.4.1.3, recipients should + # consider x-gzip equivalent to gzip + if mode in ("gzip", "x-gzip"): + return GzipDecoder() + + if brotli is not None and mode == "br": + return BrotliDecoder() + + if HAS_ZSTD and mode == "zstd": + return ZstdDecoder() + + return DeflateDecoder() + + +class BytesQueueBuffer: + """Memory-efficient bytes buffer + + To return decoded data in read() and still follow the BufferedIOBase API, we need a + buffer to always return the correct amount of bytes. + + This buffer should be filled using calls to put() + + Our maximum memory usage is determined by the sum of the size of: + + * self.buffer, which contains the full data + * the largest chunk that we will copy in get() + """ + + def __init__(self) -> None: + self.buffer: typing.Deque[bytes | memoryview[bytes]] = collections.deque() + self._size: int = 0 + + def __len__(self) -> int: + return self._size + + def put(self, data: bytes) -> None: + self.buffer.append(data) + self._size += len(data) + + def get(self, n: int) -> bytes: + if n == 0: + return b"" + elif not self.buffer: + raise RuntimeError("buffer is empty") + elif n < 0: + raise ValueError("n should be > 0") + + if len(self.buffer[0]) == n and isinstance(self.buffer[0], bytes): + self._size -= n + return self.buffer.popleft() + + fetched = 0 + ret = io.BytesIO() + while fetched < n: + remaining = n - fetched + chunk = self.buffer.popleft() + chunk_length = len(chunk) + if remaining < chunk_length: + chunk = memoryview(chunk) + left_chunk, right_chunk = chunk[:remaining], chunk[remaining:] + ret.write(left_chunk) + self.buffer.appendleft(right_chunk) + self._size -= remaining + break + else: + ret.write(chunk) + self._size -= chunk_length + fetched += chunk_length + + if not self.buffer: + break + + return ret.getvalue() + + def get_all(self) -> bytes: + buffer = self.buffer + if not buffer: + assert self._size == 0 + return b"" + if len(buffer) == 1: + result = buffer.pop() + if isinstance(result, memoryview): + result = result.tobytes() + else: + ret = io.BytesIO() + ret.writelines(buffer.popleft() for _ in range(len(buffer))) + result = ret.getvalue() + self._size = 0 + return result + + +class BaseHTTPResponse(io.IOBase): + CONTENT_DECODERS = ["gzip", "x-gzip", "deflate"] + if brotli is not None: + CONTENT_DECODERS += ["br"] + if HAS_ZSTD: + CONTENT_DECODERS += ["zstd"] + REDIRECT_STATUSES = [301, 302, 303, 307, 308] + + DECODER_ERROR_CLASSES: tuple[type[Exception], ...] = (IOError, zlib.error) + if brotli is not None: + DECODER_ERROR_CLASSES += (brotli.error,) + + if HAS_ZSTD: + DECODER_ERROR_CLASSES += (zstd.ZstdError,) + + def __init__( + self, + *, + headers: typing.Mapping[str, str] | typing.Mapping[bytes, bytes] | None = None, + status: int, + version: int, + version_string: str, + reason: str | None, + decode_content: bool, + request_url: str | None, + retries: Retry | None = None, + ) -> None: + if isinstance(headers, HTTPHeaderDict): + self.headers = headers + else: + self.headers = HTTPHeaderDict(headers) # type: ignore[arg-type] + self.status = status + self.version = version + self.version_string = version_string + self.reason = reason + self.decode_content = decode_content + self._has_decoded_content = False + self._request_url: str | None = request_url + self.retries = retries + + self.chunked = False + tr_enc = self.headers.get("transfer-encoding", "").lower() + # Don't incur the penalty of creating a list and then discarding it + encodings = (enc.strip() for enc in tr_enc.split(",")) + if "chunked" in encodings: + self.chunked = True + + self._decoder: ContentDecoder | None = None + self.length_remaining: int | None + + def get_redirect_location(self) -> str | None | typing.Literal[False]: + """ + Should we redirect and where to? + + :returns: Truthy redirect location string if we got a redirect status + code and valid location. ``None`` if redirect status and no + location. ``False`` if not a redirect status code. + """ + if self.status in self.REDIRECT_STATUSES: + return self.headers.get("location") + return False + + @property + def data(self) -> bytes: + raise NotImplementedError() + + def json(self) -> typing.Any: + """ + Deserializes the body of the HTTP response as a Python object. + + The body of the HTTP response must be encoded using UTF-8, as per + `RFC 8529 Section 8.1 <https://www.rfc-editor.org/rfc/rfc8259#section-8.1>`_. + + To use a custom JSON decoder pass the result of :attr:`HTTPResponse.data` to + your custom decoder instead. + + If the body of the HTTP response is not decodable to UTF-8, a + `UnicodeDecodeError` will be raised. If the body of the HTTP response is not a + valid JSON document, a `json.JSONDecodeError` will be raised. + + Read more :ref:`here <json_content>`. + + :returns: The body of the HTTP response as a Python object. + """ + data = self.data.decode("utf-8") + return _json.loads(data) + + @property + def url(self) -> str | None: + raise NotImplementedError() + + @url.setter + def url(self, url: str | None) -> None: + raise NotImplementedError() + + @property + def connection(self) -> BaseHTTPConnection | None: + raise NotImplementedError() + + @property + def retries(self) -> Retry | None: + return self._retries + + @retries.setter + def retries(self, retries: Retry | None) -> None: + # Override the request_url if retries has a redirect location. + if retries is not None and retries.history: + self.url = retries.history[-1].redirect_location + self._retries = retries + + def stream( + self, amt: int | None = 2**16, decode_content: bool | None = None + ) -> typing.Iterator[bytes]: + raise NotImplementedError() + + def read( + self, + amt: int | None = None, + decode_content: bool | None = None, + cache_content: bool = False, + ) -> bytes: + raise NotImplementedError() + + def read1( + self, + amt: int | None = None, + decode_content: bool | None = None, + ) -> bytes: + raise NotImplementedError() + + def read_chunked( + self, + amt: int | None = None, + decode_content: bool | None = None, + ) -> typing.Iterator[bytes]: + raise NotImplementedError() + + def release_conn(self) -> None: + raise NotImplementedError() + + def drain_conn(self) -> None: + raise NotImplementedError() + + def shutdown(self) -> None: + raise NotImplementedError() + + def close(self) -> None: + raise NotImplementedError() + + def _init_decoder(self) -> None: + """ + Set-up the _decoder attribute if necessary. + """ + # Note: content-encoding value should be case-insensitive, per RFC 7230 + # Section 3.2 + content_encoding = self.headers.get("content-encoding", "").lower() + if self._decoder is None: + if content_encoding in self.CONTENT_DECODERS: + self._decoder = _get_decoder(content_encoding) + elif "," in content_encoding: + encodings = [ + e.strip() + for e in content_encoding.split(",") + if e.strip() in self.CONTENT_DECODERS + ] + if encodings: + self._decoder = _get_decoder(content_encoding) + + def _decode( + self, + data: bytes, + decode_content: bool | None, + flush_decoder: bool, + max_length: int | None = None, + ) -> bytes: + """ + Decode the data passed in and potentially flush the decoder. + """ + if not decode_content: + if self._has_decoded_content: + raise RuntimeError( + "Calling read(decode_content=False) is not supported after " + "read(decode_content=True) was called." + ) + return data + + if max_length is None or flush_decoder: + max_length = -1 + + try: + if self._decoder: + data = self._decoder.decompress(data, max_length=max_length) + self._has_decoded_content = True + except self.DECODER_ERROR_CLASSES as e: + content_encoding = self.headers.get("content-encoding", "").lower() + raise DecodeError( + "Received response with content-encoding: %s, but " + "failed to decode it." % content_encoding, + e, + ) from e + if flush_decoder: + data += self._flush_decoder() + + return data + + def _flush_decoder(self) -> bytes: + """ + Flushes the decoder. Should only be called if the decoder is actually + being used. + """ + if self._decoder: + return self._decoder.decompress(b"") + self._decoder.flush() + return b"" + + # Compatibility methods for `io` module + def readinto(self, b: bytearray | memoryview[int]) -> int: + temp = self.read(len(b)) + if len(temp) == 0: + return 0 + else: + b[: len(temp)] = temp + return len(temp) + + # Methods used by dependent libraries + def getheaders(self) -> HTTPHeaderDict: + return self.headers + + def getheader(self, name: str, default: str | None = None) -> str | None: + return self.headers.get(name, default) + + # Compatibility method for http.cookiejar + def info(self) -> HTTPHeaderDict: + return self.headers + + def geturl(self) -> str | None: + return self.url + + +class HTTPResponse(BaseHTTPResponse): + """ + HTTP Response container. + + Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is + loaded and decoded on-demand when the ``data`` property is accessed. This + class is also compatible with the Python standard library's :mod:`io` + module, and can hence be treated as a readable object in the context of that + framework. + + Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`: + + :param preload_content: + If True, the response's body will be preloaded during construction. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param original_response: + When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse` + object, it's convenient to include the original for debug purposes. It's + otherwise unused. + + :param retries: + The retries contains the last :class:`~urllib3.util.retry.Retry` that + was used during the request. + + :param enforce_content_length: + Enforce content length checking. Body returned by server must match + value of Content-Length header, if present. Otherwise, raise error. + """ + + def __init__( + self, + body: _TYPE_BODY = "", + headers: typing.Mapping[str, str] | typing.Mapping[bytes, bytes] | None = None, + status: int = 0, + version: int = 0, + version_string: str = "HTTP/?", + reason: str | None = None, + preload_content: bool = True, + decode_content: bool = True, + original_response: _HttplibHTTPResponse | None = None, + pool: HTTPConnectionPool | None = None, + connection: HTTPConnection | None = None, + msg: _HttplibHTTPMessage | None = None, + retries: Retry | None = None, + enforce_content_length: bool = True, + request_method: str | None = None, + request_url: str | None = None, + auto_close: bool = True, + sock_shutdown: typing.Callable[[int], None] | None = None, + ) -> None: + super().__init__( + headers=headers, + status=status, + version=version, + version_string=version_string, + reason=reason, + decode_content=decode_content, + request_url=request_url, + retries=retries, + ) + + self.enforce_content_length = enforce_content_length + self.auto_close = auto_close + + self._body = None + self._uncached_read_occurred = False + self._fp: _HttplibHTTPResponse | None = None + self._original_response = original_response + self._fp_bytes_read = 0 + self.msg = msg + + if body and isinstance(body, (str, bytes)): + self._body = body + + self._pool = pool + self._connection = connection + + if hasattr(body, "read"): + self._fp = body # type: ignore[assignment] + self._sock_shutdown = sock_shutdown + + # Are we using the chunked-style of transfer encoding? + self.chunk_left: int | None = None + + # Determine length of response + self.length_remaining = self._init_length(request_method) + + # Used to return the correct amount of bytes for partial read()s + self._decoded_buffer = BytesQueueBuffer() + + # If requested, preload the body. + if preload_content and not self._body: + self._body = self.read(decode_content=decode_content) + + def release_conn(self) -> None: + if not self._pool or not self._connection: + return None + + self._pool._put_conn(self._connection) + self._connection = None + + def drain_conn(self) -> None: + """ + Read and discard any remaining HTTP response data in the response connection. + + Unread data in the HTTPResponse connection blocks the connection from being released back to the pool. + """ + try: + self._raw_read() + except (HTTPError, OSError, BaseSSLError, HTTPException): + pass + if self._has_decoded_content: + # `_raw_read` skips decompression, so we should clean up the + # decoder to avoid keeping unnecessary data in memory. + self._decoded_buffer = BytesQueueBuffer() + self._decoder = None + + @property + def data(self) -> bytes: + # For backwards-compat with earlier urllib3 0.4 and earlier. + if self._body: + return self._body # type: ignore[return-value] + + if self._fp: + return self.read(cache_content=True) + + return None # type: ignore[return-value] + + @property + def connection(self) -> HTTPConnection | None: + return self._connection + + def isclosed(self) -> bool: + return is_fp_closed(self._fp) + + def tell(self) -> int: + """ + Obtain the number of bytes pulled over the wire so far. May differ from + the amount of content returned by :meth:`HTTPResponse.read` + if bytes are encoded on the wire (e.g, compressed). + """ + return self._fp_bytes_read + + def _init_length(self, request_method: str | None) -> int | None: + """ + Set initial length value for Response content if available. + """ + length: int | None + content_length: str | None = self.headers.get("content-length") + + if content_length is not None: + if self.chunked: + # This Response will fail with an IncompleteRead if it can't be + # received as chunked. This method falls back to attempt reading + # the response before raising an exception. + log.warning( + "Received response with both Content-Length and " + "Transfer-Encoding set. This is expressly forbidden " + "by RFC 7230 sec 3.3.2. Ignoring Content-Length and " + "attempting to process response as Transfer-Encoding: " + "chunked." + ) + return None + + try: + # RFC 7230 section 3.3.2 specifies multiple content lengths can + # be sent in a single Content-Length header + # (e.g. Content-Length: 42, 42). This line ensures the values + # are all valid ints and that as long as the `set` length is 1, + # all values are the same. Otherwise, the header is invalid. + lengths = {int(val) for val in content_length.split(",")} + if len(lengths) > 1: + raise InvalidHeader( + "Content-Length contained multiple " + "unmatching values (%s)" % content_length + ) + length = lengths.pop() + except ValueError: + length = None + else: + if length < 0: + length = None + + else: # if content_length is None + length = None + + # Convert status to int for comparison + # In some cases, httplib returns a status of "_UNKNOWN" + try: + status = int(self.status) + except ValueError: + status = 0 + + # Check for responses that shouldn't include a body + if status in (204, 304) or 100 <= status < 200 or request_method == "HEAD": + length = 0 + + return length + + @contextmanager + def _error_catcher(self) -> typing.Generator[None]: + """ + Catch low-level python exceptions, instead re-raising urllib3 + variants, so that low-level exceptions are not leaked in the + high-level api. + + On exit, release the connection back to the pool. + """ + clean_exit = False + + try: + try: + yield + + except SocketTimeout as e: + # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but + # there is yet no clean way to get at it from this context. + raise ReadTimeoutError(self._pool, None, "Read timed out.") from e # type: ignore[arg-type] + + except BaseSSLError as e: + # SSL errors related to framing/MAC get wrapped and reraised here + raise SSLError(e) from e + + except IncompleteRead as e: + if ( + e.expected is not None + and e.partial is not None + and e.expected == -e.partial + ): + arg = "Response may not contain content." + else: + arg = f"Connection broken: {e!r}" + raise ProtocolError(arg, e) from e + + except (HTTPException, OSError) as e: + raise ProtocolError(f"Connection broken: {e!r}", e) from e + + # If no exception is thrown, we should avoid cleaning up + # unnecessarily. + clean_exit = True + finally: + # If we didn't terminate cleanly, we need to throw away our + # connection. + if not clean_exit: + # The response may not be closed but we're not going to use it + # anymore so close it now to ensure that the connection is + # released back to the pool. + if self._original_response: + self._original_response.close() + + # Closing the response may not actually be sufficient to close + # everything, so if we have a hold of the connection close that + # too. + if self._connection: + self._connection.close() + + # If we hold the original response but it's closed now, we should + # return the connection back to the pool. + if self._original_response and self._original_response.isclosed(): + self.release_conn() + + def _fp_read( + self, + amt: int | None = None, + *, + read1: bool = False, + ) -> bytes: + """ + Read a response with the thought that reading the number of bytes + larger than can fit in a 32-bit int at a time via SSL in some + known cases leads to an overflow error that has to be prevented + if `amt` or `self.length_remaining` indicate that a problem may + happen. + + This happens to urllib3 injected with pyOpenSSL-backed SSL-support. + """ + assert self._fp + c_int_max = 2**31 - 1 + if ( + (amt and amt > c_int_max) + or ( + amt is None + and self.length_remaining + and self.length_remaining > c_int_max + ) + ) and util.IS_PYOPENSSL: + if read1: + return self._fp.read1(c_int_max) + buffer = io.BytesIO() + # Besides `max_chunk_amt` being a maximum chunk size, it + # affects memory overhead of reading a response by this + # method in CPython. + # `c_int_max` equal to 2 GiB - 1 byte is the actual maximum + # chunk size that does not lead to an overflow error, but + # 256 MiB is a compromise. + max_chunk_amt = 2**28 + while amt is None or amt != 0: + if amt is not None: + chunk_amt = min(amt, max_chunk_amt) + amt -= chunk_amt + else: + chunk_amt = max_chunk_amt + data = self._fp.read(chunk_amt) + if not data: + break + buffer.write(data) + del data # to reduce peak memory usage by `max_chunk_amt`. + return buffer.getvalue() + elif read1: + return self._fp.read1(amt) if amt is not None else self._fp.read1() + else: + # StringIO doesn't like amt=None + return self._fp.read(amt) if amt is not None else self._fp.read() + + def _raw_read( + self, + amt: int | None = None, + *, + read1: bool = False, + ) -> bytes: + """ + Reads `amt` of bytes from the socket. + """ + if self._fp is None: + return None # type: ignore[return-value] + + fp_closed = getattr(self._fp, "closed", False) + + with self._error_catcher(): + data = self._fp_read(amt, read1=read1) if not fp_closed else b"" + if amt is not None and amt != 0 and not data: + # Platform-specific: Buggy versions of Python. + # Close the connection when no data is returned + # + # This is redundant to what httplib/http.client _should_ + # already do. However, versions of python released before + # December 15, 2012 (http://bugs.python.org/issue16298) do + # not properly close the connection in all cases. There is + # no harm in redundantly calling close. + self._fp.close() + if ( + self.enforce_content_length + and self.length_remaining is not None + and self.length_remaining != 0 + ): + # This is an edge case that httplib failed to cover due + # to concerns of backward compatibility. We're + # addressing it here to make sure IncompleteRead is + # raised during streaming, so all calls with incorrect + # Content-Length are caught. + raise IncompleteRead(self._fp_bytes_read, self.length_remaining) + elif read1 and ( + (amt != 0 and not data) or self.length_remaining == len(data) + ): + # All data has been read, but `self._fp.read1` in + # CPython 3.12 and older doesn't always close + # `http.client.HTTPResponse`, so we close it here. + # See https://github.com/python/cpython/issues/113199 + self._fp.close() + + if data: + self._fp_bytes_read += len(data) + if self.length_remaining is not None: + self.length_remaining -= len(data) + return data + + def read( + self, + amt: int | None = None, + decode_content: bool | None = None, + cache_content: bool = False, + ) -> bytes: + """ + Similar to :meth:`http.client.HTTPResponse.read`, but with two additional + parameters: ``decode_content`` and ``cache_content``. + + :param amt: + How much of the content to read. If specified, caching is skipped + because it doesn't make sense to cache partial content as the full + response. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param cache_content: + If True, will save the returned data such that the same result is + returned despite of the state of the underlying file object. This + is useful if you want the ``.data`` property to continue working + after having ``.read()`` the file object. (Overridden if ``amt`` is + set.) + """ + self._init_decoder() + if decode_content is None: + decode_content = self.decode_content + + if amt and amt < 0: + # Negative numbers and `None` should be treated the same. + amt = None + elif amt is not None: + cache_content = False + + if ( + self._decoder + and self._decoder.has_unconsumed_tail + and len(self._decoded_buffer) < amt + ): + decoded_data = self._decode( + b"", + decode_content, + flush_decoder=False, + max_length=amt - len(self._decoded_buffer), + ) + self._decoded_buffer.put(decoded_data) + if len(self._decoded_buffer) >= amt: + return self._decoded_buffer.get(amt) + + data = self._raw_read(amt) + if not cache_content: + self._uncached_read_occurred = True + + flush_decoder = amt is None or (amt != 0 and not data) + + if ( + not data + and len(self._decoded_buffer) == 0 + and not (self._decoder and self._decoder.has_unconsumed_tail) + ): + return data + + if amt is None: + data = self._decode(data, decode_content, flush_decoder) + # It's possible that there is buffered decoded data after a + # partial read. + if decode_content and len(self._decoded_buffer) > 0: + self._decoded_buffer.put(data) + data = self._decoded_buffer.get_all() + + if cache_content and not self._uncached_read_occurred: + self._body = data + else: + # do not waste memory on buffer when not decoding + if not decode_content: + if self._has_decoded_content: + raise RuntimeError( + "Calling read(decode_content=False) is not supported after " + "read(decode_content=True) was called." + ) + return data + + decoded_data = self._decode( + data, + decode_content, + flush_decoder, + max_length=amt - len(self._decoded_buffer), + ) + self._decoded_buffer.put(decoded_data) + + while len(self._decoded_buffer) < amt and data: + # TODO make sure to initially read enough data to get past the headers + # For example, the GZ file header takes 10 bytes, we don't want to read + # it one byte at a time + data = self._raw_read(amt) + decoded_data = self._decode( + data, + decode_content, + flush_decoder, + max_length=amt - len(self._decoded_buffer), + ) + self._decoded_buffer.put(decoded_data) + data = self._decoded_buffer.get(amt) + + return data + + def read1( + self, + amt: int | None = None, + decode_content: bool | None = None, + ) -> bytes: + """ + Similar to ``http.client.HTTPResponse.read1`` and documented + in :meth:`io.BufferedReader.read1`, but with an additional parameter: + ``decode_content``. + + :param amt: + How much of the content to read. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + if decode_content is None: + decode_content = self.decode_content + if amt and amt < 0: + # Negative numbers and `None` should be treated the same. + amt = None + # try and respond without going to the network + if self._has_decoded_content: + if not decode_content: + raise RuntimeError( + "Calling read1(decode_content=False) is not supported after " + "read1(decode_content=True) was called." + ) + if ( + self._decoder + and self._decoder.has_unconsumed_tail + and (amt is None or len(self._decoded_buffer) < amt) + ): + decoded_data = self._decode( + b"", + decode_content, + flush_decoder=False, + max_length=( + amt - len(self._decoded_buffer) if amt is not None else None + ), + ) + self._decoded_buffer.put(decoded_data) + if len(self._decoded_buffer) > 0: + if amt is None: + return self._decoded_buffer.get_all() + return self._decoded_buffer.get(amt) + if amt == 0: + return b"" + + # FIXME, this method's type doesn't say returning None is possible + data = self._raw_read(amt, read1=True) + self._uncached_read_occurred = True + if not decode_content or data is None: + return data + + self._init_decoder() + while True: + flush_decoder = not data + decoded_data = self._decode( + data, decode_content, flush_decoder, max_length=amt + ) + self._decoded_buffer.put(decoded_data) + if decoded_data or flush_decoder: + break + data = self._raw_read(8192, read1=True) + + if amt is None: + return self._decoded_buffer.get_all() + return self._decoded_buffer.get(amt) + + def stream( + self, amt: int | None = 2**16, decode_content: bool | None = None + ) -> typing.Generator[bytes]: + """ + A generator wrapper for the read() method. A call will block until + ``amt`` bytes have been read from the connection or until the + connection is closed. + + :param amt: + How much of the content to read. The generator will return up to + much data per iteration, but may return less. This is particularly + likely when using compressed data. However, the empty string will + never be returned. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + if amt == 0: + return + + if self.chunked and self.supports_chunked_reads(): + yield from self.read_chunked(amt, decode_content=decode_content) + else: + while ( + not is_fp_closed(self._fp) + or len(self._decoded_buffer) > 0 + or (self._decoder and self._decoder.has_unconsumed_tail) + ): + data = self.read(amt=amt, decode_content=decode_content) + + if data: + yield data + + # Overrides from io.IOBase + def readable(self) -> bool: + return True + + def shutdown(self) -> None: + if not self._sock_shutdown: + raise ValueError("Cannot shutdown socket as self._sock_shutdown is not set") + if self._connection is None: + raise RuntimeError( + "Cannot shutdown as connection has already been released to the pool" + ) + self._sock_shutdown(socket.SHUT_RD) + + def close(self) -> None: + self._sock_shutdown = None + + if not self.closed and self._fp: + self._fp.close() + + if self._connection: + self._connection.close() + + if not self.auto_close: + io.IOBase.close(self) + + @property + def closed(self) -> bool: + if not self.auto_close: + return io.IOBase.closed.__get__(self) # type: ignore[no-any-return] + elif self._fp is None: + return True + elif hasattr(self._fp, "isclosed"): + return self._fp.isclosed() + elif hasattr(self._fp, "closed"): + return self._fp.closed + else: + return True + + def fileno(self) -> int: + if self._fp is None: + raise OSError("HTTPResponse has no file to get a fileno from") + elif hasattr(self._fp, "fileno"): + return self._fp.fileno() + else: + raise OSError( + "The file-like object this HTTPResponse is wrapped " + "around has no file descriptor" + ) + + def flush(self) -> None: + if ( + self._fp is not None + and hasattr(self._fp, "flush") + and not getattr(self._fp, "closed", False) + ): + return self._fp.flush() + + def supports_chunked_reads(self) -> bool: + """ + Checks if the underlying file-like object looks like a + :class:`http.client.HTTPResponse` object. We do this by testing for + the fp attribute. If it is present we assume it returns raw chunks as + processed by read_chunked(). + """ + return hasattr(self._fp, "fp") + + def _update_chunk_length(self) -> None: + # First, we'll figure out length of a chunk and then + # we'll try to read it from socket. + if self.chunk_left is not None: + return None + line = self._fp.fp.readline() # type: ignore[union-attr] + line = line.split(b";", 1)[0] + try: + self.chunk_left = int(line, 16) + except ValueError: + self.close() + if line: + # Invalid chunked protocol response, abort. + raise InvalidChunkLength(self, line) from None + else: + # Truncated at start of next chunk + raise ProtocolError("Response ended prematurely") from None + + def _handle_chunk(self, amt: int | None) -> bytes: + returned_chunk = None + if amt is None: + chunk = self._fp._safe_read(self.chunk_left) # type: ignore[union-attr] + returned_chunk = chunk + self._fp._safe_read(2) # type: ignore[union-attr] # Toss the CRLF at the end of the chunk. + self.chunk_left = None + elif self.chunk_left is not None and amt < self.chunk_left: + value = self._fp._safe_read(amt) # type: ignore[union-attr] + self.chunk_left = self.chunk_left - amt + returned_chunk = value + elif amt == self.chunk_left: + value = self._fp._safe_read(amt) # type: ignore[union-attr] + self._fp._safe_read(2) # type: ignore[union-attr] # Toss the CRLF at the end of the chunk. + self.chunk_left = None + returned_chunk = value + else: # amt > self.chunk_left + returned_chunk = self._fp._safe_read(self.chunk_left) # type: ignore[union-attr] + self._fp._safe_read(2) # type: ignore[union-attr] # Toss the CRLF at the end of the chunk. + self.chunk_left = None + return returned_chunk # type: ignore[no-any-return] + + def read_chunked( + self, amt: int | None = None, decode_content: bool | None = None + ) -> typing.Generator[bytes]: + """ + Similar to :meth:`HTTPResponse.read`, but with an additional + parameter: ``decode_content``. + + :param amt: + How much of the content to read. If specified, caching is skipped + because it doesn't make sense to cache partial content as the full + response. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + self._init_decoder() + # FIXME: Rewrite this method and make it a class with a better structured logic. + if not self.chunked: + raise ResponseNotChunked( + "Response is not chunked. " + "Header 'transfer-encoding: chunked' is missing." + ) + if not self.supports_chunked_reads(): + raise BodyNotHttplibCompatible( + "Body should be http.client.HTTPResponse like. " + "It should have have an fp attribute which returns raw chunks." + ) + + with self._error_catcher(): + # Don't bother reading the body of a HEAD request. + if self._original_response and is_response_to_head(self._original_response): + self._original_response.close() + return None + + # If a response is already read and closed + # then return immediately. + if self._fp.fp is None: # type: ignore[union-attr] + return None + + if amt == 0: + return + elif amt and amt < 0: + # Negative numbers and `None` should be treated the same, + # but httplib handles only `None` correctly. + amt = None + + while True: + # First, check if any data is left in the decoder's buffer. + if self._decoder and self._decoder.has_unconsumed_tail: + chunk = b"" + else: + self._update_chunk_length() + self._uncached_read_occurred = True + if self.chunk_left == 0: + break + chunk = self._handle_chunk(amt) + decoded = self._decode( + chunk, + decode_content=decode_content, + flush_decoder=False, + max_length=amt, + ) + if decoded: + yield decoded + + if decode_content: + # On CPython and PyPy, we should never need to flush the + # decoder. However, on Jython we *might* need to, so + # lets defensively do it anyway. + decoded = self._flush_decoder() + if decoded: # Platform-specific: Jython. + yield decoded + + # Chunk content ends with \r\n: discard it. + while self._fp is not None: + line = self._fp.fp.readline() + if not line: + # Some sites may not end with '\r\n'. + break + if line == b"\r\n": + break + + # We read everything; close the "file". + if self._original_response: + self._original_response.close() + + @property + def url(self) -> str | None: + """ + Returns the URL that was the source of this response. + If the request that generated this response redirected, this method + will return the final redirect location. + """ + return self._request_url + + @url.setter + def url(self, url: str | None) -> None: + self._request_url = url + + def __iter__(self) -> typing.Iterator[bytes]: + buffer: list[bytes] = [] + for chunk in self.stream(decode_content=True): + if b"\n" in chunk: + chunks = chunk.split(b"\n") + yield b"".join(buffer) + chunks[0] + b"\n" + for x in chunks[1:-1]: + yield x + b"\n" + if chunks[-1]: + buffer = [chunks[-1]] + else: + buffer = [] + else: + buffer.append(chunk) + if buffer: + yield b"".join(buffer) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__init__.py b/micromamba_root/Lib/site-packages/urllib3/util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..534126033c083203649022fa9b753a433f005556 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/__init__.py @@ -0,0 +1,42 @@ +# For backwards compatibility, provide imports that used to be here. +from __future__ import annotations + +from .connection import is_connection_dropped +from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers +from .response import is_fp_closed +from .retry import Retry +from .ssl_ import ( + ALPN_PROTOCOLS, + IS_PYOPENSSL, + SSLContext, + assert_fingerprint, + create_urllib3_context, + resolve_cert_reqs, + resolve_ssl_version, + ssl_wrap_socket, +) +from .timeout import Timeout +from .url import Url, parse_url +from .wait import wait_for_read, wait_for_write + +__all__ = ( + "IS_PYOPENSSL", + "SSLContext", + "ALPN_PROTOCOLS", + "Retry", + "Timeout", + "Url", + "assert_fingerprint", + "create_urllib3_context", + "is_connection_dropped", + "is_fp_closed", + "parse_url", + "make_headers", + "resolve_cert_reqs", + "resolve_ssl_version", + "ssl_wrap_socket", + "wait_for_read", + "wait_for_write", + "SKIP_HEADER", + "SKIPPABLE_HEADERS", +) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5308cccece0c5183c25e20bfd63b5603681176bb Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/connection.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/connection.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a72930934b8b7492b778a25ef6f58f4c65dbe7e7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/connection.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/proxy.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/proxy.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92907a0c2f7a04af17ccb9eefcf4fee18893732b Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/proxy.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/request.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/request.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca0e4e22f7df10362009dfbc385e42838da00229 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/request.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/response.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/response.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b62ab08eb214c05ad0fbbda396bd9f44bad57612 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/response.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/retry.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/retry.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a32864558b19797b880d14486be8e2e6258ce8ed Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/retry.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c08efd82766d1183606a9a78a8d9f37681bcd56 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_match_hostname.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_match_hostname.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fe99dd5799680ab6b27e7af6f871d4f216c9656 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssl_match_hostname.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssltransport.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssltransport.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf0409354d86abfe2f32f92e4b06a65253406f3a Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/ssltransport.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/timeout.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/timeout.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bd02671e414e58e4e31bb0a5d9734b1397a47db Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/timeout.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/url.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/url.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26a0638266d34b77d89c2dfcb764489a39096933 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/url.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/util.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/util.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16bace9a7cbe02724b1881922957a6fdb66ce7de Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/util.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/wait.cpython-314.pyc b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/wait.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8fd66cac9ed09e1409e8c89e88f2a5f9c311975 Binary files /dev/null and b/micromamba_root/Lib/site-packages/urllib3/util/__pycache__/wait.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/urllib3/util/connection.py b/micromamba_root/Lib/site-packages/urllib3/util/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..f92519ee9124e91e5da7d60ccc3f274312ed3514 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/connection.py @@ -0,0 +1,137 @@ +from __future__ import annotations + +import socket +import typing + +from ..exceptions import LocationParseError +from .timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT + +_TYPE_SOCKET_OPTIONS = list[tuple[int, int, typing.Union[int, bytes]]] + +if typing.TYPE_CHECKING: + from .._base_connection import BaseHTTPConnection + + +def is_connection_dropped(conn: BaseHTTPConnection) -> bool: # Platform-specific + """ + Returns True if the connection is dropped and should be closed. + :param conn: :class:`urllib3.connection.HTTPConnection` object. + """ + return not conn.is_connected + + +# This function is copied from socket.py in the Python 2.7 standard +# library test suite. Added to its signature is only `socket_options`. +# One additional modification is that we avoid binding to IPv6 servers +# discovered in DNS if the system doesn't have IPv6 functionality. +def create_connection( + address: tuple[str, int], + timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + source_address: tuple[str, int] | None = None, + socket_options: _TYPE_SOCKET_OPTIONS | None = None, +) -> socket.socket: + """Connect to *address* and return the socket object. + + Convenience function. Connect to *address* (a 2-tuple ``(host, + port)``) and return the socket object. Passing the optional + *timeout* parameter will set the timeout on the socket instance + before attempting to connect. If no *timeout* is supplied, the + global default timeout setting returned by :func:`socket.getdefaulttimeout` + is used. If *source_address* is set it must be a tuple of (host, port) + for the socket to bind as a source address before making the connection. + An host of '' or port 0 tells the OS to use the default. + """ + + host, port = address + if host.startswith("["): + host = host.strip("[]") + err = None + + # Using the value from allowed_gai_family() in the context of getaddrinfo lets + # us select whether to work with IPv4 DNS records, IPv6 records, or both. + # The original create_connection function always returns all records. + family = allowed_gai_family() + + try: + host.encode("idna") + except UnicodeError: + raise LocationParseError(f"'{host}', label empty or too long") from None + + for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + sock = None + try: + sock = socket.socket(af, socktype, proto) + + # If provided, set socket level options before connecting. + _set_socket_options(sock, socket_options) + + if timeout is not _DEFAULT_TIMEOUT: + sock.settimeout(timeout) + if source_address: + sock.bind(source_address) + sock.connect(sa) + # Break explicitly a reference cycle + err = None + return sock + + except OSError as _: + err = _ + if sock is not None: + sock.close() + + if err is not None: + try: + raise err + finally: + # Break explicitly a reference cycle + err = None + else: + raise OSError("getaddrinfo returns an empty list") + + +def _set_socket_options( + sock: socket.socket, options: _TYPE_SOCKET_OPTIONS | None +) -> None: + if options is None: + return + + for opt in options: + sock.setsockopt(*opt) + + +def allowed_gai_family() -> socket.AddressFamily: + """This function is designed to work in the context of + getaddrinfo, where family=socket.AF_UNSPEC is the default and + will perform a DNS search for both IPv6 and IPv4 records.""" + + family = socket.AF_INET + if HAS_IPV6: + family = socket.AF_UNSPEC + return family + + +def _has_ipv6(host: str) -> bool: + """Returns True if the system can bind an IPv6 address.""" + sock = None + has_ipv6 = False + + if socket.has_ipv6: + # has_ipv6 returns true if cPython was compiled with IPv6 support. + # It does not tell us if the system has IPv6 support enabled. To + # determine that we must bind to an IPv6 address. + # https://github.com/urllib3/urllib3/pull/611 + # https://bugs.python.org/issue658327 + try: + sock = socket.socket(socket.AF_INET6) + sock.bind((host, 0)) + has_ipv6 = True + except Exception: + pass + + if sock: + sock.close() + return has_ipv6 + + +HAS_IPV6 = _has_ipv6("::1") diff --git a/micromamba_root/Lib/site-packages/urllib3/util/proxy.py b/micromamba_root/Lib/site-packages/urllib3/util/proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..908fc6621d0afbed16bde2c1957a5cf28d3a84d8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/proxy.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +import typing + +from .url import Url + +if typing.TYPE_CHECKING: + from ..connection import ProxyConfig + + +def connection_requires_http_tunnel( + proxy_url: Url | None = None, + proxy_config: ProxyConfig | None = None, + destination_scheme: str | None = None, +) -> bool: + """ + Returns True if the connection requires an HTTP CONNECT through the proxy. + + :param URL proxy_url: + URL of the proxy. + :param ProxyConfig proxy_config: + Proxy configuration from poolmanager.py + :param str destination_scheme: + The scheme of the destination. (i.e https, http, etc) + """ + # If we're not using a proxy, no way to use a tunnel. + if proxy_url is None: + return False + + # HTTP destinations never require tunneling, we always forward. + if destination_scheme == "http": + return False + + # Support for forwarding with HTTPS proxies and HTTPS destinations. + if ( + proxy_url.scheme == "https" + and proxy_config + and proxy_config.use_forwarding_for_https + ): + return False + + # Otherwise always use a tunnel. + return True diff --git a/micromamba_root/Lib/site-packages/urllib3/util/request.py b/micromamba_root/Lib/site-packages/urllib3/util/request.py new file mode 100644 index 0000000000000000000000000000000000000000..6c2372ba7e777826a4eb124ddfb54f0240b65d67 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/request.py @@ -0,0 +1,263 @@ +from __future__ import annotations + +import io +import sys +import typing +from base64 import b64encode +from enum import Enum + +from ..exceptions import UnrewindableBodyError +from .util import to_bytes + +if typing.TYPE_CHECKING: + from typing import Final + +# Pass as a value within ``headers`` to skip +# emitting some HTTP headers that are added automatically. +# The only headers that are supported are ``Accept-Encoding``, +# ``Host``, and ``User-Agent``. +SKIP_HEADER = "@@@SKIP_HEADER@@@" +SKIPPABLE_HEADERS = frozenset(["accept-encoding", "host", "user-agent"]) + +ACCEPT_ENCODING = "gzip,deflate" +try: + try: + import brotlicffi as _unused_module_brotli # type: ignore[import-not-found] # noqa: F401 + except ImportError: + import brotli as _unused_module_brotli # type: ignore[import-not-found] # noqa: F401 +except ImportError: + pass +else: + ACCEPT_ENCODING += ",br" + +try: + if sys.version_info >= (3, 14): + from compression import zstd as _unused_module_zstd # noqa: F401 + else: + from backports import zstd as _unused_module_zstd # noqa: F401 +except ImportError: + pass +else: + ACCEPT_ENCODING += ",zstd" + + +class _TYPE_FAILEDTELL(Enum): + token = 0 + + +_FAILEDTELL: Final[_TYPE_FAILEDTELL] = _TYPE_FAILEDTELL.token + +_TYPE_BODY_POSITION = typing.Union[int, _TYPE_FAILEDTELL] + +# When sending a request with these methods we aren't expecting +# a body so don't need to set an explicit 'Content-Length: 0' +# The reason we do this in the negative instead of tracking methods +# which 'should' have a body is because unknown methods should be +# treated as if they were 'POST' which *does* expect a body. +_METHODS_NOT_EXPECTING_BODY = {"GET", "HEAD", "DELETE", "TRACE", "OPTIONS", "CONNECT"} + + +def make_headers( + keep_alive: bool | None = None, + accept_encoding: bool | list[str] | str | None = None, + user_agent: str | None = None, + basic_auth: str | None = None, + proxy_basic_auth: str | None = None, + disable_cache: bool | None = None, +) -> dict[str, str]: + """ + Shortcuts for generating request headers. + + :param keep_alive: + If ``True``, adds 'connection: keep-alive' header. + + :param accept_encoding: + Can be a boolean, list, or string. + ``True`` translates to 'gzip,deflate'. If the dependencies for + Brotli (either the ``brotli`` or ``brotlicffi`` package) and/or + Zstandard (the ``backports.zstd`` package for Python before 3.14) + algorithms are installed, then their encodings are + included in the string ('br' and 'zstd', respectively). + List will get joined by comma. + String will be used as provided. + + :param user_agent: + String representing the user-agent you want, such as + "python-urllib3/0.6" + + :param basic_auth: + Colon-separated username:password string for 'authorization: basic ...' + auth header. + + :param proxy_basic_auth: + Colon-separated username:password string for 'proxy-authorization: basic ...' + auth header. + + :param disable_cache: + If ``True``, adds 'cache-control: no-cache' header. + + Example: + + .. code-block:: python + + import urllib3 + + print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0")) + # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} + print(urllib3.util.make_headers(accept_encoding=True)) + # {'accept-encoding': 'gzip,deflate'} + """ + headers: dict[str, str] = {} + if accept_encoding: + if isinstance(accept_encoding, str): + pass + elif isinstance(accept_encoding, list): + accept_encoding = ",".join(accept_encoding) + else: + accept_encoding = ACCEPT_ENCODING + headers["accept-encoding"] = accept_encoding + + if user_agent: + headers["user-agent"] = user_agent + + if keep_alive: + headers["connection"] = "keep-alive" + + if basic_auth: + headers["authorization"] = ( + f"Basic {b64encode(basic_auth.encode('latin-1')).decode()}" + ) + + if proxy_basic_auth: + headers["proxy-authorization"] = ( + f"Basic {b64encode(proxy_basic_auth.encode('latin-1')).decode()}" + ) + + if disable_cache: + headers["cache-control"] = "no-cache" + + return headers + + +def set_file_position( + body: typing.Any, pos: _TYPE_BODY_POSITION | None +) -> _TYPE_BODY_POSITION | None: + """ + If a position is provided, move file to that point. + Otherwise, we'll attempt to record a position for future use. + """ + if pos is not None: + rewind_body(body, pos) + elif getattr(body, "tell", None) is not None: + try: + pos = body.tell() + except OSError: + # This differentiates from None, allowing us to catch + # a failed `tell()` later when trying to rewind the body. + pos = _FAILEDTELL + + return pos + + +def rewind_body(body: typing.IO[typing.AnyStr], body_pos: _TYPE_BODY_POSITION) -> None: + """ + Attempt to rewind body to a certain position. + Primarily used for request redirects and retries. + + :param body: + File-like object that supports seek. + + :param int pos: + Position to seek to in file. + """ + body_seek = getattr(body, "seek", None) + if body_seek is not None and isinstance(body_pos, int): + try: + body_seek(body_pos) + except OSError as e: + raise UnrewindableBodyError( + "An error occurred when rewinding request body for redirect/retry." + ) from e + elif body_pos is _FAILEDTELL: + raise UnrewindableBodyError( + "Unable to record file position for rewinding " + "request body during a redirect/retry." + ) + else: + raise ValueError( + f"body_pos must be of type integer, instead it was {type(body_pos)}." + ) + + +class ChunksAndContentLength(typing.NamedTuple): + chunks: typing.Iterable[bytes] | None + content_length: int | None + + +def body_to_chunks( + body: typing.Any | None, method: str, blocksize: int +) -> ChunksAndContentLength: + """Takes the HTTP request method, body, and blocksize and + transforms them into an iterable of chunks to pass to + socket.sendall() and an optional 'Content-Length' header. + + A 'Content-Length' of 'None' indicates the length of the body + can't be determined so should use 'Transfer-Encoding: chunked' + for framing instead. + """ + + chunks: typing.Iterable[bytes] | None + content_length: int | None + + # No body, we need to make a recommendation on 'Content-Length' + # based on whether that request method is expected to have + # a body or not. + if body is None: + chunks = None + if method.upper() not in _METHODS_NOT_EXPECTING_BODY: + content_length = 0 + else: + content_length = None + + # Bytes or strings become bytes + elif isinstance(body, (str, bytes)): + chunks = (to_bytes(body),) + content_length = len(chunks[0]) + + # File-like object, TODO: use seek() and tell() for length? + elif hasattr(body, "read"): + + def chunk_readable() -> typing.Iterable[bytes]: + encode = isinstance(body, io.TextIOBase) + while True: + datablock = body.read(blocksize) + if not datablock: + break + if encode: + datablock = datablock.encode("utf-8") + yield datablock + + chunks = chunk_readable() + content_length = None + + # Otherwise we need to start checking via duck-typing. + else: + try: + # Check if the body implements the buffer API. + mv = memoryview(body) + except TypeError: + try: + # Check if the body is an iterable + chunks = iter(body) + content_length = None + except TypeError: + raise TypeError( + f"'body' must be a bytes-like object, file-like " + f"object, or iterable. Instead was {body!r}" + ) from None + else: + # Since it implements the buffer API can be passed directly to socket.sendall() + chunks = (body,) + content_length = mv.nbytes + + return ChunksAndContentLength(chunks=chunks, content_length=content_length) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/response.py b/micromamba_root/Lib/site-packages/urllib3/util/response.py new file mode 100644 index 0000000000000000000000000000000000000000..0f4578696fa2e17a900c6890ec26d65e860b0b72 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/response.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +import http.client as httplib +from email.errors import MultipartInvariantViolationDefect, StartBoundaryNotFoundDefect + +from ..exceptions import HeaderParsingError + + +def is_fp_closed(obj: object) -> bool: + """ + Checks whether a given file-like object is closed. + + :param obj: + The file-like object to check. + """ + + try: + # Check `isclosed()` first, in case Python3 doesn't set `closed`. + # GH Issue #928 + return obj.isclosed() # type: ignore[no-any-return, attr-defined] + except AttributeError: + pass + + try: + # Check via the official file-like-object way. + return obj.closed # type: ignore[no-any-return, attr-defined] + except AttributeError: + pass + + try: + # Check if the object is a container for another file-like object that + # gets released on exhaustion (e.g. HTTPResponse). + return obj.fp is None # type: ignore[attr-defined] + except AttributeError: + pass + + raise ValueError("Unable to determine whether fp is closed.") + + +def assert_header_parsing(headers: httplib.HTTPMessage) -> None: + """ + Asserts whether all headers have been successfully parsed. + Extracts encountered errors from the result of parsing headers. + + Only works on Python 3. + + :param http.client.HTTPMessage headers: Headers to verify. + + :raises urllib3.exceptions.HeaderParsingError: + If parsing errors are found. + """ + + # This will fail silently if we pass in the wrong kind of parameter. + # To make debugging easier add an explicit check. + if not isinstance(headers, httplib.HTTPMessage): + raise TypeError(f"expected httplib.Message, got {type(headers)}.") + + unparsed_data = None + + # get_payload is actually email.message.Message.get_payload; + # we're only interested in the result if it's not a multipart message + if not headers.is_multipart(): + payload = headers.get_payload() + + if isinstance(payload, (bytes, str)): + unparsed_data = payload + + # httplib is assuming a response body is available + # when parsing headers even when httplib only sends + # header data to parse_headers() This results in + # defects on multipart responses in particular. + # See: https://github.com/urllib3/urllib3/issues/800 + + # So we ignore the following defects: + # - StartBoundaryNotFoundDefect: + # The claimed start boundary was never found. + # - MultipartInvariantViolationDefect: + # A message claimed to be a multipart but no subparts were found. + defects = [ + defect + for defect in headers.defects + if not isinstance( + defect, (StartBoundaryNotFoundDefect, MultipartInvariantViolationDefect) + ) + ] + + if defects or unparsed_data: + raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) + + +def is_response_to_head(response: httplib.HTTPResponse) -> bool: + """ + Checks whether the request of a response has been a HEAD-request. + + :param http.client.HTTPResponse response: + Response to check if the originating request + used 'HEAD' as a method. + """ + # FIXME: Can we do this somehow without accessing private httplib _method? + method_str = response._method # type: str # type: ignore[attr-defined] + return method_str.upper() == "HEAD" diff --git a/micromamba_root/Lib/site-packages/urllib3/util/retry.py b/micromamba_root/Lib/site-packages/urllib3/util/retry.py new file mode 100644 index 0000000000000000000000000000000000000000..7649898e1d9930724a456c1c6fdecb66e078b4cc --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/retry.py @@ -0,0 +1,557 @@ +from __future__ import annotations + +import email +import logging +import random +import re +import time +import typing +from itertools import takewhile +from types import TracebackType + +from ..exceptions import ( + ConnectTimeoutError, + InvalidHeader, + MaxRetryError, + ProtocolError, + ProxyError, + ReadTimeoutError, + ResponseError, +) +from .util import reraise + +if typing.TYPE_CHECKING: + from typing_extensions import Self + + from ..connectionpool import ConnectionPool + from ..response import BaseHTTPResponse + +log = logging.getLogger(__name__) + + +# Data structure for representing the metadata of requests that result in a retry. +class RequestHistory(typing.NamedTuple): + method: str | None + url: str | None + error: Exception | None + status: int | None + redirect_location: str | None + + +class Retry: + """Retry configuration. + + Each retry attempt will create a new Retry object with updated values, so + they can be safely reused. + + Retries can be defined as a default for a pool: + + .. code-block:: python + + retries = Retry(connect=5, read=2, redirect=5) + http = PoolManager(retries=retries) + response = http.request("GET", "https://example.com/") + + Or per-request (which overrides the default for the pool): + + .. code-block:: python + + response = http.request("GET", "https://example.com/", retries=Retry(10)) + + Retries can be disabled by passing ``False``: + + .. code-block:: python + + response = http.request("GET", "https://example.com/", retries=False) + + Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless + retries are disabled, in which case the causing exception will be raised. + + :param int total: + Total number of retries to allow. Takes precedence over other counts. + + Set to ``None`` to remove this constraint and fall back on other + counts. + + Set to ``0`` to fail on the first retry. + + Set to ``False`` to disable and imply ``raise_on_redirect=False``. + + :param int connect: + How many connection-related errors to retry on. + + These are errors raised before the request is sent to the remote server, + which we assume has not triggered the server to process the request. + + Set to ``0`` to fail on the first retry of this type. + + :param int read: + How many times to retry on read errors. + + These errors are raised after the request was sent to the server, so the + request may have side-effects. + + Set to ``0`` to fail on the first retry of this type. + + :param int redirect: + How many redirects to perform. Limit this to avoid infinite redirect + loops. + + A redirect is a HTTP response with a status code 301, 302, 303, 307 or + 308. + + Set to ``0`` to fail on the first retry of this type. + + Set to ``False`` to disable and imply ``raise_on_redirect=False``. + + :param int status: + How many times to retry on bad status codes. + + These are retries made on responses, where status code matches + ``status_forcelist``. + + Set to ``0`` to fail on the first retry of this type. + + :param int other: + How many times to retry on other errors. + + Other errors are errors that are not connect, read, redirect or status errors. + These errors might be raised after the request was sent to the server, so the + request might have side-effects. + + Set to ``0`` to fail on the first retry of this type. + + If ``total`` is not set, it's a good idea to set this to 0 to account + for unexpected edge cases and avoid infinite retry loops. + + :param Collection allowed_methods: + Set of uppercased HTTP method verbs that we should retry on. + + By default, we only retry on methods which are considered to be + idempotent (multiple requests with the same parameters end with the + same state). See :attr:`Retry.DEFAULT_ALLOWED_METHODS`. + + Set to a ``None`` value to retry on any verb. + + :param Collection status_forcelist: + A set of integer HTTP status codes that we should force a retry on. + A retry is initiated if the request method is in ``allowed_methods`` + and the response status code is in ``status_forcelist``. + + By default, this is disabled with ``None``. + + :param float backoff_factor: + A backoff factor to apply between attempts after the second try + (most errors are resolved immediately by a second try without a + delay). urllib3 will sleep for:: + + {backoff factor} * (2 ** ({number of previous retries})) + + seconds. If `backoff_jitter` is non-zero, this sleep is extended by:: + + random.uniform(0, {backoff jitter}) + + seconds. For example, if the backoff_factor is 0.1, then :func:`Retry.sleep` will + sleep for [0.0s, 0.2s, 0.4s, 0.8s, ...] between retries. No backoff will ever + be longer than `backoff_max`. + + By default, backoff is disabled (factor set to 0). + + :param float backoff_max: + The maximum backoff time (in seconds) between retry attempts. + This value caps the computed backoff from `backoff_factor`. + + :param float backoff_jitter: + Random jitter amount (in seconds) added to the computed backoff. + Jitter is sampled uniformly from `0` to `backoff_jitter`. + + :param bool raise_on_redirect: Whether, if the number of redirects is + exhausted, to raise a MaxRetryError, or to return a response with a + response code in the 3xx range. + + :param bool raise_on_status: Similar meaning to ``raise_on_redirect``: + whether we should raise an exception, or return a response, + if status falls in ``status_forcelist`` range and retries have + been exhausted. + + :param tuple history: The history of the request encountered during + each call to :meth:`~Retry.increment`. The list is in the order + the requests occurred. Each list item is of class :class:`RequestHistory`. + + :param bool respect_retry_after_header: + Whether to respect Retry-After header on status codes defined as + :attr:`Retry.RETRY_AFTER_STATUS_CODES` or not. + + :param Collection remove_headers_on_redirect: + Sequence of headers to remove from the request when a response + indicating a redirect is returned before firing off the redirected + request. + + :param int retry_after_max: Number of seconds to allow as the maximum for + Retry-After headers. Defaults to :attr:`Retry.DEFAULT_RETRY_AFTER_MAX`. + Any Retry-After headers larger than this value will be limited to this + value. + """ + + #: Default methods to be used for ``allowed_methods`` + DEFAULT_ALLOWED_METHODS = frozenset( + ["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"] + ) + + #: Default status codes to be used for ``status_forcelist`` + RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503]) + + #: Default headers to be used for ``remove_headers_on_redirect`` + DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset( + ["Cookie", "Authorization", "Proxy-Authorization"] + ) + + #: Default maximum backoff time. + DEFAULT_BACKOFF_MAX = 120 + + # This is undocumented in the RFC. Setting to 6 hours matches other popular libraries. + #: Default maximum allowed value for Retry-After headers in seconds + DEFAULT_RETRY_AFTER_MAX: typing.Final[int] = 21600 + + # Backward compatibility; assigned outside of the class. + DEFAULT: typing.ClassVar[Retry] + + def __init__( + self, + total: bool | int | None = 10, + connect: int | None = None, + read: int | None = None, + redirect: bool | int | None = None, + status: int | None = None, + other: int | None = None, + allowed_methods: typing.Collection[str] | None = DEFAULT_ALLOWED_METHODS, + status_forcelist: typing.Collection[int] | None = None, + backoff_factor: float = 0, + backoff_max: float = DEFAULT_BACKOFF_MAX, + raise_on_redirect: bool = True, + raise_on_status: bool = True, + history: tuple[RequestHistory, ...] | None = None, + respect_retry_after_header: bool = True, + remove_headers_on_redirect: typing.Collection[ + str + ] = DEFAULT_REMOVE_HEADERS_ON_REDIRECT, + backoff_jitter: float = 0.0, + retry_after_max: int = DEFAULT_RETRY_AFTER_MAX, + ) -> None: + self.total = total + self.connect = connect + self.read = read + self.status = status + self.other = other + + if redirect is False or total is False: + redirect = 0 + raise_on_redirect = False + + self.redirect = redirect + self.status_forcelist = status_forcelist or set() + self.allowed_methods = allowed_methods + self.backoff_factor = backoff_factor + self.backoff_max = backoff_max + self.retry_after_max = retry_after_max + self.raise_on_redirect = raise_on_redirect + self.raise_on_status = raise_on_status + self.history = history or () + self.respect_retry_after_header = respect_retry_after_header + self.remove_headers_on_redirect = frozenset( + h.lower() for h in remove_headers_on_redirect + ) + self.backoff_jitter = backoff_jitter + + def new(self, **kw: typing.Any) -> Self: + params = dict( + total=self.total, + connect=self.connect, + read=self.read, + redirect=self.redirect, + status=self.status, + other=self.other, + allowed_methods=self.allowed_methods, + status_forcelist=self.status_forcelist, + backoff_factor=self.backoff_factor, + backoff_max=self.backoff_max, + retry_after_max=self.retry_after_max, + raise_on_redirect=self.raise_on_redirect, + raise_on_status=self.raise_on_status, + history=self.history, + remove_headers_on_redirect=self.remove_headers_on_redirect, + respect_retry_after_header=self.respect_retry_after_header, + backoff_jitter=self.backoff_jitter, + ) + + params.update(kw) + return type(self)(**params) # type: ignore[arg-type] + + @classmethod + def from_int( + cls, + retries: Retry | bool | int | None, + redirect: bool | int | None = True, + default: Retry | bool | int | None = None, + ) -> Retry: + """Backwards-compatibility for the old retries format.""" + if retries is None: + retries = default if default is not None else cls.DEFAULT + + if isinstance(retries, Retry): + return retries + + redirect = bool(redirect) and None + new_retries = cls(retries, redirect=redirect) + log.debug("Converted retries value: %r -> %r", retries, new_retries) + return new_retries + + def get_backoff_time(self) -> float: + """Formula for computing the current backoff + + :rtype: float + """ + # We want to consider only the last consecutive errors sequence (Ignore redirects). + consecutive_errors_len = len( + list( + takewhile(lambda x: x.redirect_location is None, reversed(self.history)) + ) + ) + if consecutive_errors_len <= 1: + return 0 + + backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1)) + if self.backoff_jitter != 0.0: + backoff_value += random.random() * self.backoff_jitter + return float(max(0, min(self.backoff_max, backoff_value))) + + def parse_retry_after(self, retry_after: str) -> float: + seconds: float + # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4 + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = int(retry_after) + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + raise InvalidHeader(f"Invalid Retry-After header: {retry_after}") + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + seconds = max(seconds, 0) + + # Check the seconds do not exceed the specified maximum + if seconds > self.retry_after_max: + seconds = self.retry_after_max + + return seconds + + def get_retry_after(self, response: BaseHTTPResponse) -> float | None: + """Get the value of Retry-After in seconds.""" + + retry_after = response.headers.get("Retry-After") + + if retry_after is None: + return None + + return self.parse_retry_after(retry_after) + + def sleep_for_retry(self, response: BaseHTTPResponse) -> bool: + retry_after = self.get_retry_after(response) + if retry_after: + time.sleep(retry_after) + return True + + return False + + def _sleep_backoff(self) -> None: + backoff = self.get_backoff_time() + if backoff <= 0: + return + time.sleep(backoff) + + def sleep(self, response: BaseHTTPResponse | None = None) -> None: + """Sleep between retry attempts. + + This method will respect a server's ``Retry-After`` response header + and sleep the duration of the time requested. If that is not present, it + will use an exponential backoff. By default, the backoff factor is 0 and + this method will return immediately. + """ + + if self.respect_retry_after_header and response: + slept = self.sleep_for_retry(response) + if slept: + return + + self._sleep_backoff() + + def _is_connection_error(self, err: Exception) -> bool: + """Errors when we're fairly sure that the server did not receive the + request, so it should be safe to retry. + """ + if isinstance(err, ProxyError): + err = err.original_error + return isinstance(err, ConnectTimeoutError) + + def _is_read_error(self, err: Exception) -> bool: + """Errors that occur after the request has been started, so we should + assume that the server began processing it. + """ + return isinstance(err, (ReadTimeoutError, ProtocolError)) + + def _is_method_retryable(self, method: str) -> bool: + """Checks if a given HTTP method should be retried upon, depending if + it is included in the allowed_methods + """ + if self.allowed_methods and method.upper() not in self.allowed_methods: + return False + return True + + def is_retry( + self, method: str, status_code: int, has_retry_after: bool = False + ) -> bool: + """Is this method/status code retryable? (Based on allowlists and control + variables such as the number of total retries to allow, whether to + respect the Retry-After header, whether this header is present, and + whether the returned status code is on the list of status codes to + be retried upon on the presence of the aforementioned header) + """ + if not self._is_method_retryable(method): + return False + + if self.status_forcelist and status_code in self.status_forcelist: + return True + + return bool( + self.total + and self.respect_retry_after_header + and has_retry_after + and (status_code in self.RETRY_AFTER_STATUS_CODES) + ) + + def is_exhausted(self) -> bool: + """Are we out of retries?""" + retry_counts = [ + x + for x in ( + self.total, + self.connect, + self.read, + self.redirect, + self.status, + self.other, + ) + if x + ] + if not retry_counts: + return False + + return min(retry_counts) < 0 + + def increment( + self, + method: str | None = None, + url: str | None = None, + response: BaseHTTPResponse | None = None, + error: Exception | None = None, + _pool: ConnectionPool | None = None, + _stacktrace: TracebackType | None = None, + ) -> Self: + """Return a new Retry object with incremented retry counters. + + :param response: A response object, or None, if the server did not + return a response. + :type response: :class:`~urllib3.response.BaseHTTPResponse` + :param Exception error: An error encountered during the request, or + None if the response was received successfully. + + :return: A new ``Retry`` object. + """ + if self.total is False and error: + # Disabled, indicate to re-raise the error. + raise reraise(type(error), error, _stacktrace) + + total = self.total + if total is not None: + total -= 1 + + connect = self.connect + read = self.read + redirect = self.redirect + status_count = self.status + other = self.other + cause = "unknown" + status = None + redirect_location = None + + if error and self._is_connection_error(error): + # Connect retry? + if connect is False: + raise reraise(type(error), error, _stacktrace) + elif connect is not None: + connect -= 1 + + elif error and self._is_read_error(error): + # Read retry? + if read is False or method is None or not self._is_method_retryable(method): + raise reraise(type(error), error, _stacktrace) + elif read is not None: + read -= 1 + + elif error: + # Other retry? + if other is not None: + other -= 1 + + elif response and response.get_redirect_location(): + # Redirect retry? + if redirect is not None: + redirect -= 1 + cause = "too many redirects" + response_redirect_location = response.get_redirect_location() + if response_redirect_location: + redirect_location = response_redirect_location + status = response.status + + else: + # Incrementing because of a server error like a 500 in + # status_forcelist and the given method is in the allowed_methods + cause = ResponseError.GENERIC_ERROR + if response and response.status: + if status_count is not None: + status_count -= 1 + cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) + status = response.status + + history = self.history + ( + RequestHistory(method, url, error, status, redirect_location), + ) + + new_retry = self.new( + total=total, + connect=connect, + read=read, + redirect=redirect, + status=status_count, + other=other, + history=history, + ) + + if new_retry.is_exhausted(): + reason = error or ResponseError(cause) + raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] + + log.debug("Incremented Retry for (url='%s'): %r", url, new_retry) + + return new_retry + + def __repr__(self) -> str: + return ( + f"{type(self).__name__}(total={self.total}, connect={self.connect}, " + f"read={self.read}, redirect={self.redirect}, status={self.status})" + ) + + +# For backwards compatibility (equivalent to pre-v1.9): +Retry.DEFAULT = Retry(3) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/ssl_.py b/micromamba_root/Lib/site-packages/urllib3/util/ssl_.py new file mode 100644 index 0000000000000000000000000000000000000000..e66549a76c4b5821e639e5facfeb63dd1a39d543 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/ssl_.py @@ -0,0 +1,477 @@ +from __future__ import annotations + +import hashlib +import hmac +import os +import socket +import sys +import typing +import warnings +from binascii import unhexlify + +from ..exceptions import ProxySchemeUnsupported, SSLError +from .url import _BRACELESS_IPV6_ADDRZ_RE, _IPV4_RE + +SSLContext = None +SSLTransport = None +HAS_NEVER_CHECK_COMMON_NAME = False +IS_PYOPENSSL = False +ALPN_PROTOCOLS = ["http/1.1"] + +_TYPE_VERSION_INFO = tuple[int, int, int, str, int] + +# Maps the length of a digest to a possible hash function producing this digest +HASHFUNC_MAP = { + length: getattr(hashlib, algorithm, None) + for length, algorithm in ((32, "md5"), (40, "sha1"), (64, "sha256")) +} + + +def _is_has_never_check_common_name_reliable( + openssl_version: str, +) -> bool: + # As of May 2023, all released versions of LibreSSL fail to reject certificates with + # only common names, see https://github.com/urllib3/urllib3/pull/3024 + is_openssl = openssl_version.startswith("OpenSSL ") + + return is_openssl + + +if typing.TYPE_CHECKING: + from ssl import VerifyMode + from typing import TypedDict + + from .ssltransport import SSLTransport as SSLTransportType + + class _TYPE_PEER_CERT_RET_DICT(TypedDict, total=False): + subjectAltName: tuple[tuple[str, str], ...] + subject: tuple[tuple[tuple[str, str], ...], ...] + serialNumber: str + + +# Mapping from 'ssl.PROTOCOL_TLSX' to 'TLSVersion.X' +_SSL_VERSION_TO_TLS_VERSION: dict[int, int] = {} + +try: # Do we have ssl at all? + import ssl + from ssl import ( # type: ignore[assignment] + CERT_REQUIRED, + HAS_NEVER_CHECK_COMMON_NAME, + OP_NO_COMPRESSION, + OP_NO_TICKET, + OPENSSL_VERSION, + PROTOCOL_TLS, + PROTOCOL_TLS_CLIENT, + VERIFY_X509_PARTIAL_CHAIN, + VERIFY_X509_STRICT, + OP_NO_SSLv2, + OP_NO_SSLv3, + SSLContext, + TLSVersion, + ) + + PROTOCOL_SSLv23 = PROTOCOL_TLS + + # Setting SSLContext.hostname_checks_common_name = False didn't work with + # LibreSSL, check details in the used function. + if HAS_NEVER_CHECK_COMMON_NAME and not _is_has_never_check_common_name_reliable( + OPENSSL_VERSION, + ): # Defensive: + HAS_NEVER_CHECK_COMMON_NAME = False + + # Need to be careful here in case old TLS versions get + # removed in future 'ssl' module implementations. + for attr in ("TLSv1", "TLSv1_1", "TLSv1_2"): + try: + _SSL_VERSION_TO_TLS_VERSION[getattr(ssl, f"PROTOCOL_{attr}")] = getattr( + TLSVersion, attr + ) + except AttributeError: # Defensive: + continue + + from .ssltransport import SSLTransport # type: ignore[assignment] +except ImportError: + OP_NO_COMPRESSION = 0x20000 # type: ignore[assignment, misc] + OP_NO_TICKET = 0x4000 # type: ignore[assignment, misc] + OP_NO_SSLv2 = 0x1000000 # type: ignore[assignment, misc] + OP_NO_SSLv3 = 0x2000000 # type: ignore[assignment, misc] + PROTOCOL_SSLv23 = PROTOCOL_TLS = 2 # type: ignore[assignment, misc] + PROTOCOL_TLS_CLIENT = 16 # type: ignore[assignment, misc] + VERIFY_X509_PARTIAL_CHAIN = 0x80000 # type: ignore[assignment,misc] + VERIFY_X509_STRICT = 0x20 # type: ignore[assignment, misc] + + +_TYPE_PEER_CERT_RET = typing.Union["_TYPE_PEER_CERT_RET_DICT", bytes, None] + + +def assert_fingerprint(cert: bytes | None, fingerprint: str) -> None: + """ + Checks if given fingerprint matches the supplied certificate. + + :param cert: + Certificate as bytes object. + :param fingerprint: + Fingerprint as string of hexdigits, can be interspersed by colons. + """ + + if cert is None: + raise SSLError("No certificate for the peer.") + + fingerprint = fingerprint.replace(":", "").lower() + digest_length = len(fingerprint) + if digest_length not in HASHFUNC_MAP: + raise SSLError(f"Fingerprint of invalid length: {fingerprint}") + hashfunc = HASHFUNC_MAP.get(digest_length) + if hashfunc is None: + raise SSLError( + f"Hash function implementation unavailable for fingerprint length: {digest_length}" + ) + + # We need encode() here for py32; works on py2 and p33. + fingerprint_bytes = unhexlify(fingerprint.encode()) + + cert_digest = hashfunc(cert).digest() + + if not hmac.compare_digest(cert_digest, fingerprint_bytes): + raise SSLError( + f'Fingerprints did not match. Expected "{fingerprint}", got "{cert_digest.hex()}"' + ) + + +def resolve_cert_reqs(candidate: None | int | str) -> VerifyMode: + """ + Resolves the argument to a numeric constant, which can be passed to + the wrap_socket function/method from the ssl module. + Defaults to :data:`ssl.CERT_REQUIRED`. + If given a string it is assumed to be the name of the constant in the + :mod:`ssl` module or its abbreviation. + (So you can specify `REQUIRED` instead of `CERT_REQUIRED`. + If it's neither `None` nor a string we assume it is already the numeric + constant which can directly be passed to wrap_socket. + """ + if candidate is None: + return CERT_REQUIRED + + if isinstance(candidate, str): + res = getattr(ssl, candidate, None) + if res is None: + res = getattr(ssl, "CERT_" + candidate) + return res # type: ignore[no-any-return] + + return candidate # type: ignore[return-value] + + +def resolve_ssl_version(candidate: None | int | str) -> int: + """ + like resolve_cert_reqs + """ + if candidate is None: + return PROTOCOL_TLS + + if isinstance(candidate, str): + res = getattr(ssl, candidate, None) + if res is None: + res = getattr(ssl, "PROTOCOL_" + candidate) + return typing.cast(int, res) + + return candidate + + +def create_urllib3_context( + ssl_version: int | None = None, + cert_reqs: int | None = None, + options: int | None = None, + ciphers: str | None = None, + ssl_minimum_version: int | None = None, + ssl_maximum_version: int | None = None, + verify_flags: int | None = None, +) -> ssl.SSLContext: + """Creates and configures an :class:`ssl.SSLContext` instance for use with urllib3. + + :param ssl_version: + The desired protocol version to use. This will default to + PROTOCOL_SSLv23 which will negotiate the highest protocol that both + the server and your installation of OpenSSL support. + + This parameter is deprecated instead use 'ssl_minimum_version'. + :param ssl_minimum_version: + The minimum version of TLS to be used. Use the 'ssl.TLSVersion' enum for specifying the value. + :param ssl_maximum_version: + The maximum version of TLS to be used. Use the 'ssl.TLSVersion' enum for specifying the value. + Not recommended to set to anything other than 'ssl.TLSVersion.MAXIMUM_SUPPORTED' which is the + default value. + :param cert_reqs: + Whether to require the certificate verification. This defaults to + ``ssl.CERT_REQUIRED``. + :param options: + Specific OpenSSL options. These default to ``ssl.OP_NO_SSLv2``, + ``ssl.OP_NO_SSLv3``, ``ssl.OP_NO_COMPRESSION``, and ``ssl.OP_NO_TICKET``. + :param ciphers: + Which cipher suites to allow the server to select. Defaults to either system configured + ciphers if OpenSSL 1.1.1+, otherwise uses a secure default set of ciphers. + :param verify_flags: + The flags for certificate verification operations. These default to + ``ssl.VERIFY_X509_PARTIAL_CHAIN`` and ``ssl.VERIFY_X509_STRICT`` for Python 3.13+. + :returns: + Constructed SSLContext object with specified options + :rtype: SSLContext + """ + if SSLContext is None: + raise TypeError("Can't create an SSLContext object without an ssl module") + + # This means 'ssl_version' was specified as an exact value. + if ssl_version not in (None, PROTOCOL_TLS, PROTOCOL_TLS_CLIENT): + # Disallow setting 'ssl_version' and 'ssl_minimum|maximum_version' + # to avoid conflicts. + if ssl_minimum_version is not None or ssl_maximum_version is not None: + raise ValueError( + "Can't specify both 'ssl_version' and either " + "'ssl_minimum_version' or 'ssl_maximum_version'" + ) + + # 'ssl_version' is deprecated and will be removed in the future. + else: + # Use 'ssl_minimum_version' and 'ssl_maximum_version' instead. + ssl_minimum_version = _SSL_VERSION_TO_TLS_VERSION.get( + ssl_version, TLSVersion.MINIMUM_SUPPORTED + ) + ssl_maximum_version = _SSL_VERSION_TO_TLS_VERSION.get( + ssl_version, TLSVersion.MAXIMUM_SUPPORTED + ) + + # This warning message is pushing users to use 'ssl_minimum_version' + # instead of both min/max. Best practice is to only set the minimum version and + # keep the maximum version to be it's default value: 'TLSVersion.MAXIMUM_SUPPORTED' + warnings.warn( + "'ssl_version' option is deprecated and will be " + "removed in urllib3 v3.0. Instead use 'ssl_minimum_version'", + category=FutureWarning, + stacklevel=2, + ) + + context = SSLContext(PROTOCOL_TLS_CLIENT) + if ssl_minimum_version is not None: + context.minimum_version = ssl_minimum_version + else: # pyOpenSSL defaults to 'MINIMUM_SUPPORTED' so explicitly set TLSv1.2 here + context.minimum_version = TLSVersion.TLSv1_2 + + if ssl_maximum_version is not None: + context.maximum_version = ssl_maximum_version + + # Unless we're given ciphers defer to either system ciphers in + # the case of OpenSSL 1.1.1+ or use our own secure default ciphers. + if ciphers: + context.set_ciphers(ciphers) + + # Setting the default here, as we may have no ssl module on import + cert_reqs = ssl.CERT_REQUIRED if cert_reqs is None else cert_reqs + + if options is None: + options = 0 + # SSLv2 is easily broken and is considered harmful and dangerous + options |= OP_NO_SSLv2 + # SSLv3 has several problems and is now dangerous + options |= OP_NO_SSLv3 + # Disable compression to prevent CRIME attacks for OpenSSL 1.0+ + # (issue #309) + options |= OP_NO_COMPRESSION + # TLSv1.2 only. Unless set explicitly, do not request tickets. + # This may save some bandwidth on wire, and although the ticket is encrypted, + # there is a risk associated with it being on wire, + # if the server is not rotating its ticketing keys properly. + options |= OP_NO_TICKET + + context.options |= options + + if verify_flags is None: + verify_flags = 0 + # In Python 3.13+ ssl.create_default_context() sets VERIFY_X509_PARTIAL_CHAIN + # and VERIFY_X509_STRICT so we do the same + if sys.version_info >= (3, 13): + verify_flags |= VERIFY_X509_PARTIAL_CHAIN + verify_flags |= VERIFY_X509_STRICT + + context.verify_flags |= verify_flags + + # Enable post-handshake authentication for TLS 1.3, see GH #1634. PHA is + # necessary for conditional client cert authentication with TLS 1.3. + # The attribute is None for OpenSSL <= 1.1.0 or does not exist when using + # an SSLContext created by pyOpenSSL. + if getattr(context, "post_handshake_auth", None) is not None: + context.post_handshake_auth = True + + # The order of the below lines setting verify_mode and check_hostname + # matter due to safe-guards SSLContext has to prevent an SSLContext with + # check_hostname=True, verify_mode=NONE/OPTIONAL. + # We always set 'check_hostname=False' for pyOpenSSL so we rely on our own + # 'ssl.match_hostname()' implementation. + if cert_reqs == ssl.CERT_REQUIRED and not IS_PYOPENSSL: + context.verify_mode = cert_reqs + context.check_hostname = True + else: + context.check_hostname = False + context.verify_mode = cert_reqs + + context.hostname_checks_common_name = False + + if "SSLKEYLOGFILE" in os.environ: + sslkeylogfile = os.path.expandvars(os.environ.get("SSLKEYLOGFILE")) + else: + sslkeylogfile = None + if sslkeylogfile: + context.keylog_filename = sslkeylogfile + + return context + + +@typing.overload +def ssl_wrap_socket( + sock: socket.socket, + keyfile: str | None = ..., + certfile: str | None = ..., + cert_reqs: int | None = ..., + ca_certs: str | None = ..., + server_hostname: str | None = ..., + ssl_version: int | None = ..., + ciphers: str | None = ..., + ssl_context: ssl.SSLContext | None = ..., + ca_cert_dir: str | None = ..., + key_password: str | None = ..., + ca_cert_data: None | str | bytes = ..., + tls_in_tls: typing.Literal[False] = ..., +) -> ssl.SSLSocket: ... + + +@typing.overload +def ssl_wrap_socket( + sock: socket.socket, + keyfile: str | None = ..., + certfile: str | None = ..., + cert_reqs: int | None = ..., + ca_certs: str | None = ..., + server_hostname: str | None = ..., + ssl_version: int | None = ..., + ciphers: str | None = ..., + ssl_context: ssl.SSLContext | None = ..., + ca_cert_dir: str | None = ..., + key_password: str | None = ..., + ca_cert_data: None | str | bytes = ..., + tls_in_tls: bool = ..., +) -> ssl.SSLSocket | SSLTransportType: ... + + +def ssl_wrap_socket( + sock: socket.socket, + keyfile: str | None = None, + certfile: str | None = None, + cert_reqs: int | None = None, + ca_certs: str | None = None, + server_hostname: str | None = None, + ssl_version: int | None = None, + ciphers: str | None = None, + ssl_context: ssl.SSLContext | None = None, + ca_cert_dir: str | None = None, + key_password: str | None = None, + ca_cert_data: None | str | bytes = None, + tls_in_tls: bool = False, +) -> ssl.SSLSocket | SSLTransportType: + """ + All arguments except for server_hostname, ssl_context, tls_in_tls, ca_cert_data and + ca_cert_dir have the same meaning as they do when using + :func:`ssl.create_default_context`, :meth:`ssl.SSLContext.load_cert_chain`, + :meth:`ssl.SSLContext.set_ciphers` and :meth:`ssl.SSLContext.wrap_socket`. + + :param server_hostname: + When SNI is supported, the expected hostname of the certificate + :param ssl_context: + A pre-made :class:`SSLContext` object. If none is provided, one will + be created using :func:`create_urllib3_context`. + :param ciphers: + A string of ciphers we wish the client to support. + :param ca_cert_dir: + A directory containing CA certificates in multiple separate files, as + supported by OpenSSL's -CApath flag or the capath argument to + SSLContext.load_verify_locations(). + :param key_password: + Optional password if the keyfile is encrypted. + :param ca_cert_data: + Optional string containing CA certificates in PEM format suitable for + passing as the cadata parameter to SSLContext.load_verify_locations() + :param tls_in_tls: + Use SSLTransport to wrap the existing socket. + """ + context = ssl_context + if context is None: + # Note: This branch of code and all the variables in it are only used in tests. + # We should consider deprecating and removing this code. + context = create_urllib3_context(ssl_version, cert_reqs, ciphers=ciphers) + + if ca_certs or ca_cert_dir or ca_cert_data: + try: + context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data) + except OSError as e: + raise SSLError(e) from e + + elif ssl_context is None and hasattr(context, "load_default_certs"): + # try to load OS default certs; works well on Windows. + context.load_default_certs() + + # Attempt to detect if we get the goofy behavior of the + # keyfile being encrypted and OpenSSL asking for the + # passphrase via the terminal and instead error out. + if keyfile and key_password is None and _is_key_file_encrypted(keyfile): + raise SSLError("Client private key is encrypted, password is required") + + if certfile: + if key_password is None: + context.load_cert_chain(certfile, keyfile) + else: + context.load_cert_chain(certfile, keyfile, key_password) + + context.set_alpn_protocols(ALPN_PROTOCOLS) + + ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname) + return ssl_sock + + +def is_ipaddress(hostname: str | bytes) -> bool: + """Detects whether the hostname given is an IPv4 or IPv6 address. + Also detects IPv6 addresses with Zone IDs. + + :param str hostname: Hostname to examine. + :return: True if the hostname is an IP address, False otherwise. + """ + if isinstance(hostname, bytes): + # IDN A-label bytes are ASCII compatible. + hostname = hostname.decode("ascii") + return bool(_IPV4_RE.match(hostname) or _BRACELESS_IPV6_ADDRZ_RE.match(hostname)) + + +def _is_key_file_encrypted(key_file: str) -> bool: + """Detects if a key file is encrypted or not.""" + with open(key_file) as f: + for line in f: + # Look for Proc-Type: 4,ENCRYPTED + if "ENCRYPTED" in line: + return True + + return False + + +def _ssl_wrap_socket_impl( + sock: socket.socket, + ssl_context: ssl.SSLContext, + tls_in_tls: bool, + server_hostname: str | None = None, +) -> ssl.SSLSocket | SSLTransportType: + if tls_in_tls: + if not SSLTransport: + # Import error, ssl is not available. + raise ProxySchemeUnsupported( + "TLS in TLS requires support for the 'ssl' module" + ) + + SSLTransport._validate_ssl_context_for_tls_in_tls(ssl_context) + return SSLTransport(sock, ssl_context, server_hostname) + + return ssl_context.wrap_socket(sock, server_hostname=server_hostname) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/ssl_match_hostname.py b/micromamba_root/Lib/site-packages/urllib3/util/ssl_match_hostname.py new file mode 100644 index 0000000000000000000000000000000000000000..94994f25ae1570211c0b98353790f669ef4585fa --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/ssl_match_hostname.py @@ -0,0 +1,153 @@ +"""The match_hostname() function from Python 3.5, essential when using SSL.""" + +# Note: This file is under the PSF license as the code comes from the python +# stdlib. http://docs.python.org/3/license.html +# It is modified to remove commonName support. + +from __future__ import annotations + +import ipaddress +import re +import typing +from ipaddress import IPv4Address, IPv6Address + +if typing.TYPE_CHECKING: + from .ssl_ import _TYPE_PEER_CERT_RET_DICT + +__version__ = "3.5.0.1" + + +class CertificateError(ValueError): + pass + + +def _dnsname_match( + dn: typing.Any, hostname: str, max_wildcards: int = 1 +) -> typing.Match[str] | None | bool: + """Matching according to RFC 6125, section 6.4.3 + + http://tools.ietf.org/html/rfc6125#section-6.4.3 + """ + pats = [] + if not dn: + return False + + # Ported from python3-syntax: + # leftmost, *remainder = dn.split(r'.') + parts = dn.split(r".") + leftmost = parts[0] + remainder = parts[1:] + + wildcards = leftmost.count("*") + if wildcards > max_wildcards: + # Issue #17980: avoid denials of service by refusing more + # than one wildcard per fragment. A survey of established + # policy among SSL implementations showed it to be a + # reasonable choice. + raise CertificateError( + "too many wildcards in certificate DNS name: " + repr(dn) + ) + + # speed up common case w/o wildcards + if not wildcards: + return bool(dn.lower() == hostname.lower()) + + # RFC 6125, section 6.4.3, subitem 1. + # The client SHOULD NOT attempt to match a presented identifier in which + # the wildcard character comprises a label other than the left-most label. + if leftmost == "*": + # When '*' is a fragment by itself, it matches a non-empty dotless + # fragment. + pats.append("[^.]+") + elif leftmost.startswith("xn--") or hostname.startswith("xn--"): + # RFC 6125, section 6.4.3, subitem 3. + # The client SHOULD NOT attempt to match a presented identifier + # where the wildcard character is embedded within an A-label or + # U-label of an internationalized domain name. + pats.append(re.escape(leftmost)) + else: + # Otherwise, '*' matches any dotless string, e.g. www* + pats.append(re.escape(leftmost).replace(r"\*", "[^.]*")) + + # add the remaining fragments, ignore any wildcards + for frag in remainder: + pats.append(re.escape(frag)) + + pat = re.compile(r"\A" + r"\.".join(pats) + r"\Z", re.IGNORECASE) + return pat.match(hostname) + + +def _ipaddress_match(ipname: str, host_ip: IPv4Address | IPv6Address) -> bool: + """Exact matching of IP addresses. + + RFC 9110 section 4.3.5: "A reference identity of IP-ID contains the decoded + bytes of the IP address. An IP version 4 address is 4 octets, and an IP + version 6 address is 16 octets. [...] A reference identity of type IP-ID + matches if the address is identical to an iPAddress value of the + subjectAltName extension of the certificate." + """ + # OpenSSL may add a trailing newline to a subjectAltName's IP address + # Divergence from upstream: ipaddress can't handle byte str + ip = ipaddress.ip_address(ipname.rstrip()) + return bool(ip.packed == host_ip.packed) + + +def match_hostname( + cert: _TYPE_PEER_CERT_RET_DICT | None, + hostname: str, + hostname_checks_common_name: bool = False, +) -> None: + """Verify that *cert* (in decoded format as returned by + SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 + rules are followed, but IP addresses are not accepted for *hostname*. + + CertificateError is raised on failure. On success, the function + returns nothing. + """ + if not cert: + raise ValueError( + "empty or no certificate, match_hostname needs a " + "SSL socket or SSL context with either " + "CERT_OPTIONAL or CERT_REQUIRED" + ) + + try: + host_ip = ipaddress.ip_address(hostname) + except ValueError: + # Not an IP address (common case) + host_ip = None + dnsnames = [] + san: tuple[tuple[str, str], ...] = cert.get("subjectAltName", ()) + key: str + value: str + for key, value in san: + if key == "DNS": + if host_ip is None and _dnsname_match(value, hostname): + return + dnsnames.append(value) + elif key == "IP Address": + if host_ip is not None and _ipaddress_match(value, host_ip): + return + dnsnames.append(value) + + # We only check 'commonName' if it's enabled and we're not verifying + # an IP address. IP addresses aren't valid within 'commonName'. + if hostname_checks_common_name and host_ip is None and not dnsnames: + for sub in cert.get("subject", ()): + for key, value in sub: + if key == "commonName": + if _dnsname_match(value, hostname): + return + dnsnames.append( + value + ) # Defensive: for older PyPy and OpenSSL versions + + if len(dnsnames) > 1: + raise CertificateError( + "hostname %r " + "doesn't match either of %s" % (hostname, ", ".join(map(repr, dnsnames))) + ) + elif len(dnsnames) == 1: + raise CertificateError(f"hostname {hostname!r} doesn't match {dnsnames[0]!r}") + else: + raise CertificateError("no appropriate subjectAltName fields were found") diff --git a/micromamba_root/Lib/site-packages/urllib3/util/ssltransport.py b/micromamba_root/Lib/site-packages/urllib3/util/ssltransport.py new file mode 100644 index 0000000000000000000000000000000000000000..6d59bc3bce2489c3a0aa5bcb83b737dcf33c033b --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/ssltransport.py @@ -0,0 +1,271 @@ +from __future__ import annotations + +import io +import socket +import ssl +import typing + +from ..exceptions import ProxySchemeUnsupported + +if typing.TYPE_CHECKING: + from typing_extensions import Self + + from .ssl_ import _TYPE_PEER_CERT_RET, _TYPE_PEER_CERT_RET_DICT + + +_WriteBuffer = typing.Union[bytearray, memoryview] +_ReturnValue = typing.TypeVar("_ReturnValue") + +SSL_BLOCKSIZE = 16384 + + +class SSLTransport: + """ + The SSLTransport wraps an existing socket and establishes an SSL connection. + + Contrary to Python's implementation of SSLSocket, it allows you to chain + multiple TLS connections together. It's particularly useful if you need to + implement TLS within TLS. + + The class supports most of the socket API operations. + """ + + @staticmethod + def _validate_ssl_context_for_tls_in_tls(ssl_context: ssl.SSLContext) -> None: + """ + Raises a ProxySchemeUnsupported if the provided ssl_context can't be used + for TLS in TLS. + + The only requirement is that the ssl_context provides the 'wrap_bio' + methods. + """ + + if not hasattr(ssl_context, "wrap_bio"): + raise ProxySchemeUnsupported( + "TLS in TLS requires SSLContext.wrap_bio() which isn't " + "available on non-native SSLContext" + ) + + def __init__( + self, + socket: socket.socket, + ssl_context: ssl.SSLContext, + server_hostname: str | None = None, + suppress_ragged_eofs: bool = True, + ) -> None: + """ + Create an SSLTransport around socket using the provided ssl_context. + """ + self.incoming = ssl.MemoryBIO() + self.outgoing = ssl.MemoryBIO() + + self.suppress_ragged_eofs = suppress_ragged_eofs + self.socket = socket + + self.sslobj = ssl_context.wrap_bio( + self.incoming, self.outgoing, server_hostname=server_hostname + ) + + # Perform initial handshake. + self._ssl_io_loop(self.sslobj.do_handshake) + + def __enter__(self) -> Self: + return self + + def __exit__(self, *_: typing.Any) -> None: + self.close() + + def fileno(self) -> int: + return self.socket.fileno() + + def read(self, len: int = 1024, buffer: typing.Any | None = None) -> int | bytes: + return self._wrap_ssl_read(len, buffer) + + def recv(self, buflen: int = 1024, flags: int = 0) -> int | bytes: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to recv") + return self._wrap_ssl_read(buflen) + + def recv_into( + self, + buffer: _WriteBuffer, + nbytes: int | None = None, + flags: int = 0, + ) -> None | int | bytes: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to recv_into") + if nbytes is None: + nbytes = len(buffer) + return self.read(nbytes, buffer) + + def sendall(self, data: bytes, flags: int = 0) -> None: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to sendall") + count = 0 + with memoryview(data) as view, view.cast("B") as byte_view: + amount = len(byte_view) + while count < amount: + v = self.send(byte_view[count:]) + count += v + + def send(self, data: bytes, flags: int = 0) -> int: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to send") + return self._ssl_io_loop(self.sslobj.write, data) + + def makefile( + self, + mode: str, + buffering: int | None = None, + *, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + ) -> typing.BinaryIO | typing.TextIO | socket.SocketIO: + """ + Python's httpclient uses makefile and buffered io when reading HTTP + messages and we need to support it. + + This is unfortunately a copy and paste of socket.py makefile with small + changes to point to the socket directly. + """ + if not set(mode) <= {"r", "w", "b"}: + raise ValueError(f"invalid mode {mode!r} (only r, w, b allowed)") + + writing = "w" in mode + reading = "r" in mode or not writing + assert reading or writing + binary = "b" in mode + rawmode = "" + if reading: + rawmode += "r" + if writing: + rawmode += "w" + raw = socket.SocketIO(self, rawmode) # type: ignore[arg-type] + self.socket._io_refs += 1 # type: ignore[attr-defined] + if buffering is None: + buffering = -1 + if buffering < 0: + buffering = io.DEFAULT_BUFFER_SIZE + if buffering == 0: + if not binary: + raise ValueError("unbuffered streams must be binary") + return raw + buffer: typing.BinaryIO + if reading and writing: + buffer = io.BufferedRWPair(raw, raw, buffering) # type: ignore[assignment] + elif reading: + buffer = io.BufferedReader(raw, buffering) + else: + assert writing + buffer = io.BufferedWriter(raw, buffering) + if binary: + return buffer + text = io.TextIOWrapper(buffer, encoding, errors, newline) + text.mode = mode # type: ignore[misc] + return text + + def unwrap(self) -> None: + self._ssl_io_loop(self.sslobj.unwrap) + + def close(self) -> None: + self.socket.close() + + @typing.overload + def getpeercert( + self, binary_form: typing.Literal[False] = ... + ) -> _TYPE_PEER_CERT_RET_DICT | None: ... + + @typing.overload + def getpeercert(self, binary_form: typing.Literal[True]) -> bytes | None: ... + + def getpeercert(self, binary_form: bool = False) -> _TYPE_PEER_CERT_RET: + return self.sslobj.getpeercert(binary_form) # type: ignore[return-value] + + def version(self) -> str | None: + return self.sslobj.version() + + def cipher(self) -> tuple[str, str, int] | None: + return self.sslobj.cipher() + + def selected_alpn_protocol(self) -> str | None: + return self.sslobj.selected_alpn_protocol() + + def shared_ciphers(self) -> list[tuple[str, str, int]] | None: + return self.sslobj.shared_ciphers() + + def compression(self) -> str | None: + return self.sslobj.compression() + + def settimeout(self, value: float | None) -> None: + self.socket.settimeout(value) + + def gettimeout(self) -> float | None: + return self.socket.gettimeout() + + def _decref_socketios(self) -> None: + self.socket._decref_socketios() # type: ignore[attr-defined] + + def _wrap_ssl_read(self, len: int, buffer: bytearray | None = None) -> int | bytes: + try: + return self._ssl_io_loop(self.sslobj.read, len, buffer) + except ssl.SSLError as e: + if e.errno == ssl.SSL_ERROR_EOF and self.suppress_ragged_eofs: + return 0 # eof, return 0. + else: + raise + + # func is sslobj.do_handshake or sslobj.unwrap + @typing.overload + def _ssl_io_loop(self, func: typing.Callable[[], None]) -> None: ... + + # func is sslobj.write, arg1 is data + @typing.overload + def _ssl_io_loop(self, func: typing.Callable[[bytes], int], arg1: bytes) -> int: ... + + # func is sslobj.read, arg1 is len, arg2 is buffer + @typing.overload + def _ssl_io_loop( + self, + func: typing.Callable[[int, bytearray | None], bytes], + arg1: int, + arg2: bytearray | None, + ) -> bytes: ... + + def _ssl_io_loop( + self, + func: typing.Callable[..., _ReturnValue], + arg1: None | bytes | int = None, + arg2: bytearray | None = None, + ) -> _ReturnValue: + """Performs an I/O loop between incoming/outgoing and the socket.""" + should_loop = True + ret = None + + while should_loop: + errno = None + try: + if arg1 is None and arg2 is None: + ret = func() + elif arg2 is None: + ret = func(arg1) + else: + ret = func(arg1, arg2) + except ssl.SSLError as e: + if e.errno not in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE): + # WANT_READ, and WANT_WRITE are expected, others are not. + raise e + errno = e.errno + + buf = self.outgoing.read() + self.socket.sendall(buf) + + if errno is None: + should_loop = False + elif errno == ssl.SSL_ERROR_WANT_READ: + buf = self.socket.recv(SSL_BLOCKSIZE) + if buf: + self.incoming.write(buf) + else: + self.incoming.write_eof() + return typing.cast(_ReturnValue, ret) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/timeout.py b/micromamba_root/Lib/site-packages/urllib3/util/timeout.py new file mode 100644 index 0000000000000000000000000000000000000000..4bb1be11d9cb06900dd82ecebd06aa6a7c5de916 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/timeout.py @@ -0,0 +1,275 @@ +from __future__ import annotations + +import time +import typing +from enum import Enum +from socket import getdefaulttimeout + +from ..exceptions import TimeoutStateError + +if typing.TYPE_CHECKING: + from typing import Final + + +class _TYPE_DEFAULT(Enum): + # This value should never be passed to socket.settimeout() so for safety we use a -1. + # socket.settimout() raises a ValueError for negative values. + token = -1 + + +_DEFAULT_TIMEOUT: Final[_TYPE_DEFAULT] = _TYPE_DEFAULT.token + +_TYPE_TIMEOUT = typing.Optional[typing.Union[float, _TYPE_DEFAULT]] + + +class Timeout: + """Timeout configuration. + + Timeouts can be defined as a default for a pool: + + .. code-block:: python + + import urllib3 + + timeout = urllib3.util.Timeout(connect=2.0, read=7.0) + + http = urllib3.PoolManager(timeout=timeout) + + resp = http.request("GET", "https://example.com/") + + print(resp.status) + + Or per-request (which overrides the default for the pool): + + .. code-block:: python + + response = http.request("GET", "https://example.com/", timeout=Timeout(10)) + + Timeouts can be disabled by setting all the parameters to ``None``: + + .. code-block:: python + + no_timeout = Timeout(connect=None, read=None) + response = http.request("GET", "https://example.com/", timeout=no_timeout) + + + :param total: + This combines the connect and read timeouts into one; the read timeout + will be set to the time leftover from the connect attempt. In the + event that both a connect timeout and a total are specified, or a read + timeout and a total are specified, the shorter timeout will be applied. + + Defaults to None. + + :type total: int, float, or None + + :param connect: + The maximum amount of time (in seconds) to wait for a connection + attempt to a server to succeed. Omitting the parameter will default the + connect timeout to the system default, probably `the global default + timeout in socket.py + <http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`_. + None will set an infinite timeout for connection attempts. + + :type connect: int, float, or None + + :param read: + The maximum amount of time (in seconds) to wait between consecutive + read operations for a response from the server. Omitting the parameter + will default the read timeout to the system default, probably `the + global default timeout in socket.py + <http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`_. + None will set an infinite timeout. + + :type read: int, float, or None + + .. note:: + + Many factors can affect the total amount of time for urllib3 to return + an HTTP response. + + For example, Python's DNS resolver does not obey the timeout specified + on the socket. Other factors that can affect total request time include + high CPU load, high swap, the program running at a low priority level, + or other behaviors. + + In addition, the read and total timeouts only measure the time between + read operations on the socket connecting the client and the server, + not the total amount of time for the request to return a complete + response. For most requests, the timeout is raised because the server + has not sent the first byte in the specified time. This is not always + the case; if a server streams one byte every fifteen seconds, a timeout + of 20 seconds will not trigger, even though the request will take + several minutes to complete. + """ + + #: A sentinel object representing the default timeout value + DEFAULT_TIMEOUT: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT + + def __init__( + self, + total: _TYPE_TIMEOUT = None, + connect: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + read: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, + ) -> None: + self._connect = self._validate_timeout(connect, "connect") + self._read = self._validate_timeout(read, "read") + self.total = self._validate_timeout(total, "total") + self._start_connect: float | None = None + + def __repr__(self) -> str: + return f"{type(self).__name__}(connect={self._connect!r}, read={self._read!r}, total={self.total!r})" + + # __str__ provided for backwards compatibility + __str__ = __repr__ + + @staticmethod + def resolve_default_timeout(timeout: _TYPE_TIMEOUT) -> float | None: + return getdefaulttimeout() if timeout is _DEFAULT_TIMEOUT else timeout + + @classmethod + def _validate_timeout(cls, value: _TYPE_TIMEOUT, name: str) -> _TYPE_TIMEOUT: + """Check that a timeout attribute is valid. + + :param value: The timeout value to validate + :param name: The name of the timeout attribute to validate. This is + used to specify in error messages. + :return: The validated and casted version of the given value. + :raises ValueError: If it is a numeric value less than or equal to + zero, or the type is not an integer, float, or None. + """ + if value is None or value is _DEFAULT_TIMEOUT: + return value + + if isinstance(value, bool): + raise ValueError( + "Timeout cannot be a boolean value. It must " + "be an int, float or None." + ) + try: + float(value) + except (TypeError, ValueError): + raise ValueError( + "Timeout value %s was %s, but it must be an " + "int, float or None." % (name, value) + ) from None + + try: + if value <= 0: + raise ValueError( + "Attempted to set %s timeout to %s, but the " + "timeout cannot be set to a value less " + "than or equal to 0." % (name, value) + ) + except TypeError: + raise ValueError( + "Timeout value %s was %s, but it must be an " + "int, float or None." % (name, value) + ) from None + + return value + + @classmethod + def from_float(cls, timeout: _TYPE_TIMEOUT) -> Timeout: + """Create a new Timeout from a legacy timeout value. + + The timeout value used by httplib.py sets the same timeout on the + connect(), and recv() socket requests. This creates a :class:`Timeout` + object that sets the individual timeouts to the ``timeout`` value + passed to this function. + + :param timeout: The legacy timeout value. + :type timeout: integer, float, :attr:`urllib3.util.Timeout.DEFAULT_TIMEOUT`, or None + :return: Timeout object + :rtype: :class:`Timeout` + """ + return Timeout(read=timeout, connect=timeout) + + def clone(self) -> Timeout: + """Create a copy of the timeout object + + Timeout properties are stored per-pool but each request needs a fresh + Timeout object to ensure each one has its own start/stop configured. + + :return: a copy of the timeout object + :rtype: :class:`Timeout` + """ + # We can't use copy.deepcopy because that will also create a new object + # for _GLOBAL_DEFAULT_TIMEOUT, which socket.py uses as a sentinel to + # detect the user default. + return Timeout(connect=self._connect, read=self._read, total=self.total) + + def start_connect(self) -> float: + """Start the timeout clock, used during a connect() attempt + + :raises urllib3.exceptions.TimeoutStateError: if you attempt + to start a timer that has been started already. + """ + if self._start_connect is not None: + raise TimeoutStateError("Timeout timer has already been started.") + self._start_connect = time.monotonic() + return self._start_connect + + def get_connect_duration(self) -> float: + """Gets the time elapsed since the call to :meth:`start_connect`. + + :return: Elapsed time in seconds. + :rtype: float + :raises urllib3.exceptions.TimeoutStateError: if you attempt + to get duration for a timer that hasn't been started. + """ + if self._start_connect is None: + raise TimeoutStateError( + "Can't get connect duration for timer that has not started." + ) + return time.monotonic() - self._start_connect + + @property + def connect_timeout(self) -> _TYPE_TIMEOUT: + """Get the value to use when setting a connection timeout. + + This will be a positive float or integer, the value None + (never timeout), or the default system timeout. + + :return: Connect timeout. + :rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None + """ + if self.total is None: + return self._connect + + if self._connect is None or self._connect is _DEFAULT_TIMEOUT: + return self.total + + return min(self._connect, self.total) # type: ignore[type-var] + + @property + def read_timeout(self) -> float | None: + """Get the value for the read timeout. + + This assumes some time has elapsed in the connection timeout and + computes the read timeout appropriately. + + If self.total is set, the read timeout is dependent on the amount of + time taken by the connect timeout. If the connection time has not been + established, a :exc:`~urllib3.exceptions.TimeoutStateError` will be + raised. + + :return: Value to use for the read timeout. + :rtype: int, float or None + :raises urllib3.exceptions.TimeoutStateError: If :meth:`start_connect` + has not yet been called on this object. + """ + if ( + self.total is not None + and self.total is not _DEFAULT_TIMEOUT + and self._read is not None + and self._read is not _DEFAULT_TIMEOUT + ): + # In case the connect timeout has not yet been established. + if self._start_connect is None: + return self._read + return max(0, min(self.total - self.get_connect_duration(), self._read)) + elif self.total is not None and self.total is not _DEFAULT_TIMEOUT: + return max(0, self.total - self.get_connect_duration()) + else: + return self.resolve_default_timeout(self._read) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/url.py b/micromamba_root/Lib/site-packages/urllib3/util/url.py new file mode 100644 index 0000000000000000000000000000000000000000..db057f17be610174f30928748b5004dcbf6c501c --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/url.py @@ -0,0 +1,469 @@ +from __future__ import annotations + +import re +import typing + +from ..exceptions import LocationParseError +from .util import to_str + +# We only want to normalize urls with an HTTP(S) scheme. +# urllib3 infers URLs without a scheme (None) to be http. +_NORMALIZABLE_SCHEMES = ("http", "https", None) + +# Almost all of these patterns were derived from the +# 'rfc3986' module: https://github.com/python-hyper/rfc3986 +_PERCENT_RE = re.compile(r"%[a-fA-F0-9]{2}") +_SCHEME_RE = re.compile(r"^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)") +_URI_RE = re.compile( + r"^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?" + r"(?://([^\\/?#]*))?" + r"([^?#]*)" + r"(?:\?([^#]*))?" + r"(?:#(.*))?$", + re.UNICODE | re.DOTALL, +) + +_IPV4_PAT = r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}" +_HEX_PAT = "[0-9A-Fa-f]{1,4}" +_LS32_PAT = "(?:{hex}:{hex}|{ipv4})".format(hex=_HEX_PAT, ipv4=_IPV4_PAT) +_subs = {"hex": _HEX_PAT, "ls32": _LS32_PAT} +_variations = [ + # 6( h16 ":" ) ls32 + "(?:%(hex)s:){6}%(ls32)s", + # "::" 5( h16 ":" ) ls32 + "::(?:%(hex)s:){5}%(ls32)s", + # [ h16 ] "::" 4( h16 ":" ) ls32 + "(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)s", + # [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + "(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)s", + # [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + "(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)s", + # [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + "(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)s", + # [ *4( h16 ":" ) h16 ] "::" ls32 + "(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)s", + # [ *5( h16 ":" ) h16 ] "::" h16 + "(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)s", + # [ *6( h16 ":" ) h16 ] "::" + "(?:(?:%(hex)s:){0,6}%(hex)s)?::", +] + +_UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~" +_IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")" +_ZONE_ID_PAT = "(?:%25|%)(?:[" + _UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+" +_IPV6_ADDRZ_PAT = r"\[" + _IPV6_PAT + r"(?:" + _ZONE_ID_PAT + r")?\]" +_REG_NAME_PAT = r"(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*" +_TARGET_RE = re.compile(r"^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$") + +_IPV4_RE = re.compile("^" + _IPV4_PAT + "$") +_IPV6_RE = re.compile("^" + _IPV6_PAT + "$") +_IPV6_ADDRZ_RE = re.compile("^" + _IPV6_ADDRZ_PAT + "$") +_BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + _IPV6_ADDRZ_PAT[2:-2] + "$") +_ZONE_ID_RE = re.compile("(" + _ZONE_ID_PAT + r")\]$") + +_HOST_PORT_PAT = ("^(%s|%s|%s)(?::0*?(|0|[1-9][0-9]{0,4}))?$") % ( + _REG_NAME_PAT, + _IPV4_PAT, + _IPV6_ADDRZ_PAT, +) +_HOST_PORT_RE = re.compile(_HOST_PORT_PAT, re.UNICODE | re.DOTALL) + +_UNRESERVED_CHARS = set( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~" +) +_SUB_DELIM_CHARS = set("!$&'()*+,;=") +_USERINFO_CHARS = _UNRESERVED_CHARS | _SUB_DELIM_CHARS | {":"} +_PATH_CHARS = _USERINFO_CHARS | {"@", "/"} +_QUERY_CHARS = _FRAGMENT_CHARS = _PATH_CHARS | {"?"} + + +class Url( + typing.NamedTuple( + "Url", + [ + ("scheme", typing.Optional[str]), + ("auth", typing.Optional[str]), + ("host", typing.Optional[str]), + ("port", typing.Optional[int]), + ("path", typing.Optional[str]), + ("query", typing.Optional[str]), + ("fragment", typing.Optional[str]), + ], + ) +): + """ + Data structure for representing an HTTP URL. Used as a return value for + :func:`parse_url`. Both the scheme and host are normalized as they are + both case-insensitive according to RFC 3986. + """ + + def __new__( # type: ignore[no-untyped-def] + cls, + scheme: str | None = None, + auth: str | None = None, + host: str | None = None, + port: int | None = None, + path: str | None = None, + query: str | None = None, + fragment: str | None = None, + ): + if path and not path.startswith("/"): + path = "/" + path + if scheme is not None: + scheme = scheme.lower() + return super().__new__(cls, scheme, auth, host, port, path, query, fragment) + + @property + def hostname(self) -> str | None: + """For backwards-compatibility with urlparse. We're nice like that.""" + return self.host + + @property + def request_uri(self) -> str: + """Absolute path including the query string.""" + uri = self.path or "/" + + if self.query is not None: + uri += "?" + self.query + + return uri + + @property + def authority(self) -> str | None: + """ + Authority component as defined in RFC 3986 3.2. + This includes userinfo (auth), host and port. + + i.e. + userinfo@host:port + """ + userinfo = self.auth + netloc = self.netloc + if netloc is None or userinfo is None: + return netloc + else: + return f"{userinfo}@{netloc}" + + @property + def netloc(self) -> str | None: + """ + Network location including host and port. + + If you need the equivalent of urllib.parse's ``netloc``, + use the ``authority`` property instead. + """ + if self.host is None: + return None + if self.port: + return f"{self.host}:{self.port}" + return self.host + + @property + def url(self) -> str: + """ + Convert self into a url + + This function should more or less round-trip with :func:`.parse_url`. The + returned url may not be exactly the same as the url inputted to + :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls + with a blank port will have : removed). + + Example: + + .. code-block:: python + + import urllib3 + + U = urllib3.util.parse_url("https://google.com/mail/") + + print(U.url) + # "https://google.com/mail/" + + print( urllib3.util.Url("https", "username:password", + "host.com", 80, "/path", "query", "fragment" + ).url + ) + # "https://username:password@host.com:80/path?query#fragment" + """ + scheme, auth, host, port, path, query, fragment = self + url = "" + + # We use "is not None" we want things to happen with empty strings (or 0 port) + if scheme is not None: + url += scheme + "://" + if auth is not None: + url += auth + "@" + if host is not None: + url += host + if port is not None: + url += ":" + str(port) + if path is not None: + url += path + if query is not None: + url += "?" + query + if fragment is not None: + url += "#" + fragment + + return url + + def __str__(self) -> str: + return self.url + + +@typing.overload +def _encode_invalid_chars( + component: str, allowed_chars: typing.Container[str] +) -> str: # Abstract + ... + + +@typing.overload +def _encode_invalid_chars( + component: None, allowed_chars: typing.Container[str] +) -> None: # Abstract + ... + + +def _encode_invalid_chars( + component: str | None, allowed_chars: typing.Container[str] +) -> str | None: + """Percent-encodes a URI component without reapplying + onto an already percent-encoded component. + """ + if component is None: + return component + + component = to_str(component) + + # Normalize existing percent-encoded bytes. + # Try to see if the component we're encoding is already percent-encoded + # so we can skip all '%' characters but still encode all others. + component, percent_encodings = _PERCENT_RE.subn( + lambda match: match.group(0).upper(), component + ) + + uri_bytes = component.encode("utf-8", "surrogatepass") + is_percent_encoded = percent_encodings == uri_bytes.count(b"%") + encoded_component = bytearray() + + for i in range(0, len(uri_bytes)): + # Will return a single character bytestring + byte = uri_bytes[i : i + 1] + byte_ord = ord(byte) + if (is_percent_encoded and byte == b"%") or ( + byte_ord < 128 and byte.decode() in allowed_chars + ): + encoded_component += byte + continue + encoded_component.extend(b"%" + (hex(byte_ord)[2:].encode().zfill(2).upper())) + + return encoded_component.decode() + + +def _remove_path_dot_segments(path: str) -> str: + # See http://tools.ietf.org/html/rfc3986#section-5.2.4 for pseudo-code + segments = path.split("/") # Turn the path into a list of segments + output = [] # Initialize the variable to use to store output + + for segment in segments: + # '.' is the current directory, so ignore it, it is superfluous + if segment == ".": + continue + # Anything other than '..', should be appended to the output + if segment != "..": + output.append(segment) + # In this case segment == '..', if we can, we should pop the last + # element + elif output: + output.pop() + + # If the path starts with '/' and the output is empty or the first string + # is non-empty + if path.startswith("/") and (not output or output[0]): + output.insert(0, "") + + # If the path starts with '/.' or '/..' ensure we add one more empty + # string to add a trailing '/' + if path.endswith(("/.", "/..")): + output.append("") + + return "/".join(output) + + +@typing.overload +def _normalize_host(host: None, scheme: str | None) -> None: ... + + +@typing.overload +def _normalize_host(host: str, scheme: str | None) -> str: ... + + +def _normalize_host(host: str | None, scheme: str | None) -> str | None: + if host: + if scheme in _NORMALIZABLE_SCHEMES: + is_ipv6 = _IPV6_ADDRZ_RE.match(host) + if is_ipv6: + # IPv6 hosts of the form 'a::b%zone' are encoded in a URL as + # such per RFC 6874: 'a::b%25zone'. Unquote the ZoneID + # separator as necessary to return a valid RFC 4007 scoped IP. + match = _ZONE_ID_RE.search(host) + if match: + start, end = match.span(1) + zone_id = host[start:end] + + if zone_id.startswith("%25") and zone_id != "%25": + zone_id = zone_id[3:] + else: + zone_id = zone_id[1:] + zone_id = _encode_invalid_chars(zone_id, _UNRESERVED_CHARS) + return f"{host[:start].lower()}%{zone_id}{host[end:]}" + else: + return host.lower() + elif not _IPV4_RE.match(host): + return to_str( + b".".join([_idna_encode(label) for label in host.split(".")]), + "ascii", + ) + return host + + +def _idna_encode(name: str) -> bytes: + if not name.isascii(): + try: + import idna + except ImportError: + raise LocationParseError( + "Unable to parse URL without the 'idna' module" + ) from None + + try: + return idna.encode(name.lower(), strict=True, std3_rules=True) + except idna.IDNAError: + raise LocationParseError( + f"Name '{name}' is not a valid IDNA label" + ) from None + + return name.lower().encode("ascii") + + +def _encode_target(target: str) -> str: + """Percent-encodes a request target so that there are no invalid characters + + Pre-condition for this function is that 'target' must start with '/'. + If that is the case then _TARGET_RE will always produce a match. + """ + match = _TARGET_RE.match(target) + if not match: # Defensive: + raise LocationParseError(f"{target!r} is not a valid request URI") + + path, query = match.groups() + encoded_target = _encode_invalid_chars(path, _PATH_CHARS) + if query is not None: + query = _encode_invalid_chars(query, _QUERY_CHARS) + encoded_target += "?" + query + return encoded_target + + +def parse_url(url: str) -> Url: + """ + Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is + performed to parse incomplete urls. Fields not provided will be None. + This parser is RFC 3986 and RFC 6874 compliant. + + The parser logic and helper functions are based heavily on + work done in the ``rfc3986`` module. + + :param str url: URL to parse into a :class:`.Url` namedtuple. + + Partly backwards-compatible with :mod:`urllib.parse`. + + Example: + + .. code-block:: python + + import urllib3 + + print( urllib3.util.parse_url('http://google.com/mail/')) + # Url(scheme='http', host='google.com', port=None, path='/mail/', ...) + + print( urllib3.util.parse_url('google.com:80')) + # Url(scheme=None, host='google.com', port=80, path=None, ...) + + print( urllib3.util.parse_url('/foo?bar')) + # Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) + """ + if not url: + # Empty + return Url() + + source_url = url + if not _SCHEME_RE.search(url): + url = "//" + url + + scheme: str | None + authority: str | None + auth: str | None + host: str | None + port: str | None + port_int: int | None + path: str | None + query: str | None + fragment: str | None + + try: + scheme, authority, path, query, fragment = _URI_RE.match(url).groups() # type: ignore[union-attr] + normalize_uri = scheme is None or scheme.lower() in _NORMALIZABLE_SCHEMES + + if scheme: + scheme = scheme.lower() + + if authority: + auth, _, host_port = authority.rpartition("@") + auth = auth or None + host, port = _HOST_PORT_RE.match(host_port).groups() # type: ignore[union-attr] + if auth and normalize_uri: + auth = _encode_invalid_chars(auth, _USERINFO_CHARS) + if port == "": + port = None + else: + auth, host, port = None, None, None + + if port is not None: + port_int = int(port) + if not (0 <= port_int <= 65535): + raise LocationParseError(url) + else: + port_int = None + + host = _normalize_host(host, scheme) + + if normalize_uri and path: + path = _remove_path_dot_segments(path) + path = _encode_invalid_chars(path, _PATH_CHARS) + if normalize_uri and query: + query = _encode_invalid_chars(query, _QUERY_CHARS) + if normalize_uri and fragment: + fragment = _encode_invalid_chars(fragment, _FRAGMENT_CHARS) + + except (ValueError, AttributeError) as e: + raise LocationParseError(source_url) from e + + # For the sake of backwards compatibility we put empty + # string values for path if there are any defined values + # beyond the path in the URL. + # TODO: Remove this when we break backwards compatibility. + if not path: + if query is not None or fragment is not None: + path = "" + else: + path = None + + return Url( + scheme=scheme, + auth=auth, + host=host, + port=port_int, + path=path, + query=query, + fragment=fragment, + ) diff --git a/micromamba_root/Lib/site-packages/urllib3/util/util.py b/micromamba_root/Lib/site-packages/urllib3/util/util.py new file mode 100644 index 0000000000000000000000000000000000000000..35c77e4025842f548565334a3c04cba90f9283d6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/util.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +import typing +from types import TracebackType + + +def to_bytes( + x: str | bytes, encoding: str | None = None, errors: str | None = None +) -> bytes: + if isinstance(x, bytes): + return x + elif not isinstance(x, str): + raise TypeError(f"not expecting type {type(x).__name__}") + if encoding or errors: + return x.encode(encoding or "utf-8", errors=errors or "strict") + return x.encode() + + +def to_str( + x: str | bytes, encoding: str | None = None, errors: str | None = None +) -> str: + if isinstance(x, str): + return x + elif not isinstance(x, bytes): + raise TypeError(f"not expecting type {type(x).__name__}") + if encoding or errors: + return x.decode(encoding or "utf-8", errors=errors or "strict") + return x.decode() + + +def reraise( + tp: type[BaseException] | None, + value: BaseException, + tb: TracebackType | None = None, +) -> typing.NoReturn: + try: + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + finally: + value = None # type: ignore[assignment] + tb = None diff --git a/micromamba_root/Lib/site-packages/urllib3/util/wait.py b/micromamba_root/Lib/site-packages/urllib3/util/wait.py new file mode 100644 index 0000000000000000000000000000000000000000..aeca0c7ad5b232eeb1ad9c43d315bd1d74eaed9a --- /dev/null +++ b/micromamba_root/Lib/site-packages/urllib3/util/wait.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +import select +import socket +from functools import partial + +__all__ = ["wait_for_read", "wait_for_write"] + + +# How should we wait on sockets? +# +# There are two types of APIs you can use for waiting on sockets: the fancy +# modern stateful APIs like epoll/kqueue, and the older stateless APIs like +# select/poll. The stateful APIs are more efficient when you have a lots of +# sockets to keep track of, because you can set them up once and then use them +# lots of times. But we only ever want to wait on a single socket at a time +# and don't want to keep track of state, so the stateless APIs are actually +# more efficient. So we want to use select() or poll(). +# +# Now, how do we choose between select() and poll()? On traditional Unixes, +# select() has a strange calling convention that makes it slow, or fail +# altogether, for high-numbered file descriptors. The point of poll() is to fix +# that, so on Unixes, we prefer poll(). +# +# On Windows, there is no poll() (or at least Python doesn't provide a wrapper +# for it), but that's OK, because on Windows, select() doesn't have this +# strange calling convention; plain select() works fine. +# +# So: on Windows we use select(), and everywhere else we use poll(). We also +# fall back to select() in case poll() is somehow broken or missing. + + +def select_wait_for_socket( + sock: socket.socket, + read: bool = False, + write: bool = False, + timeout: float | None = None, +) -> bool: + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + rcheck = [] + wcheck = [] + if read: + rcheck.append(sock) + if write: + wcheck.append(sock) + # When doing a non-blocking connect, most systems signal success by + # marking the socket writable. Windows, though, signals success by marked + # it as "exceptional". We paper over the difference by checking the write + # sockets for both conditions. (The stdlib selectors module does the same + # thing.) + fn = partial(select.select, rcheck, wcheck, wcheck) + rready, wready, xready = fn(timeout) + return bool(rready or wready or xready) + + +def poll_wait_for_socket( + sock: socket.socket, + read: bool = False, + write: bool = False, + timeout: float | None = None, +) -> bool: + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + mask = 0 + if read: + mask |= select.POLLIN + if write: + mask |= select.POLLOUT + poll_obj = select.poll() + poll_obj.register(sock, mask) + + # For some reason, poll() takes timeout in milliseconds + def do_poll(t: float | None) -> list[tuple[int, int]]: + if t is not None: + t *= 1000 + return poll_obj.poll(t) + + return bool(do_poll(timeout)) + + +def _have_working_poll() -> bool: + # Apparently some systems have a select.poll that fails as soon as you try + # to use it, either due to strange configuration or broken monkeypatching + # from libraries like eventlet/greenlet. + try: + poll_obj = select.poll() + poll_obj.poll(0) + except (AttributeError, OSError): + return False + else: + return True + + +def wait_for_socket( + sock: socket.socket, + read: bool = False, + write: bool = False, + timeout: float | None = None, +) -> bool: + # We delay choosing which implementation to use until the first time we're + # called. We could do it at import time, but then we might make the wrong + # decision if someone goes wild with monkeypatching select.poll after + # we're imported. + global wait_for_socket + if _have_working_poll(): + wait_for_socket = poll_wait_for_socket + elif hasattr(select, "select"): + wait_for_socket = select_wait_for_socket + return wait_for_socket(sock, read, write, timeout) + + +def wait_for_read(sock: socket.socket, timeout: float | None = None) -> bool: + """Waits for reading to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, read=True, timeout=timeout) + + +def wait_for_write(sock: socket.socket, timeout: float | None = None) -> bool: + """Waits for writing to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, write=True, timeout=timeout) diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..b7306a2c174d6160f5b2a0dde6d78bfb57fe2b6a --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/METADATA @@ -0,0 +1,890 @@ +Metadata-Version: 2.4 +Name: watchdog +Version: 6.0.0 +Summary: Filesystem events monitoring +Home-page: https://github.com/gorakhargosh/watchdog +Author: Mickaël Schoentgen +Author-email: contact@tiger-222.fr +License: Apache-2.0 +Project-URL: Documentation, https://python-watchdog.readthedocs.io/en/stable/ +Project-URL: Source, https://github.com/gorakhargosh/watchdog/ +Project-URL: Issues, https://github.com/gorakhargosh/watchdog/issues +Project-URL: Changelog, https://github.com/gorakhargosh/watchdog/blob/master/changelog.rst +Keywords: python filesystem monitoring monitor FSEvents kqueue inotify ReadDirectoryChangesW polling DirectorySnapshot +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Natural Language :: English +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX :: BSD +Classifier: Operating System :: Microsoft :: Windows :: Windows Vista +Classifier: Operating System :: Microsoft :: Windows :: Windows 7 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1 +Classifier: Operating System :: Microsoft :: Windows :: Windows 10 +Classifier: Operating System :: Microsoft :: Windows :: Windows 11 +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Programming Language :: C +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: System :: Monitoring +Classifier: Topic :: System :: Filesystems +Classifier: Topic :: Utilities +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst +License-File: LICENSE +License-File: COPYING +License-File: AUTHORS +Provides-Extra: watchmedo +Requires-Dist: PyYAML>=3.10; extra == "watchmedo" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: license-file +Dynamic: provides-extra +Dynamic: requires-python +Dynamic: summary + +Watchdog +======== + +|PyPI Version| +|PyPI Status| +|PyPI Python Versions| +|GitHub Build Status| +|GitHub License| + +Python API and shell utilities to monitor file system events. + +Works on 3.9+. + +Example API Usage +----------------- + +A simple program that uses watchdog to monitor directories specified +as command-line arguments and logs events generated: + +.. code-block:: python + + import time + + from watchdog.events import FileSystemEvent, FileSystemEventHandler + from watchdog.observers import Observer + + + class MyEventHandler(FileSystemEventHandler): + def on_any_event(self, event: FileSystemEvent) -> None: + print(event) + + + event_handler = MyEventHandler() + observer = Observer() + observer.schedule(event_handler, ".", recursive=True) + observer.start() + try: + while True: + time.sleep(1) + finally: + observer.stop() + observer.join() + + +Shell Utilities +--------------- + +Watchdog comes with an *optional* utility script called ``watchmedo``. +Please type ``watchmedo --help`` at the shell prompt to +know more about this tool. + +Here is how you can log the current directory recursively +for events related only to ``*.py`` and ``*.txt`` files while +ignoring all directory events: + +.. code-block:: bash + + watchmedo log \ + --patterns='*.py;*.txt' \ + --ignore-directories \ + --recursive \ + --verbose \ + . + +You can use the ``shell-command`` subcommand to execute shell commands in +response to events: + +.. code-block:: bash + + watchmedo shell-command \ + --patterns='*.py;*.txt' \ + --recursive \ + --command='echo "${watch_src_path}"' \ + . + +Please see the help information for these commands by typing: + +.. code-block:: bash + + watchmedo [command] --help + + +About ``watchmedo`` Tricks +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``watchmedo`` can read ``tricks.yaml`` files and execute tricks within them in +response to file system events. Tricks are actually event handlers that +subclass ``watchdog.tricks.Trick`` and are written by plugin authors. Trick +classes are augmented with a few additional features that regular event handlers +don't need. + +An example ``tricks.yaml`` file: + +.. code-block:: yaml + + tricks: + - watchdog.tricks.LoggerTrick: + patterns: ["*.py", "*.js"] + - watchmedo_webtricks.GoogleClosureTrick: + patterns: ['*.js'] + hash_names: true + mappings_format: json # json|yaml|python + mappings_module: app/javascript_mappings + suffix: .min.js + compilation_level: advanced # simple|advanced + source_directory: app/static/js/ + destination_directory: app/public/js/ + files: + index-page: + - app/static/js/vendor/jquery*.js + - app/static/js/base.js + - app/static/js/index-page.js + about-page: + - app/static/js/vendor/jquery*.js + - app/static/js/base.js + - app/static/js/about-page/**/*.js + +The directory containing the ``tricks.yaml`` file will be monitored. Each trick +class is initialized with its corresponding keys in the ``tricks.yaml`` file as +arguments and events are fed to an instance of this class as they arrive. + +Installation +------------ +Install from PyPI using ``pip``: + +.. code-block:: bash + + $ python -m pip install -U watchdog + + # or to install the watchmedo utility: + $ python -m pip install -U 'watchdog[watchmedo]' + +Install from source: + +.. code-block:: bash + + $ python -m pip install -e . + + # or to install the watchmedo utility: + $ python -m pip install -e '.[watchmedo]' + + +Documentation +------------- + +You can browse the latest release documentation_ online. + +Contribute +---------- + +Fork the `repository`_ on GitHub and send a pull request, or file an issue +ticket at the `issue tracker`_. For general help and questions use +`stackoverflow`_ with tag `python-watchdog`. + +Create and activate your virtual environment, then:: + + python -m pip install tox + python -m tox [-q] [-e ENV] + +If you are making a substantial change, add an entry to the "Unreleased" section +of the `changelog`_. + +Supported Platforms +------------------- + +* Linux 2.6 (inotify) +* macOS (FSEvents, kqueue) +* FreeBSD/BSD (kqueue) +* Windows (ReadDirectoryChangesW with I/O completion ports; + ReadDirectoryChangesW worker threads) +* OS-independent (polling the disk for directory snapshots and comparing them + periodically; slow and not recommended) + +Note that when using watchdog with kqueue, you need the +number of file descriptors allowed to be opened by programs +running on your system to be increased to more than the +number of files that you will be monitoring. The easiest way +to do that is to edit your ``~/.profile`` file and add +a line similar to:: + + ulimit -n 1024 + +This is an inherent problem with kqueue because it uses +file descriptors to monitor files. That plus the enormous +amount of bookkeeping that watchdog needs to do in order +to monitor file descriptors just makes this a painful way +to monitor files and directories. In essence, kqueue is +not a very scalable way to monitor a deeply nested +directory of files and directories with a large number of +files. + +About using watchdog with editors like Vim +------------------------------------------ + +Vim does not modify files unless directed to do so. +It creates backup files and then swaps them in to replace +the files you are editing on the disk. This means that +if you use Vim to edit your files, the on-modified events +for those files will not be triggered by watchdog. +You may need to configure Vim appropriately to disable +this feature. + + +About using watchdog with CIFS +------------------------------ + +When you want to watch changes in CIFS, you need to explicitly tell watchdog to +use ``PollingObserver``, that is, instead of letting watchdog decide an +appropriate observer like in the example above, do:: + + from watchdog.observers.polling import PollingObserver as Observer + + +Dependencies +------------ + +1. Python 3.9 or above. +2. XCode_ (only on macOS when installing from sources) +3. PyYAML_ (only for ``watchmedo``) + +Licensing +--------- + +Watchdog is licensed under the terms of the `Apache License, version 2.0`_. + +- Copyright 2018-2024 Mickaël Schoentgen & contributors +- Copyright 2014-2018 Thomas Amland & contributors +- Copyright 2012-2014 Google, Inc. +- Copyright 2011-2012 Yesudeep Mangalapilly + +Project `source code`_ is available at Github. Please report bugs and file +enhancement requests at the `issue tracker`_. + +Why Watchdog? +------------- + +Too many people tried to do the same thing and none did what I needed Python +to do: + +* pnotify_ +* `unison fsmonitor`_ +* fsmonitor_ +* guard_ +* pyinotify_ +* `inotify-tools`_ +* jnotify_ +* treewatcher_ +* `file.monitor`_ +* pyfilesystem_ + +.. links: +.. _Yesudeep Mangalapilly: yesudeep@gmail.com +.. _source code: https://github.com/gorakhargosh/watchdog +.. _issue tracker: https://github.com/gorakhargosh/watchdog/issues +.. _Apache License, version 2.0: https://www.apache.org/licenses/LICENSE-2.0 +.. _documentation: https://python-watchdog.readthedocs.io/ +.. _stackoverflow: https://stackoverflow.com/questions/tagged/python-watchdog +.. _repository: https://github.com/gorakhargosh/watchdog +.. _issue tracker: https://github.com/gorakhargosh/watchdog/issues +.. _changelog: https://github.com/gorakhargosh/watchdog/blob/master/changelog.rst + +.. _PyYAML: https://www.pyyaml.org/ +.. _XCode: https://developer.apple.com/technologies/tools/xcode.html + +.. _pnotify: http://mark.heily.com/pnotify +.. _unison fsmonitor: https://webdav.seas.upenn.edu/viewvc/unison/trunk/src/fsmonitor.py?view=markup&pathrev=471 +.. _fsmonitor: https://github.com/shaurz/fsmonitor +.. _guard: https://github.com/guard/guard +.. _pyinotify: https://github.com/seb-m/pyinotify +.. _inotify-tools: https://github.com/rvoicilas/inotify-tools +.. _jnotify: http://jnotify.sourceforge.net/ +.. _treewatcher: https://github.com/jbd/treewatcher +.. _file.monitor: https://github.com/pke/file.monitor +.. _pyfilesystem: https://github.com/PyFilesystem/pyfilesystem + +.. |PyPI Version| image:: https://img.shields.io/pypi/v/watchdog.svg + :target: https://pypi.python.org/pypi/watchdog/ +.. |PyPI Status| image:: https://img.shields.io/pypi/status/watchdog.svg + :target: https://pypi.python.org/pypi/watchdog/ +.. |PyPI Python Versions| image:: https://img.shields.io/pypi/pyversions/watchdog.svg + :target: https://pypi.python.org/pypi/watchdog/ +.. |Github Build Status| image:: https://github.com/gorakhargosh/watchdog/workflows/Tests/badge.svg + :target: https://github.com/gorakhargosh/watchdog/actions?query=workflow%3ATests +.. |GitHub License| image:: https://img.shields.io/github/license/gorakhargosh/watchdog.svg + :target: https://github.com/gorakhargosh/watchdog/blob/master/LICENSE + + +.. :changelog: + +Changelog +--------- + +6.0.0 +~~~~~ + +2024-11-01 • `full history <https://github.com/gorakhargosh/watchdog/compare/v5.0.3...v6.0.0>`__ + +- Pin test dependecies. +- [docs] Add typing info to quick start. (`#1082 <https://github.com/gorakhargosh/watchdog/pull/1082>`__) +- [inotify] Use of ``select.poll()`` instead of deprecated ``select.select()``, if available. (`#1078 <https://github.com/gorakhargosh/watchdog/pull/1078>`__) +- [inotify] Fix reading inotify file descriptor after closing it. (`#1081 <https://github.com/gorakhargosh/watchdog/pull/1081>`__) +- [utils] The ``stop_signal`` keyword-argument type of the ``AutoRestartTrick`` class can now be either a ``signal.Signals`` or an ``int``. +- [utils] Added the ``__repr__()`` method to the ``Trick`` class. +- [utils] Removed the unused ``echo_class()`` function from the ``echo`` module. +- [utils] Removed the unused ``echo_instancemethod()`` function from the ``echo`` module. +- [utils] Removed the unused ``echo_module()`` function from the ``echo`` module. +- [utils] Removed the unused ``is_class_private_name()`` function from the ``echo`` module. +- [utils] Removed the unused ``is_classmethod()`` function from the ``echo`` module. +- [utils] Removed the unused ``ic_method(met()`` function from the ``echo`` module. +- [utils] Removed the unused ``method_name()`` function from the ``echo`` module. +- [utils] Removed the unused ``name()`` function from the ``echo`` module. +- [watchmedo] Fixed Mypy issues. +- [watchmedo] Added the ``__repr__()`` method to the ``HelpFormatter`` class. +- [watchmedo] Removed the ``--trace`` CLI argument from the ``watchmedo log`` command, useless since events are logged by default at the ``LoggerTrick`` class level. +- [windows] Fixed Mypy issues. +- Thanks to our beloved contributors: @BoboTiG, @g-pichlern, @ethan-vanderheijden, @nhairs + +5.0.3 +~~~~~ + +2024-09-27 • `full history <https://github.com/gorakhargosh/watchdog/compare/v5.0.2...v5.0.3>`__ + +- [inotify] Improve cleaning up ``Inotify`` threads, and add ``eventlet`` test cases (`#1070 <https://github.com/gorakhargosh/watchdog/pull/1070>`__) +- Thanks to our beloved contributors: @BoboTiG, @ethan-vanderheijden + +5.0.2 +~~~~~ + +2024-09-03 • `full history <https://github.com/gorakhargosh/watchdog/compare/v5.0.1...v5.0.2>`__ + +- Enable OS specific Mypy checks (`#1064 <https://github.com/gorakhargosh/watchdog/pull/1064>`__) +- [watchmedo] Fix ``tricks`` argument type of ``schedule_tricks()`` (`#1063 <https://github.com/gorakhargosh/watchdog/pull/1063>`__) +- Thanks to our beloved contributors: @gnought, @BoboTiG + +5.0.1 +~~~~~ + +2024-09-02 • `full history <https://github.com/gorakhargosh/watchdog/compare/v5.0.0...v5.0.1>`__ + +- [kqueue] Fix ``TypeError: kqueue.control() only accepts positional parameters`` (`#1062 <https://github.com/gorakhargosh/watchdog/pull/1062>`__) +- Thanks to our beloved contributors: @apoirier, @BoboTiG + +5.0.0 +~~~~~ + +2024-08-26 • `full history <https://github.com/gorakhargosh/watchdog/compare/v4.0.2...v5.0.0>`__ + +**Breaking Changes** + +- Drop support for Python 3.8 (`#1055 <https://github.com/gorakhargosh/watchdog/pull/1055>`__) +- [core] Enforced usage of proper keyword-arguments (`#1057 <https://github.com/gorakhargosh/watchdog/pull/1057>`__) +- [core] Renamed the ``BaseObserverSubclassCallable`` class to ``ObserverType`` (`#1055 <https://github.com/gorakhargosh/watchdog/pull/1055>`__) +- [inotify] Renamed the ``inotify_event_struct`` class to ``InotifyEventStruct`` (`#1055 <https://github.com/gorakhargosh/watchdog/pull/1055>`__) +- [inotify] Renamed the ``UnsupportedLibc`` exception to ``UnsupportedLibcError`` (`#1057 <https://github.com/gorakhargosh/watchdog/pull/1057>`__) +- [inotify] Removed the ``InotifyConstants.IN_CLOSE`` constant (`#1046 <https://github.com/gorakhargosh/watchdog/pull/1046>`__) +- [watchmedo] Renamed the ``LogLevelException`` exception to ``LogLevelError`` (`#1057 <https://github.com/gorakhargosh/watchdog/pull/1057>`__) +- [watchmedo] Renamed the ``WatchdogShutdown`` exception to ``WatchdogShutdownError`` (`#1057 <https://github.com/gorakhargosh/watchdog/pull/1057>`__) +- [windows] Renamed the ``FILE_NOTIFY_INFORMATION`` class to ``FileNotifyInformation`` (`#1055 <https://github.com/gorakhargosh/watchdog/pull/1055>`__) +- [windows] Removed the unused ``WATCHDOG_TRAVERSE_MOVED_DIR_DELAY`` constant (`#1057 <https://github.com/gorakhargosh/watchdog/pull/1057>`__) + +**Other Changes** + +- [core] Enable ``disallow_untyped_calls`` Mypy rule (`#1055 <https://github.com/gorakhargosh/watchdog/pull/1055>`__) +- [core] Enable ``disallow_untyped_defs`` Mypy rule (`#1060 <https://github.com/gorakhargosh/watchdog/pull/1060>`__) +- [core] Improve typing references for events (`#1040 <https://github.com/gorakhargosh/watchdog/issues/1040>`__) +- [inotify] Add support for ``IN_CLOSE_NOWRITE`` events. A ``FileClosedNoWriteEvent`` event will be fired, and its ``on_closed_no_write()`` dispatcher has been introduced (`#1046 <https://github.com/gorakhargosh/watchdog/pull/1046>`__) +- Thanks to our beloved contributors: @BoboTiG + +4.0.2 +~~~~~ + +2024-08-11 • `full history <https://github.com/gorakhargosh/watchdog/compare/v4.0.1...v4.0.2>`__ + +- Add support for Python 3.13 (`#1052 <https://github.com/gorakhargosh/watchdog/pull/1052>`__) +- [core] Run ``ruff``, apply several fixes (`#1033 <https://github.com/gorakhargosh/watchdog/pull/1033>`__) +- [core] Remove execution rights from ``events.py`` +- [documentation] Update ``PatternMatchingEventHandler`` docstrings (`#1048 <https://github.com/gorakhargosh/watchdog/pull/1048>`__) +- [documentation] Simplify the quickstart example (`#1047 <https://github.com/gorakhargosh/watchdog/pull/1047>`__) +- [fsevents] Add missing ``event_filter`` keyword-argument to ``FSEventsObserver.schedule()`` (`#1049 <https://github.com/gorakhargosh/watchdog/pull/1049>`__) +- [utils] Fix a possible race condition in ``AutoRestartTrick`` (`#1002 <https://github.com/gorakhargosh/watchdog/pull/1002>`__) +- [watchmedo] Remove execution rights from ``watchmedo.py`` +- Thanks to our beloved contributors: @BoboTiG, @nbelakovski, @ivg + +4.0.1 +~~~~~ + +2024-05-23 • `full history <https://github.com/gorakhargosh/watchdog/compare/v4.0.0...v4.0.1>`__ + +- [inotify] Fix missing ``event_filter`` for the full emitter (`#1032 <https://github.com/gorakhargosh/watchdog/pull/1032>`__) +- Thanks to our beloved contributors: @mraspaud, @BoboTiG + +4.0.0 +~~~~~ + +2024-02-06 • `full history <https://github.com/gorakhargosh/watchdog/compare/v3.0.0...v4.0.0>`__ + +- Drop support for Python 3.7. +- Add support for Python 3.12. +- [snapshot] Add typing to ``dirsnapshot`` (`#1012 <https://github.com/gorakhargosh/watchdog/pull/1012>`__) +- [snapshot] Added ``DirectorySnapshotDiff.ContextManager`` (`#1011 <https://github.com/gorakhargosh/watchdog/pull/1011>`__) +- [events] ``FileSystemEvent``, and subclasses, are now ``dataclass``es, and their ``repr()`` has changed +- [windows] ``WinAPINativeEvent`` is now a ``dataclass``, and its ``repr()`` has changed +- [events] Log ``FileOpenedEvent``, and ``FileClosedEvent``, events in ``LoggingEventHandler`` +- [tests] Improve ``FileSystemEvent`` coverage +- [watchmedo] Log all events in ``LoggerTrick`` +- [windows] The ``observers.read_directory_changes.WATCHDOG_TRAVERSE_MOVED_DIR_DELAY`` hack was removed. The constant will be kept to prevent breaking other softwares. +- Thanks to our beloved contributors: @BoboTiG, @msabramo + +3.0.0 +~~~~~ + +2023-03-20 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.3.1...v3.0.0>`__ + +- Drop support for Python 3.6. +- ``watchdog`` is now PEP 561 compatible, and tested with ``mypy`` +- Fix missing ``>`` in ``FileSystemEvent.__repr__()`` (`#980 <https://github.com/gorakhargosh/watchdog/pull/980>`__) +- [ci] Lots of improvements +- [inotify] Return from ``InotifyEmitter.queue_events()`` if not launched when thread is inactive (`#963 <https://github.com/gorakhargosh/watchdog/pull/963>`__) +- [tests] Stability improvements +- [utils] Remove handling of ``threading.Event.isSet`` spelling (`#962 <https://github.com/gorakhargosh/watchdog/pull/962>`__) +- [watchmedo] Fixed tricks YAML generation (`#965 <https://github.com/gorakhargosh/watchdog/pull/965>`__) +- Thanks to our beloved contributors: @kurtmckee, @altendky, @agroszer, @BoboTiG + +2.3.1 +~~~~~ + +2023-02-28 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.3.0...v2.3.1>`__ + +- Run ``black`` on the entire source code +- Bundle the ``requirements-tests.txt`` file in the source distribution (`#939 <https://github.com/gorakhargosh/watchdog/pull/939>`__) +- [watchmedo] Exclude ``FileOpenedEvent`` events from ``AutoRestartTrick``, and ``ShellCommandTrick``, to restore watchdog < 2.3.0 behavior. A better solution should be found in the future. (`#949 <https://github.com/gorakhargosh/watchdog/pull/949>`__) +- [watchmedo] Log ``FileOpenedEvent``, and ``FileClosedEvent``, events in ``LoggerTrick`` +- Thanks to our beloved contributors: @BoboTiG + +2.3.0 +~~~~~ + +2023-02-23 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.2.1...v2.3.0>`__ + +- [inotify] Add support for ``IN_OPEN`` events: a ``FileOpenedEvent`` event will be fired (`#941 <https://github.com/gorakhargosh/watchdog/pull/941>`__) +- [watchmedo] Add optional event debouncing for ``auto-restart``, only restarting once if many events happen in quick succession (``--debounce-interval``) (`#940 <https://github.com/gorakhargosh/watchdog/pull/940>`__) +- [watchmedo] Exit gracefully on ``KeyboardInterrupt`` exception (Ctrl+C) (`#945 <https://github.com/gorakhargosh/watchdog/pull/945>`__) +- [watchmedo] Add option to not auto-restart the command after it exits (``--no-restart-on-command-exit``) (`#946 <https://github.com/gorakhargosh/watchdog/pull/946>`__) +- Thanks to our beloved contributors: @BoboTiG, @dstaple, @taleinat, @cernekj + +2.2.1 +~~~~~ + +2023-01-01 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.2.0...v2.2.1>`__ + +- Enable ``mypy`` to discover type hints as specified in PEP 561 (`#933 <https://github.com/gorakhargosh/watchdog/pull/933>`__) +- [ci] Set the expected Python version when building release files +- [ci] Update actions versions in use +- [watchmedo] [regression] Fix usage of missing ``signal.SIGHUP`` attribute on non-Unix OSes (`#935 <https://github.com/gorakhargosh/watchdog/pull/935>`__) +- Thanks to our beloved contributors: @BoboTiG, @simon04, @piotrpdev + +2.2.0 +~~~~~ + +2022-12-05 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.9...v2.2.0>`__ + +- [build] Wheels are now available for Python 3.11 (`#932 <https://github.com/gorakhargosh/watchdog/pull/932>`__) +- [documentation] HTML documentation builds are now tested for errors (`#902 <https://github.com/gorakhargosh/watchdog/pull/902>`__) +- [documentation] Fix typos here, and there (`#910 <https://github.com/gorakhargosh/watchdog/pull/910>`__) +- [fsevents2] The ``fsevents2`` observer is now deprecated (`#909 <https://github.com/gorakhargosh/watchdog/pull/909>`__) +- [tests] The error message returned by musl libc for error code ``-1`` is now allowed (`#923 <https://github.com/gorakhargosh/watchdog/pull/923>`__) +- [utils] Remove unnecessary code in ``dirsnapshot.py`` (`#930 <https://github.com/gorakhargosh/watchdog/pull/930>`__) +- [watchmedo] Handle shutdown events from ``SIGHUP`` (`#912 <https://github.com/gorakhargosh/watchdog/pull/912>`__) +- Thanks to our beloved contributors: @kurtmckee, @babymastodon, @QuantumEnergyE, @timgates42, @BoboTiG + +2.1.9 +~~~~~ + +2022-06-10 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.8...v2.1.9>`__ + +- [fsevents] Fix flakey test to assert that there are no errors when stopping the emitter. +- [inotify] Suppress occasional ``OSError: [Errno 9] Bad file descriptor`` at shutdown. (`#805 <https://github.com/gorakhargosh/watchdog/issues/805>`__) +- [watchmedo] Make ``auto-restart`` restart the sub-process if it terminates. (`#896 <https://github.com/gorakhargosh/watchdog/pull/896>`__) +- [watchmedo] Avoid zombie sub-processes when running ``shell-command`` without ``--wait``. (`#405 <https://github.com/gorakhargosh/watchdog/issues/405>`__) +- Thanks to our beloved contributors: @samschott, @taleinat, @altendky, @BoboTiG + +2.1.8 +~~~~~ + +2022-05-15 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.7...v2.1.8>`__ + +- Fix adding failed emitters on observer schedule. (`#872 <https://github.com/gorakhargosh/watchdog/issues/872>`__) +- [inotify] Fix hang when unscheduling watch on a path in an unmounted filesystem. (`#869 <https://github.com/gorakhargosh/watchdog/pull/869>`__) +- [watchmedo] Fix broken parsing of ``--kill-after`` argument for the ``auto-restart`` command. (`#870 <https://github.com/gorakhargosh/watchdog/issues/870>`__) +- [watchmedo] Fix broken parsing of boolean arguments. (`#887 <https://github.com/gorakhargosh/watchdog/issues/887>`__) +- [watchmedo] Fix broken parsing of commands from ``auto-restart``, and ``shell-command``. (`#888 <https://github.com/gorakhargosh/watchdog/issues/888>`__) +- [watchmedo] Support setting verbosity level via ``-q/--quiet`` and ``-v/--verbose`` arguments. (`#889 <https://github.com/gorakhargosh/watchdog/pull/889>`__) +- Thanks to our beloved contributors: @taleinat, @kianmeng, @palfrey, @IlayRosenberg, @BoboTiG + +2.1.7 +~~~~~ + +2022-03-25 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.6...v2.1.7>`__ + +- Eliminate timeout in waiting on event queue. (`#861 <https://github.com/gorakhargosh/watchdog/pull/861>`__) +- [inotify] Fix ``not`` equality implementation for ``InotifyEvent``. (`#848 <https://github.com/gorakhargosh/watchdog/pull/848>`__) +- [watchmedo] Fix calling commands from within a Python script. (`#879 <https://github.com/gorakhargosh/watchdog/pull/879>`__) +- [watchmedo] ``PyYAML`` is loaded only when strictly necessary. Simple usages of ``watchmedo`` are possible without the module being installed. (`#847 <https://github.com/gorakhargosh/watchdog/pull/847>`__) +- Thanks to our beloved contributors: @sattlerc, @JanzenLiu, @BoboTiG + +2.1.6 +~~~~~ + +2021-10-01 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.5...v2.1.6>`__ + +- [bsd] Fixed returned paths in ``kqueue.py`` and restored the overall results of the test suite. (`#842 <https://github.com/gorakhargosh/watchdog/pull/842>`__) +- [bsd] Updated FreeBSD CI support .(`#841 <https://github.com/gorakhargosh/watchdog/pull/841>`__) +- [watchmedo] Removed the ``argh`` dependency in favor of the builtin ``argparse`` module. (`#836 <https://github.com/gorakhargosh/watchdog/pull/836>`__) +- [watchmedo] Removed unexistant ``WindowsApiAsyncObserver`` references and ``--debug-force-winapi-async`` arguments. +- [watchmedo] Improved the help output. +- Thanks to our beloved contributors: @knobix, @AndreaRe9, @BoboTiG + +2.1.5 +~~~~~ + +2021-08-23 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.4...v2.1.5>`__ + +- Fix regression introduced in 2.1.4 (reverted "Allow overriding or adding custom event handlers to event dispatch map. (`#814 <https://github.com/gorakhargosh/watchdog/pull/814>`__)"). (`#830 <https://github.com/gorakhargosh/watchdog/pull/830>`__) +- Convert regexes of type ``str`` to ``list``. (`831 <https://github.com/gorakhargosh/watchdog/pull/831>`__) +- Thanks to our beloved contributors: @unique1o1, @BoboTiG + +2.1.4 +~~~~~ + +2021-08-19 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.3...v2.1.4>`__ + +- [watchmedo] Fix usage of ``os.setsid()`` and ``os.killpg()`` Unix-only functions. (`#809 <https://github.com/gorakhargosh/watchdog/pull/809>`__) +- [mac] Fix missing ``FileModifiedEvent`` on permission or ownership changes of a file. (`#815 <https://github.com/gorakhargosh/watchdog/pull/815>`__) +- [mac] Convert absolute watch path in ``FSEeventsEmitter`` with ``os.path.realpath()``. (`#822 <https://github.com/gorakhargosh/watchdog/pull/822>`__) +- Fix a possible ``AttributeError`` in ``SkipRepeatsQueue._put()``. (`#818 <https://github.com/gorakhargosh/watchdog/pull/818>`__) +- Allow overriding or adding custom event handlers to event dispatch map. (`#814 <https://github.com/gorakhargosh/watchdog/pull/814>`__) +- Fix tests on big endian platforms. (`#828 <https://github.com/gorakhargosh/watchdog/pull/828>`__) +- Thanks to our beloved contributors: @replabrobin, @BoboTiG, @SamSchott, @AndreiB97, @NiklasRosenstein, @ikokollari, @mgorny + +2.1.3 +~~~~~ + +2021-06-26 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.2...v2.1.3>`__ + +- Publish macOS ``arm64`` and ``universal2`` wheels. (`#740 <https://github.com/gorakhargosh/watchdog/pull/740>`__) +- Thanks to our beloved contributors: @kainjow, @BoboTiG + +2.1.2 +~~~~~ + +2021-05-19 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.1...v2.1.2>`__ + +- [mac] Fix relative path handling for non-recursive watch. (`#797 <https://github.com/gorakhargosh/watchdog/pull/797>`__) +- [windows] On PyPy, events happening right after ``start()`` were missed. Add a workaround for that. (`#796 <https://github.com/gorakhargosh/watchdog/pull/796>`__) +- Thanks to our beloved contributors: @oprypin, @CCP-Aporia, @BoboTiG + +2.1.1 +~~~~~ + +2021-05-10 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.1.0...v2.1.1>`__ + +- [mac] Fix callback exceptions when the watcher is deleted but still receiving events (`#786 <https://github.com/gorakhargosh/watchdog/pull/786>`__) +- Thanks to our beloved contributors: @rom1win, @BoboTiG, @CCP-Aporia + + +2.1.0 +~~~~~ + +2021-05-04 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.0.3...v2.1.0>`__ + +- [inotify] Simplify ``libc`` loading (`#776 <https://github.com/gorakhargosh/watchdog/pull/776>`__) +- [mac] Add support for non-recursive watches in ``FSEventsEmitter`` (`#779 <https://github.com/gorakhargosh/watchdog/pull/779>`__) +- [watchmedo] Add support for ``--debug-force-*`` arguments to ``tricks`` (`#781 <https://github.com/gorakhargosh/watchdog/pull/781>`__) +- Thanks to our beloved contributors: @CCP-Aporia, @aodj, @UnitedMarsupials, @BoboTiG + + +2.0.3 +~~~~~ + +2021-04-22 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.0.2...v2.0.3>`__ + +- [mac] Use ``logger.debug()`` instead of ``logger.info()`` (`#774 <https://github.com/gorakhargosh/watchdog/pull/774>`__) +- Updated documentation links (`#777 <https://github.com/gorakhargosh/watchdog/pull/777>`__) +- Thanks to our beloved contributors: @globau, @imba-tjd, @BoboTiG + + +2.0.2 +~~~~~ + +2021-02-22 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.0.1...v2.0.2>`__ + +- [mac] Add missing exception objects (`#766 <https://github.com/gorakhargosh/watchdog/pull/766>`__) +- Thanks to our beloved contributors: @CCP-Aporia, @BoboTiG + + +2.0.1 +~~~~~ + +2021-02-17 • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.0.0...v2.0.1>`__ + +- [mac] Fix a segmentation fault when dealing with unicode paths (`#763 <https://github.com/gorakhargosh/watchdog/pull/763>`__) +- Moved the CI from Travis-CI to GitHub Actions (`#764 <https://github.com/gorakhargosh/watchdog/pull/764>`__) +- Thanks to our beloved contributors: @SamSchott, @BoboTiG + + +2.0.0 +~~~~~ + +2021-02-11 • `full history <https://github.com/gorakhargosh/watchdog/compare/v1.0.2...v2.0.0>`__ + +- Avoid deprecated ``PyEval_InitThreads`` on Python 3.7+ (`#746 <https://github.com/gorakhargosh/watchdog/pull/746>`__) +- [inotify] Add support for ``IN_CLOSE_WRITE`` events. A ``FileCloseEvent`` event will be fired. Note that ``IN_CLOSE_NOWRITE`` events are not handled to prevent much noise. (`#184 <https://github.com/gorakhargosh/watchdog/pull/184>`__, `#245 <https://github.com/gorakhargosh/watchdog/pull/245>`__, `#280 <https://github.com/gorakhargosh/watchdog/pull/280>`__, `#313 <https://github.com/gorakhargosh/watchdog/pull/313>`__, `#690 <https://github.com/gorakhargosh/watchdog/pull/690>`__) +- [inotify] Allow to stop the emitter multiple times (`#760 <https://github.com/gorakhargosh/watchdog/pull/760>`__) +- [mac] Support coalesced filesystem events (`#734 <https://github.com/gorakhargosh/watchdog/pull/734>`__) +- [mac] Drop support for macOS 10.12 and earlier (`#750 <https://github.com/gorakhargosh/watchdog/pull/750>`__) +- [mac] Fix an issue when renaming an item changes only the casing (`#750 <https://github.com/gorakhargosh/watchdog/pull/750>`__) +- Thanks to our beloved contributors: @bstaletic, @lukassup, @ysard, @SamSchott, @CCP-Aporia, @BoboTiG + + +1.0.2 +~~~~~ + +2020-12-18 • `full history <https://github.com/gorakhargosh/watchdog/compare/v1.0.1...v1.0.2>`__ + +- Wheels are published for GNU/Linux, macOS and Windows (`#739 <https://github.com/gorakhargosh/watchdog/pull/739>`__) +- [mac] Fix missing ``event_id`` attribute in ``fsevents`` (`#721 <https://github.com/gorakhargosh/watchdog/pull/721>`__) +- [mac] Return byte paths if a byte path was given in ``fsevents`` (`#726 <https://github.com/gorakhargosh/watchdog/pull/726>`__) +- [mac] Add compatibility with old macOS versions (`#733 <https://github.com/gorakhargosh/watchdog/pull/733>`__) +- Uniformize event for deletion of watched dir (`#727 <https://github.com/gorakhargosh/watchdog/pull/727>`__) +- Thanks to our beloved contributors: @SamSchott, @CCP-Aporia, @di, @BoboTiG + + +1.0.1 +~~~~~ + +2020-12-10 • Fix version with good metadatas. + + +1.0.0 +~~~~~ + +2020-12-10 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.10.4...v1.0.0>`__ + +- Versioning is now following the `semver <https://semver.org/>`__ +- Drop support for Python 2.7, 3.4 and 3.5 +- [mac] Regression fixes for native ``fsevents`` (`#717 <https://github.com/gorakhargosh/watchdog/pull/717>`__) +- [windows] ``winapi.BUFFER_SIZE`` now defaults to ``64000`` (instead of ``2048``) (`#700 <https://github.com/gorakhargosh/watchdog/pull/700>`__) +- [windows] Introduced ``winapi.PATH_BUFFER_SIZE`` (defaults to ``2048``) to keep the old behavior with path-realted functions (`#700 <https://github.com/gorakhargosh/watchdog/pull/700>`__) +- Use ``pathlib`` from the standard library, instead of pathtools (`#556 <https://github.com/gorakhargosh/watchdog/pull/556>`__) +- Allow file paths on Unix that don't follow the file system encoding (`#703 <https://github.com/gorakhargosh/watchdog/pull/703>`__) +- Removed the long-time deprecated ``events.LoggingFileSystemEventHandler`` class, use ``LoggingEventHandler`` instead +- Thanks to our beloved contributors: @SamSchott, @bstaletic, @BoboTiG, @CCP-Aporia + + +0.10.4 +~~~~~~ + +2020-11-21 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.10.3...v0.10.4>`__ + +- Add ``logger`` parameter for the ``LoggingEventHandler`` (`#676 <https://github.com/gorakhargosh/watchdog/pull/676>`__) +- Replace mutable default arguments with ``if None`` implementation (`#677 <https://github.com/gorakhargosh/watchdog/pull/677>`__) +- Expand tests to Python 2.7 and 3.5-3.10 for GNU/Linux, macOS and Windows +- [mac] Performance improvements for the ``fsevents`` module (`#680 <https://github.com/gorakhargosh/watchdog/pull/680>`__) +- [mac] Prevent compilation of ``watchdog_fsevents.c`` on non-macOS machines (`#687 <https://github.com/gorakhargosh/watchdog/pull/687>`__) +- [watchmedo] Handle shutdown events from ``SIGTERM`` and ``SIGINT`` more reliably (`#693 <https://github.com/gorakhargosh/watchdog/pull/693>`__) +- Thanks to our beloved contributors: @Sraw, @CCP-Aporia, @BoboTiG, @maybe-sybr + + +0.10.3 +~~~~~~ + +2020-06-25 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.10.2...v0.10.3>`__ + +- Ensure ``ObservedWatch.path`` is a string (`#651 <https://github.com/gorakhargosh/watchdog/pull/651>`__) +- [inotify] Allow to monitor single file (`#655 <https://github.com/gorakhargosh/watchdog/pull/655>`__) +- [inotify] Prevent raising an exception when a file in a monitored folder has no permissions (`#669 <https://github.com/gorakhargosh/watchdog/pull/669>`__, `#670 <https://github.com/gorakhargosh/watchdog/pull/670>`__) +- Thanks to our beloved contributors: @brant-ruan, @rec, @andfoy, @BoboTiG + + +0.10.2 +~~~~~~ + +2020-02-08 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.10.1...v0.10.2>`__ + +- Fixed the ``build_ext`` command on macOS Catalina (`#628 <https://github.com/gorakhargosh/watchdog/pull/628>`__) +- Fixed the installation of macOS requirements on non-macOS OSes (`#635 <https://github.com/gorakhargosh/watchdog/pull/635>`__) +- Refactored ``dispatch()`` method of ``FileSystemEventHandler``, + ``PatternMatchingEventHandler`` and ``RegexMatchingEventHandler`` +- [bsd] Improved tests support on non Windows/Linux platforms (`#633 <https://github.com/gorakhargosh/watchdog/pull/633>`__, `#639 <https://github.com/gorakhargosh/watchdog/pull/639>`__) +- [bsd] Added FreeBSD CI support (`#532 <https://github.com/gorakhargosh/watchdog/pull/532>`__) +- [bsd] Restored full support (`#638 <https://github.com/gorakhargosh/watchdog/pull/638>`__, `#641 <https://github.com/gorakhargosh/watchdog/pull/641>`__) +- Thanks to our beloved contributors: @BoboTiG, @evilham, @danilobellini + + +0.10.1 +~~~~~~ + +2020-01-30 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.10.0...v0.10.1>`__ + +- Fixed Python 2.7 to 3.6 installation when the OS locale is set to POSIX (`#615 <https://github.com/gorakhargosh/watchdog/pull/615>`__) +- Fixed the ``build_ext`` command on macOS (`#618 <https://github.com/gorakhargosh/watchdog/pull/618>`__, `#620 <https://github.com/gorakhargosh/watchdog/pull/620>`__) +- Moved requirements to ``setup.cfg`` (`#617 <https://github.com/gorakhargosh/watchdog/pull/617>`__) +- [mac] Removed old C code for Python 2.5 in the `fsevents` C implementation +- [snapshot] Added ``EmptyDirectorySnapshot`` (`#613 <https://github.com/gorakhargosh/watchdog/pull/613>`__) +- Thanks to our beloved contributors: @Ajordat, @tehkirill, @BoboTiG + + +0.10.0 +~~~~~~ + +2020-01-26 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.9.0...v0.10.0>`__ + +**Breaking Changes** + +- Dropped support for Python 2.6, 3.2 and 3.3 +- Emitters that failed to start are now removed +- [snapshot] Removed the deprecated ``walker_callback`` argument, + use ``stat`` instead +- [watchmedo] The utility is no more installed by default but via the extra + ``watchdog[watchmedo]`` + +**Other Changes** + +- Fixed several Python 3 warnings +- Identify synthesized events with ``is_synthetic`` attribute (`#369 <https://github.com/gorakhargosh/watchdog/pull/369>`__) +- Use ``os.scandir()`` to improve memory usage (`#503 <https://github.com/gorakhargosh/watchdog/pull/503>`__) +- [bsd] Fixed flavors of FreeBSD detection (`#529 <https://github.com/gorakhargosh/watchdog/pull/529>`__) +- [bsd] Skip unprocessable socket files (`#509 <https://github.com/gorakhargosh/watchdog/issue/509>`__) +- [inotify] Fixed events containing non-ASCII characters (`#516 <https://github.com/gorakhargosh/watchdog/issues/516>`__) +- [inotify] Fixed the way ``OSError`` are re-raised (`#377 <https://github.com/gorakhargosh/watchdog/issues/377>`__) +- [inotify] Fixed wrong source path after renaming a top level folder (`#515 <https://github.com/gorakhargosh/watchdog/pull/515>`__) +- [inotify] Removed delay from non-move events (`#477 <https://github.com/gorakhargosh/watchdog/pull/477>`__) +- [mac] Fixed a bug when calling ``FSEventsEmitter.stop()`` twice (`#466 <https://github.com/gorakhargosh/watchdog/pull/466>`__) +- [mac] Support for unscheduling deleted watch (`#541 <https://github.com/gorakhargosh/watchdog/issue/541>`__) +- [mac] Fixed missing field initializers and unused parameters in + ``watchdog_fsevents.c`` +- [snapshot] Don't walk directories without read permissions (`#408 <https://github.com/gorakhargosh/watchdog/pull/408>`__) +- [snapshot] Fixed a race condition crash when a directory is swapped for a file (`#513 <https://github.com/gorakhargosh/watchdog/pull/513>`__) +- [snasphot] Fixed an ``AttributeError`` about forgotten ``path_for_inode`` attr (`#436 <https://github.com/gorakhargosh/watchdog/issues/436>`__) +- [snasphot] Added the ``ignore_device=False`` parameter to the ctor (`597 <https://github.com/gorakhargosh/watchdog/pull/597>`__) +- [watchmedo] Fixed the path separator used (`#478 <https://github.com/gorakhargosh/watchdog/pull/478>`__) +- [watchmedo] Fixed the use of ``yaml.load()`` for ``yaml.safe_load()`` (`#453 <https://github.com/gorakhargosh/watchdog/issues/453>`__) +- [watchmedo] Handle all available signals (`#549 <https://github.com/gorakhargosh/watchdog/issue/549>`__) +- [watchmedo] Added the ``--debug-force-polling`` argument (`#404 <https://github.com/gorakhargosh/watchdog/pull/404>`__) +- [windows] Fixed issues when the observed directory is deleted (`#570 <https://github.com/gorakhargosh/watchdog/issues/570>`__ and `#601 <https://github.com/gorakhargosh/watchdog/pull/601>`__) +- [windows] ``WindowsApiEmitter`` made easier to subclass (`#344 <https://github.com/gorakhargosh/watchdog/pull/344>`__) +- [windows] Use separate ctypes DLL instances +- [windows] Generate sub created events only if ``recursive=True`` (`#454 <https://github.com/gorakhargosh/watchdog/pull/454>`__) +- Thanks to our beloved contributors: @BoboTiG, @LKleinNux, @rrzaripov, + @wildmichael, @TauPan, @segevfiner, @petrblahos, @QuantumEnergyE, + @jeffwidman, @kapsh, @nickoala, @petrblahos, @julianolf, @tonybaloney, + @mbakiev, @pR0Ps, javaguirre, @skurfer, @exarkun, @joshuaskelly, + @danilobellini, @Ajordat + + +0.9.0 +~~~~~ + +2018-08-28 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.8.3...v0.9.0>`__ + +- Deleting the observed directory now emits a ``DirDeletedEvent`` event +- [bsd] Improved the platform detection (`#378 <https://github.com/gorakhargosh/watchdog/pull/378>`__) +- [inotify] Fixed a crash when the root directory being watched by was deleted (`#374 <https://github.com/gorakhargosh/watchdog/pull/374>`__) +- [inotify] Handle systems providing uClibc +- [linux] Fixed a possible ``DirDeletedEvent`` duplication when + deleting a directory +- [mac] Fixed unicode path handling ``fsevents2.py`` (`#298 <https://github.com/gorakhargosh/watchdog/pull/298>`__) +- [watchmedo] Added the ``--debug-force-polling`` argument (`#336 <https://github.com/gorakhargosh/watchdog/pull/336>`__) +- [windows] Fixed the ``FILE_LIST_DIRECTORY`` constant (`#376 <https://github.com/gorakhargosh/watchdog/pull/376>`__) +- Thanks to our beloved contributors: @vulpeszerda, @hpk42, @tamland, @senden9, + @gorakhargosh, @nolsto, @mafrosis, @DonyorM, @anthrotype, @danilobellini, + @pierregr, @ShinNoNoir, @adrpar, @gforcada, @pR0Ps, @yegorich, @dhke + + +0.8.3 +~~~~~ + +2015-02-11 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.8.2...v0.8.3>`__ + +- Fixed the use of the root logger (`#274 <https://github.com/gorakhargosh/watchdog/issues/274>`__) +- [inotify] Refactored libc loading and improved error handling in + ``inotify_c.py`` +- [inotify] Fixed a possible unbound local error in ``inotify_c.py`` +- Thanks to our beloved contributors: @mmorearty, @tamland, @tony, + @gorakhargosh + + +0.8.2 +~~~~~ + +2014-10-29 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.8.1...v0.8.2>`__ + +- Event emitters are no longer started on schedule if ``Observer`` is not + already running +- [mac] Fixed usued arguments to pass clang compilation (`#265 <https://github.com/gorakhargosh/watchdog/pull/265>`__) +- [snapshot] Fixed a possible race condition crash on directory deletion (`#281 <https://github.com/gorakhargosh/watchdog/pull/281>`__) +- [windows] Fixed an error when watching the same folder again (`#270 <https://github.com/gorakhargosh/watchdog/pull/270>`__) +- Thanks to our beloved contributors: @tamland, @apetrone, @Falldog, + @theospears + + +0.8.1 +~~~~~ + +2014-07-28 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.8.0...v0.8.1>`__ + +- Fixed ``anon_inode`` descriptors leakage (`#249 <https://github.com/gorakhargosh/watchdog/pull/249>`__) +- [inotify] Fixed thread stop dead lock (`#250 <https://github.com/gorakhargosh/watchdog/issues/250>`__) +- Thanks to our beloved contributors: @Witos, @adiroiban, @tamland + + +0.8.0 +~~~~~ + +2014-07-02 • `full history <https://github.com/gorakhargosh/watchdog/compare/v0.7.1...v0.8.0>`__ + +- Fixed ``argh`` deprecation warnings (`#242 <https://github.com/gorakhargosh/watchdog/pull/242>`__) +- [snapshot] Methods returning internal stats info were replaced by + ``mtime()``, ``inode()`` and ``path()`` methods +- [snapshot] Deprecated the ``walker_callback`` argument +- [watchmedo] Fixed ``auto-restart`` to terminate all children processes (`#225 <https://github.com/gorakhargosh/watchdog/pull/225>`__) +- [watchmedo] Added the ``--no-parallel`` argument (`#227 <https://github.com/gorakhargosh/watchdog/issues/227>`__) +- [windows] Fixed the value of ``INVALID_HANDLE_VALUE`` (`#123 <https://github.com/gorakhargosh/watchdog/issues/123>`__) +- [windows] Fixed octal usages to work with Python 3 as well (`#223 <https://github.com/gorakhargosh/watchdog/issues/223>`__) +- Thanks to our beloved contributors: @tamland, @Ormod, @berdario, @cro, + @BernieSumption, @pypingou, @gotcha, @tommorris, @frewsxcv diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..ef9c683523a16fc72d24d9e06f211e814a1069c6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/RECORD @@ -0,0 +1,63 @@ +../../Scripts/watchmedo.exe,sha256=WVQqzbUPKovc9aG2RGeTdsRAvJmoOhXkwt59tvk5CqY,108362 +watchdog-6.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +watchdog-6.0.0.dist-info/METADATA,sha256=QTGKr7vS5LXERw_7vGHrpQ_Gd5KkyE077i71PmmkoUo,45437 +watchdog-6.0.0.dist-info/RECORD,, +watchdog-6.0.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +watchdog-6.0.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91 +watchdog-6.0.0.dist-info/direct_url.json,sha256=NJsZwAwy6u2dfjMFdvqeBy227WZQZsea0W2vZfphixA,84 +watchdog-6.0.0.dist-info/entry_points.txt,sha256=qt_Oe2U5Zlfz7LNA3PHipn3_1zlfRTp9dk3wTS3Ivb8,66 +watchdog-6.0.0.dist-info/licenses/AUTHORS,sha256=JT4CdfYRf1V0Mg9RbNaaGK6LyP9pztEsJR6bQ-MfaG8,2928 +watchdog-6.0.0.dist-info/licenses/COPYING,sha256=OfCBgo22-UxwEj-k-zDBvOPiFaj97OU6SZkf4HamnAg,703 +watchdog-6.0.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358 +watchdog-6.0.0.dist-info/top_level.txt,sha256=OVdR7GkPGZako8sRtVuM0Nis-ZIElx3he3hKFPYnTGg,9 +watchdog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +watchdog/__pycache__/__init__.cpython-314.pyc,, +watchdog/__pycache__/events.cpython-314.pyc,, +watchdog/__pycache__/version.cpython-314.pyc,, +watchdog/__pycache__/watchmedo.cpython-314.pyc,, +watchdog/events.py,sha256=ig4oCNcm-mSe6rK5LPsIUcMO3dfq9EKegfM9I4SwVv8,16323 +watchdog/observers/__init__.py,sha256=BmXKL1WXWnJP8-WRrhP4kmGK04gNADh1ifJezeZs4hs,3256 +watchdog/observers/__pycache__/__init__.cpython-314.pyc,, +watchdog/observers/__pycache__/api.cpython-314.pyc,, +watchdog/observers/__pycache__/fsevents.cpython-314.pyc,, +watchdog/observers/__pycache__/fsevents2.cpython-314.pyc,, +watchdog/observers/__pycache__/inotify.cpython-314.pyc,, +watchdog/observers/__pycache__/inotify_buffer.cpython-314.pyc,, +watchdog/observers/__pycache__/inotify_c.cpython-314.pyc,, +watchdog/observers/__pycache__/kqueue.cpython-314.pyc,, +watchdog/observers/__pycache__/polling.cpython-314.pyc,, +watchdog/observers/__pycache__/read_directory_changes.cpython-314.pyc,, +watchdog/observers/__pycache__/winapi.cpython-314.pyc,, +watchdog/observers/api.py,sha256=tyPhqDhzh2pveEkCVRR2B51SaXlDsrcpl8W6oidQuUs,13802 +watchdog/observers/fsevents.py,sha256=6ho3sgBQt6hsq_1F6eJgtor5CjZV09TaoT01xeHNgd4,14284 +watchdog/observers/fsevents2.py,sha256=fZ8O7zomltBgvucDBlUHZIWKREFn4MKB30T5iEisPsc,9439 +watchdog/observers/inotify.py,sha256=i075APHIwIUdiFrfdocpbYsedUvh_u3AtLqU3bqlgFE,10649 +watchdog/observers/inotify_buffer.py,sha256=VWWuleFQRaJL_ZM0jbcAGjGdj1kZUWmUigC4WSbPmyQ,4434 +watchdog/observers/inotify_c.py,sha256=ys6NrVEbw2bPZQUkzshY5lGlfDZT4nz58Vmn4A49emU,21129 +watchdog/observers/kqueue.py,sha256=HYARzdF_Nlu72vTaIBbIvh5e_N7ROd33VDtZc1Ab2oc,24425 +watchdog/observers/polling.py,sha256=B8gyEtzkRiHmSSf8dcY_0P-Bu0U5i-VWQanBqIVxTs0,4932 +watchdog/observers/read_directory_changes.py,sha256=mKHZIfUopCAU0ae7oE9Ttkggk7LfTb8lwgcMJHmOW5E,4167 +watchdog/observers/winapi.py,sha256=q2nTZ2JYnbuEUiByTcSmpbw4iiKhtNQ6UQg9CWPIUxY,11635 +watchdog/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +watchdog/tricks/__init__.py,sha256=zLFpZfXN_A3jXlH00Ok0SpbtWxP2WwwsxG7w2PXkxP8,9492 +watchdog/tricks/__pycache__/__init__.cpython-314.pyc,, +watchdog/utils/__init__.py,sha256=9q7wEZW7yl81Db1CcLBQJ33xZ2YrGwyzsK2gzNCC-lE,3513 +watchdog/utils/__pycache__/__init__.cpython-314.pyc,, +watchdog/utils/__pycache__/bricks.cpython-314.pyc,, +watchdog/utils/__pycache__/delayed_queue.cpython-314.pyc,, +watchdog/utils/__pycache__/dirsnapshot.cpython-314.pyc,, +watchdog/utils/__pycache__/echo.cpython-314.pyc,, +watchdog/utils/__pycache__/event_debouncer.cpython-314.pyc,, +watchdog/utils/__pycache__/patterns.cpython-314.pyc,, +watchdog/utils/__pycache__/platform.cpython-314.pyc,, +watchdog/utils/__pycache__/process_watcher.cpython-314.pyc,, +watchdog/utils/bricks.py,sha256=cZCA4T9e1iWvr3yY4FOGuOzIpdP4c4Nhx0ipfgyhBno,2545 +watchdog/utils/delayed_queue.py,sha256=Xv-Rco10b62Vt4LnLEmZxlpr93MeBV2ZX-U2--nHS5A,2615 +watchdog/utils/dirsnapshot.py,sha256=SaGnxq0miZbxLZcpJcSOj5sE8ihunqjb5-m8ww9F1aA,14740 +watchdog/utils/echo.py,sha256=GALgUot9zXVAMxMwLN5CkHRIdjmio1X3vppVS14P-eM,2210 +watchdog/utils/event_debouncer.py,sha256=oVifdt50PjOiV4n-0W1OZOCNO4j689BRRVgCGrJvH0E,2079 +watchdog/utils/patterns.py,sha256=fjy8h_XaUuRkoh46uFLv37JzgjmmK2Vzt1ZVbMNa0cE,3672 +watchdog/utils/platform.py,sha256=VSN45Y2kA0NS1Nzlmr5SHB4Ct0xqK2KRly9jlx7DHSg,885 +watchdog/utils/process_watcher.py,sha256=qgLtEZLhYLjpL-GZawIEjV-p_PnMka_hBGH_1vxX-gk,925 +watchdog/version.py,sha256=guvQM7983CuZ2S52zEtdhsS_dkqhbY3mp-GQvVM4DR0,349 +watchdog/watchmedo.py,sha256=AMTUpNSlQmAqxf5EhtfKKh5eYiPZoDYgUm1Gf8xD3-g,25452 diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..1ef5583317a5e59140e3f1c85c2db91aec0961e8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (82.0.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..9a376a3a8d93f08228e5b55d6064e9be9e1e0b77 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/bld/rattler-build_watchdog_1772608056/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/entry_points.txt b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..b05809e4e163ed58b9d01b5d5f5321486d19fe27 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +watchmedo = watchdog.watchmedo:main [watchmedo] diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/AUTHORS b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..8c3fed3232160b1d6e47313b0f3244b94e87ddcd --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/AUTHORS @@ -0,0 +1,73 @@ +Original Project Lead: +---------------------- +Yesudeep Mangalapilly <yesudeep@google.com> + +Current Project Lead: +--------------------- +Mickaël Schoentgen <contact@tiger-222.fr> + +Contributors in alphabetical order: +----------------------------------- +Adrian Tejn Kern <tejnkern@gmail.com> +Andrew Schaaf <andrew@andrewschaaf.com> +Danilo de Jesus da Silva Bellini <danilo.bellini@gmail.com> +David LaPalomento <dlapalomento@gmail.com> +dvogel <dvogel@wlscapi.uwsc.wisc.edu> +Filip Noetzel <filip@j03.de> +Gary van der Merwe <garyvdm@garyvdm.localdomain> +gfxmonk <tim3d.junk@gmail.com> +Gora Khargosh <gora.khargosh@gmail.com> +Hannu Valtonen <hannu.valtonen@ohmu.fi> +Jesse Printz <jesse@jonypawks.net> +Kurt McKee <contactme@kurtmckee.org> +Léa Klein <lklein@nuxeo.com> +Luke McCarthy <luke@iogopro.co.uk> +Lukáš Lalinský <lalinsky@gmail.com> +Malthe Borch <mborch@gmail.com> +Martin Kreichgauer <kreichgauer@gmail.com> +Martin Kreichgauer <martin@kreichgauer.com> +Mike Lundy <mike@fluffypenguin.org> +Nicholas Hairs <info+watchdog@nicholashairs.com> +Raymond Hettinger <python@rcn.com> +Roman Ovchinnikov <coolthecold@gmail.com> +Rotem Yaari <vmalloc@gmail.com> +Ryan Kelly <ryan@rfk.id.au> +Senko Rasic <senko.rasic@dobarkod.hr> +Senko Rašić <senko@senko.net> +Shane Hathaway <shane@hathawaymix.org> +Simon Pantzare <simon@pewpewlabs.com> +Simon Pantzare <simpa395@student.liu.se> +Steven Samuel Cole <steven.samuel.cole@gmail.com> +Stéphane Klein <stephane@harobed.org> +Thomas Guest <tag@wordaligned.org> +Thomas Heller <theller@ctypes.org> +Tim Cuthbertson <tim+github@gfxmonk.net> +Todd Whiteman <toddw@activestate.com> +Will McGugan <will@willmcgugan.com> +Yesudeep Mangalapilly <gora.khargosh@gmail.com> +Yesudeep Mangalapilly <yesudeep@google.com> + +We would like to thank these individuals for ideas: +--------------------------------------------------- +Tim Golden <mail@timgolden.me.uk> +Sebastien Martini <seb@dbzteam.org> + +Initially we used the flask theme for the documentation which was written by +---------------------------------------------------------------------------- +Armin Ronacher <armin.ronacher@active-4.com> + + +Watchdog also includes open source libraries or adapted code +from the following projects: + +- MacFSEvents - https://github.com/malthe/macfsevents +- watch_directory.py - http://timgolden.me.uk/python/downloads/watch_directory.py +- pyinotify - https://github.com/seb-m/pyinotify +- fsmonitor - https://github.com/shaurz/fsmonitor +- echo - http://wordaligned.org/articles/echo +- Lukáš Lalinský's ordered set queue implementation: + https://stackoverflow.com/questions/1581895/how-check-if-a-task-is-already-in-python-queue +- Armin Ronacher's flask-sphinx-themes for the documentation: + https://github.com/mitsuhiko/flask-sphinx-themes +- pyfilesystem - https://github.com/PyFilesystem/pyfilesystem +- get_FILE_NOTIFY_INFORMATION - http://blog.gmane.org/gmane.comp.python.ctypes/month=20070901 diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/COPYING b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..b84e0b3c8468ff4672c6f1c5a88cb28c3eb067d7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/COPYING @@ -0,0 +1,16 @@ +Copyright 2018-2024 Mickaël Schoentgen & contributors +Copyright 2014-2018 Thomas Amland & contributors +Copyright 2012-2014 Google, Inc. +Copyright 2011-2012 Yesudeep Mangalapilly + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/licenses/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..e59495eee06b72aaf42ba877daa7f944ede675ce --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog-6.0.0.dist-info/top_level.txt @@ -0,0 +1 @@ +watchdog diff --git a/micromamba_root/Lib/site-packages/watchdog/__init__.py b/micromamba_root/Lib/site-packages/watchdog/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/watchdog/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59a92f639d8505fbc0b37c7f7a48dcbcc2d45724 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/__pycache__/events.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/__pycache__/events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c741f56c85f8547ebc4b2452ab67ad386ec29c95 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/__pycache__/events.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/__pycache__/version.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/__pycache__/version.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69d56ca5dd4b33e6a8aa7902dbbaa02156d87cc7 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/__pycache__/version.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/__pycache__/watchmedo.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/__pycache__/watchmedo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a1b54c41f1ec7b0ed0393f2536959fb1edf1c1d Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/__pycache__/watchmedo.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/events.py b/micromamba_root/Lib/site-packages/watchdog/events.py new file mode 100644 index 0000000000000000000000000000000000000000..db430235088d2b35fbb84303d1818bce2bb80f23 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/events.py @@ -0,0 +1,542 @@ +""":module: watchdog.events +:synopsis: File system events and event handlers. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Event Classes +------------- +.. autoclass:: FileSystemEvent + :members: + :show-inheritance: + :inherited-members: + +.. autoclass:: FileSystemMovedEvent + :members: + :show-inheritance: + +.. autoclass:: FileMovedEvent + :members: + :show-inheritance: + +.. autoclass:: DirMovedEvent + :members: + :show-inheritance: + +.. autoclass:: FileModifiedEvent + :members: + :show-inheritance: + +.. autoclass:: DirModifiedEvent + :members: + :show-inheritance: + +.. autoclass:: FileCreatedEvent + :members: + :show-inheritance: + +.. autoclass:: FileClosedEvent + :members: + :show-inheritance: + +.. autoclass:: FileClosedNoWriteEvent + :members: + :show-inheritance: + +.. autoclass:: FileOpenedEvent + :members: + :show-inheritance: + +.. autoclass:: DirCreatedEvent + :members: + :show-inheritance: + +.. autoclass:: FileDeletedEvent + :members: + :show-inheritance: + +.. autoclass:: DirDeletedEvent + :members: + :show-inheritance: + + +Event Handler Classes +--------------------- +.. autoclass:: FileSystemEventHandler + :members: + :show-inheritance: + +.. autoclass:: PatternMatchingEventHandler + :members: + :show-inheritance: + +.. autoclass:: RegexMatchingEventHandler + :members: + :show-inheritance: + +.. autoclass:: LoggingEventHandler + :members: + :show-inheritance: + +""" + +from __future__ import annotations + +import logging +import os.path +import re +from dataclasses import dataclass, field +from typing import TYPE_CHECKING + +from watchdog.utils.patterns import match_any_paths + +if TYPE_CHECKING: + from collections.abc import Generator + +EVENT_TYPE_MOVED = "moved" +EVENT_TYPE_DELETED = "deleted" +EVENT_TYPE_CREATED = "created" +EVENT_TYPE_MODIFIED = "modified" +EVENT_TYPE_CLOSED = "closed" +EVENT_TYPE_CLOSED_NO_WRITE = "closed_no_write" +EVENT_TYPE_OPENED = "opened" + + +@dataclass(unsafe_hash=True) +class FileSystemEvent: + """Immutable type that represents a file system event that is triggered + when a change occurs on the monitored file system. + + All FileSystemEvent objects are required to be immutable and hence + can be used as keys in dictionaries or be added to sets. + """ + + src_path: bytes | str + dest_path: bytes | str = "" + event_type: str = field(default="", init=False) + is_directory: bool = field(default=False, init=False) + + """ + True if event was synthesized; False otherwise. + These are events that weren't actually broadcast by the OS, but + are presumed to have happened based on other, actual events. + """ + is_synthetic: bool = field(default=False) + + +class FileSystemMovedEvent(FileSystemEvent): + """File system event representing any kind of file system movement.""" + + event_type = EVENT_TYPE_MOVED + + +# File events. + + +class FileDeletedEvent(FileSystemEvent): + """File system event representing file deletion on the file system.""" + + event_type = EVENT_TYPE_DELETED + + +class FileModifiedEvent(FileSystemEvent): + """File system event representing file modification on the file system.""" + + event_type = EVENT_TYPE_MODIFIED + + +class FileCreatedEvent(FileSystemEvent): + """File system event representing file creation on the file system.""" + + event_type = EVENT_TYPE_CREATED + + +class FileMovedEvent(FileSystemMovedEvent): + """File system event representing file movement on the file system.""" + + +class FileClosedEvent(FileSystemEvent): + """File system event representing file close on the file system.""" + + event_type = EVENT_TYPE_CLOSED + + +class FileClosedNoWriteEvent(FileSystemEvent): + """File system event representing an unmodified file close on the file system.""" + + event_type = EVENT_TYPE_CLOSED_NO_WRITE + + +class FileOpenedEvent(FileSystemEvent): + """File system event representing file close on the file system.""" + + event_type = EVENT_TYPE_OPENED + + +# Directory events. + + +class DirDeletedEvent(FileSystemEvent): + """File system event representing directory deletion on the file system.""" + + event_type = EVENT_TYPE_DELETED + is_directory = True + + +class DirModifiedEvent(FileSystemEvent): + """File system event representing directory modification on the file system.""" + + event_type = EVENT_TYPE_MODIFIED + is_directory = True + + +class DirCreatedEvent(FileSystemEvent): + """File system event representing directory creation on the file system.""" + + event_type = EVENT_TYPE_CREATED + is_directory = True + + +class DirMovedEvent(FileSystemMovedEvent): + """File system event representing directory movement on the file system.""" + + is_directory = True + + +class FileSystemEventHandler: + """Base file system event handler that you can override methods from.""" + + def dispatch(self, event: FileSystemEvent) -> None: + """Dispatches events to the appropriate methods. + + :param event: + The event object representing the file system event. + :type event: + :class:`FileSystemEvent` + """ + self.on_any_event(event) + getattr(self, f"on_{event.event_type}")(event) + + def on_any_event(self, event: FileSystemEvent) -> None: + """Catch-all event handler. + + :param event: + The event object representing the file system event. + :type event: + :class:`FileSystemEvent` + """ + + def on_moved(self, event: DirMovedEvent | FileMovedEvent) -> None: + """Called when a file or a directory is moved or renamed. + + :param event: + Event representing file/directory movement. + :type event: + :class:`DirMovedEvent` or :class:`FileMovedEvent` + """ + + def on_created(self, event: DirCreatedEvent | FileCreatedEvent) -> None: + """Called when a file or directory is created. + + :param event: + Event representing file/directory creation. + :type event: + :class:`DirCreatedEvent` or :class:`FileCreatedEvent` + """ + + def on_deleted(self, event: DirDeletedEvent | FileDeletedEvent) -> None: + """Called when a file or directory is deleted. + + :param event: + Event representing file/directory deletion. + :type event: + :class:`DirDeletedEvent` or :class:`FileDeletedEvent` + """ + + def on_modified(self, event: DirModifiedEvent | FileModifiedEvent) -> None: + """Called when a file or directory is modified. + + :param event: + Event representing file/directory modification. + :type event: + :class:`DirModifiedEvent` or :class:`FileModifiedEvent` + """ + + def on_closed(self, event: FileClosedEvent) -> None: + """Called when a file opened for writing is closed. + + :param event: + Event representing file closing. + :type event: + :class:`FileClosedEvent` + """ + + def on_closed_no_write(self, event: FileClosedNoWriteEvent) -> None: + """Called when a file opened for reading is closed. + + :param event: + Event representing file closing. + :type event: + :class:`FileClosedNoWriteEvent` + """ + + def on_opened(self, event: FileOpenedEvent) -> None: + """Called when a file is opened. + + :param event: + Event representing file opening. + :type event: + :class:`FileOpenedEvent` + """ + + +class PatternMatchingEventHandler(FileSystemEventHandler): + """Matches given patterns with file paths associated with occurring events. + Uses pathlib's `PurePath.match()` method. `patterns` and `ignore_patterns` + are expected to be a list of strings. + """ + + def __init__( + self, + *, + patterns: list[str] | None = None, + ignore_patterns: list[str] | None = None, + ignore_directories: bool = False, + case_sensitive: bool = False, + ): + super().__init__() + + self._patterns = patterns + self._ignore_patterns = ignore_patterns + self._ignore_directories = ignore_directories + self._case_sensitive = case_sensitive + + @property + def patterns(self) -> list[str] | None: + """(Read-only) + Patterns to allow matching event paths. + """ + return self._patterns + + @property + def ignore_patterns(self) -> list[str] | None: + """(Read-only) + Patterns to ignore matching event paths. + """ + return self._ignore_patterns + + @property + def ignore_directories(self) -> bool: + """(Read-only) + ``True`` if directories should be ignored; ``False`` otherwise. + """ + return self._ignore_directories + + @property + def case_sensitive(self) -> bool: + """(Read-only) + ``True`` if path names should be matched sensitive to case; ``False`` + otherwise. + """ + return self._case_sensitive + + def dispatch(self, event: FileSystemEvent) -> None: + """Dispatches events to the appropriate methods. + + :param event: + The event object representing the file system event. + :type event: + :class:`FileSystemEvent` + """ + if self.ignore_directories and event.is_directory: + return + + paths = [] + if hasattr(event, "dest_path"): + paths.append(os.fsdecode(event.dest_path)) + if event.src_path: + paths.append(os.fsdecode(event.src_path)) + + if match_any_paths( + paths, + included_patterns=self.patterns, + excluded_patterns=self.ignore_patterns, + case_sensitive=self.case_sensitive, + ): + super().dispatch(event) + + +class RegexMatchingEventHandler(FileSystemEventHandler): + """Matches given regexes with file paths associated with occurring events. + Uses the `re` module. + """ + + def __init__( + self, + *, + regexes: list[str] | None = None, + ignore_regexes: list[str] | None = None, + ignore_directories: bool = False, + case_sensitive: bool = False, + ): + super().__init__() + + if regexes is None: + regexes = [r".*"] + elif isinstance(regexes, str): + regexes = [regexes] + if ignore_regexes is None: + ignore_regexes = [] + if case_sensitive: + self._regexes = [re.compile(r) for r in regexes] + self._ignore_regexes = [re.compile(r) for r in ignore_regexes] + else: + self._regexes = [re.compile(r, re.IGNORECASE) for r in regexes] + self._ignore_regexes = [re.compile(r, re.IGNORECASE) for r in ignore_regexes] + self._ignore_directories = ignore_directories + self._case_sensitive = case_sensitive + + @property + def regexes(self) -> list[re.Pattern[str]]: + """(Read-only) + Regexes to allow matching event paths. + """ + return self._regexes + + @property + def ignore_regexes(self) -> list[re.Pattern[str]]: + """(Read-only) + Regexes to ignore matching event paths. + """ + return self._ignore_regexes + + @property + def ignore_directories(self) -> bool: + """(Read-only) + ``True`` if directories should be ignored; ``False`` otherwise. + """ + return self._ignore_directories + + @property + def case_sensitive(self) -> bool: + """(Read-only) + ``True`` if path names should be matched sensitive to case; ``False`` + otherwise. + """ + return self._case_sensitive + + def dispatch(self, event: FileSystemEvent) -> None: + """Dispatches events to the appropriate methods. + + :param event: + The event object representing the file system event. + :type event: + :class:`FileSystemEvent` + """ + if self.ignore_directories and event.is_directory: + return + + paths = [] + if hasattr(event, "dest_path"): + paths.append(os.fsdecode(event.dest_path)) + if event.src_path: + paths.append(os.fsdecode(event.src_path)) + + if any(r.match(p) for r in self.ignore_regexes for p in paths): + return + + if any(r.match(p) for r in self.regexes for p in paths): + super().dispatch(event) + + +class LoggingEventHandler(FileSystemEventHandler): + """Logs all the events captured.""" + + def __init__(self, *, logger: logging.Logger | None = None) -> None: + super().__init__() + self.logger = logger or logging.root + + def on_moved(self, event: DirMovedEvent | FileMovedEvent) -> None: + super().on_moved(event) + + what = "directory" if event.is_directory else "file" + self.logger.info("Moved %s: from %s to %s", what, event.src_path, event.dest_path) + + def on_created(self, event: DirCreatedEvent | FileCreatedEvent) -> None: + super().on_created(event) + + what = "directory" if event.is_directory else "file" + self.logger.info("Created %s: %s", what, event.src_path) + + def on_deleted(self, event: DirDeletedEvent | FileDeletedEvent) -> None: + super().on_deleted(event) + + what = "directory" if event.is_directory else "file" + self.logger.info("Deleted %s: %s", what, event.src_path) + + def on_modified(self, event: DirModifiedEvent | FileModifiedEvent) -> None: + super().on_modified(event) + + what = "directory" if event.is_directory else "file" + self.logger.info("Modified %s: %s", what, event.src_path) + + def on_closed(self, event: FileClosedEvent) -> None: + super().on_closed(event) + + self.logger.info("Closed modified file: %s", event.src_path) + + def on_closed_no_write(self, event: FileClosedNoWriteEvent) -> None: + super().on_closed_no_write(event) + + self.logger.info("Closed read file: %s", event.src_path) + + def on_opened(self, event: FileOpenedEvent) -> None: + super().on_opened(event) + + self.logger.info("Opened file: %s", event.src_path) + + +def generate_sub_moved_events( + src_dir_path: bytes | str, + dest_dir_path: bytes | str, +) -> Generator[DirMovedEvent | FileMovedEvent]: + """Generates an event list of :class:`DirMovedEvent` and + :class:`FileMovedEvent` objects for all the files and directories within + the given moved directory that were moved along with the directory. + + :param src_dir_path: + The source path of the moved directory. + :param dest_dir_path: + The destination path of the moved directory. + :returns: + An iterable of file system events of type :class:`DirMovedEvent` and + :class:`FileMovedEvent`. + """ + for root, directories, filenames in os.walk(dest_dir_path): # type: ignore[type-var] + for directory in directories: + full_path = os.path.join(root, directory) # type: ignore[call-overload] + renamed_path = full_path.replace(dest_dir_path, src_dir_path) if src_dir_path else "" + yield DirMovedEvent(renamed_path, full_path, is_synthetic=True) + for filename in filenames: + full_path = os.path.join(root, filename) # type: ignore[call-overload] + renamed_path = full_path.replace(dest_dir_path, src_dir_path) if src_dir_path else "" + yield FileMovedEvent(renamed_path, full_path, is_synthetic=True) + + +def generate_sub_created_events(src_dir_path: bytes | str) -> Generator[DirCreatedEvent | FileCreatedEvent]: + """Generates an event list of :class:`DirCreatedEvent` and + :class:`FileCreatedEvent` objects for all the files and directories within + the given moved directory that were moved along with the directory. + + :param src_dir_path: + The source path of the created directory. + :returns: + An iterable of file system events of type :class:`DirCreatedEvent` and + :class:`FileCreatedEvent`. + """ + for root, directories, filenames in os.walk(src_dir_path): # type: ignore[type-var] + for directory in directories: + full_path = os.path.join(root, directory) # type: ignore[call-overload] + yield DirCreatedEvent(full_path, is_synthetic=True) + for filename in filenames: + full_path = os.path.join(root, filename) # type: ignore[call-overload] + yield FileCreatedEvent(full_path, is_synthetic=True) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__init__.py b/micromamba_root/Lib/site-packages/watchdog/observers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ce3957418de5fbbd7bb4c731d6ef5031bab4abaa --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/__init__.py @@ -0,0 +1,91 @@ +""":module: watchdog.observers +:synopsis: Observer that picks a native implementation if available. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Classes +======= +.. autoclass:: Observer + :members: + :show-inheritance: + :inherited-members: + +Observer thread that schedules watching directories and dispatches +calls to event handlers. + +You can also import platform specific classes directly and use it instead +of :class:`Observer`. Here is a list of implemented observer classes.: + +============== ================================ ============================== +Class Platforms Note +============== ================================ ============================== +|Inotify| Linux 2.6.13+ ``inotify(7)`` based observer +|FSEvents| macOS FSEvents based observer +|Kqueue| macOS and BSD with kqueue(2) ``kqueue(2)`` based observer +|WinApi| Microsoft Windows Windows API-based observer +|Polling| Any fallback implementation +============== ================================ ============================== + +.. |Inotify| replace:: :class:`.inotify.InotifyObserver` +.. |FSEvents| replace:: :class:`.fsevents.FSEventsObserver` +.. |Kqueue| replace:: :class:`.kqueue.KqueueObserver` +.. |WinApi| replace:: :class:`.read_directory_changes.WindowsApiObserver` +.. |Polling| replace:: :class:`.polling.PollingObserver` + +""" + +from __future__ import annotations + +import contextlib +import warnings +from typing import TYPE_CHECKING, Protocol + +from watchdog.utils import UnsupportedLibcError, platform + +if TYPE_CHECKING: + from watchdog.observers.api import BaseObserver + + +class ObserverType(Protocol): + def __call__(self, *, timeout: float = ...) -> BaseObserver: ... + + +def _get_observer_cls() -> ObserverType: + if platform.is_linux(): + with contextlib.suppress(UnsupportedLibcError): + from watchdog.observers.inotify import InotifyObserver + + return InotifyObserver + elif platform.is_darwin(): + try: + from watchdog.observers.fsevents import FSEventsObserver + except Exception: + try: + from watchdog.observers.kqueue import KqueueObserver + except Exception: + warnings.warn("Failed to import fsevents and kqueue. Fall back to polling.", stacklevel=1) + else: + warnings.warn("Failed to import fsevents. Fall back to kqueue", stacklevel=1) + return KqueueObserver + else: + return FSEventsObserver + elif platform.is_windows(): + try: + from watchdog.observers.read_directory_changes import WindowsApiObserver + except Exception: + warnings.warn("Failed to import `read_directory_changes`. Fall back to polling.", stacklevel=1) + else: + return WindowsApiObserver + elif platform.is_bsd(): + from watchdog.observers.kqueue import KqueueObserver + + return KqueueObserver + + from watchdog.observers.polling import PollingObserver + + return PollingObserver + + +Observer = _get_observer_cls() + +__all__ = ["Observer"] diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f15721658638581f1389681e1ca8f20a4eceaf9b Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/api.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/api.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..065f36bccc7101255dcf0dde59aea8edf6ee6799 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/api.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1b170d75e365bfecaa186814ade0c9ddf4a4c91 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents2.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents2.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6792120a1ec4a7632d312cf04836e1195243a8f Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/fsevents2.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fa171fc5e4a17738702318c0c1595a10a4f0fff Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_buffer.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_buffer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83455f15a9fd3c76c2fe37180937c5d9157d1dd6 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_buffer.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_c.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_c.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..131de8b0396124512e019a0c98447cfcedb0c6b0 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/inotify_c.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/kqueue.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/kqueue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..637e2dbe9282b0a11f6db1d5d9ede7bd2153466b Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/kqueue.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/polling.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/polling.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c45c538259fc1a4b1b4ab491ad879d08268d4e91 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/polling.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/read_directory_changes.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/read_directory_changes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3698f4c1bc5a84040258aa88c22e516646065b2d Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/read_directory_changes.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/winapi.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/winapi.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84d0cda2938a0f866ac04556250205e055597c29 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/observers/__pycache__/winapi.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/api.py b/micromamba_root/Lib/site-packages/watchdog/observers/api.py new file mode 100644 index 0000000000000000000000000000000000000000..30cb21caff9c686e11c6420064d039f37eb1ff02 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/api.py @@ -0,0 +1,392 @@ +from __future__ import annotations + +import contextlib +import queue +import threading +from collections import defaultdict +from pathlib import Path +from typing import TYPE_CHECKING + +from watchdog.utils import BaseThread +from watchdog.utils.bricks import SkipRepeatsQueue + +if TYPE_CHECKING: + from watchdog.events import FileSystemEvent, FileSystemEventHandler + +DEFAULT_EMITTER_TIMEOUT = 1.0 # in seconds +DEFAULT_OBSERVER_TIMEOUT = 1.0 # in seconds + + +class EventQueue(SkipRepeatsQueue): + """Thread-safe event queue based on a special queue that skips adding + the same event (:class:`FileSystemEvent`) multiple times consecutively. + Thus avoiding dispatching multiple event handling + calls when multiple identical events are produced quicker than an observer + can consume them. + """ + + +class ObservedWatch: + """An scheduled watch. + + :param path: + Path string. + :param recursive: + ``True`` if watch is recursive; ``False`` otherwise. + :param event_filter: + Optional collection of :class:`watchdog.events.FileSystemEvent` to watch + """ + + def __init__(self, path: str | Path, *, recursive: bool, event_filter: list[type[FileSystemEvent]] | None = None): + self._path = str(path) if isinstance(path, Path) else path + self._is_recursive = recursive + self._event_filter = frozenset(event_filter) if event_filter is not None else None + + @property + def path(self) -> str: + """The path that this watch monitors.""" + return self._path + + @property + def is_recursive(self) -> bool: + """Determines whether subdirectories are watched for the path.""" + return self._is_recursive + + @property + def event_filter(self) -> frozenset[type[FileSystemEvent]] | None: + """Collection of event types watched for the path""" + return self._event_filter + + @property + def key(self) -> tuple[str, bool, frozenset[type[FileSystemEvent]] | None]: + return self.path, self.is_recursive, self.event_filter + + def __eq__(self, watch: object) -> bool: + if not isinstance(watch, ObservedWatch): + return NotImplemented + return self.key == watch.key + + def __ne__(self, watch: object) -> bool: + if not isinstance(watch, ObservedWatch): + return NotImplemented + return self.key != watch.key + + def __hash__(self) -> int: + return hash(self.key) + + def __repr__(self) -> str: + if self.event_filter is not None: + event_filter_str = "|".join(sorted(_cls.__name__ for _cls in self.event_filter)) + event_filter_str = f", event_filter={event_filter_str}" + else: + event_filter_str = "" + return f"<{type(self).__name__}: path={self.path!r}, is_recursive={self.is_recursive}{event_filter_str}>" + + +# Observer classes +class EventEmitter(BaseThread): + """Producer thread base class subclassed by event emitters + that generate events and populate a queue with them. + + :param event_queue: + The event queue to populate with generated events. + :type event_queue: + :class:`watchdog.events.EventQueue` + :param watch: + The watch to observe and produce events for. + :type watch: + :class:`ObservedWatch` + :param timeout: + Timeout (in seconds) between successive attempts at reading events. + :type timeout: + ``float`` + :param event_filter: + Collection of event types to emit, or None for no filtering (default). + :type event_filter: + Iterable[:class:`watchdog.events.FileSystemEvent`] | None + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + ) -> None: + super().__init__() + self._event_queue = event_queue + self._watch = watch + self._timeout = timeout + self._event_filter = frozenset(event_filter) if event_filter is not None else None + + @property + def timeout(self) -> float: + """Blocking timeout for reading events.""" + return self._timeout + + @property + def watch(self) -> ObservedWatch: + """The watch associated with this emitter.""" + return self._watch + + def queue_event(self, event: FileSystemEvent) -> None: + """Queues a single event. + + :param event: + Event to be queued. + :type event: + An instance of :class:`watchdog.events.FileSystemEvent` + or a subclass. + """ + if self._event_filter is None or any(isinstance(event, cls) for cls in self._event_filter): + self._event_queue.put((event, self.watch)) + + def queue_events(self, timeout: float) -> None: + """Override this method to populate the event queue with events + per interval period. + + :param timeout: + Timeout (in seconds) between successive attempts at + reading events. + :type timeout: + ``float`` + """ + + def run(self) -> None: + while self.should_keep_running(): + self.queue_events(self.timeout) + + +class EventDispatcher(BaseThread): + """Consumer thread base class subclassed by event observer threads + that dispatch events from an event queue to appropriate event handlers. + + :param timeout: + Timeout value (in seconds) passed to emitters + constructions in the child class BaseObserver. + :type timeout: + ``float`` + """ + + stop_event = object() + """Event inserted into the queue to signal a requested stop.""" + + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__() + self._event_queue = EventQueue() + self._timeout = timeout + + @property + def timeout(self) -> float: + """Timeout value to construct emitters with.""" + return self._timeout + + def stop(self) -> None: + BaseThread.stop(self) + with contextlib.suppress(queue.Full): + self.event_queue.put_nowait(EventDispatcher.stop_event) + + @property + def event_queue(self) -> EventQueue: + """The event queue which is populated with file system events + by emitters and from which events are dispatched by a dispatcher + thread. + """ + return self._event_queue + + def dispatch_events(self, event_queue: EventQueue) -> None: + """Override this method to consume events from an event queue, blocking + on the queue for the specified timeout before raising :class:`queue.Empty`. + + :param event_queue: + Event queue to populate with one set of events. + :type event_queue: + :class:`EventQueue` + :raises: + :class:`queue.Empty` + """ + + def run(self) -> None: + while self.should_keep_running(): + try: + self.dispatch_events(self.event_queue) + except queue.Empty: + continue + + +class BaseObserver(EventDispatcher): + """Base observer.""" + + def __init__(self, emitter_class: type[EventEmitter], *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(timeout=timeout) + self._emitter_class = emitter_class + self._lock = threading.RLock() + self._watches: set[ObservedWatch] = set() + self._handlers: defaultdict[ObservedWatch, set[FileSystemEventHandler]] = defaultdict(set) + self._emitters: set[EventEmitter] = set() + self._emitter_for_watch: dict[ObservedWatch, EventEmitter] = {} + + def _add_emitter(self, emitter: EventEmitter) -> None: + self._emitter_for_watch[emitter.watch] = emitter + self._emitters.add(emitter) + + def _remove_emitter(self, emitter: EventEmitter) -> None: + del self._emitter_for_watch[emitter.watch] + self._emitters.remove(emitter) + emitter.stop() + with contextlib.suppress(RuntimeError): + emitter.join() + + def _clear_emitters(self) -> None: + for emitter in self._emitters: + emitter.stop() + for emitter in self._emitters: + with contextlib.suppress(RuntimeError): + emitter.join() + self._emitters.clear() + self._emitter_for_watch.clear() + + def _add_handler_for_watch(self, event_handler: FileSystemEventHandler, watch: ObservedWatch) -> None: + self._handlers[watch].add(event_handler) + + def _remove_handlers_for_watch(self, watch: ObservedWatch) -> None: + del self._handlers[watch] + + @property + def emitters(self) -> set[EventEmitter]: + """Returns event emitter created by this observer.""" + return self._emitters + + def start(self) -> None: + for emitter in self._emitters.copy(): + try: + emitter.start() + except Exception: + self._remove_emitter(emitter) + raise + super().start() + + def schedule( + self, + event_handler: FileSystemEventHandler, + path: str, + *, + recursive: bool = False, + event_filter: list[type[FileSystemEvent]] | None = None, + ) -> ObservedWatch: + """Schedules watching a path and calls appropriate methods specified + in the given event handler in response to file system events. + + :param event_handler: + An event handler instance that has appropriate event handling + methods which will be called by the observer in response to + file system events. + :type event_handler: + :class:`watchdog.events.FileSystemEventHandler` or a subclass + :param path: + Directory path that will be monitored. + :type path: + ``str`` + :param recursive: + ``True`` if events will be emitted for sub-directories + traversed recursively; ``False`` otherwise. + :type recursive: + ``bool`` + :param event_filter: + Collection of event types to emit, or None for no filtering (default). + :type event_filter: + Iterable[:class:`watchdog.events.FileSystemEvent`] | None + :return: + An :class:`ObservedWatch` object instance representing + a watch. + """ + with self._lock: + watch = ObservedWatch(path, recursive=recursive, event_filter=event_filter) + self._add_handler_for_watch(event_handler, watch) + + # If we don't have an emitter for this watch already, create it. + if watch not in self._emitter_for_watch: + emitter = self._emitter_class(self.event_queue, watch, timeout=self.timeout, event_filter=event_filter) + if self.is_alive(): + emitter.start() + self._add_emitter(emitter) + self._watches.add(watch) + return watch + + def add_handler_for_watch(self, event_handler: FileSystemEventHandler, watch: ObservedWatch) -> None: + """Adds a handler for the given watch. + + :param event_handler: + An event handler instance that has appropriate event handling + methods which will be called by the observer in response to + file system events. + :type event_handler: + :class:`watchdog.events.FileSystemEventHandler` or a subclass + :param watch: + The watch to add a handler for. + :type watch: + An instance of :class:`ObservedWatch` or a subclass of + :class:`ObservedWatch` + """ + with self._lock: + self._add_handler_for_watch(event_handler, watch) + + def remove_handler_for_watch(self, event_handler: FileSystemEventHandler, watch: ObservedWatch) -> None: + """Removes a handler for the given watch. + + :param event_handler: + An event handler instance that has appropriate event handling + methods which will be called by the observer in response to + file system events. + :type event_handler: + :class:`watchdog.events.FileSystemEventHandler` or a subclass + :param watch: + The watch to remove a handler for. + :type watch: + An instance of :class:`ObservedWatch` or a subclass of + :class:`ObservedWatch` + """ + with self._lock: + self._handlers[watch].remove(event_handler) + + def unschedule(self, watch: ObservedWatch) -> None: + """Unschedules a watch. + + :param watch: + The watch to unschedule. + :type watch: + An instance of :class:`ObservedWatch` or a subclass of + :class:`ObservedWatch` + """ + with self._lock: + emitter = self._emitter_for_watch[watch] + del self._handlers[watch] + self._remove_emitter(emitter) + self._watches.remove(watch) + + def unschedule_all(self) -> None: + """Unschedules all watches and detaches all associated event handlers.""" + with self._lock: + self._handlers.clear() + self._clear_emitters() + self._watches.clear() + + def on_thread_stop(self) -> None: + self.unschedule_all() + + def dispatch_events(self, event_queue: EventQueue) -> None: + entry = event_queue.get(block=True) + if entry is EventDispatcher.stop_event: + return + + event, watch = entry + + with self._lock: + # To allow unschedule/stop and safe removal of event handlers + # within event handlers itself, check if the handler is still + # registered after every dispatch. + for handler in self._handlers[watch].copy(): + if handler in self._handlers[watch]: + handler.dispatch(event) + event_queue.task_done() diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/fsevents.py b/micromamba_root/Lib/site-packages/watchdog/observers/fsevents.py new file mode 100644 index 0000000000000000000000000000000000000000..257e16e7b16c39751963781c1d37fc11b22489b5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/fsevents.py @@ -0,0 +1,339 @@ +""":module: watchdog.observers.fsevents +:synopsis: FSEvents based emitter implementation. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: macOS +""" + +from __future__ import annotations + +import logging +import os +import threading +import time +import unicodedata +from typing import TYPE_CHECKING + +import _watchdog_fsevents as _fsevents + +from watchdog.events import ( + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, + generate_sub_created_events, + generate_sub_moved_events, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter +from watchdog.utils.dirsnapshot import DirectorySnapshot + +if TYPE_CHECKING: + from watchdog.events import FileSystemEvent, FileSystemEventHandler + from watchdog.observers.api import EventQueue, ObservedWatch + + +logger = logging.getLogger("fsevents") + + +class FSEventsEmitter(EventEmitter): + """macOS FSEvents Emitter class. + + :param event_queue: + The event queue to fill with events. + :param watch: + A watch object representing the directory to monitor. + :type watch: + :class:`watchdog.observers.api.ObservedWatch` + :param timeout: + Read events blocking timeout (in seconds). + :param event_filter: + Collection of event types to emit, or None for no filtering (default). + :param suppress_history: + The FSEvents API may emit historic events up to 30 sec before the watch was + started. When ``suppress_history`` is ``True``, those events will be suppressed + by creating a directory snapshot of the watched path before starting the stream + as a reference to suppress old events. Warning: This may result in significant + memory usage in case of a large number of items in the watched path. + :type timeout: + ``float`` + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + suppress_history: bool = False, + ) -> None: + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + self._fs_view: set[int] = set() + self.suppress_history = suppress_history + self._start_time = 0.0 + self._starting_state: DirectorySnapshot | None = None + self._lock = threading.Lock() + self._absolute_watch_path = os.path.realpath(os.path.abspath(os.path.expanduser(self.watch.path))) + + def on_thread_stop(self) -> None: + _fsevents.remove_watch(self.watch) + _fsevents.stop(self) + + def queue_event(self, event: FileSystemEvent) -> None: + # fsevents defaults to be recursive, so if the watch was meant to be non-recursive then we need to drop + # all the events here which do not have a src_path / dest_path that matches the watched path + if self._watch.is_recursive or not self._is_recursive_event(event): + logger.debug("queue_event %s", event) + EventEmitter.queue_event(self, event) + else: + logger.debug("drop event %s", event) + + def _is_recursive_event(self, event: FileSystemEvent) -> bool: + src_path = event.src_path if event.is_directory else os.path.dirname(event.src_path) + if src_path == self._absolute_watch_path: + return False + + if isinstance(event, (FileMovedEvent, DirMovedEvent)): + # when moving something into the watch path we must always take the dirname, + # otherwise we miss out on `DirMovedEvent`s + dest_path = os.path.dirname(event.dest_path) + if dest_path == self._absolute_watch_path: + return False + + return True + + def _queue_created_event(self, event: FileSystemEvent, src_path: bytes | str, dirname: bytes | str) -> None: + cls = DirCreatedEvent if event.is_directory else FileCreatedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(dirname)) + + def _queue_deleted_event(self, event: FileSystemEvent, src_path: bytes | str, dirname: bytes | str) -> None: + cls = DirDeletedEvent if event.is_directory else FileDeletedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(dirname)) + + def _queue_modified_event(self, event: FileSystemEvent, src_path: bytes | str, dirname: bytes | str) -> None: + cls = DirModifiedEvent if event.is_directory else FileModifiedEvent + self.queue_event(cls(src_path)) + + def _queue_renamed_event( + self, + src_event: FileSystemEvent, + src_path: bytes | str, + dst_path: bytes | str, + src_dirname: bytes | str, + dst_dirname: bytes | str, + ) -> None: + cls = DirMovedEvent if src_event.is_directory else FileMovedEvent + dst_path = self._encode_path(dst_path) + self.queue_event(cls(src_path, dst_path)) + self.queue_event(DirModifiedEvent(src_dirname)) + self.queue_event(DirModifiedEvent(dst_dirname)) + + def _is_historic_created_event(self, event: _fsevents.NativeEvent) -> bool: + # We only queue a created event if the item was created after we + # started the FSEventsStream. + + in_history = event.inode in self._fs_view + + if self._starting_state: + try: + old_inode = self._starting_state.inode(event.path)[0] + before_start = old_inode == event.inode + except KeyError: + before_start = False + else: + before_start = False + + return in_history or before_start + + @staticmethod + def _is_meta_mod(event: _fsevents.NativeEvent) -> bool: + """Returns True if the event indicates a change in metadata.""" + return event.is_inode_meta_mod or event.is_xattr_mod or event.is_owner_change + + def queue_events(self, timeout: float, events: list[_fsevents.NativeEvent]) -> None: # type: ignore[override] + if logger.getEffectiveLevel() <= logging.DEBUG: + for event in events: + flags = ", ".join(attr for attr in dir(event) if getattr(event, attr) is True) + logger.debug("%s: %s", event, flags) + + if time.monotonic() - self._start_time > 60: + # Event history is no longer needed, let's free some memory. + self._starting_state = None + + while events: + event = events.pop(0) + + src_path = self._encode_path(event.path) + src_dirname = os.path.dirname(src_path) + + try: + stat = os.stat(src_path) + except OSError: + stat = None + + exists = stat and stat.st_ino == event.inode + + # FSevents may coalesce multiple events for the same item + path into a + # single event. However, events are never coalesced for different items at + # the same path or for the same item at different paths. Therefore, the + # event chains "removed -> created" and "created -> renamed -> removed" will + # never emit a single native event and a deleted event *always* means that + # the item no longer existed at the end of the event chain. + + # Some events will have a spurious `is_created` flag set, coalesced from an + # already emitted and processed CreatedEvent. To filter those, we keep track + # of all inodes which we know to be already created. This is safer than + # keeping track of paths since paths are more likely to be reused than + # inodes. + + # Likewise, some events will have a spurious `is_modified`, + # `is_inode_meta_mod` or `is_xattr_mod` flag set. We currently do not + # suppress those but could do so if the item still exists by caching the + # stat result and verifying that it did change. + + if event.is_created and event.is_removed: + # Events will only be coalesced for the same item / inode. + # The sequence deleted -> created therefore cannot occur. + # Any combination with renamed cannot occur either. + + if not self._is_historic_created_event(event): + self._queue_created_event(event, src_path, src_dirname) + + self._fs_view.add(event.inode) + + if event.is_modified or self._is_meta_mod(event): + self._queue_modified_event(event, src_path, src_dirname) + + self._queue_deleted_event(event, src_path, src_dirname) + self._fs_view.discard(event.inode) + + else: + if event.is_created and not self._is_historic_created_event(event): + self._queue_created_event(event, src_path, src_dirname) + + self._fs_view.add(event.inode) + + if event.is_modified or self._is_meta_mod(event): + self._queue_modified_event(event, src_path, src_dirname) + + if event.is_renamed: + # Check if we have a corresponding destination event in the watched path. + dst_event = next( + iter(e for e in events if e.is_renamed and e.inode == event.inode), + None, + ) + + if dst_event: + # Item was moved within the watched folder. + logger.debug("Destination event for rename is %s", dst_event) + + dst_path = self._encode_path(dst_event.path) + dst_dirname = os.path.dirname(dst_path) + + self._queue_renamed_event(event, src_path, dst_path, src_dirname, dst_dirname) + self._fs_view.add(event.inode) + + for sub_moved_event in generate_sub_moved_events(src_path, dst_path): + self.queue_event(sub_moved_event) + + # Process any coalesced flags for the dst_event. + + events.remove(dst_event) + + if dst_event.is_modified or self._is_meta_mod(dst_event): + self._queue_modified_event(dst_event, dst_path, dst_dirname) + + if dst_event.is_removed: + self._queue_deleted_event(dst_event, dst_path, dst_dirname) + self._fs_view.discard(dst_event.inode) + + elif exists: + # This is the destination event, item was moved into the watched + # folder. + self._queue_created_event(event, src_path, src_dirname) + self._fs_view.add(event.inode) + + for sub_created_event in generate_sub_created_events(src_path): + self.queue_event(sub_created_event) + + else: + # This is the source event, item was moved out of the watched + # folder. + self._queue_deleted_event(event, src_path, src_dirname) + self._fs_view.discard(event.inode) + + # Skip further coalesced processing. + continue + + if event.is_removed: + # Won't occur together with renamed. + self._queue_deleted_event(event, src_path, src_dirname) + self._fs_view.discard(event.inode) + + if event.is_root_changed: + # This will be set if root or any of its parents is renamed or deleted. + # TODO: find out new path and generate DirMovedEvent? + self.queue_event(DirDeletedEvent(self.watch.path)) + logger.debug("Stopping because root path was changed") + self.stop() + + self._fs_view.clear() + + def events_callback(self, paths: list[bytes], inodes: list[int], flags: list[int], ids: list[int]) -> None: + """Callback passed to FSEventStreamCreate(), it will receive all + FS events and queue them. + """ + cls = _fsevents.NativeEvent + try: + events = [ + cls(path, inode, event_flags, event_id) + for path, inode, event_flags, event_id in zip(paths, inodes, flags, ids) + ] + with self._lock: + self.queue_events(self.timeout, events) + except Exception: + logger.exception("Unhandled exception in fsevents callback") + + def run(self) -> None: + self.pathnames = [self.watch.path] + self._start_time = time.monotonic() + try: + _fsevents.add_watch(self, self.watch, self.events_callback, self.pathnames) + _fsevents.read_events(self) + except Exception: + logger.exception("Unhandled exception in FSEventsEmitter") + + def on_thread_start(self) -> None: + if self.suppress_history: + watch_path = os.fsdecode(self.watch.path) if isinstance(self.watch.path, bytes) else self.watch.path + self._starting_state = DirectorySnapshot(watch_path) + + def _encode_path(self, path: bytes | str) -> bytes | str: + """Encode path only if bytes were passed to this emitter.""" + return os.fsencode(path) if isinstance(self.watch.path, bytes) else path + + +class FSEventsObserver(BaseObserver): + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(FSEventsEmitter, timeout=timeout) + + def schedule( + self, + event_handler: FileSystemEventHandler, + path: str, + *, + recursive: bool = False, + event_filter: list[type[FileSystemEvent]] | None = None, + ) -> ObservedWatch: + # Fix for issue #26: Trace/BPT error when given a unicode path + # string. https://github.com/gorakhargosh/watchdog/issues#issue/26 + if isinstance(path, str): + path = unicodedata.normalize("NFC", path) + + return super().schedule(event_handler, path, recursive=recursive, event_filter=event_filter) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/fsevents2.py b/micromamba_root/Lib/site-packages/watchdog/observers/fsevents2.py new file mode 100644 index 0000000000000000000000000000000000000000..3d1f7e9b1eb7dd03bd58a52aa0728f2b590aaa0a --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/fsevents2.py @@ -0,0 +1,253 @@ +""":module: watchdog.observers.fsevents2 +:synopsis: FSEvents based emitter implementation. +:author: thomas.amland@gmail.com (Thomas Amland) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: macOS +""" + +from __future__ import annotations + +import logging +import os +import queue +import unicodedata +import warnings +from threading import Thread +from typing import TYPE_CHECKING + +# pyobjc +import AppKit +from FSEvents import ( + CFRunLoopGetCurrent, + CFRunLoopRun, + CFRunLoopStop, + FSEventStreamCreate, + FSEventStreamInvalidate, + FSEventStreamRelease, + FSEventStreamScheduleWithRunLoop, + FSEventStreamStart, + FSEventStreamStop, + kCFAllocatorDefault, + kCFRunLoopDefaultMode, + kFSEventStreamCreateFlagFileEvents, + kFSEventStreamCreateFlagNoDefer, + kFSEventStreamEventFlagItemChangeOwner, + kFSEventStreamEventFlagItemCreated, + kFSEventStreamEventFlagItemFinderInfoMod, + kFSEventStreamEventFlagItemInodeMetaMod, + kFSEventStreamEventFlagItemIsDir, + kFSEventStreamEventFlagItemIsSymlink, + kFSEventStreamEventFlagItemModified, + kFSEventStreamEventFlagItemRemoved, + kFSEventStreamEventFlagItemRenamed, + kFSEventStreamEventFlagItemXattrMod, + kFSEventStreamEventIdSinceNow, +) + +from watchdog.events import ( + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, + FileSystemEvent, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter + +if TYPE_CHECKING: + from typing import Callable + + from watchdog.observers.api import EventQueue, ObservedWatch + +logger = logging.getLogger(__name__) + +message = "watchdog.observers.fsevents2 is deprecated and will be removed in a future release." +warnings.warn(message, category=DeprecationWarning, stacklevel=1) +logger.warning(message) + + +class FSEventsQueue(Thread): + """Low level FSEvents client.""" + + def __init__(self, path: bytes | str) -> None: + Thread.__init__(self) + self._queue: queue.Queue[list[NativeEvent] | None] = queue.Queue() + self._run_loop = None + + if isinstance(path, bytes): + path = os.fsdecode(path) + self._path = unicodedata.normalize("NFC", path) + + context = None + latency = 1.0 + self._stream_ref = FSEventStreamCreate( + kCFAllocatorDefault, + self._callback, + context, + [self._path], + kFSEventStreamEventIdSinceNow, + latency, + kFSEventStreamCreateFlagNoDefer | kFSEventStreamCreateFlagFileEvents, + ) + if self._stream_ref is None: + error = "FSEvents. Could not create stream." + raise OSError(error) + + def run(self) -> None: + pool = AppKit.NSAutoreleasePool.alloc().init() + self._run_loop = CFRunLoopGetCurrent() + FSEventStreamScheduleWithRunLoop(self._stream_ref, self._run_loop, kCFRunLoopDefaultMode) + if not FSEventStreamStart(self._stream_ref): + FSEventStreamInvalidate(self._stream_ref) + FSEventStreamRelease(self._stream_ref) + error = "FSEvents. Could not start stream." + raise OSError(error) + + CFRunLoopRun() + FSEventStreamStop(self._stream_ref) + FSEventStreamInvalidate(self._stream_ref) + FSEventStreamRelease(self._stream_ref) + del pool + # Make sure waiting thread is notified + self._queue.put(None) + + def stop(self) -> None: + if self._run_loop is not None: + CFRunLoopStop(self._run_loop) + + def _callback( + self, + stream_ref: int, + client_callback_info: Callable, + num_events: int, + event_paths: list[bytes], + event_flags: list[int], + event_ids: list[int], + ) -> None: + events = [NativeEvent(path, flags, _id) for path, flags, _id in zip(event_paths, event_flags, event_ids)] + logger.debug("FSEvents callback. Got %d events:", num_events) + for e in events: + logger.debug(e) + self._queue.put(events) + + def read_events(self) -> list[NativeEvent] | None: + """Returns a list or one or more events, or None if there are no more + events to be read. + """ + return self._queue.get() if self.is_alive() else None + + +class NativeEvent: + def __init__(self, path: bytes, flags: int, event_id: int) -> None: + self.path = path + self.flags = flags + self.event_id = event_id + self.is_created = bool(flags & kFSEventStreamEventFlagItemCreated) + self.is_removed = bool(flags & kFSEventStreamEventFlagItemRemoved) + self.is_renamed = bool(flags & kFSEventStreamEventFlagItemRenamed) + self.is_modified = bool(flags & kFSEventStreamEventFlagItemModified) + self.is_change_owner = bool(flags & kFSEventStreamEventFlagItemChangeOwner) + self.is_inode_meta_mod = bool(flags & kFSEventStreamEventFlagItemInodeMetaMod) + self.is_finder_info_mod = bool(flags & kFSEventStreamEventFlagItemFinderInfoMod) + self.is_xattr_mod = bool(flags & kFSEventStreamEventFlagItemXattrMod) + self.is_symlink = bool(flags & kFSEventStreamEventFlagItemIsSymlink) + self.is_directory = bool(flags & kFSEventStreamEventFlagItemIsDir) + + @property + def _event_type(self) -> str: + if self.is_created: + return "Created" + if self.is_removed: + return "Removed" + if self.is_renamed: + return "Renamed" + if self.is_modified: + return "Modified" + if self.is_inode_meta_mod: + return "InodeMetaMod" + if self.is_xattr_mod: + return "XattrMod" + return "Unknown" + + def __repr__(self) -> str: + return ( + f"<{type(self).__name__}: path={self.path!r}, type={self._event_type}," + f" is_dir={self.is_directory}, flags={hex(self.flags)}, id={self.event_id}>" + ) + + +class FSEventsEmitter(EventEmitter): + """FSEvents based event emitter. Handles conversion of native events.""" + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + ): + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + self._fsevents = FSEventsQueue(watch.path) + self._fsevents.start() + + def on_thread_stop(self) -> None: + self._fsevents.stop() + + def queue_events(self, timeout: float) -> None: + events = self._fsevents.read_events() + if events is None: + return + i = 0 + while i < len(events): + event = events[i] + + cls: type[FileSystemEvent] + # For some reason the create and remove flags are sometimes also + # set for rename and modify type events, so let those take + # precedence. + if event.is_renamed: + # Internal moves appears to always be consecutive in the same + # buffer and have IDs differ by exactly one (while others + # don't) making it possible to pair up the two events coming + # from a single move operation. (None of this is documented!) + # Otherwise, guess whether file was moved in or out. + # TODO: handle id wrapping + if i + 1 < len(events) and events[i + 1].is_renamed and events[i + 1].event_id == event.event_id + 1: + cls = DirMovedEvent if event.is_directory else FileMovedEvent + self.queue_event(cls(event.path, events[i + 1].path)) + self.queue_event(DirModifiedEvent(os.path.dirname(event.path))) + self.queue_event(DirModifiedEvent(os.path.dirname(events[i + 1].path))) + i += 1 + elif os.path.exists(event.path): + cls = DirCreatedEvent if event.is_directory else FileCreatedEvent + self.queue_event(cls(event.path)) + self.queue_event(DirModifiedEvent(os.path.dirname(event.path))) + else: + cls = DirDeletedEvent if event.is_directory else FileDeletedEvent + self.queue_event(cls(event.path)) + self.queue_event(DirModifiedEvent(os.path.dirname(event.path))) + # TODO: generate events for tree + + elif event.is_modified or event.is_inode_meta_mod or event.is_xattr_mod: + cls = DirModifiedEvent if event.is_directory else FileModifiedEvent + self.queue_event(cls(event.path)) + + elif event.is_created: + cls = DirCreatedEvent if event.is_directory else FileCreatedEvent + self.queue_event(cls(event.path)) + self.queue_event(DirModifiedEvent(os.path.dirname(event.path))) + + elif event.is_removed: + cls = DirDeletedEvent if event.is_directory else FileDeletedEvent + self.queue_event(cls(event.path)) + self.queue_event(DirModifiedEvent(os.path.dirname(event.path))) + i += 1 + + +class FSEventsObserver2(BaseObserver): + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(FSEventsEmitter, timeout=timeout) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/inotify.py b/micromamba_root/Lib/site-packages/watchdog/observers/inotify.py new file mode 100644 index 0000000000000000000000000000000000000000..a07aee5cf4451d28e74f940a7f4fe72f02b72b9c --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/inotify.py @@ -0,0 +1,252 @@ +""":module: watchdog.observers.inotify +:synopsis: ``inotify(7)`` based emitter implementation. +:author: Sebastien Martini <seb@dbzteam.org> +:author: Luke McCarthy <luke@iogopro.co.uk> +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: Tim Cuthbertson <tim+github@gfxmonk.net> +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: Linux 2.6.13+. + +.. ADMONITION:: About system requirements + + Recommended minimum kernel version: 2.6.25. + + Quote from the inotify(7) man page: + + "Inotify was merged into the 2.6.13 Linux kernel. The required library + interfaces were added to glibc in version 2.4. (IN_DONT_FOLLOW, + IN_MASK_ADD, and IN_ONLYDIR were only added in version 2.5.)" + + Therefore, you must ensure the system is running at least these versions + appropriate libraries and the kernel. + +.. ADMONITION:: About recursiveness, event order, and event coalescing + + Quote from the inotify(7) man page: + + If successive output inotify events produced on the inotify file + descriptor are identical (same wd, mask, cookie, and name) then they + are coalesced into a single event if the older event has not yet been + read (but see BUGS). + + The events returned by reading from an inotify file descriptor form + an ordered queue. Thus, for example, it is guaranteed that when + renaming from one directory to another, events will be produced in + the correct order on the inotify file descriptor. + + ... + + Inotify monitoring of directories is not recursive: to monitor + subdirectories under a directory, additional watches must be created. + + This emitter implementation therefore automatically adds watches for + sub-directories if running in recursive mode. + +Some extremely useful articles and documentation: + +.. _inotify FAQ: http://inotify.aiken.cz/?section=inotify&page=faq&lang=en +.. _intro to inotify: http://www.linuxjournal.com/article/8478 + +""" + +from __future__ import annotations + +import logging +import os +import threading +from typing import TYPE_CHECKING + +from watchdog.events import ( + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileClosedEvent, + FileClosedNoWriteEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, + FileOpenedEvent, + FileSystemEvent, + generate_sub_created_events, + generate_sub_moved_events, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter +from watchdog.observers.inotify_buffer import InotifyBuffer +from watchdog.observers.inotify_c import InotifyConstants + +if TYPE_CHECKING: + from watchdog.observers.api import EventQueue, ObservedWatch + +logger = logging.getLogger(__name__) + + +class InotifyEmitter(EventEmitter): + """inotify(7)-based event emitter. + + :param event_queue: + The event queue to fill with events. + :param watch: + A watch object representing the directory to monitor. + :type watch: + :class:`watchdog.observers.api.ObservedWatch` + :param timeout: + Read events blocking timeout (in seconds). + :type timeout: + ``float`` + :param event_filter: + Collection of event types to emit, or None for no filtering (default). + :type event_filter: + Iterable[:class:`watchdog.events.FileSystemEvent`] | None + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + ) -> None: + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + self._lock = threading.Lock() + self._inotify: InotifyBuffer | None = None + + def on_thread_start(self) -> None: + path = os.fsencode(self.watch.path) + event_mask = self.get_event_mask_from_filter() + self._inotify = InotifyBuffer(path, recursive=self.watch.is_recursive, event_mask=event_mask) + + def on_thread_stop(self) -> None: + if self._inotify: + self._inotify.close() + self._inotify = None + + def queue_events(self, timeout: float, *, full_events: bool = False) -> None: + # If "full_events" is true, then the method will report unmatched move events as separate events + # This behavior is by default only called by a InotifyFullEmitter + if self._inotify is None: + logger.error("InotifyEmitter.queue_events() called when the thread is inactive") + return + with self._lock: + if self._inotify is None: + logger.error("InotifyEmitter.queue_events() called when the thread is inactive") + return + event = self._inotify.read_event() + if event is None: + return + + cls: type[FileSystemEvent] + if isinstance(event, tuple): + move_from, move_to = event + src_path = self._decode_path(move_from.src_path) + dest_path = self._decode_path(move_to.src_path) + cls = DirMovedEvent if move_from.is_directory else FileMovedEvent + self.queue_event(cls(src_path, dest_path)) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + self.queue_event(DirModifiedEvent(os.path.dirname(dest_path))) + if move_from.is_directory and self.watch.is_recursive: + for sub_moved_event in generate_sub_moved_events(src_path, dest_path): + self.queue_event(sub_moved_event) + return + + src_path = self._decode_path(event.src_path) + if event.is_moved_to: + if full_events: + cls = DirMovedEvent if event.is_directory else FileMovedEvent + self.queue_event(cls("", src_path)) + else: + cls = DirCreatedEvent if event.is_directory else FileCreatedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + if event.is_directory and self.watch.is_recursive: + for sub_created_event in generate_sub_created_events(src_path): + self.queue_event(sub_created_event) + elif event.is_attrib or event.is_modify: + cls = DirModifiedEvent if event.is_directory else FileModifiedEvent + self.queue_event(cls(src_path)) + elif event.is_delete or (event.is_moved_from and not full_events): + cls = DirDeletedEvent if event.is_directory else FileDeletedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + elif event.is_moved_from and full_events: + cls = DirMovedEvent if event.is_directory else FileMovedEvent + self.queue_event(cls(src_path, "")) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + elif event.is_create: + cls = DirCreatedEvent if event.is_directory else FileCreatedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + elif event.is_delete_self and src_path == self.watch.path: + cls = DirDeletedEvent if event.is_directory else FileDeletedEvent + self.queue_event(cls(src_path)) + self.stop() + elif not event.is_directory: + if event.is_open: + cls = FileOpenedEvent + self.queue_event(cls(src_path)) + elif event.is_close_write: + cls = FileClosedEvent + self.queue_event(cls(src_path)) + self.queue_event(DirModifiedEvent(os.path.dirname(src_path))) + elif event.is_close_nowrite: + cls = FileClosedNoWriteEvent + self.queue_event(cls(src_path)) + + def _decode_path(self, path: bytes | str) -> bytes | str: + """Decode path only if unicode string was passed to this emitter.""" + return path if isinstance(self.watch.path, bytes) else os.fsdecode(path) + + def get_event_mask_from_filter(self) -> int | None: + """Optimization: Only include events we are filtering in inotify call.""" + if self._event_filter is None: + return None + + # Always listen to delete self + event_mask = InotifyConstants.IN_DELETE_SELF + + for cls in self._event_filter: + if cls in {DirMovedEvent, FileMovedEvent}: + event_mask |= InotifyConstants.IN_MOVE + elif cls in {DirCreatedEvent, FileCreatedEvent}: + event_mask |= InotifyConstants.IN_MOVE | InotifyConstants.IN_CREATE + elif cls is DirModifiedEvent: + event_mask |= ( + InotifyConstants.IN_MOVE + | InotifyConstants.IN_ATTRIB + | InotifyConstants.IN_MODIFY + | InotifyConstants.IN_CREATE + | InotifyConstants.IN_CLOSE_WRITE + ) + elif cls is FileModifiedEvent: + event_mask |= InotifyConstants.IN_ATTRIB | InotifyConstants.IN_MODIFY + elif cls in {DirDeletedEvent, FileDeletedEvent}: + event_mask |= InotifyConstants.IN_DELETE + elif cls is FileClosedEvent: + event_mask |= InotifyConstants.IN_CLOSE_WRITE + elif cls is FileClosedNoWriteEvent: + event_mask |= InotifyConstants.IN_CLOSE_NOWRITE + elif cls is FileOpenedEvent: + event_mask |= InotifyConstants.IN_OPEN + + return event_mask + + +class InotifyFullEmitter(InotifyEmitter): + """inotify(7)-based event emitter. By default this class produces move events even if they are not matched + Such move events will have a ``None`` value for the unmatched part. + """ + + def queue_events(self, timeout: float, *, events: bool = True) -> None: # type: ignore[override] + super().queue_events(timeout, full_events=events) + + +class InotifyObserver(BaseObserver): + """Observer thread that schedules watching directories and dispatches + calls to event handlers. + """ + + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT, generate_full_events: bool = False) -> None: + cls = InotifyFullEmitter if generate_full_events else InotifyEmitter + super().__init__(cls, timeout=timeout) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/inotify_buffer.py b/micromamba_root/Lib/site-packages/watchdog/observers/inotify_buffer.py new file mode 100644 index 0000000000000000000000000000000000000000..f542974a041ef5d27ea9c6cd4113a8827dfb68bd --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/inotify_buffer.py @@ -0,0 +1,102 @@ +""":module: watchdog.observers.inotify_buffer +:synopsis: A wrapper for ``Inotify``. +:author: thomas.amland@gmail.com (Thomas Amland) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: linux +""" + +from __future__ import annotations + +import logging + +from watchdog.observers.inotify_c import Inotify, InotifyEvent +from watchdog.utils import BaseThread +from watchdog.utils.delayed_queue import DelayedQueue + +logger = logging.getLogger(__name__) + + +class InotifyBuffer(BaseThread): + """A wrapper for `Inotify` that holds events for `delay` seconds. During + this time, IN_MOVED_FROM and IN_MOVED_TO events are paired. + """ + + delay = 0.5 + + def __init__(self, path: bytes, *, recursive: bool = False, event_mask: int | None = None) -> None: + super().__init__() + # XXX: Remove quotes after Python 3.9 drop + self._queue = DelayedQueue["InotifyEvent | tuple[InotifyEvent, InotifyEvent]"](self.delay) + self._inotify = Inotify(path, recursive=recursive, event_mask=event_mask) + self.start() + + def read_event(self) -> InotifyEvent | tuple[InotifyEvent, InotifyEvent] | None: + """Returns a single event or a tuple of from/to events in case of a + paired move event. If this buffer has been closed, immediately return + None. + """ + return self._queue.get() + + def on_thread_stop(self) -> None: + self._inotify.close() + self._queue.close() + + def close(self) -> None: + self.stop() + self.join() + + def _group_events(self, event_list: list[InotifyEvent]) -> list[InotifyEvent | tuple[InotifyEvent, InotifyEvent]]: + """Group any matching move events""" + grouped: list[InotifyEvent | tuple[InotifyEvent, InotifyEvent]] = [] + for inotify_event in event_list: + logger.debug("in-event %s", inotify_event) + + def matching_from_event(event: InotifyEvent | tuple[InotifyEvent, InotifyEvent]) -> bool: + return not isinstance(event, tuple) and event.is_moved_from and event.cookie == inotify_event.cookie + + if inotify_event.is_moved_to: + # Check if move_from is already in the buffer + for index, event in enumerate(grouped): + if matching_from_event(event): + grouped[index] = (event, inotify_event) # type: ignore[assignment] + break + else: + # Check if move_from is in delayqueue already + from_event = self._queue.remove(matching_from_event) + if from_event is not None: + grouped.append((from_event, inotify_event)) # type: ignore[arg-type] + else: + logger.debug("could not find matching move_from event") + grouped.append(inotify_event) + else: + grouped.append(inotify_event) + return grouped + + def run(self) -> None: + """Read event from `inotify` and add them to `queue`. When reading a + IN_MOVE_TO event, remove the previous added matching IN_MOVE_FROM event + and add them back to the queue as a tuple. + """ + deleted_self = False + while self.should_keep_running() and not deleted_self: + inotify_events = self._inotify.read_events() + grouped_events = self._group_events(inotify_events) + for inotify_event in grouped_events: + if not isinstance(inotify_event, tuple) and inotify_event.is_ignored: + if inotify_event.src_path == self._inotify.path: + # Watch was removed explicitly (inotify_rm_watch(2)) or automatically (file + # was deleted, or filesystem was unmounted), stop watching for events + deleted_self = True + continue + + # Only add delay for unmatched move_from events + delay = not isinstance(inotify_event, tuple) and inotify_event.is_moved_from + self._queue.put(inotify_event, delay=delay) + + if ( + not isinstance(inotify_event, tuple) + and inotify_event.is_delete_self + and inotify_event.src_path == self._inotify.path + ): + # Deleted the watched directory, stop watching for events + deleted_self = True diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/inotify_c.py b/micromamba_root/Lib/site-packages/watchdog/observers/inotify_c.py new file mode 100644 index 0000000000000000000000000000000000000000..33cbd25dda6eaf205c541e56cedf9ddf8d62cc4c --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/inotify_c.py @@ -0,0 +1,605 @@ +from __future__ import annotations + +import contextlib +import ctypes +import ctypes.util +import errno +import os +import select +import struct +import threading +from ctypes import c_char_p, c_int, c_uint32 +from functools import reduce +from typing import TYPE_CHECKING + +from watchdog.utils import UnsupportedLibcError + +if TYPE_CHECKING: + from collections.abc import Generator + +libc = ctypes.CDLL(None) + +if not hasattr(libc, "inotify_init") or not hasattr(libc, "inotify_add_watch") or not hasattr(libc, "inotify_rm_watch"): + error = f"Unsupported libc version found: {libc._name}" # noqa:SLF001 + raise UnsupportedLibcError(error) + +inotify_add_watch = ctypes.CFUNCTYPE(c_int, c_int, c_char_p, c_uint32, use_errno=True)(("inotify_add_watch", libc)) + +inotify_rm_watch = ctypes.CFUNCTYPE(c_int, c_int, c_uint32, use_errno=True)(("inotify_rm_watch", libc)) + +inotify_init = ctypes.CFUNCTYPE(c_int, use_errno=True)(("inotify_init", libc)) + + +class InotifyConstants: + # User-space events + IN_ACCESS = 0x00000001 # File was accessed. + IN_MODIFY = 0x00000002 # File was modified. + IN_ATTRIB = 0x00000004 # Meta-data changed. + IN_CLOSE_WRITE = 0x00000008 # Writable file was closed. + IN_CLOSE_NOWRITE = 0x00000010 # Unwritable file closed. + IN_OPEN = 0x00000020 # File was opened. + IN_MOVED_FROM = 0x00000040 # File was moved from X. + IN_MOVED_TO = 0x00000080 # File was moved to Y. + IN_CREATE = 0x00000100 # Subfile was created. + IN_DELETE = 0x00000200 # Subfile was deleted. + IN_DELETE_SELF = 0x00000400 # Self was deleted. + IN_MOVE_SELF = 0x00000800 # Self was moved. + + # Helper user-space events. + IN_MOVE = IN_MOVED_FROM | IN_MOVED_TO # Moves. + + # Events sent by the kernel to a watch. + IN_UNMOUNT = 0x00002000 # Backing file system was unmounted. + IN_Q_OVERFLOW = 0x00004000 # Event queued overflowed. + IN_IGNORED = 0x00008000 # File was ignored. + + # Special flags. + IN_ONLYDIR = 0x01000000 # Only watch the path if it's a directory. + IN_DONT_FOLLOW = 0x02000000 # Do not follow a symbolic link. + IN_EXCL_UNLINK = 0x04000000 # Exclude events on unlinked objects + IN_MASK_ADD = 0x20000000 # Add to the mask of an existing watch. + IN_ISDIR = 0x40000000 # Event occurred against directory. + IN_ONESHOT = 0x80000000 # Only send event once. + + # All user-space events. + IN_ALL_EVENTS = reduce( + lambda x, y: x | y, + [ + IN_ACCESS, + IN_MODIFY, + IN_ATTRIB, + IN_CLOSE_WRITE, + IN_CLOSE_NOWRITE, + IN_OPEN, + IN_MOVED_FROM, + IN_MOVED_TO, + IN_DELETE, + IN_CREATE, + IN_DELETE_SELF, + IN_MOVE_SELF, + ], + ) + + # Flags for ``inotify_init1`` + IN_CLOEXEC = 0x02000000 + IN_NONBLOCK = 0x00004000 + + +# Watchdog's API cares only about these events. +WATCHDOG_ALL_EVENTS = reduce( + lambda x, y: x | y, + [ + InotifyConstants.IN_MODIFY, + InotifyConstants.IN_ATTRIB, + InotifyConstants.IN_MOVED_FROM, + InotifyConstants.IN_MOVED_TO, + InotifyConstants.IN_CREATE, + InotifyConstants.IN_DELETE, + InotifyConstants.IN_DELETE_SELF, + InotifyConstants.IN_DONT_FOLLOW, + InotifyConstants.IN_CLOSE_WRITE, + InotifyConstants.IN_CLOSE_NOWRITE, + InotifyConstants.IN_OPEN, + ], +) + + +class InotifyEventStruct(ctypes.Structure): + """Structure representation of the inotify_event structure + (used in buffer size calculations):: + + struct inotify_event { + __s32 wd; /* watch descriptor */ + __u32 mask; /* watch mask */ + __u32 cookie; /* cookie to synchronize two events */ + __u32 len; /* length (including nulls) of name */ + char name[0]; /* stub for possible name */ + }; + """ + + _fields_ = ( + ("wd", c_int), + ("mask", c_uint32), + ("cookie", c_uint32), + ("len", c_uint32), + ("name", c_char_p), + ) + + +EVENT_SIZE = ctypes.sizeof(InotifyEventStruct) +DEFAULT_NUM_EVENTS = 2048 +DEFAULT_EVENT_BUFFER_SIZE = DEFAULT_NUM_EVENTS * (EVENT_SIZE + 16) + + +class Inotify: + """Linux inotify(7) API wrapper class. + + :param path: + The directory path for which we want an inotify object. + :type path: + :class:`bytes` + :param recursive: + ``True`` if subdirectories should be monitored; ``False`` otherwise. + """ + + def __init__(self, path: bytes, *, recursive: bool = False, event_mask: int | None = None) -> None: + # The file descriptor associated with the inotify instance. + inotify_fd = inotify_init() + if inotify_fd == -1: + Inotify._raise_error() + self._inotify_fd = inotify_fd + self._lock = threading.Lock() + self._closed = False + self._is_reading = True + self._kill_r, self._kill_w = os.pipe() + + # _check_inotify_fd will return true if we can read _inotify_fd without blocking + if hasattr(select, "poll"): + self._poller = select.poll() + self._poller.register(self._inotify_fd, select.POLLIN) + self._poller.register(self._kill_r, select.POLLIN) + + def do_poll() -> bool: + return any(fd == self._inotify_fd for fd, _ in self._poller.poll()) + + self._check_inotify_fd = do_poll + else: + + def do_select() -> bool: + result = select.select([self._inotify_fd, self._kill_r], [], []) + return self._inotify_fd in result[0] + + self._check_inotify_fd = do_select + + # Stores the watch descriptor for a given path. + self._wd_for_path: dict[bytes, int] = {} + self._path_for_wd: dict[int, bytes] = {} + + self._path = path + # Default to all events + if event_mask is None: + event_mask = WATCHDOG_ALL_EVENTS + self._event_mask = event_mask + self._is_recursive = recursive + if os.path.isdir(path): + self._add_dir_watch(path, event_mask, recursive=recursive) + else: + self._add_watch(path, event_mask) + self._moved_from_events: dict[int, InotifyEvent] = {} + + @property + def event_mask(self) -> int: + """The event mask for this inotify instance.""" + return self._event_mask + + @property + def path(self) -> bytes: + """The path associated with the inotify instance.""" + return self._path + + @property + def is_recursive(self) -> bool: + """Whether we are watching directories recursively.""" + return self._is_recursive + + @property + def fd(self) -> int: + """The file descriptor associated with the inotify instance.""" + return self._inotify_fd + + def clear_move_records(self) -> None: + """Clear cached records of MOVED_FROM events""" + self._moved_from_events = {} + + def source_for_move(self, destination_event: InotifyEvent) -> bytes | None: + """The source path corresponding to the given MOVED_TO event. + + If the source path is outside the monitored directories, None + is returned instead. + """ + if destination_event.cookie in self._moved_from_events: + return self._moved_from_events[destination_event.cookie].src_path + + return None + + def remember_move_from_event(self, event: InotifyEvent) -> None: + """Save this event as the source event for future MOVED_TO events to + reference. + """ + self._moved_from_events[event.cookie] = event + + def add_watch(self, path: bytes) -> None: + """Adds a watch for the given path. + + :param path: + Path to begin monitoring. + """ + with self._lock: + self._add_watch(path, self._event_mask) + + def remove_watch(self, path: bytes) -> None: + """Removes a watch for the given path. + + :param path: + Path string for which the watch will be removed. + """ + with self._lock: + wd = self._wd_for_path.pop(path) + del self._path_for_wd[wd] + if inotify_rm_watch(self._inotify_fd, wd) == -1: + Inotify._raise_error() + + def close(self) -> None: + """Closes the inotify instance and removes all associated watches.""" + with self._lock: + if not self._closed: + self._closed = True + + if self._path in self._wd_for_path: + wd = self._wd_for_path[self._path] + inotify_rm_watch(self._inotify_fd, wd) + + if self._is_reading: + # inotify_rm_watch() should write data to _inotify_fd and wake + # the thread, but writing to the kill channel will gaurentee this + os.write(self._kill_w, b"!") + else: + self._close_resources() + + def read_events(self, *, event_buffer_size: int = DEFAULT_EVENT_BUFFER_SIZE) -> list[InotifyEvent]: + """Reads events from inotify and yields them.""" + # HACK: We need to traverse the directory path + # recursively and simulate events for newly + # created subdirectories/files. This will handle + # mkdir -p foobar/blah/bar; touch foobar/afile + + def _recursive_simulate(src_path: bytes) -> list[InotifyEvent]: + events = [] + for root, dirnames, filenames in os.walk(src_path): + for dirname in dirnames: + with contextlib.suppress(OSError): + full_path = os.path.join(root, dirname) + wd_dir = self._add_watch(full_path, self._event_mask) + e = InotifyEvent( + wd_dir, + InotifyConstants.IN_CREATE | InotifyConstants.IN_ISDIR, + 0, + dirname, + full_path, + ) + events.append(e) + for filename in filenames: + full_path = os.path.join(root, filename) + wd_parent_dir = self._wd_for_path[os.path.dirname(full_path)] + e = InotifyEvent( + wd_parent_dir, + InotifyConstants.IN_CREATE, + 0, + filename, + full_path, + ) + events.append(e) + return events + + event_buffer = b"" + while True: + try: + with self._lock: + if self._closed: + return [] + + self._is_reading = True + + if self._check_inotify_fd(): + event_buffer = os.read(self._inotify_fd, event_buffer_size) + + with self._lock: + self._is_reading = False + + if self._closed: + self._close_resources() + return [] + except OSError as e: + if e.errno == errno.EINTR: + continue + + if e.errno == errno.EBADF: + return [] + + raise + break + + with self._lock: + event_list = [] + for wd, mask, cookie, name in Inotify._parse_event_buffer(event_buffer): + if wd == -1: + continue + wd_path = self._path_for_wd[wd] + src_path = os.path.join(wd_path, name) if name else wd_path # avoid trailing slash + inotify_event = InotifyEvent(wd, mask, cookie, name, src_path) + + if inotify_event.is_moved_from: + self.remember_move_from_event(inotify_event) + elif inotify_event.is_moved_to: + move_src_path = self.source_for_move(inotify_event) + if move_src_path in self._wd_for_path: + moved_wd = self._wd_for_path[move_src_path] + del self._wd_for_path[move_src_path] + self._wd_for_path[inotify_event.src_path] = moved_wd + self._path_for_wd[moved_wd] = inotify_event.src_path + if self.is_recursive: + for _path in self._wd_for_path.copy(): + if _path.startswith(move_src_path + os.path.sep.encode()): + moved_wd = self._wd_for_path.pop(_path) + _move_to_path = _path.replace(move_src_path, inotify_event.src_path) + self._wd_for_path[_move_to_path] = moved_wd + self._path_for_wd[moved_wd] = _move_to_path + src_path = os.path.join(wd_path, name) + inotify_event = InotifyEvent(wd, mask, cookie, name, src_path) + + if inotify_event.is_ignored: + # Clean up book-keeping for deleted watches. + path = self._path_for_wd.pop(wd) + if self._wd_for_path[path] == wd: + del self._wd_for_path[path] + + event_list.append(inotify_event) + + if self.is_recursive and inotify_event.is_directory and inotify_event.is_create: + # TODO: When a directory from another part of the + # filesystem is moved into a watched directory, this + # will not generate events for the directory tree. + # We need to coalesce IN_MOVED_TO events and those + # IN_MOVED_TO events which don't pair up with + # IN_MOVED_FROM events should be marked IN_CREATE + # instead relative to this directory. + try: + self._add_watch(src_path, self._event_mask) + except OSError: + continue + + event_list.extend(_recursive_simulate(src_path)) + + return event_list + + def _close_resources(self) -> None: + os.close(self._inotify_fd) + os.close(self._kill_r) + os.close(self._kill_w) + + # Non-synchronized methods. + def _add_dir_watch(self, path: bytes, mask: int, *, recursive: bool) -> None: + """Adds a watch (optionally recursively) for the given directory path + to monitor events specified by the mask. + + :param path: + Path to monitor + :param recursive: + ``True`` to monitor recursively. + :param mask: + Event bit mask. + """ + if not os.path.isdir(path): + raise OSError(errno.ENOTDIR, os.strerror(errno.ENOTDIR), path) + self._add_watch(path, mask) + if recursive: + for root, dirnames, _ in os.walk(path): + for dirname in dirnames: + full_path = os.path.join(root, dirname) + if os.path.islink(full_path): + continue + self._add_watch(full_path, mask) + + def _add_watch(self, path: bytes, mask: int) -> int: + """Adds a watch for the given path to monitor events specified by the + mask. + + :param path: + Path to monitor + :param mask: + Event bit mask. + """ + wd = inotify_add_watch(self._inotify_fd, path, mask) + if wd == -1: + Inotify._raise_error() + self._wd_for_path[path] = wd + self._path_for_wd[wd] = path + return wd + + @staticmethod + def _raise_error() -> None: + """Raises errors for inotify failures.""" + err = ctypes.get_errno() + + if err == errno.ENOSPC: + raise OSError(errno.ENOSPC, "inotify watch limit reached") + + if err == errno.EMFILE: + raise OSError(errno.EMFILE, "inotify instance limit reached") + + if err != errno.EACCES: + raise OSError(err, os.strerror(err)) + + @staticmethod + def _parse_event_buffer(event_buffer: bytes) -> Generator[tuple[int, int, int, bytes]]: + """Parses an event buffer of ``inotify_event`` structs returned by + inotify:: + + struct inotify_event { + __s32 wd; /* watch descriptor */ + __u32 mask; /* watch mask */ + __u32 cookie; /* cookie to synchronize two events */ + __u32 len; /* length (including nulls) of name */ + char name[0]; /* stub for possible name */ + }; + + The ``cookie`` member of this struct is used to pair two related + events, for example, it pairs an IN_MOVED_FROM event with an + IN_MOVED_TO event. + """ + i = 0 + while i + 16 <= len(event_buffer): + wd, mask, cookie, length = struct.unpack_from("iIII", event_buffer, i) + name = event_buffer[i + 16 : i + 16 + length].rstrip(b"\0") + i += 16 + length + yield wd, mask, cookie, name + + +class InotifyEvent: + """Inotify event struct wrapper. + + :param wd: + Watch descriptor + :param mask: + Event mask + :param cookie: + Event cookie + :param name: + Base name of the event source path. + :param src_path: + Full event source path. + """ + + def __init__(self, wd: int, mask: int, cookie: int, name: bytes, src_path: bytes) -> None: + self._wd = wd + self._mask = mask + self._cookie = cookie + self._name = name + self._src_path = src_path + + @property + def src_path(self) -> bytes: + return self._src_path + + @property + def wd(self) -> int: + return self._wd + + @property + def mask(self) -> int: + return self._mask + + @property + def cookie(self) -> int: + return self._cookie + + @property + def name(self) -> bytes: + return self._name + + @property + def is_modify(self) -> bool: + return self._mask & InotifyConstants.IN_MODIFY > 0 + + @property + def is_close_write(self) -> bool: + return self._mask & InotifyConstants.IN_CLOSE_WRITE > 0 + + @property + def is_close_nowrite(self) -> bool: + return self._mask & InotifyConstants.IN_CLOSE_NOWRITE > 0 + + @property + def is_open(self) -> bool: + return self._mask & InotifyConstants.IN_OPEN > 0 + + @property + def is_access(self) -> bool: + return self._mask & InotifyConstants.IN_ACCESS > 0 + + @property + def is_delete(self) -> bool: + return self._mask & InotifyConstants.IN_DELETE > 0 + + @property + def is_delete_self(self) -> bool: + return self._mask & InotifyConstants.IN_DELETE_SELF > 0 + + @property + def is_create(self) -> bool: + return self._mask & InotifyConstants.IN_CREATE > 0 + + @property + def is_moved_from(self) -> bool: + return self._mask & InotifyConstants.IN_MOVED_FROM > 0 + + @property + def is_moved_to(self) -> bool: + return self._mask & InotifyConstants.IN_MOVED_TO > 0 + + @property + def is_move(self) -> bool: + return self._mask & InotifyConstants.IN_MOVE > 0 + + @property + def is_move_self(self) -> bool: + return self._mask & InotifyConstants.IN_MOVE_SELF > 0 + + @property + def is_attrib(self) -> bool: + return self._mask & InotifyConstants.IN_ATTRIB > 0 + + @property + def is_ignored(self) -> bool: + return self._mask & InotifyConstants.IN_IGNORED > 0 + + @property + def is_directory(self) -> bool: + # It looks like the kernel does not provide this information for + # IN_DELETE_SELF and IN_MOVE_SELF. In this case, assume it's a dir. + # See also: https://github.com/seb-m/pyinotify/blob/2c7e8f8/python2/pyinotify.py#L897 + return self.is_delete_self or self.is_move_self or self._mask & InotifyConstants.IN_ISDIR > 0 + + @property + def key(self) -> tuple[bytes, int, int, int, bytes]: + return self._src_path, self._wd, self._mask, self._cookie, self._name + + def __eq__(self, inotify_event: object) -> bool: + if not isinstance(inotify_event, InotifyEvent): + return NotImplemented + return self.key == inotify_event.key + + def __ne__(self, inotify_event: object) -> bool: + if not isinstance(inotify_event, InotifyEvent): + return NotImplemented + return self.key != inotify_event.key + + def __hash__(self) -> int: + return hash(self.key) + + @staticmethod + def _get_mask_string(mask: int) -> str: + masks = [] + for c in dir(InotifyConstants): + if c.startswith("IN_") and c not in {"IN_ALL_EVENTS", "IN_MOVE"}: + c_val = getattr(InotifyConstants, c) + if mask & c_val: + masks.append(c) + return "|".join(masks) + + def __repr__(self) -> str: + return ( + f"<{type(self).__name__}: src_path={self.src_path!r}, wd={self.wd}," + f" mask={self._get_mask_string(self.mask)}, cookie={self.cookie}," + f" name={os.fsdecode(self.name)!r}>" + ) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/kqueue.py b/micromamba_root/Lib/site-packages/watchdog/observers/kqueue.py new file mode 100644 index 0000000000000000000000000000000000000000..2f9d0c6ffa3c3fda21803bbf38ea853e75a12332 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/kqueue.py @@ -0,0 +1,655 @@ +""":module: watchdog.observers.kqueue +:synopsis: ``kqueue(2)`` based emitter implementation. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: macOS and BSD with kqueue(2). + +.. WARNING:: kqueue is a very heavyweight way to monitor file systems. + Each kqueue-detected directory modification triggers + a full directory scan. Traversing the entire directory tree + and opening file descriptors for all files will create + performance problems. We need to find a way to re-scan + only those directories which report changes and do a diff + between two sub-DirectorySnapshots perhaps. + +.. ADMONITION:: About OS X performance guidelines + + Quote from the `macOS File System Performance Guidelines`_: + + "When you only want to track changes on a file or directory, be sure to + open it using the ``O_EVTONLY`` flag. This flag prevents the file or + directory from being marked as open or in use. This is important + if you are tracking files on a removable volume and the user tries to + unmount the volume. With this flag in place, the system knows it can + dismiss the volume. If you had opened the files or directories without + this flag, the volume would be marked as busy and would not be + unmounted." + + ``O_EVTONLY`` is defined as ``0x8000`` in the OS X header files. + More information here: http://www.mlsite.net/blog/?p=2312 + +Classes +------- +.. autoclass:: KqueueEmitter + :members: + :show-inheritance: + +Collections and Utility Classes +------------------------------- +.. autoclass:: KeventDescriptor + :members: + :show-inheritance: + +.. autoclass:: KeventDescriptorSet + :members: + :show-inheritance: + +.. _macOS File System Performance Guidelines: + http://developer.apple.com/library/ios/#documentation/Performance/Conceptual/FileSystem/Articles/TrackingChanges.html#//apple_ref/doc/uid/20001993-CJBJFIDD + +""" + + +# The `select` module varies between platforms. +# mypy may complain about missing module attributes depending on which platform it's running on. +# The comment below disables mypy's attribute check. +# mypy: disable-error-code="attr-defined, name-defined" + +from __future__ import annotations + +import contextlib +import errno +import os +import os.path +import select +import threading +from stat import S_ISDIR +from typing import TYPE_CHECKING + +from watchdog.events import ( + EVENT_TYPE_CREATED, + EVENT_TYPE_DELETED, + EVENT_TYPE_MOVED, + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, + generate_sub_moved_events, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter +from watchdog.utils import platform +from watchdog.utils.dirsnapshot import DirectorySnapshot + +if TYPE_CHECKING: + from collections.abc import Generator + from typing import Callable + + from watchdog.events import FileSystemEvent + from watchdog.observers.api import EventQueue, ObservedWatch + +# Maximum number of events to process. +MAX_EVENTS = 4096 + +# O_EVTONLY value from the header files for OS X only. +O_EVTONLY = 0x8000 + +# Pre-calculated values for the kevent filter, flags, and fflags attributes. +WATCHDOG_OS_OPEN_FLAGS = O_EVTONLY if platform.is_darwin() else os.O_RDONLY | os.O_NONBLOCK +WATCHDOG_KQ_FILTER = select.KQ_FILTER_VNODE +WATCHDOG_KQ_EV_FLAGS = select.KQ_EV_ADD | select.KQ_EV_ENABLE | select.KQ_EV_CLEAR +WATCHDOG_KQ_FFLAGS = ( + select.KQ_NOTE_DELETE + | select.KQ_NOTE_WRITE + | select.KQ_NOTE_EXTEND + | select.KQ_NOTE_ATTRIB + | select.KQ_NOTE_LINK + | select.KQ_NOTE_RENAME + | select.KQ_NOTE_REVOKE +) + + +def absolute_path(path: bytes | str) -> bytes | str: + return os.path.abspath(os.path.normpath(path)) + + +# Flag tests. + + +def is_deleted(kev: select.kevent) -> bool: + """Determines whether the given kevent represents deletion.""" + return kev.fflags & select.KQ_NOTE_DELETE > 0 + + +def is_modified(kev: select.kevent) -> bool: + """Determines whether the given kevent represents modification.""" + fflags = kev.fflags + return (fflags & select.KQ_NOTE_EXTEND > 0) or (fflags & select.KQ_NOTE_WRITE > 0) + + +def is_attrib_modified(kev: select.kevent) -> bool: + """Determines whether the given kevent represents attribute modification.""" + return kev.fflags & select.KQ_NOTE_ATTRIB > 0 + + +def is_renamed(kev: select.kevent) -> bool: + """Determines whether the given kevent represents movement.""" + return kev.fflags & select.KQ_NOTE_RENAME > 0 + + +class KeventDescriptorSet: + """Thread-safe kevent descriptor collection.""" + + def __init__(self) -> None: + self._descriptors: set[KeventDescriptor] = set() + self._descriptor_for_path: dict[bytes | str, KeventDescriptor] = {} + self._descriptor_for_fd: dict[int, KeventDescriptor] = {} + self._kevents: list[select.kevent] = [] + self._lock = threading.Lock() + + @property + def kevents(self) -> list[select.kevent]: + """List of kevents monitored.""" + with self._lock: + return self._kevents + + @property + def paths(self) -> list[bytes | str]: + """List of paths for which kevents have been created.""" + with self._lock: + return list(self._descriptor_for_path.keys()) + + def get_for_fd(self, fd: int) -> KeventDescriptor: + """Given a file descriptor, returns the kevent descriptor object + for it. + + :param fd: + OS file descriptor. + :type fd: + ``int`` + :returns: + A :class:`KeventDescriptor` object. + """ + with self._lock: + return self._descriptor_for_fd[fd] + + def get(self, path: bytes | str) -> KeventDescriptor: + """Obtains a :class:`KeventDescriptor` object for the specified path. + + :param path: + Path for which the descriptor will be obtained. + """ + with self._lock: + path = absolute_path(path) + return self._get(path) + + def __contains__(self, path: bytes | str) -> bool: + """Determines whether a :class:`KeventDescriptor has been registered + for the specified path. + + :param path: + Path for which the descriptor will be obtained. + """ + with self._lock: + path = absolute_path(path) + return self._has_path(path) + + def add(self, path: bytes | str, *, is_directory: bool) -> None: + """Adds a :class:`KeventDescriptor` to the collection for the given + path. + + :param path: + The path for which a :class:`KeventDescriptor` object will be + added. + :param is_directory: + ``True`` if the path refers to a directory; ``False`` otherwise. + :type is_directory: + ``bool`` + """ + with self._lock: + path = absolute_path(path) + if not self._has_path(path): + self._add_descriptor(KeventDescriptor(path, is_directory=is_directory)) + + def remove(self, path: bytes | str) -> None: + """Removes the :class:`KeventDescriptor` object for the given path + if it already exists. + + :param path: + Path for which the :class:`KeventDescriptor` object will be + removed. + """ + with self._lock: + path = absolute_path(path) + if self._has_path(path): + self._remove_descriptor(self._get(path)) + + def clear(self) -> None: + """Clears the collection and closes all open descriptors.""" + with self._lock: + for descriptor in self._descriptors: + descriptor.close() + self._descriptors.clear() + self._descriptor_for_fd.clear() + self._descriptor_for_path.clear() + self._kevents = [] + + # Thread-unsafe methods. Locking is provided at a higher level. + def _get(self, path: bytes | str) -> KeventDescriptor: + """Returns a kevent descriptor for a given path.""" + return self._descriptor_for_path[path] + + def _has_path(self, path: bytes | str) -> bool: + """Determines whether a :class:`KeventDescriptor` for the specified + path exists already in the collection. + """ + return path in self._descriptor_for_path + + def _add_descriptor(self, descriptor: KeventDescriptor) -> None: + """Adds a descriptor to the collection. + + :param descriptor: + An instance of :class:`KeventDescriptor` to be added. + """ + self._descriptors.add(descriptor) + self._kevents.append(descriptor.kevent) + self._descriptor_for_path[descriptor.path] = descriptor + self._descriptor_for_fd[descriptor.fd] = descriptor + + def _remove_descriptor(self, descriptor: KeventDescriptor) -> None: + """Removes a descriptor from the collection. + + :param descriptor: + An instance of :class:`KeventDescriptor` to be removed. + """ + self._descriptors.remove(descriptor) + del self._descriptor_for_fd[descriptor.fd] + del self._descriptor_for_path[descriptor.path] + self._kevents.remove(descriptor.kevent) + descriptor.close() + + +class KeventDescriptor: + """A kevent descriptor convenience data structure to keep together: + + * kevent + * directory status + * path + * file descriptor + + :param path: + Path string for which a kevent descriptor will be created. + :param is_directory: + ``True`` if the path refers to a directory; ``False`` otherwise. + :type is_directory: + ``bool`` + """ + + def __init__(self, path: bytes | str, *, is_directory: bool) -> None: + self._path = absolute_path(path) + self._is_directory = is_directory + self._fd = os.open(path, WATCHDOG_OS_OPEN_FLAGS) + self._kev = select.kevent( + self._fd, + filter=WATCHDOG_KQ_FILTER, + flags=WATCHDOG_KQ_EV_FLAGS, + fflags=WATCHDOG_KQ_FFLAGS, + ) + + @property + def fd(self) -> int: + """OS file descriptor for the kevent descriptor.""" + return self._fd + + @property + def path(self) -> bytes | str: + """The path associated with the kevent descriptor.""" + return self._path + + @property + def kevent(self) -> select.kevent: + """The kevent object associated with the kevent descriptor.""" + return self._kev + + @property + def is_directory(self) -> bool: + """Determines whether the kevent descriptor refers to a directory. + + :returns: + ``True`` or ``False`` + """ + return self._is_directory + + def close(self) -> None: + """Closes the file descriptor associated with a kevent descriptor.""" + with contextlib.suppress(OSError): + os.close(self.fd) + + @property + def key(self) -> tuple[bytes | str, bool]: + return (self.path, self.is_directory) + + def __eq__(self, descriptor: object) -> bool: + if not isinstance(descriptor, KeventDescriptor): + return NotImplemented + return self.key == descriptor.key + + def __ne__(self, descriptor: object) -> bool: + if not isinstance(descriptor, KeventDescriptor): + return NotImplemented + return self.key != descriptor.key + + def __hash__(self) -> int: + return hash(self.key) + + def __repr__(self) -> str: + return f"<{type(self).__name__}: path={self.path!r}, is_directory={self.is_directory}>" + + +class KqueueEmitter(EventEmitter): + """kqueue(2)-based event emitter. + + .. ADMONITION:: About ``kqueue(2)`` behavior and this implementation + + ``kqueue(2)`` monitors file system events only for + open descriptors, which means, this emitter does a lot of + book-keeping behind the scenes to keep track of open + descriptors for every entry in the monitored directory tree. + + This also means the number of maximum open file descriptors + on your system must be increased **manually**. + Usually, issuing a call to ``ulimit`` should suffice:: + + ulimit -n 1024 + + Ensure that you pick a number that is larger than the + number of files you expect to be monitored. + + ``kqueue(2)`` does not provide enough information about the + following things: + + * The destination path of a file or directory that is renamed. + * Creation of a file or directory within a directory; in this + case, ``kqueue(2)`` only indicates a modified event on the + parent directory. + + Therefore, this emitter takes a snapshot of the directory + tree when ``kqueue(2)`` detects a change on the file system + to be able to determine the above information. + + :param event_queue: + The event queue to fill with events. + :param watch: + A watch object representing the directory to monitor. + :type watch: + :class:`watchdog.observers.api.ObservedWatch` + :param timeout: + Read events blocking timeout (in seconds). + :type timeout: + ``float`` + :param event_filter: + Collection of event types to emit, or None for no filtering (default). + :type event_filter: + Iterable[:class:`watchdog.events.FileSystemEvent`] | None + :param stat: stat function. See ``os.stat`` for details. + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + stat: Callable[[str], os.stat_result] = os.stat, + ) -> None: + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + + self._kq = select.kqueue() + self._lock = threading.RLock() + + # A collection of KeventDescriptor. + self._descriptors = KeventDescriptorSet() + + def custom_stat(path: str, cls: KqueueEmitter = self) -> os.stat_result: + stat_info = stat(path) + cls._register_kevent(path, is_directory=S_ISDIR(stat_info.st_mode)) + return stat_info + + self._snapshot = DirectorySnapshot(watch.path, recursive=watch.is_recursive, stat=custom_stat) + + def _register_kevent(self, path: bytes | str, *, is_directory: bool) -> None: + """Registers a kevent descriptor for the given path. + + :param path: + Path for which a kevent descriptor will be created. + :param is_directory: + ``True`` if the path refers to a directory; ``False`` otherwise. + :type is_directory: + ``bool`` + """ + try: + self._descriptors.add(path, is_directory=is_directory) + except OSError as e: + if e.errno == errno.ENOENT: + # Probably dealing with a temporary file that was created + # and then quickly deleted before we could open + # a descriptor for it. Therefore, simply queue a sequence + # of created and deleted events for the path. + + # TODO: We could simply ignore these files. + # Locked files cause the python process to die with + # a bus error when we handle temporary files. + # eg. .git/index.lock when running tig operations. + # I don't fully understand this at the moment. + pass + elif e.errno == errno.EOPNOTSUPP: + # Probably dealing with the socket or special file + # mounted through a file system that does not support + # access to it (e.g. NFS). On BSD systems look at + # EOPNOTSUPP in man 2 open. + pass + else: + # All other errors are propagated. + raise + + def _unregister_kevent(self, path: bytes | str) -> None: + """Convenience function to close the kevent descriptor for a + specified kqueue-monitored path. + + :param path: + Path for which the kevent descriptor will be closed. + """ + self._descriptors.remove(path) + + def queue_event(self, event: FileSystemEvent) -> None: + """Handles queueing a single event object. + + :param event: + An instance of :class:`watchdog.events.FileSystemEvent` + or a subclass. + """ + # Handles all the book keeping for queued events. + # We do not need to fire moved/deleted events for all subitems in + # a directory tree here, because this function is called by kqueue + # for all those events anyway. + EventEmitter.queue_event(self, event) + if event.event_type == EVENT_TYPE_CREATED: + self._register_kevent(event.src_path, is_directory=event.is_directory) + elif event.event_type == EVENT_TYPE_MOVED: + self._unregister_kevent(event.src_path) + self._register_kevent(event.dest_path, is_directory=event.is_directory) + elif event.event_type == EVENT_TYPE_DELETED: + self._unregister_kevent(event.src_path) + + def _gen_kqueue_events( + self, kev: select.kevent, ref_snapshot: DirectorySnapshot, new_snapshot: DirectorySnapshot + ) -> Generator[FileSystemEvent]: + """Generate events from the kevent list returned from the call to + :meth:`select.kqueue.control`. + + .. NOTE:: kqueue only tells us about deletions, file modifications, + attribute modifications. The other events, namely, + file creation, directory modification, file rename, + directory rename, directory creation, etc. are + determined by comparing directory snapshots. + """ + descriptor = self._descriptors.get_for_fd(kev.ident) + src_path = descriptor.path + + if is_renamed(kev): + # Kqueue does not specify the destination names for renames + # to, so we have to process these using the a snapshot + # of the directory. + yield from self._gen_renamed_events( + src_path, + ref_snapshot, + new_snapshot, + is_directory=descriptor.is_directory, + ) + elif is_attrib_modified(kev): + if descriptor.is_directory: + yield DirModifiedEvent(src_path) + else: + yield FileModifiedEvent(src_path) + elif is_modified(kev): + if descriptor.is_directory: + if self.watch.is_recursive or self.watch.path == src_path: + # When a directory is modified, it may be due to + # sub-file/directory renames or new file/directory + # creation. We determine all this by comparing + # snapshots later. + yield DirModifiedEvent(src_path) + else: + yield FileModifiedEvent(src_path) + elif is_deleted(kev): + if descriptor.is_directory: + yield DirDeletedEvent(src_path) + else: + yield FileDeletedEvent(src_path) + + def _parent_dir_modified(self, src_path: bytes | str) -> DirModifiedEvent: + """Helper to generate a DirModifiedEvent on the parent of src_path.""" + return DirModifiedEvent(os.path.dirname(src_path)) + + def _gen_renamed_events( + self, + src_path: bytes | str, + ref_snapshot: DirectorySnapshot, + new_snapshot: DirectorySnapshot, + *, + is_directory: bool, + ) -> Generator[FileSystemEvent]: + """Compares information from two directory snapshots (one taken before + the rename operation and another taken right after) to determine the + destination path of the file system object renamed, and yields + the appropriate events to be queued. + """ + try: + f_inode = ref_snapshot.inode(src_path) + except KeyError: + # Probably caught a temporary file/directory that was renamed + # and deleted. Fires a sequence of created and deleted events + # for the path. + if is_directory: + yield DirCreatedEvent(src_path) + yield DirDeletedEvent(src_path) + else: + yield FileCreatedEvent(src_path) + yield FileDeletedEvent(src_path) + # We don't process any further and bail out assuming + # the event represents deletion/creation instead of movement. + return + + dest_path = new_snapshot.path(f_inode) + if dest_path is not None: + dest_path = absolute_path(dest_path) + if is_directory: + yield DirMovedEvent(src_path, dest_path) + else: + yield FileMovedEvent(src_path, dest_path) + yield self._parent_dir_modified(src_path) + yield self._parent_dir_modified(dest_path) + if is_directory and self.watch.is_recursive: + # TODO: Do we need to fire moved events for the items + # inside the directory tree? Does kqueue does this + # all by itself? Check this and then enable this code + # only if it doesn't already. + # A: It doesn't. So I've enabled this block. + yield from generate_sub_moved_events(src_path, dest_path) + else: + # If the new snapshot does not have an inode for the + # old path, we haven't found the new name. Therefore, + # we mark it as deleted and remove unregister the path. + if is_directory: + yield DirDeletedEvent(src_path) + else: + yield FileDeletedEvent(src_path) + yield self._parent_dir_modified(src_path) + + def _read_events(self, timeout: float) -> list[select.kevent]: + """Reads events from a call to the blocking + :meth:`select.kqueue.control()` method. + + :param timeout: + Blocking timeout for reading events. + :type timeout: + ``float`` (seconds) + """ + return self._kq.control(self._descriptors.kevents, MAX_EVENTS, timeout) + + def queue_events(self, timeout: float) -> None: + """Queues events by reading them from a call to the blocking + :meth:`select.kqueue.control()` method. + + :param timeout: + Blocking timeout for reading events. + :type timeout: + ``float`` (seconds) + """ + with self._lock: + try: + event_list = self._read_events(timeout) + # TODO: investigate why order appears to be reversed + event_list.reverse() + + # Take a fresh snapshot of the directory and update the + # saved snapshot. + new_snapshot = DirectorySnapshot(self.watch.path, recursive=self.watch.is_recursive) + ref_snapshot = self._snapshot + self._snapshot = new_snapshot + diff_events = new_snapshot - ref_snapshot + + # Process events + for directory_created in diff_events.dirs_created: + self.queue_event(DirCreatedEvent(directory_created)) + for file_created in diff_events.files_created: + self.queue_event(FileCreatedEvent(file_created)) + for file_modified in diff_events.files_modified: + self.queue_event(FileModifiedEvent(file_modified)) + + for kev in event_list: + for event in self._gen_kqueue_events(kev, ref_snapshot, new_snapshot): + self.queue_event(event) + + except OSError as e: + if e.errno != errno.EBADF: + raise + + def on_thread_stop(self) -> None: + # Clean up. + with self._lock: + self._descriptors.clear() + self._kq.close() + + +class KqueueObserver(BaseObserver): + """Observer thread that schedules watching directories and dispatches + calls to event handlers. + """ + + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(KqueueEmitter, timeout=timeout) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/polling.py b/micromamba_root/Lib/site-packages/watchdog/observers/polling.py new file mode 100644 index 0000000000000000000000000000000000000000..5c94e525902e41f52b6362a87172b848e0778f1c --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/polling.py @@ -0,0 +1,142 @@ +""":module: watchdog.observers.polling +:synopsis: Polling emitter implementation. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Classes +------- +.. autoclass:: PollingObserver + :members: + :show-inheritance: + +.. autoclass:: PollingObserverVFS + :members: + :show-inheritance: + :special-members: +""" + +from __future__ import annotations + +import os +import threading +from functools import partial +from typing import TYPE_CHECKING + +from watchdog.events import ( + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter +from watchdog.utils.dirsnapshot import DirectorySnapshot, DirectorySnapshotDiff, EmptyDirectorySnapshot + +if TYPE_CHECKING: + from collections.abc import Iterator + from typing import Callable + + from watchdog.events import FileSystemEvent + from watchdog.observers.api import EventQueue, ObservedWatch + + +class PollingEmitter(EventEmitter): + """Platform-independent emitter that polls a directory to detect file + system changes. + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + stat: Callable[[str], os.stat_result] = os.stat, + listdir: Callable[[str | None], Iterator[os.DirEntry]] = os.scandir, + ) -> None: + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + self._snapshot: DirectorySnapshot = EmptyDirectorySnapshot() + self._lock = threading.Lock() + self._take_snapshot: Callable[[], DirectorySnapshot] = lambda: DirectorySnapshot( + self.watch.path, + recursive=self.watch.is_recursive, + stat=stat, + listdir=listdir, + ) + + def on_thread_start(self) -> None: + self._snapshot = self._take_snapshot() + + def queue_events(self, timeout: float) -> None: + # We don't want to hit the disk continuously. + # timeout behaves like an interval for polling emitters. + if self.stopped_event.wait(timeout): + return + + with self._lock: + if not self.should_keep_running(): + return + + # Get event diff between fresh snapshot and previous snapshot. + # Update snapshot. + try: + new_snapshot = self._take_snapshot() + except OSError: + self.queue_event(DirDeletedEvent(self.watch.path)) + self.stop() + return + + events = DirectorySnapshotDiff(self._snapshot, new_snapshot) + self._snapshot = new_snapshot + + # Files. + for src_path in events.files_deleted: + self.queue_event(FileDeletedEvent(src_path)) + for src_path in events.files_modified: + self.queue_event(FileModifiedEvent(src_path)) + for src_path in events.files_created: + self.queue_event(FileCreatedEvent(src_path)) + for src_path, dest_path in events.files_moved: + self.queue_event(FileMovedEvent(src_path, dest_path)) + + # Directories. + for src_path in events.dirs_deleted: + self.queue_event(DirDeletedEvent(src_path)) + for src_path in events.dirs_modified: + self.queue_event(DirModifiedEvent(src_path)) + for src_path in events.dirs_created: + self.queue_event(DirCreatedEvent(src_path)) + for src_path, dest_path in events.dirs_moved: + self.queue_event(DirMovedEvent(src_path, dest_path)) + + +class PollingObserver(BaseObserver): + """Platform-independent observer that polls a directory to detect file + system changes. + """ + + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(PollingEmitter, timeout=timeout) + + +class PollingObserverVFS(BaseObserver): + """File system independent observer that polls a directory to detect changes.""" + + def __init__( + self, + stat: Callable[[str], os.stat_result], + listdir: Callable[[str | None], Iterator[os.DirEntry]], + *, + polling_interval: int = 1, + ) -> None: + """:param stat: stat function. See ``os.stat`` for details. + :param listdir: listdir function. See ``os.scandir`` for details. + :type polling_interval: int + :param polling_interval: interval in seconds between polling the file system. + """ + emitter_cls = partial(PollingEmitter, stat=stat, listdir=listdir) + super().__init__(emitter_cls, timeout=polling_interval) # type: ignore[arg-type] diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/read_directory_changes.py b/micromamba_root/Lib/site-packages/watchdog/observers/read_directory_changes.py new file mode 100644 index 0000000000000000000000000000000000000000..4faa9450b29c4626153cb48fd6fd120dbd9a4ccc --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/read_directory_changes.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +import os.path +import platform +import threading +from typing import TYPE_CHECKING + +from watchdog.events import ( + DirCreatedEvent, + DirDeletedEvent, + DirModifiedEvent, + DirMovedEvent, + FileCreatedEvent, + FileDeletedEvent, + FileModifiedEvent, + FileMovedEvent, + generate_sub_created_events, + generate_sub_moved_events, +) +from watchdog.observers.api import DEFAULT_EMITTER_TIMEOUT, DEFAULT_OBSERVER_TIMEOUT, BaseObserver, EventEmitter +from watchdog.observers.winapi import close_directory_handle, get_directory_handle, read_events + +if TYPE_CHECKING: + from ctypes.wintypes import HANDLE + + from watchdog.events import FileSystemEvent + from watchdog.observers.api import EventQueue, ObservedWatch + from watchdog.observers.winapi import WinAPINativeEvent + + +class WindowsApiEmitter(EventEmitter): + """Windows API-based emitter that uses ReadDirectoryChangesW + to detect file system changes for a watch. + """ + + def __init__( + self, + event_queue: EventQueue, + watch: ObservedWatch, + *, + timeout: float = DEFAULT_EMITTER_TIMEOUT, + event_filter: list[type[FileSystemEvent]] | None = None, + ) -> None: + super().__init__(event_queue, watch, timeout=timeout, event_filter=event_filter) + self._lock = threading.Lock() + self._whandle: HANDLE | None = None + + def on_thread_start(self) -> None: + self._whandle = get_directory_handle(self.watch.path) + + if platform.python_implementation() == "PyPy": + + def start(self) -> None: + """PyPy needs some time before receiving events, see #792.""" + from time import sleep + + super().start() + sleep(0.01) + + def on_thread_stop(self) -> None: + if self._whandle: + close_directory_handle(self._whandle) + + def _read_events(self) -> list[WinAPINativeEvent]: + if not self._whandle: + return [] + return read_events(self._whandle, self.watch.path, recursive=self.watch.is_recursive) + + def queue_events(self, timeout: float) -> None: + winapi_events = self._read_events() + with self._lock: + last_renamed_src_path = "" + for winapi_event in winapi_events: + src_path = os.path.join(self.watch.path, winapi_event.src_path) + + if winapi_event.is_renamed_old: + last_renamed_src_path = src_path + elif winapi_event.is_renamed_new: + dest_path = src_path + src_path = last_renamed_src_path + if os.path.isdir(dest_path): + self.queue_event(DirMovedEvent(src_path, dest_path)) + if self.watch.is_recursive: + for sub_moved_event in generate_sub_moved_events(src_path, dest_path): + self.queue_event(sub_moved_event) + else: + self.queue_event(FileMovedEvent(src_path, dest_path)) + elif winapi_event.is_modified: + self.queue_event((DirModifiedEvent if os.path.isdir(src_path) else FileModifiedEvent)(src_path)) + elif winapi_event.is_added: + isdir = os.path.isdir(src_path) + self.queue_event((DirCreatedEvent if isdir else FileCreatedEvent)(src_path)) + if isdir and self.watch.is_recursive: + for sub_created_event in generate_sub_created_events(src_path): + self.queue_event(sub_created_event) + elif winapi_event.is_removed: + self.queue_event(FileDeletedEvent(src_path)) + elif winapi_event.is_removed_self: + self.queue_event(DirDeletedEvent(self.watch.path)) + self.stop() + + +class WindowsApiObserver(BaseObserver): + """Observer thread that schedules watching directories and dispatches + calls to event handlers. + """ + + def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None: + super().__init__(WindowsApiEmitter, timeout=timeout) diff --git a/micromamba_root/Lib/site-packages/watchdog/observers/winapi.py b/micromamba_root/Lib/site-packages/watchdog/observers/winapi.py new file mode 100644 index 0000000000000000000000000000000000000000..1247e1f874ee9c6e3784977d9f8c47f63e3e6b4a --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/observers/winapi.py @@ -0,0 +1,382 @@ +""":module: watchdog.observers.winapi +:synopsis: Windows API-Python interface (removes dependency on ``pywin32``). +:author: theller@ctypes.org (Thomas Heller) +:author: will@willmcgugan.com (Will McGugan) +:author: ryan@rfk.id.au (Ryan Kelly) +:author: yesudeep@gmail.com (Yesudeep Mangalapilly) +:author: thomas.amland@gmail.com (Thomas Amland) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:platforms: windows +""" + +from __future__ import annotations + +import contextlib +import ctypes +from ctypes.wintypes import BOOL, DWORD, HANDLE, LPCWSTR, LPVOID, LPWSTR +from dataclasses import dataclass +from functools import reduce +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Any + +# Invalid handle value. +INVALID_HANDLE_VALUE = ctypes.c_void_p(-1).value + +# File notification constants. +FILE_NOTIFY_CHANGE_FILE_NAME = 0x01 +FILE_NOTIFY_CHANGE_DIR_NAME = 0x02 +FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x04 +FILE_NOTIFY_CHANGE_SIZE = 0x08 +FILE_NOTIFY_CHANGE_LAST_WRITE = 0x010 +FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x020 +FILE_NOTIFY_CHANGE_CREATION = 0x040 +FILE_NOTIFY_CHANGE_SECURITY = 0x0100 + +FILE_FLAG_BACKUP_SEMANTICS = 0x02000000 +FILE_FLAG_OVERLAPPED = 0x40000000 +FILE_LIST_DIRECTORY = 1 +FILE_SHARE_READ = 0x01 +FILE_SHARE_WRITE = 0x02 +FILE_SHARE_DELETE = 0x04 +OPEN_EXISTING = 3 + +VOLUME_NAME_NT = 0x02 + +# File action constants. +FILE_ACTION_CREATED = 1 +FILE_ACTION_DELETED = 2 +FILE_ACTION_MODIFIED = 3 +FILE_ACTION_RENAMED_OLD_NAME = 4 +FILE_ACTION_RENAMED_NEW_NAME = 5 +FILE_ACTION_DELETED_SELF = 0xFFFE +FILE_ACTION_OVERFLOW = 0xFFFF + +# Aliases +FILE_ACTION_ADDED = FILE_ACTION_CREATED +FILE_ACTION_REMOVED = FILE_ACTION_DELETED +FILE_ACTION_REMOVED_SELF = FILE_ACTION_DELETED_SELF + +THREAD_TERMINATE = 0x0001 + +# IO waiting constants. +WAIT_ABANDONED = 0x00000080 +WAIT_IO_COMPLETION = 0x000000C0 +WAIT_OBJECT_0 = 0x00000000 +WAIT_TIMEOUT = 0x00000102 + +# Error codes +ERROR_OPERATION_ABORTED = 995 + + +class OVERLAPPED(ctypes.Structure): + _fields_ = ( + ("Internal", LPVOID), + ("InternalHigh", LPVOID), + ("Offset", DWORD), + ("OffsetHigh", DWORD), + ("Pointer", LPVOID), + ("hEvent", HANDLE), + ) + + +def _errcheck_bool(value: Any | None, func: Any, args: Any) -> Any: + if not value: + raise ctypes.WinError() # type: ignore[attr-defined] + return args + + +def _errcheck_handle(value: Any | None, func: Any, args: Any) -> Any: + if not value: + raise ctypes.WinError() # type: ignore[attr-defined] + if value == INVALID_HANDLE_VALUE: + raise ctypes.WinError() # type: ignore[attr-defined] + return args + + +def _errcheck_dword(value: Any | None, func: Any, args: Any) -> Any: + if value == 0xFFFFFFFF: + raise ctypes.WinError() # type: ignore[attr-defined] + return args + + +kernel32 = ctypes.WinDLL("kernel32") # type: ignore[attr-defined] + +ReadDirectoryChangesW = kernel32.ReadDirectoryChangesW +ReadDirectoryChangesW.restype = BOOL +ReadDirectoryChangesW.errcheck = _errcheck_bool +ReadDirectoryChangesW.argtypes = ( + HANDLE, # hDirectory + LPVOID, # lpBuffer + DWORD, # nBufferLength + BOOL, # bWatchSubtree + DWORD, # dwNotifyFilter + ctypes.POINTER(DWORD), # lpBytesReturned + ctypes.POINTER(OVERLAPPED), # lpOverlapped + LPVOID, # FileIOCompletionRoutine # lpCompletionRoutine +) + +CreateFileW = kernel32.CreateFileW +CreateFileW.restype = HANDLE +CreateFileW.errcheck = _errcheck_handle +CreateFileW.argtypes = ( + LPCWSTR, # lpFileName + DWORD, # dwDesiredAccess + DWORD, # dwShareMode + LPVOID, # lpSecurityAttributes + DWORD, # dwCreationDisposition + DWORD, # dwFlagsAndAttributes + HANDLE, # hTemplateFile +) + +CloseHandle = kernel32.CloseHandle +CloseHandle.restype = BOOL +CloseHandle.argtypes = (HANDLE,) # hObject + +CancelIoEx = kernel32.CancelIoEx +CancelIoEx.restype = BOOL +CancelIoEx.errcheck = _errcheck_bool +CancelIoEx.argtypes = ( + HANDLE, # hObject + ctypes.POINTER(OVERLAPPED), # lpOverlapped +) + +CreateEvent = kernel32.CreateEventW +CreateEvent.restype = HANDLE +CreateEvent.errcheck = _errcheck_handle +CreateEvent.argtypes = ( + LPVOID, # lpEventAttributes + BOOL, # bManualReset + BOOL, # bInitialState + LPCWSTR, # lpName +) + +SetEvent = kernel32.SetEvent +SetEvent.restype = BOOL +SetEvent.errcheck = _errcheck_bool +SetEvent.argtypes = (HANDLE,) # hEvent + +WaitForSingleObjectEx = kernel32.WaitForSingleObjectEx +WaitForSingleObjectEx.restype = DWORD +WaitForSingleObjectEx.errcheck = _errcheck_dword +WaitForSingleObjectEx.argtypes = ( + HANDLE, # hObject + DWORD, # dwMilliseconds + BOOL, # bAlertable +) + +CreateIoCompletionPort = kernel32.CreateIoCompletionPort +CreateIoCompletionPort.restype = HANDLE +CreateIoCompletionPort.errcheck = _errcheck_handle +CreateIoCompletionPort.argtypes = ( + HANDLE, # FileHandle + HANDLE, # ExistingCompletionPort + LPVOID, # CompletionKey + DWORD, # NumberOfConcurrentThreads +) + +GetQueuedCompletionStatus = kernel32.GetQueuedCompletionStatus +GetQueuedCompletionStatus.restype = BOOL +GetQueuedCompletionStatus.errcheck = _errcheck_bool +GetQueuedCompletionStatus.argtypes = ( + HANDLE, # CompletionPort + LPVOID, # lpNumberOfBytesTransferred + LPVOID, # lpCompletionKey + ctypes.POINTER(OVERLAPPED), # lpOverlapped + DWORD, # dwMilliseconds +) + +PostQueuedCompletionStatus = kernel32.PostQueuedCompletionStatus +PostQueuedCompletionStatus.restype = BOOL +PostQueuedCompletionStatus.errcheck = _errcheck_bool +PostQueuedCompletionStatus.argtypes = ( + HANDLE, # CompletionPort + DWORD, # lpNumberOfBytesTransferred + DWORD, # lpCompletionKey + ctypes.POINTER(OVERLAPPED), # lpOverlapped +) + + +GetFinalPathNameByHandleW = kernel32.GetFinalPathNameByHandleW +GetFinalPathNameByHandleW.restype = DWORD +GetFinalPathNameByHandleW.errcheck = _errcheck_dword +GetFinalPathNameByHandleW.argtypes = ( + HANDLE, # hFile + LPWSTR, # lpszFilePath + DWORD, # cchFilePath + DWORD, # DWORD +) + + +class FileNotifyInformation(ctypes.Structure): + _fields_ = ( + ("NextEntryOffset", DWORD), + ("Action", DWORD), + ("FileNameLength", DWORD), + ("FileName", (ctypes.c_char * 1)), + ) + + +LPFNI = ctypes.POINTER(FileNotifyInformation) + + +# We don't need to recalculate these flags every time a call is made to +# the win32 API functions. +WATCHDOG_FILE_FLAGS = FILE_FLAG_BACKUP_SEMANTICS +WATCHDOG_FILE_SHARE_FLAGS = reduce( + lambda x, y: x | y, + [ + FILE_SHARE_READ, + FILE_SHARE_WRITE, + FILE_SHARE_DELETE, + ], +) +WATCHDOG_FILE_NOTIFY_FLAGS = reduce( + lambda x, y: x | y, + [ + FILE_NOTIFY_CHANGE_FILE_NAME, + FILE_NOTIFY_CHANGE_DIR_NAME, + FILE_NOTIFY_CHANGE_ATTRIBUTES, + FILE_NOTIFY_CHANGE_SIZE, + FILE_NOTIFY_CHANGE_LAST_WRITE, + FILE_NOTIFY_CHANGE_SECURITY, + FILE_NOTIFY_CHANGE_LAST_ACCESS, + FILE_NOTIFY_CHANGE_CREATION, + ], +) + +# ReadDirectoryChangesW buffer length. +# To handle cases with lot of changes, this seems the highest safest value we can use. +# Note: it will fail with ERROR_INVALID_PARAMETER when it is greater than 64 KB and +# the application is monitoring a directory over the network. +# This is due to a packet size limitation with the underlying file sharing protocols. +# https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw#remarks +BUFFER_SIZE = 64000 + +# Buffer length for path-related stuff. +# Introduced to keep the old behavior when we bumped BUFFER_SIZE from 2048 to 64000 in v1.0.0. +PATH_BUFFER_SIZE = 2048 + + +def _parse_event_buffer(read_buffer: bytes, n_bytes: int) -> list[tuple[int, str]]: + results = [] + while n_bytes > 0: + fni = ctypes.cast(read_buffer, LPFNI)[0] # type: ignore[arg-type] + ptr = ctypes.addressof(fni) + FileNotifyInformation.FileName.offset + filename = ctypes.string_at(ptr, fni.FileNameLength) + results.append((fni.Action, filename.decode("utf-16"))) + num_to_skip = fni.NextEntryOffset + if num_to_skip <= 0: + break + read_buffer = read_buffer[num_to_skip:] + n_bytes -= num_to_skip # num_to_skip is long. n_bytes should be long too. + return results + + +def _is_observed_path_deleted(handle: HANDLE, path: str) -> bool: + # Comparison of observed path and actual path, returned by + # GetFinalPathNameByHandleW. If directory moved to the trash bin, or + # deleted, actual path will not be equal to observed path. + buff = ctypes.create_unicode_buffer(PATH_BUFFER_SIZE) + GetFinalPathNameByHandleW(handle, buff, PATH_BUFFER_SIZE, VOLUME_NAME_NT) + return buff.value != path + + +def _generate_observed_path_deleted_event() -> tuple[bytes, int]: + # Create synthetic event for notify that observed directory is deleted + path = ctypes.create_unicode_buffer(".") + event = FileNotifyInformation(0, FILE_ACTION_DELETED_SELF, len(path), path.value.encode("utf-8")) + event_size = ctypes.sizeof(event) + buff = ctypes.create_string_buffer(PATH_BUFFER_SIZE) + ctypes.memmove(buff, ctypes.addressof(event), event_size) + return buff.raw, event_size + + +def get_directory_handle(path: str) -> HANDLE: + """Returns a Windows handle to the specified directory path.""" + return CreateFileW( + path, + FILE_LIST_DIRECTORY, + WATCHDOG_FILE_SHARE_FLAGS, + None, + OPEN_EXISTING, + WATCHDOG_FILE_FLAGS, + None, + ) + + +def close_directory_handle(handle: HANDLE) -> None: + try: + CancelIoEx(handle, None) # force ReadDirectoryChangesW to return + CloseHandle(handle) + except OSError: + with contextlib.suppress(Exception): + CloseHandle(handle) + + +def read_directory_changes(handle: HANDLE, path: str, *, recursive: bool) -> tuple[bytes, int]: + """Read changes to the directory using the specified directory handle. + + https://timgolden.me.uk/pywin32-docs/win32file__ReadDirectoryChangesW_meth.html + """ + event_buffer = ctypes.create_string_buffer(BUFFER_SIZE) + nbytes = DWORD() + try: + ReadDirectoryChangesW( + handle, + ctypes.byref(event_buffer), + len(event_buffer), + recursive, + WATCHDOG_FILE_NOTIFY_FLAGS, + ctypes.byref(nbytes), + None, + None, + ) + except OSError as e: + if e.winerror == ERROR_OPERATION_ABORTED: # type: ignore[attr-defined] + return event_buffer.raw, 0 + + # Handle the case when the root path is deleted + if _is_observed_path_deleted(handle, path): + return _generate_observed_path_deleted_event() + + raise + + return event_buffer.raw, int(nbytes.value) + + +@dataclass(unsafe_hash=True) +class WinAPINativeEvent: + action: int + src_path: str + + @property + def is_added(self) -> bool: + return self.action == FILE_ACTION_CREATED + + @property + def is_removed(self) -> bool: + return self.action == FILE_ACTION_REMOVED + + @property + def is_modified(self) -> bool: + return self.action == FILE_ACTION_MODIFIED + + @property + def is_renamed_old(self) -> bool: + return self.action == FILE_ACTION_RENAMED_OLD_NAME + + @property + def is_renamed_new(self) -> bool: + return self.action == FILE_ACTION_RENAMED_NEW_NAME + + @property + def is_removed_self(self) -> bool: + return self.action == FILE_ACTION_REMOVED_SELF + + +def read_events(handle: HANDLE, path: str, *, recursive: bool) -> list[WinAPINativeEvent]: + buf, nbytes = read_directory_changes(handle, path, recursive=recursive) + events = _parse_event_buffer(buf, nbytes) + return [WinAPINativeEvent(action, src_path) for action, src_path in events] diff --git a/micromamba_root/Lib/site-packages/watchdog/py.typed b/micromamba_root/Lib/site-packages/watchdog/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/watchdog/tricks/__init__.py b/micromamba_root/Lib/site-packages/watchdog/tricks/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b993b6d2c17dccf08d2e3e6a8c60bd7b8bf6e324 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/tricks/__init__.py @@ -0,0 +1,293 @@ +""":module: watchdog.tricks +:synopsis: Utility event handlers. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Classes +------- +.. autoclass:: Trick + :members: + :show-inheritance: + +.. autoclass:: LoggerTrick + :members: + :show-inheritance: + +.. autoclass:: ShellCommandTrick + :members: + :show-inheritance: + +.. autoclass:: AutoRestartTrick + :members: + :show-inheritance: + +""" + +from __future__ import annotations + +import contextlib +import functools +import logging +import os +import signal +import subprocess +import threading +import time + +from watchdog.events import EVENT_TYPE_CLOSED_NO_WRITE, EVENT_TYPE_OPENED, FileSystemEvent, PatternMatchingEventHandler +from watchdog.utils import echo, platform +from watchdog.utils.event_debouncer import EventDebouncer +from watchdog.utils.process_watcher import ProcessWatcher + +logger = logging.getLogger(__name__) +echo_events = functools.partial(echo.echo, write=lambda msg: logger.info(msg)) + + +class Trick(PatternMatchingEventHandler): + """Your tricks should subclass this class.""" + + def __repr__(self) -> str: + return f"<{type(self).__name__}>" + + @classmethod + def generate_yaml(cls) -> str: + return f"""- {cls.__module__}.{cls.__name__}: + args: + - argument1 + - argument2 + kwargs: + patterns: + - "*.py" + - "*.js" + ignore_patterns: + - "version.py" + ignore_directories: false +""" + + +class LoggerTrick(Trick): + """A simple trick that does only logs events.""" + + @echo_events + def on_any_event(self, event: FileSystemEvent) -> None: + pass + + +class ShellCommandTrick(Trick): + """Executes shell commands in response to matched events.""" + + def __init__( + self, + shell_command: str, + *, + patterns: list[str] | None = None, + ignore_patterns: list[str] | None = None, + ignore_directories: bool = False, + wait_for_process: bool = False, + drop_during_process: bool = False, + ): + super().__init__( + patterns=patterns, + ignore_patterns=ignore_patterns, + ignore_directories=ignore_directories, + ) + self.shell_command = shell_command + self.wait_for_process = wait_for_process + self.drop_during_process = drop_during_process + + self.process: subprocess.Popen[bytes] | None = None + self._process_watchers: set[ProcessWatcher] = set() + + def on_any_event(self, event: FileSystemEvent) -> None: + if event.event_type in {EVENT_TYPE_OPENED, EVENT_TYPE_CLOSED_NO_WRITE}: + # FIXME: see issue #949, and find a way to better handle that scenario + return + + from string import Template + + if self.drop_during_process and self.is_process_running(): + return + + object_type = "directory" if event.is_directory else "file" + context = { + "watch_src_path": event.src_path, + "watch_dest_path": "", + "watch_event_type": event.event_type, + "watch_object": object_type, + } + + if self.shell_command is None: + if hasattr(event, "dest_path"): + context["dest_path"] = event.dest_path + command = 'echo "${watch_event_type} ${watch_object} from ${watch_src_path} to ${watch_dest_path}"' + else: + command = 'echo "${watch_event_type} ${watch_object} ${watch_src_path}"' + else: + if hasattr(event, "dest_path"): + context["watch_dest_path"] = event.dest_path + command = self.shell_command + + command = Template(command).safe_substitute(**context) + self.process = subprocess.Popen(command, shell=True) + if self.wait_for_process: + self.process.wait() + else: + process_watcher = ProcessWatcher(self.process, None) + self._process_watchers.add(process_watcher) + process_watcher.process_termination_callback = functools.partial( + self._process_watchers.discard, + process_watcher, + ) + process_watcher.start() + + def is_process_running(self) -> bool: + return bool(self._process_watchers or (self.process is not None and self.process.poll() is None)) + + +class AutoRestartTrick(Trick): + """Starts a long-running subprocess and restarts it on matched events. + + The command parameter is a list of command arguments, such as + `['bin/myserver', '-c', 'etc/myconfig.ini']`. + + Call `start()` after creating the Trick. Call `stop()` when stopping + the process. + """ + + def __init__( + self, + command: list[str], + *, + patterns: list[str] | None = None, + ignore_patterns: list[str] | None = None, + ignore_directories: bool = False, + stop_signal: signal.Signals | int = signal.SIGINT, + kill_after: int = 10, + debounce_interval_seconds: int = 0, + restart_on_command_exit: bool = True, + ): + if kill_after < 0: + error = "kill_after must be non-negative." + raise ValueError(error) + if debounce_interval_seconds < 0: + error = "debounce_interval_seconds must be non-negative." + raise ValueError(error) + + super().__init__( + patterns=patterns, + ignore_patterns=ignore_patterns, + ignore_directories=ignore_directories, + ) + + self.command = command + self.stop_signal = stop_signal.value if isinstance(stop_signal, signal.Signals) else stop_signal + self.kill_after = kill_after + self.debounce_interval_seconds = debounce_interval_seconds + self.restart_on_command_exit = restart_on_command_exit + + self.process: subprocess.Popen[bytes] | None = None + self.process_watcher: ProcessWatcher | None = None + self.event_debouncer: EventDebouncer | None = None + self.restart_count = 0 + + self._is_process_stopping = False + self._is_trick_stopping = False + self._stopping_lock = threading.RLock() + + def start(self) -> None: + if self.debounce_interval_seconds: + self.event_debouncer = EventDebouncer( + debounce_interval_seconds=self.debounce_interval_seconds, + events_callback=lambda events: self._restart_process(), + ) + self.event_debouncer.start() + self._start_process() + + def stop(self) -> None: + # Ensure the body of the function is only run once. + with self._stopping_lock: + if self._is_trick_stopping: + return + self._is_trick_stopping = True + + process_watcher = self.process_watcher + if self.event_debouncer is not None: + self.event_debouncer.stop() + self._stop_process() + + # Don't leak threads: Wait for background threads to stop. + if self.event_debouncer is not None: + self.event_debouncer.join() + if process_watcher is not None: + process_watcher.join() + + def _start_process(self) -> None: + if self._is_trick_stopping: + return + + # windows doesn't have setsid + self.process = subprocess.Popen(self.command, preexec_fn=getattr(os, "setsid", None)) + if self.restart_on_command_exit: + self.process_watcher = ProcessWatcher(self.process, self._restart_process) + self.process_watcher.start() + + def _stop_process(self) -> None: + # Ensure the body of the function is not run in parallel in different threads. + with self._stopping_lock: + if self._is_process_stopping: + return + self._is_process_stopping = True + + try: + if self.process_watcher is not None: + self.process_watcher.stop() + self.process_watcher = None + + if self.process is not None: + try: + kill_process(self.process.pid, self.stop_signal) + except OSError: + # Process is already gone + pass + else: + kill_time = time.time() + self.kill_after + while time.time() < kill_time: + if self.process.poll() is not None: + break + time.sleep(0.25) + else: + # Process is already gone + with contextlib.suppress(OSError): + kill_process(self.process.pid, 9) + self.process = None + finally: + self._is_process_stopping = False + + @echo_events + def on_any_event(self, event: FileSystemEvent) -> None: + if event.event_type in {EVENT_TYPE_OPENED, EVENT_TYPE_CLOSED_NO_WRITE}: + # FIXME: see issue #949, and find a way to better handle that scenario + return + + if self.event_debouncer is not None: + self.event_debouncer.handle_event(event) + else: + self._restart_process() + + def _restart_process(self) -> None: + if self._is_trick_stopping: + return + self._stop_process() + self._start_process() + self.restart_count += 1 + + +if platform.is_windows(): + + def kill_process(pid: int, stop_signal: int) -> None: + os.kill(pid, stop_signal) + +else: + + def kill_process(pid: int, stop_signal: int) -> None: + os.killpg(os.getpgid(pid), stop_signal) diff --git a/micromamba_root/Lib/site-packages/watchdog/tricks/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/tricks/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7a5c95acd8f939d83c815fa94ee6f48a98390ce Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/tricks/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__init__.py b/micromamba_root/Lib/site-packages/watchdog/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..637d98885c5267896033ba4aed1d5d45f774c92b --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/__init__.py @@ -0,0 +1,122 @@ +""":module: watchdog.utils +:synopsis: Utility classes and functions. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Classes +------- +.. autoclass:: BaseThread + :members: + :show-inheritance: + :inherited-members: + +""" + +from __future__ import annotations + +import sys +import threading +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from types import ModuleType + + from watchdog.tricks import Trick + + +class UnsupportedLibcError(Exception): + pass + + +class WatchdogShutdownError(Exception): + """Semantic exception used to signal an external shutdown event.""" + + +class BaseThread(threading.Thread): + """Convenience class for creating stoppable threads.""" + + def __init__(self) -> None: + threading.Thread.__init__(self) + if hasattr(self, "daemon"): + self.daemon = True + else: + self.setDaemon(True) + self._stopped_event = threading.Event() + + @property + def stopped_event(self) -> threading.Event: + return self._stopped_event + + def should_keep_running(self) -> bool: + """Determines whether the thread should continue running.""" + return not self._stopped_event.is_set() + + def on_thread_stop(self) -> None: + """Override this method instead of :meth:`stop()`. + :meth:`stop()` calls this method. + + This method is called immediately after the thread is signaled to stop. + """ + + def stop(self) -> None: + """Signals the thread to stop.""" + self._stopped_event.set() + self.on_thread_stop() + + def on_thread_start(self) -> None: + """Override this method instead of :meth:`start()`. :meth:`start()` + calls this method. + + This method is called right before this thread is started and this + object's run() method is invoked. + """ + + def start(self) -> None: + self.on_thread_start() + threading.Thread.start(self) + + +def load_module(module_name: str) -> ModuleType: + """Imports a module given its name and returns a handle to it.""" + try: + __import__(module_name) + except ImportError as e: + error = f"No module named {module_name}" + raise ImportError(error) from e + return sys.modules[module_name] + + +def load_class(dotted_path: str) -> type[Trick]: + """Loads and returns a class definition provided a dotted path + specification the last part of the dotted path is the class name + and there is at least one module name preceding the class name. + + Notes + ----- + You will need to ensure that the module you are trying to load + exists in the Python path. + + Examples + -------- + - module.name.ClassName # Provided module.name is in the Python path. + - module.ClassName # Provided module is in the Python path. + + What won't work: + - ClassName + - modle.name.ClassName # Typo in module name. + - module.name.ClasNam # Typo in classname. + + """ + dotted_path_split = dotted_path.split(".") + if len(dotted_path_split) <= 1: + error = f"Dotted module path {dotted_path} must contain a module name and a classname" + raise ValueError(error) + klass_name = dotted_path_split[-1] + module_name = ".".join(dotted_path_split[:-1]) + + module = load_module(module_name) + if hasattr(module, klass_name): + return getattr(module, klass_name) + + error = f"Module {module_name} does not have class attribute {klass_name}" + raise AttributeError(error) diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f38f8453a5d10bdb8b9ce2743e4f5b0269b026db Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/bricks.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/bricks.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d71f0b2b62539ebc76b56b11eb72e98328300374 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/bricks.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/delayed_queue.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/delayed_queue.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8930eadd91ebbc29fbb2f925ac153f691d1918f Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/delayed_queue.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/dirsnapshot.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/dirsnapshot.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d5f2be7a0549137e6d2f6d8bf3685ce1c9b0b87 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/dirsnapshot.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/echo.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/echo.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3020062a9eb26cbdcc86fa8ea44856ac34e4744 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/echo.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/event_debouncer.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/event_debouncer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1923a262eaa9dbea8d5f1722a425fe3eeac983c8 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/event_debouncer.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/patterns.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/patterns.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f0c385ff74870c6c02fc5e4d44ae1e7bbb3d739 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/patterns.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/platform.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/platform.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d4837911b05b630778822dd90ee42bf9567a88d Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/platform.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/process_watcher.cpython-314.pyc b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/process_watcher.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..473cc9a26dfd6ecdf98dfd772b78fed8eac4d3f6 Binary files /dev/null and b/micromamba_root/Lib/site-packages/watchdog/utils/__pycache__/process_watcher.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/bricks.py b/micromamba_root/Lib/site-packages/watchdog/utils/bricks.py new file mode 100644 index 0000000000000000000000000000000000000000..6aca8e425fe83c688bc2e9020ebf3a594598d09c --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/bricks.py @@ -0,0 +1,90 @@ +"""Utility collections or "bricks". + +:module: watchdog.utils.bricks +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: lalinsky@gmail.com (Lukáš Lalinský) +:author: python@rcn.com (Raymond Hettinger) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +Classes +======= +.. autoclass:: OrderedSetQueue + :members: + :show-inheritance: + :inherited-members: + +.. autoclass:: OrderedSet + +""" + +from __future__ import annotations + +import queue +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Any + + +class SkipRepeatsQueue(queue.Queue): + """Thread-safe implementation of an special queue where a + put of the last-item put'd will be dropped. + + The implementation leverages locking already implemented in the base class + redefining only the primitives. + + Queued items must be immutable and hashable so that they can be used + as dictionary keys. You must implement **only read-only properties** and + the :meth:`Item.__hash__()`, :meth:`Item.__eq__()`, and + :meth:`Item.__ne__()` methods for items to be hashable. + + An example implementation follows:: + + class Item: + def __init__(self, a, b): + self._a = a + self._b = b + + @property + def a(self): + return self._a + + @property + def b(self): + return self._b + + def _key(self): + return (self._a, self._b) + + def __eq__(self, item): + return self._key() == item._key() + + def __ne__(self, item): + return self._key() != item._key() + + def __hash__(self): + return hash(self._key()) + + based on the OrderedSetQueue below + """ + + def _init(self, maxsize: int) -> None: + super()._init(maxsize) + self._last_item = None + + def put(self, item: Any, block: bool = True, timeout: float | None = None) -> None: # noqa: FBT001,FBT002 + """This method will be used by `eventlet`, when enabled, so we cannot use force proper keyword-only + arguments nor touch the signature. Also, the `timeout` argument will be ignored in that case. + """ + if self._last_item is None or item != self._last_item: + super().put(item, block, timeout) + + def _put(self, item: Any) -> None: + super()._put(item) + self._last_item = item + + def _get(self) -> Any: + item = super()._get() + if item is self._last_item: + self._last_item = None + return item diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/delayed_queue.py b/micromamba_root/Lib/site-packages/watchdog/utils/delayed_queue.py new file mode 100644 index 0000000000000000000000000000000000000000..e85fa6348536c08a2a4ba59fab4ddee09e501071 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/delayed_queue.py @@ -0,0 +1,77 @@ +""":module: watchdog.utils.delayed_queue +:author: thomas.amland@gmail.com (Thomas Amland) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +""" + +from __future__ import annotations + +import threading +import time +from collections import deque +from typing import Callable, Generic, TypeVar + +T = TypeVar("T") + + +class DelayedQueue(Generic[T]): + def __init__(self, delay: float) -> None: + self.delay_sec = delay + self._lock = threading.Lock() + self._not_empty = threading.Condition(self._lock) + self._queue: deque[tuple[T, float, bool]] = deque() + self._closed = False + + def put(self, element: T, *, delay: bool = False) -> None: + """Add element to queue.""" + self._lock.acquire() + self._queue.append((element, time.time(), delay)) + self._not_empty.notify() + self._lock.release() + + def close(self) -> None: + """Close queue, indicating no more items will be added.""" + self._closed = True + # Interrupt the blocking _not_empty.wait() call in get + self._not_empty.acquire() + self._not_empty.notify() + self._not_empty.release() + + def get(self) -> T | None: + """Remove and return an element from the queue, or this queue has been + closed raise the Closed exception. + """ + while True: + # wait for element to be added to queue + self._not_empty.acquire() + while len(self._queue) == 0 and not self._closed: + self._not_empty.wait() + + if self._closed: + self._not_empty.release() + return None + head, insert_time, delay = self._queue[0] + self._not_empty.release() + + # wait for delay if required + if delay: + time_left = insert_time + self.delay_sec - time.time() + while time_left > 0: + time.sleep(time_left) + time_left = insert_time + self.delay_sec - time.time() + + # return element if it's still in the queue + with self._lock: + if len(self._queue) > 0 and self._queue[0][0] is head: + self._queue.popleft() + return head + + def remove(self, predicate: Callable[[T], bool]) -> T | None: + """Remove and return the first items for which predicate is True, + ignoring delay. + """ + with self._lock: + for i, (elem, *_) in enumerate(self._queue): + if predicate(elem): + del self._queue[i] + return elem + return None diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/dirsnapshot.py b/micromamba_root/Lib/site-packages/watchdog/utils/dirsnapshot.py new file mode 100644 index 0000000000000000000000000000000000000000..ff69b0b35e677a8873d2e8d28f2857100f8f4c36 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/dirsnapshot.py @@ -0,0 +1,424 @@ +""":module: watchdog.utils.dirsnapshot +:synopsis: Directory snapshots and comparison. +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) + +.. ADMONITION:: Where are the moved events? They "disappeared" + + This implementation does not take partition boundaries + into consideration. It will only work when the directory + tree is entirely on the same file system. More specifically, + any part of the code that depends on inode numbers can + break if partition boundaries are crossed. In these cases, + the snapshot diff will represent file/directory movement as + created and deleted events. + +Classes +------- +.. autoclass:: DirectorySnapshot + :members: + :show-inheritance: + +.. autoclass:: DirectorySnapshotDiff + :members: + :show-inheritance: + +.. autoclass:: EmptyDirectorySnapshot + :members: + :show-inheritance: + +""" + +from __future__ import annotations + +import contextlib +import errno +import os +from stat import S_ISDIR +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from collections.abc import Iterator + from typing import Any, Callable + + +class DirectorySnapshotDiff: + """Compares two directory snapshots and creates an object that represents + the difference between the two snapshots. + + :param ref: + The reference directory snapshot. + :type ref: + :class:`DirectorySnapshot` + :param snapshot: + The directory snapshot which will be compared + with the reference snapshot. + :type snapshot: + :class:`DirectorySnapshot` + :param ignore_device: + A boolean indicating whether to ignore the device id or not. + By default, a file may be uniquely identified by a combination of its first + inode and its device id. The problem is that the device id may (or may not) + change between system boots. This problem would cause the DirectorySnapshotDiff + to think a file has been deleted and created again but it would be the + exact same file. + Set to True only if you are sure you will always use the same device. + :type ignore_device: + :class:`bool` + """ + + def __init__( + self, + ref: DirectorySnapshot, + snapshot: DirectorySnapshot, + *, + ignore_device: bool = False, + ) -> None: + created = snapshot.paths - ref.paths + deleted = ref.paths - snapshot.paths + + if ignore_device: + + def get_inode(directory: DirectorySnapshot, full_path: bytes | str) -> int | tuple[int, int]: + return directory.inode(full_path)[0] + + else: + + def get_inode(directory: DirectorySnapshot, full_path: bytes | str) -> int | tuple[int, int]: + return directory.inode(full_path) + + # check that all unchanged paths have the same inode + for path in ref.paths & snapshot.paths: + if get_inode(ref, path) != get_inode(snapshot, path): + created.add(path) + deleted.add(path) + + # find moved paths + moved: set[tuple[bytes | str, bytes | str]] = set() + for path in set(deleted): + inode = ref.inode(path) + new_path = snapshot.path(inode) + if new_path: + # file is not deleted but moved + deleted.remove(path) + moved.add((path, new_path)) + + for path in set(created): + inode = snapshot.inode(path) + old_path = ref.path(inode) + if old_path: + created.remove(path) + moved.add((old_path, path)) + + # find modified paths + # first check paths that have not moved + modified: set[bytes | str] = set() + for path in ref.paths & snapshot.paths: + if get_inode(ref, path) == get_inode(snapshot, path) and ( + ref.mtime(path) != snapshot.mtime(path) or ref.size(path) != snapshot.size(path) + ): + modified.add(path) + + for old_path, new_path in moved: + if ref.mtime(old_path) != snapshot.mtime(new_path) or ref.size(old_path) != snapshot.size(new_path): + modified.add(old_path) + + self._dirs_created = [path for path in created if snapshot.isdir(path)] + self._dirs_deleted = [path for path in deleted if ref.isdir(path)] + self._dirs_modified = [path for path in modified if ref.isdir(path)] + self._dirs_moved = [(frm, to) for (frm, to) in moved if ref.isdir(frm)] + + self._files_created = list(created - set(self._dirs_created)) + self._files_deleted = list(deleted - set(self._dirs_deleted)) + self._files_modified = list(modified - set(self._dirs_modified)) + self._files_moved = list(moved - set(self._dirs_moved)) + + def __str__(self) -> str: + return self.__repr__() + + def __repr__(self) -> str: + fmt = ( + "<{0} files(created={1}, deleted={2}, modified={3}, moved={4})," + " folders(created={5}, deleted={6}, modified={7}, moved={8})>" + ) + return fmt.format( + type(self).__name__, + len(self._files_created), + len(self._files_deleted), + len(self._files_modified), + len(self._files_moved), + len(self._dirs_created), + len(self._dirs_deleted), + len(self._dirs_modified), + len(self._dirs_moved), + ) + + @property + def files_created(self) -> list[bytes | str]: + """List of files that were created.""" + return self._files_created + + @property + def files_deleted(self) -> list[bytes | str]: + """List of files that were deleted.""" + return self._files_deleted + + @property + def files_modified(self) -> list[bytes | str]: + """List of files that were modified.""" + return self._files_modified + + @property + def files_moved(self) -> list[tuple[bytes | str, bytes | str]]: + """List of files that were moved. + + Each event is a two-tuple the first item of which is the path + that has been renamed to the second item in the tuple. + """ + return self._files_moved + + @property + def dirs_modified(self) -> list[bytes | str]: + """List of directories that were modified.""" + return self._dirs_modified + + @property + def dirs_moved(self) -> list[tuple[bytes | str, bytes | str]]: + """List of directories that were moved. + + Each event is a two-tuple the first item of which is the path + that has been renamed to the second item in the tuple. + """ + return self._dirs_moved + + @property + def dirs_deleted(self) -> list[bytes | str]: + """List of directories that were deleted.""" + return self._dirs_deleted + + @property + def dirs_created(self) -> list[bytes | str]: + """List of directories that were created.""" + return self._dirs_created + + class ContextManager: + """Context manager that creates two directory snapshots and a + diff object that represents the difference between the two snapshots. + + :param path: + The directory path for which a snapshot should be taken. + :type path: + ``str`` + :param recursive: + ``True`` if the entire directory tree should be included in the + snapshot; ``False`` otherwise. + :type recursive: + ``bool`` + :param stat: + Use custom stat function that returns a stat structure for path. + Currently only st_dev, st_ino, st_mode and st_mtime are needed. + + A function taking a ``path`` as argument which will be called + for every entry in the directory tree. + :param listdir: + Use custom listdir function. For details see ``os.scandir``. + :param ignore_device: + A boolean indicating whether to ignore the device id or not. + By default, a file may be uniquely identified by a combination of its first + inode and its device id. The problem is that the device id may (or may not) + change between system boots. This problem would cause the DirectorySnapshotDiff + to think a file has been deleted and created again but it would be the + exact same file. + Set to True only if you are sure you will always use the same device. + :type ignore_device: + :class:`bool` + """ + + def __init__( + self, + path: str, + *, + recursive: bool = True, + stat: Callable[[str], os.stat_result] = os.stat, + listdir: Callable[[str | None], Iterator[os.DirEntry]] = os.scandir, + ignore_device: bool = False, + ) -> None: + self.path = path + self.recursive = recursive + self.stat = stat + self.listdir = listdir + self.ignore_device = ignore_device + + def __enter__(self) -> None: + self.pre_snapshot = self.get_snapshot() + + def __exit__(self, *args: object) -> None: + self.post_snapshot = self.get_snapshot() + self.diff = DirectorySnapshotDiff( + self.pre_snapshot, + self.post_snapshot, + ignore_device=self.ignore_device, + ) + + def get_snapshot(self) -> DirectorySnapshot: + return DirectorySnapshot( + path=self.path, + recursive=self.recursive, + stat=self.stat, + listdir=self.listdir, + ) + + +class DirectorySnapshot: + """A snapshot of stat information of files in a directory. + + :param path: + The directory path for which a snapshot should be taken. + :type path: + ``str`` + :param recursive: + ``True`` if the entire directory tree should be included in the + snapshot; ``False`` otherwise. + :type recursive: + ``bool`` + :param stat: + Use custom stat function that returns a stat structure for path. + Currently only st_dev, st_ino, st_mode and st_mtime are needed. + + A function taking a ``path`` as argument which will be called + for every entry in the directory tree. + :param listdir: + Use custom listdir function. For details see ``os.scandir``. + """ + + def __init__( + self, + path: str, + *, + recursive: bool = True, + stat: Callable[[str], os.stat_result] = os.stat, + listdir: Callable[[str | None], Iterator[os.DirEntry]] = os.scandir, + ) -> None: + self.recursive = recursive + self.stat = stat + self.listdir = listdir + + self._stat_info: dict[bytes | str, os.stat_result] = {} + self._inode_to_path: dict[tuple[int, int], bytes | str] = {} + + st = self.stat(path) + self._stat_info[path] = st + self._inode_to_path[(st.st_ino, st.st_dev)] = path + + for p, st in self.walk(path): + i = (st.st_ino, st.st_dev) + self._inode_to_path[i] = p + self._stat_info[p] = st + + def walk(self, root: str) -> Iterator[tuple[str, os.stat_result]]: + try: + paths = [os.path.join(root, entry.name) for entry in self.listdir(root)] + except OSError as e: + # Directory may have been deleted between finding it in the directory + # list of its parent and trying to delete its contents. If this + # happens we treat it as empty. Likewise if the directory was replaced + # with a file of the same name (less likely, but possible). + if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): + return + else: + raise + + entries = [] + for p in paths: + with contextlib.suppress(OSError): + entry = (p, self.stat(p)) + entries.append(entry) + yield entry + + if self.recursive: + for path, st in entries: + with contextlib.suppress(PermissionError): + if S_ISDIR(st.st_mode): + yield from self.walk(path) + + @property + def paths(self) -> set[bytes | str]: + """Set of file/directory paths in the snapshot.""" + return set(self._stat_info.keys()) + + def path(self, uid: tuple[int, int]) -> bytes | str | None: + """Returns path for id. None if id is unknown to this snapshot.""" + return self._inode_to_path.get(uid) + + def inode(self, path: bytes | str) -> tuple[int, int]: + """Returns an id for path.""" + st = self._stat_info[path] + return (st.st_ino, st.st_dev) + + def isdir(self, path: bytes | str) -> bool: + return S_ISDIR(self._stat_info[path].st_mode) + + def mtime(self, path: bytes | str) -> float: + return self._stat_info[path].st_mtime + + def size(self, path: bytes | str) -> int: + return self._stat_info[path].st_size + + def stat_info(self, path: bytes | str) -> os.stat_result: + """Returns a stat information object for the specified path from + the snapshot. + + Attached information is subject to change. Do not use unless + you specify `stat` in constructor. Use :func:`inode`, :func:`mtime`, + :func:`isdir` instead. + + :param path: + The path for which stat information should be obtained + from a snapshot. + """ + return self._stat_info[path] + + def __sub__(self, previous_dirsnap: DirectorySnapshot) -> DirectorySnapshotDiff: + """Allow subtracting a DirectorySnapshot object instance from + another. + + :returns: + A :class:`DirectorySnapshotDiff` object. + """ + return DirectorySnapshotDiff(previous_dirsnap, self) + + def __str__(self) -> str: + return self.__repr__() + + def __repr__(self) -> str: + return str(self._stat_info) + + +class EmptyDirectorySnapshot(DirectorySnapshot): + """Class to implement an empty snapshot. This is used together with + DirectorySnapshot and DirectorySnapshotDiff in order to get all the files/folders + in the directory as created. + """ + + def __init__(self) -> None: + pass + + @staticmethod + def path(_: Any) -> None: + """Mock up method to return the path of the received inode. As the snapshot + is intended to be empty, it always returns None. + + :returns: + None. + """ + return + + @property + def paths(self) -> set: + """Mock up method to return a set of file/directory paths in the snapshot. As + the snapshot is intended to be empty, it always returns an empty set. + + :returns: + An empty set. + """ + return set() diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/echo.py b/micromamba_root/Lib/site-packages/watchdog/utils/echo.py new file mode 100644 index 0000000000000000000000000000000000000000..4ff9217d341584b2d2bc119506b6789a6a58593d --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/echo.py @@ -0,0 +1,68 @@ +# echo.py: Tracing function calls using Python decorators. +# +# Written by Thomas Guest <tag@wordaligned.org> +# Please see http://wordaligned.org/articles/echo +# +# Place into the public domain. + +"""Echo calls made to functions in a module. + +"Echoing" a function call means printing out the name of the function +and the values of its arguments before making the call (which is more +commonly referred to as "tracing", but Python already has a trace module). + +Alternatively, echo.echo can be used to decorate functions. Calls to the +decorated function will be echoed. + +Example: +------- + + @echo.echo + def my_function(args): + pass + +""" + +from __future__ import annotations + +import functools +import sys +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Any, Callable + + +def format_arg_value(arg_val: tuple[str, tuple[Any, ...]]) -> str: + """Return a string representing a (name, value) pair.""" + arg, val = arg_val + return f"{arg}={val!r}" + + +def echo(fn: Callable, write: Callable[[str], int | None] = sys.stdout.write) -> Callable: + """Echo calls to a function. + + Returns a decorated version of the input function which "echoes" calls + made to it by writing out the function's name and the arguments it was + called with. + """ + # Unpack function's arg count, arg names, arg defaults + code = fn.__code__ + argcount = code.co_argcount + argnames = code.co_varnames[:argcount] + fn_defaults: tuple[Any] = fn.__defaults__ or () + argdefs = dict(list(zip(argnames[-len(fn_defaults) :], fn_defaults))) + + @functools.wraps(fn) + def wrapped(*v: Any, **k: Any) -> Callable: + # Collect function arguments by chaining together positional, + # defaulted, extra positional and keyword arguments. + positional = list(map(format_arg_value, list(zip(argnames, v)))) + defaulted = [format_arg_value((a, argdefs[a])) for a in argnames[len(v) :] if a not in k] + nameless = list(map(repr, v[argcount:])) + keyword = list(map(format_arg_value, list(k.items()))) + args = positional + defaulted + nameless + keyword + write(f"{fn.__name__}({', '.join(args)})\n") + return fn(*v, **k) + + return wrapped diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/event_debouncer.py b/micromamba_root/Lib/site-packages/watchdog/utils/event_debouncer.py new file mode 100644 index 0000000000000000000000000000000000000000..d9569733354904f057b29535a842521f0628db14 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/event_debouncer.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +import logging +import threading +from typing import TYPE_CHECKING + +from watchdog.utils import BaseThread + +if TYPE_CHECKING: + from typing import Callable + + from watchdog.events import FileSystemEvent + +logger = logging.getLogger(__name__) + + +class EventDebouncer(BaseThread): + """Background thread for debouncing event handling. + + When an event is received, wait until the configured debounce interval + passes before calling the callback. If additional events are received + before the interval passes, reset the timer and keep waiting. When the + debouncing interval passes, the callback will be called with a list of + events in the order in which they were received. + """ + + def __init__( + self, + debounce_interval_seconds: int, + events_callback: Callable[[list[FileSystemEvent]], None], + ) -> None: + super().__init__() + self.debounce_interval_seconds = debounce_interval_seconds + self.events_callback = events_callback + + self._events: list[FileSystemEvent] = [] + self._cond = threading.Condition() + + def handle_event(self, event: FileSystemEvent) -> None: + with self._cond: + self._events.append(event) + self._cond.notify() + + def stop(self) -> None: + with self._cond: + super().stop() + self._cond.notify() + + def run(self) -> None: + with self._cond: + while True: + # Wait for first event (or shutdown). + self._cond.wait() + + if self.debounce_interval_seconds: + # Wait for additional events (or shutdown) until the debounce interval passes. + while self.should_keep_running(): + if not self._cond.wait(timeout=self.debounce_interval_seconds): + break + + if not self.should_keep_running(): + break + + events = self._events + self._events = [] + self.events_callback(events) diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/patterns.py b/micromamba_root/Lib/site-packages/watchdog/utils/patterns.py new file mode 100644 index 0000000000000000000000000000000000000000..95b479ae6be56e13aa020b28a42813e90d6a3797 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/patterns.py @@ -0,0 +1,99 @@ +""":module: watchdog.utils.patterns +:synopsis: Common wildcard searching/filtering functionality for files. +:author: boris.staletic@gmail.com (Boris Staletic) +:author: yesudeep@gmail.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +""" + +from __future__ import annotations + +# Non-pure path objects are only allowed on their respective OS's. +# Thus, these utilities require "pure" path objects that don't access the filesystem. +# Since pathlib doesn't have a `case_sensitive` parameter, we have to approximate it +# by converting input paths to `PureWindowsPath` and `PurePosixPath` where: +# - `PureWindowsPath` is always case-insensitive. +# - `PurePosixPath` is always case-sensitive. +# Reference: https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match +from pathlib import PurePosixPath, PureWindowsPath +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from collections.abc import Iterator + + +def _match_path( + raw_path: str, + included_patterns: set[str], + excluded_patterns: set[str], + *, + case_sensitive: bool, +) -> bool: + """Internal function same as :func:`match_path` but does not check arguments.""" + path: PurePosixPath | PureWindowsPath + if case_sensitive: + path = PurePosixPath(raw_path) + else: + included_patterns = {pattern.lower() for pattern in included_patterns} + excluded_patterns = {pattern.lower() for pattern in excluded_patterns} + path = PureWindowsPath(raw_path) + + common_patterns = included_patterns & excluded_patterns + if common_patterns: + error = f"conflicting patterns `{common_patterns}` included and excluded" + raise ValueError(error) + + return any(path.match(p) for p in included_patterns) and not any(path.match(p) for p in excluded_patterns) + + +def filter_paths( + paths: list[str], + *, + included_patterns: list[str] | None = None, + excluded_patterns: list[str] | None = None, + case_sensitive: bool = True, +) -> Iterator[str]: + """Filters from a set of paths based on acceptable patterns and + ignorable patterns. + :param paths: + A list of path names that will be filtered based on matching and + ignored patterns. + :param included_patterns: + Allow filenames matching wildcard patterns specified in this list. + If no pattern list is specified, ["*"] is used as the default pattern, + which matches all files. + :param excluded_patterns: + Ignores filenames matching wildcard patterns specified in this list. + If no pattern list is specified, no files are ignored. + :param case_sensitive: + ``True`` if matching should be case-sensitive; ``False`` otherwise. + :returns: + A list of pathnames that matched the allowable patterns and passed + through the ignored patterns. + """ + included = set(["*"] if included_patterns is None else included_patterns) + excluded = set([] if excluded_patterns is None else excluded_patterns) + + for path in paths: + if _match_path(path, included, excluded, case_sensitive=case_sensitive): + yield path + + +def match_any_paths( + paths: list[str], + *, + included_patterns: list[str] | None = None, + excluded_patterns: list[str] | None = None, + case_sensitive: bool = True, +) -> bool: + """Matches from a set of paths based on acceptable patterns and + ignorable patterns. + See ``filter_paths()`` for signature details. + """ + return any( + filter_paths( + paths, + included_patterns=included_patterns, + excluded_patterns=excluded_patterns, + case_sensitive=case_sensitive, + ), + ) diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/platform.py b/micromamba_root/Lib/site-packages/watchdog/utils/platform.py new file mode 100644 index 0000000000000000000000000000000000000000..3c11d152c0302ad28794c3a415ab43b3ecf8a8d2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/platform.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +import sys + +PLATFORM_WINDOWS = "windows" +PLATFORM_LINUX = "linux" +PLATFORM_BSD = "bsd" +PLATFORM_DARWIN = "darwin" +PLATFORM_UNKNOWN = "unknown" + + +def get_platform_name() -> str: + if sys.platform.startswith("win"): + return PLATFORM_WINDOWS + + if sys.platform.startswith("darwin"): + return PLATFORM_DARWIN + + if sys.platform.startswith("linux"): + return PLATFORM_LINUX + + if sys.platform.startswith(("dragonfly", "freebsd", "netbsd", "openbsd", "bsd")): + return PLATFORM_BSD + + return PLATFORM_UNKNOWN + + +__platform__ = get_platform_name() + + +def is_linux() -> bool: + return __platform__ == PLATFORM_LINUX + + +def is_bsd() -> bool: + return __platform__ == PLATFORM_BSD + + +def is_darwin() -> bool: + return __platform__ == PLATFORM_DARWIN + + +def is_windows() -> bool: + return __platform__ == PLATFORM_WINDOWS diff --git a/micromamba_root/Lib/site-packages/watchdog/utils/process_watcher.py b/micromamba_root/Lib/site-packages/watchdog/utils/process_watcher.py new file mode 100644 index 0000000000000000000000000000000000000000..f500266a5bbd688c436bd7fcd6091cd78dfded6f --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/utils/process_watcher.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +import logging +from typing import TYPE_CHECKING + +from watchdog.utils import BaseThread + +if TYPE_CHECKING: + import subprocess + from typing import Callable + +logger = logging.getLogger(__name__) + + +class ProcessWatcher(BaseThread): + def __init__(self, popen_obj: subprocess.Popen, process_termination_callback: Callable[[], None] | None) -> None: + super().__init__() + self.popen_obj = popen_obj + self.process_termination_callback = process_termination_callback + + def run(self) -> None: + while self.popen_obj.poll() is None: + if self.stopped_event.wait(timeout=0.1): + return + + try: + if not self.stopped_event.is_set() and self.process_termination_callback: + self.process_termination_callback() + except Exception: + logger.exception("Error calling process termination callback") diff --git a/micromamba_root/Lib/site-packages/watchdog/version.py b/micromamba_root/Lib/site-packages/watchdog/version.py new file mode 100644 index 0000000000000000000000000000000000000000..8e1876f6a2bc12c11999a2299d8b03b9332d1098 --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/version.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +# When updating this version number, please update the +# ``docs/source/global.rst.inc`` file as well. +VERSION_MAJOR = 6 +VERSION_MINOR = 0 +VERSION_BUILD = 0 +VERSION_INFO = (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD) +VERSION_STRING = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + +__version__ = VERSION_INFO diff --git a/micromamba_root/Lib/site-packages/watchdog/watchmedo.py b/micromamba_root/Lib/site-packages/watchdog/watchmedo.py new file mode 100644 index 0000000000000000000000000000000000000000..e7879563c96b71ab428f942e8f4cce435cdb5a4e --- /dev/null +++ b/micromamba_root/Lib/site-packages/watchdog/watchmedo.py @@ -0,0 +1,807 @@ +""":module: watchdog.watchmedo +:author: yesudeep@google.com (Yesudeep Mangalapilly) +:author: contact@tiger-222.fr (Mickaël Schoentgen) +:synopsis: ``watchmedo`` shell script utility. +""" + +from __future__ import annotations + +import errno +import logging +import os +import os.path +import sys +import time +from argparse import ArgumentParser, RawDescriptionHelpFormatter +from io import StringIO +from textwrap import dedent +from typing import TYPE_CHECKING, Any + +from watchdog.utils import WatchdogShutdownError, load_class, platform +from watchdog.version import VERSION_STRING + +if TYPE_CHECKING: + from argparse import Namespace, _SubParsersAction + from typing import Callable + + from watchdog.events import FileSystemEventHandler + from watchdog.observers import ObserverType + from watchdog.observers.api import BaseObserver + + +logging.basicConfig(level=logging.INFO) + +CONFIG_KEY_TRICKS = "tricks" +CONFIG_KEY_PYTHON_PATH = "python-path" + + +class HelpFormatter(RawDescriptionHelpFormatter): + """A nicer help formatter. + + Help for arguments can be indented and contain new lines. + It will be de-dented and arguments in the help + will be separated by a blank line for better readability. + + Source: https://github.com/httpie/httpie/blob/2423f89/httpie/cli/argparser.py#L31 + """ + + def __init__(self, *args: Any, max_help_position: int = 6, **kwargs: Any) -> None: + # A smaller indent for args help. + kwargs["max_help_position"] = max_help_position + super().__init__(*args, **kwargs) + + def __repr__(self) -> str: + return f"<{type(self).__name__}>" + + def _split_lines(self, text: str, width: int) -> list[str]: + text = dedent(text).strip() + "\n\n" + return text.splitlines() + + +epilog = """\ +Copyright 2018-2024 Mickaël Schoentgen & contributors +Copyright 2014-2018 Thomas Amland & contributors +Copyright 2012-2014 Google, Inc. +Copyright 2011-2012 Yesudeep Mangalapilly + +Licensed under the terms of the Apache license, version 2.0. Please see +LICENSE in the source code for more information.""" + +cli = ArgumentParser(epilog=epilog, formatter_class=HelpFormatter) +cli.add_argument("--version", action="version", version=VERSION_STRING) +subparsers = cli.add_subparsers(dest="top_command") +command_parsers = {} + +Argument = tuple[list[str], Any] + + +def argument(*name_or_flags: str, **kwargs: Any) -> Argument: + """Convenience function to properly format arguments to pass to the + command decorator. + """ + return list(name_or_flags), kwargs + + +def command( + args: list[Argument], + *, + parent: _SubParsersAction[ArgumentParser] = subparsers, + cmd_aliases: list[str] | None = None, +) -> Callable: + """Decorator to define a new command in a sanity-preserving way. + The function will be stored in the ``func`` variable when the parser + parses arguments so that it can be called directly like so:: + + >>> args = cli.parse_args() + >>> args.func(args) + + """ + + def decorator(func: Callable) -> Callable: + name = func.__name__.replace("_", "-") + desc = dedent(func.__doc__ or "") + parser = parent.add_parser(name, aliases=cmd_aliases or [], description=desc, formatter_class=HelpFormatter) + command_parsers[name] = parser + verbosity_group = parser.add_mutually_exclusive_group() + verbosity_group.add_argument("-q", "--quiet", dest="verbosity", action="append_const", const=-1) + verbosity_group.add_argument("-v", "--verbose", dest="verbosity", action="append_const", const=1) + for name_or_flags, kwargs in args: + parser.add_argument(*name_or_flags, **kwargs) + parser.set_defaults(func=func) + return func + + return decorator + + +def path_split(pathname_spec: str, *, separator: str = os.pathsep) -> list[str]: + """Splits a pathname specification separated by an OS-dependent separator. + + :param pathname_spec: + The pathname specification. + :param separator: + (OS Dependent) `:` on Unix and `;` on Windows or user-specified. + """ + return pathname_spec.split(separator) + + +def add_to_sys_path(pathnames: list[str], *, index: int = 0) -> None: + """Adds specified paths at specified index into the sys.path list. + + :param paths: + A list of paths to add to the sys.path + :param index: + (Default 0) The index in the sys.path list where the paths will be + added. + """ + for pathname in pathnames[::-1]: + sys.path.insert(index, pathname) + + +def load_config(tricks_file_pathname: str) -> dict: + """Loads the YAML configuration from the specified file. + + :param tricks_file_path: + The path to the tricks configuration file. + :returns: + A dictionary of configuration information. + """ + import yaml + + with open(tricks_file_pathname, "rb") as f: + return yaml.safe_load(f.read()) + + +def parse_patterns( + patterns_spec: str, ignore_patterns_spec: str, *, separator: str = ";" +) -> tuple[list[str], list[str]]: + """Parses pattern argument specs and returns a two-tuple of + (patterns, ignore_patterns). + """ + patterns = patterns_spec.split(separator) + ignore_patterns = ignore_patterns_spec.split(separator) + if ignore_patterns == [""]: + ignore_patterns = [] + return patterns, ignore_patterns + + +def observe_with( + observer: BaseObserver, + event_handler: FileSystemEventHandler, + pathnames: list[str], + *, + recursive: bool, +) -> None: + """Single observer thread with a scheduled path and event handler. + + :param observer: + The observer thread. + :param event_handler: + Event handler which will be called in response to file system events. + :param pathnames: + A list of pathnames to monitor. + :param recursive: + ``True`` if recursive; ``False`` otherwise. + """ + for pathname in set(pathnames): + observer.schedule(event_handler, pathname, recursive=recursive) + observer.start() + try: + while True: + time.sleep(1) + except WatchdogShutdownError: + observer.stop() + observer.join() + + +def schedule_tricks(observer: BaseObserver, tricks: list[dict], pathname: str, *, recursive: bool) -> None: + """Schedules tricks with the specified observer and for the given watch + path. + + :param observer: + The observer thread into which to schedule the trick and watch. + :param tricks: + A list of tricks. + :param pathname: + A path name which should be watched. + :param recursive: + ``True`` if recursive; ``False`` otherwise. + """ + for trick in tricks: + for name, value in trick.items(): + trick_cls = load_class(name) + handler = trick_cls(**value) + trick_pathname = getattr(handler, "source_directory", None) or pathname + observer.schedule(handler, trick_pathname, recursive=recursive) + + +@command( + [ + argument("files", nargs="*", help="perform tricks from given file"), + argument( + "--python-path", + default=".", + help=f"Paths separated by {os.pathsep!r} to add to the Python path.", + ), + argument( + "--interval", + "--timeout", + dest="timeout", + default=1.0, + type=float, + help="Use this as the polling interval/blocking timeout (in seconds).", + ), + argument( + "--recursive", + action="store_true", + default=True, + help="Recursively monitor paths (defaults to True).", + ), + argument("--debug-force-polling", action="store_true", help="[debug] Forces polling."), + argument( + "--debug-force-kqueue", + action="store_true", + help="[debug] Forces BSD kqueue(2).", + ), + argument( + "--debug-force-winapi", + action="store_true", + help="[debug] Forces Windows API.", + ), + argument( + "--debug-force-fsevents", + action="store_true", + help="[debug] Forces macOS FSEvents.", + ), + argument( + "--debug-force-inotify", + action="store_true", + help="[debug] Forces Linux inotify(7).", + ), + ], + cmd_aliases=["tricks"], +) +def tricks_from(args: Namespace) -> None: + """Command to execute tricks from a tricks configuration file.""" + observer_cls: ObserverType + if args.debug_force_polling: + from watchdog.observers.polling import PollingObserver + + observer_cls = PollingObserver + elif args.debug_force_kqueue: + from watchdog.observers.kqueue import KqueueObserver + + observer_cls = KqueueObserver + elif (not TYPE_CHECKING and args.debug_force_winapi) or (TYPE_CHECKING and platform.is_windows()): + from watchdog.observers.read_directory_changes import WindowsApiObserver + + observer_cls = WindowsApiObserver + elif args.debug_force_inotify: + from watchdog.observers.inotify import InotifyObserver + + observer_cls = InotifyObserver + elif args.debug_force_fsevents: + from watchdog.observers.fsevents import FSEventsObserver + + observer_cls = FSEventsObserver + else: + # Automatically picks the most appropriate observer for the platform + # on which it is running. + from watchdog.observers import Observer + + observer_cls = Observer + + add_to_sys_path(path_split(args.python_path)) + observers = [] + for tricks_file in args.files: + observer = observer_cls(timeout=args.timeout) + + if not os.path.exists(tricks_file): + raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), tricks_file) + + config = load_config(tricks_file) + + try: + tricks = config[CONFIG_KEY_TRICKS] + except KeyError as e: + error = f"No {CONFIG_KEY_TRICKS!r} key specified in {tricks_file!r}." + raise KeyError(error) from e + + if CONFIG_KEY_PYTHON_PATH in config: + add_to_sys_path(config[CONFIG_KEY_PYTHON_PATH]) + + dir_path = os.path.dirname(tricks_file) or os.path.relpath(os.getcwd()) + schedule_tricks(observer, tricks, dir_path, recursive=args.recursive) + observer.start() + observers.append(observer) + + try: + while True: + time.sleep(1) + except WatchdogShutdownError: + for o in observers: + o.unschedule_all() + o.stop() + for o in observers: + o.join() + + +@command( + [ + argument( + "trick_paths", + nargs="*", + help="Dotted paths for all the tricks you want to generate.", + ), + argument( + "--python-path", + default=".", + help=f"Paths separated by {os.pathsep!r} to add to the Python path.", + ), + argument( + "--append-to-file", + default=None, + help=""" + Appends the generated tricks YAML to a file. + If not specified, prints to standard output.""", + ), + argument( + "-a", + "--append-only", + dest="append_only", + action="store_true", + help=""" + If --append-to-file is not specified, produces output for + appending instead of a complete tricks YAML file.""", + ), + ], + cmd_aliases=["generate-tricks-yaml"], +) +def tricks_generate_yaml(args: Namespace) -> None: + """Command to generate Yaml configuration for tricks named on the command line.""" + import yaml + + python_paths = path_split(args.python_path) + add_to_sys_path(python_paths) + output = StringIO() + + for trick_path in args.trick_paths: + trick_cls = load_class(trick_path) + output.write(trick_cls.generate_yaml()) + + content = output.getvalue() + output.close() + + header = yaml.dump({CONFIG_KEY_PYTHON_PATH: python_paths}) + header += f"{CONFIG_KEY_TRICKS}:\n" + if args.append_to_file is None: + # Output to standard output. + if not args.append_only: + content = header + content + sys.stdout.write(content) + else: + if not os.path.exists(args.append_to_file): + content = header + content + with open(args.append_to_file, "a", encoding="utf-8") as file: + file.write(content) + + +@command( + [ + argument( + "directories", + nargs="*", + default=".", + help="Directories to watch. (default: '.').", + ), + argument( + "-p", + "--pattern", + "--patterns", + dest="patterns", + default="*", + help="Matches event paths with these patterns (separated by ;).", + ), + argument( + "-i", + "--ignore-pattern", + "--ignore-patterns", + dest="ignore_patterns", + default="", + help="Ignores event paths with these patterns (separated by ;).", + ), + argument( + "-D", + "--ignore-directories", + dest="ignore_directories", + action="store_true", + help="Ignores events for directories.", + ), + argument( + "-R", + "--recursive", + dest="recursive", + action="store_true", + help="Monitors the directories recursively.", + ), + argument( + "--interval", + "--timeout", + dest="timeout", + default=1.0, + type=float, + help="Use this as the polling interval/blocking timeout.", + ), + argument("--debug-force-polling", action="store_true", help="[debug] Forces polling."), + argument( + "--debug-force-kqueue", + action="store_true", + help="[debug] Forces BSD kqueue(2).", + ), + argument( + "--debug-force-winapi", + action="store_true", + help="[debug] Forces Windows API.", + ), + argument( + "--debug-force-fsevents", + action="store_true", + help="[debug] Forces macOS FSEvents.", + ), + argument( + "--debug-force-inotify", + action="store_true", + help="[debug] Forces Linux inotify(7).", + ), + ], +) +def log(args: Namespace) -> None: + """Command to log file system events to the console.""" + from watchdog.tricks import LoggerTrick + + patterns, ignore_patterns = parse_patterns(args.patterns, args.ignore_patterns) + handler = LoggerTrick( + patterns=patterns, + ignore_patterns=ignore_patterns, + ignore_directories=args.ignore_directories, + ) + + observer_cls: ObserverType + if args.debug_force_polling: + from watchdog.observers.polling import PollingObserver + + observer_cls = PollingObserver + elif args.debug_force_kqueue: + from watchdog.observers.kqueue import KqueueObserver + + observer_cls = KqueueObserver + elif (not TYPE_CHECKING and args.debug_force_winapi) or (TYPE_CHECKING and platform.is_windows()): + from watchdog.observers.read_directory_changes import WindowsApiObserver + + observer_cls = WindowsApiObserver + elif args.debug_force_inotify: + from watchdog.observers.inotify import InotifyObserver + + observer_cls = InotifyObserver + elif args.debug_force_fsevents: + from watchdog.observers.fsevents import FSEventsObserver + + observer_cls = FSEventsObserver + else: + # Automatically picks the most appropriate observer for the platform + # on which it is running. + from watchdog.observers import Observer + + observer_cls = Observer + + observer = observer_cls(timeout=args.timeout) + observe_with(observer, handler, args.directories, recursive=args.recursive) + + +@command( + [ + argument("directories", nargs="*", default=".", help="Directories to watch."), + argument( + "-c", + "--command", + dest="command", + default=None, + help=""" + Shell command executed in response to matching events. + These interpolation variables are available to your command string: + + ${watch_src_path} - event source path + ${watch_dest_path} - event destination path (for moved events) + ${watch_event_type} - event type + ${watch_object} - 'file' or 'directory' + + Note: + Please ensure you do not use double quotes (") to quote + your command string. That will force your shell to + interpolate before the command is processed by this + command. + + Example: + + --command='echo "${watch_src_path}"' + """, + ), + argument( + "-p", + "--pattern", + "--patterns", + dest="patterns", + default="*", + help="Matches event paths with these patterns (separated by ;).", + ), + argument( + "-i", + "--ignore-pattern", + "--ignore-patterns", + dest="ignore_patterns", + default="", + help="Ignores event paths with these patterns (separated by ;).", + ), + argument( + "-D", + "--ignore-directories", + dest="ignore_directories", + default=False, + action="store_true", + help="Ignores events for directories.", + ), + argument( + "-R", + "--recursive", + dest="recursive", + action="store_true", + help="Monitors the directories recursively.", + ), + argument( + "--interval", + "--timeout", + dest="timeout", + default=1.0, + type=float, + help="Use this as the polling interval/blocking timeout.", + ), + argument( + "-w", + "--wait", + dest="wait_for_process", + action="store_true", + help="Wait for process to finish to avoid multiple simultaneous instances.", + ), + argument( + "-W", + "--drop", + dest="drop_during_process", + action="store_true", + help="Ignore events that occur while command is still being" + " executed to avoid multiple simultaneous instances.", + ), + argument("--debug-force-polling", action="store_true", help="[debug] Forces polling."), + ], +) +def shell_command(args: Namespace) -> None: + """Command to execute shell commands in response to file system events.""" + from watchdog.tricks import ShellCommandTrick + + if not args.command: + args.command = None + + observer_cls: ObserverType + if args.debug_force_polling: + from watchdog.observers.polling import PollingObserver + + observer_cls = PollingObserver + else: + from watchdog.observers import Observer + + observer_cls = Observer + + patterns, ignore_patterns = parse_patterns(args.patterns, args.ignore_patterns) + handler = ShellCommandTrick( + args.command, + patterns=patterns, + ignore_patterns=ignore_patterns, + ignore_directories=args.ignore_directories, + wait_for_process=args.wait_for_process, + drop_during_process=args.drop_during_process, + ) + observer = observer_cls(timeout=args.timeout) + observe_with(observer, handler, args.directories, recursive=args.recursive) + + +@command( + [ + argument("command", help="Long-running command to run in a subprocess."), + argument( + "command_args", + metavar="arg", + nargs="*", + help=""" + Command arguments. + + Note: Use -- before the command arguments, otherwise watchmedo will + try to interpret them. + """, + ), + argument( + "-d", + "--directory", + dest="directories", + metavar="DIRECTORY", + action="append", + help="Directory to watch. Use another -d or --directory option for each directory.", + ), + argument( + "-p", + "--pattern", + "--patterns", + dest="patterns", + default="*", + help="Matches event paths with these patterns (separated by ;).", + ), + argument( + "-i", + "--ignore-pattern", + "--ignore-patterns", + dest="ignore_patterns", + default="", + help="Ignores event paths with these patterns (separated by ;).", + ), + argument( + "-D", + "--ignore-directories", + dest="ignore_directories", + default=False, + action="store_true", + help="Ignores events for directories.", + ), + argument( + "-R", + "--recursive", + dest="recursive", + action="store_true", + help="Monitors the directories recursively.", + ), + argument( + "--interval", + "--timeout", + dest="timeout", + default=1.0, + type=float, + help="Use this as the polling interval/blocking timeout.", + ), + argument( + "--signal", + dest="signal", + default="SIGINT", + help="Stop the subprocess with this signal (default SIGINT).", + ), + argument("--debug-force-polling", action="store_true", help="[debug] Forces polling."), + argument( + "--kill-after", + dest="kill_after", + default=10.0, + type=float, + help="When stopping, kill the subprocess after the specified timeout in seconds (default 10.0).", + ), + argument( + "--debounce-interval", + dest="debounce_interval", + default=0.0, + type=float, + help="After a file change, Wait until the specified interval (in " + "seconds) passes with no file changes, and only then restart.", + ), + argument( + "--no-restart-on-command-exit", + dest="restart_on_command_exit", + default=True, + action="store_false", + help="Don't auto-restart the command after it exits.", + ), + ], +) +def auto_restart(args: Namespace) -> None: + """Command to start a long-running subprocess and restart it on matched events.""" + observer_cls: ObserverType + if args.debug_force_polling: + from watchdog.observers.polling import PollingObserver + + observer_cls = PollingObserver + else: + from watchdog.observers import Observer + + observer_cls = Observer + + import signal + + from watchdog.tricks import AutoRestartTrick + + if not args.directories: + args.directories = ["."] + + # Allow either signal name or number. + stop_signal = getattr(signal, args.signal) if args.signal.startswith("SIG") else int(args.signal) + + # Handle termination signals by raising a semantic exception which will + # allow us to gracefully unwind and stop the observer + termination_signals = {signal.SIGTERM, signal.SIGINT} + + if hasattr(signal, "SIGHUP"): + termination_signals.add(signal.SIGHUP) + + def handler_termination_signal(_signum: signal._SIGNUM, _frame: object) -> None: + # Neuter all signals so that we don't attempt a double shutdown + for signum in termination_signals: + signal.signal(signum, signal.SIG_IGN) + raise WatchdogShutdownError + + for signum in termination_signals: + signal.signal(signum, handler_termination_signal) + + patterns, ignore_patterns = parse_patterns(args.patterns, args.ignore_patterns) + command = [args.command] + command.extend(args.command_args) + handler = AutoRestartTrick( + command, + patterns=patterns, + ignore_patterns=ignore_patterns, + ignore_directories=args.ignore_directories, + stop_signal=stop_signal, + kill_after=args.kill_after, + debounce_interval_seconds=args.debounce_interval, + restart_on_command_exit=args.restart_on_command_exit, + ) + handler.start() + observer = observer_cls(timeout=args.timeout) + try: + observe_with(observer, handler, args.directories, recursive=args.recursive) + except WatchdogShutdownError: + pass + finally: + handler.stop() + + +class LogLevelError(Exception): + pass + + +def _get_log_level_from_args(args: Namespace) -> str: + verbosity = sum(args.verbosity or []) + if verbosity < -1: + error = "-q/--quiet may be specified only once." + raise LogLevelError(error) + if verbosity > 2: + error = "-v/--verbose may be specified up to 2 times." + raise LogLevelError(error) + return ["ERROR", "WARNING", "INFO", "DEBUG"][1 + verbosity] + + +def main() -> int: + """Entry-point function.""" + args = cli.parse_args() + if args.top_command is None: + cli.print_help() + return 1 + + try: + log_level = _get_log_level_from_args(args) + except LogLevelError as exc: + print(f"Error: {exc.args[0]}", file=sys.stderr) # noqa:T201 + command_parsers[args.top_command].print_help() + return 1 + logging.getLogger("watchdog").setLevel(log_level) + + try: + args.func(args) + except KeyboardInterrupt: + return 130 + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/LICENSE b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8f58fbab24cd87e4d8fee89e95c2de376afb86d8 --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/LICENSE @@ -0,0 +1,4 @@ +This software released into the public domain. Anyone is free to copy, +modify, publish, use, compile, sell, or distribute this software, +either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/METADATA b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..38753926c95b7f91843aad68a3ecfa97160d974d --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/METADATA @@ -0,0 +1,66 @@ +Metadata-Version: 2.1 +Name: win_inet_pton +Version: 1.1.0 +Summary: Native inet_pton and inet_ntop implementation for Python on Windows (with ctypes). +Home-page: https://github.com/hickeroar/win_inet_pton +Author: Ryan Vennell +Author-email: ryan.vennell@gmail.com +Maintainer: Seth Michael Larson +Maintainer-email: sethmichaellarson@gmail.com +License: This software released into the public domain. Anyone is free to copy, + modify, publish, use, compile, sell, or distribute this software, + either in source code form or as a compiled binary, for any purpose, + commercial or non-commercial, and by any means. + +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Operating System :: Microsoft :: Windows +Classifier: License :: Public Domain +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Topic :: Utilities +License-File: LICENSE + +win_inet_pton +============= + +Native inet_pton and inet_ntop implementation for Python on Windows (with ctypes). + +Credit Where Credit Is Due +-------------------------- + +This package is based on code that was originally written by https://github.com/nnemkin here: https://gist.github.com/nnemkin/4966028 + +Why? +---- + +I needed this functionality in https://github.com/SerenitySoftwareLLC/cahoots to get full windows support. I figured, since there were other people looking for a solution to this on the net, I should publish it. + +Usage +----- + + .. code-block:: bash + + python -m pip install win_inet_pton + +Just import it, and it will auto-add the methods to the socket library: + + .. code-block:: python + + import win_inet_pton + import socket + + socket.inet_pton(...) + socket.inet_ntop(...) + +License +------- + +This software released into the public domain. Anyone is free to copy, +modify, publish, use, compile, sell, or distribute this software, +either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/RECORD b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..040f0c8bac857836c3cd2c90bd7c927e19d95cd7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/RECORD @@ -0,0 +1,10 @@ +__pycache__/win_inet_pton.cpython-39.pyc,, +win_inet_pton-1.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +win_inet_pton-1.1.0.dist-info/LICENSE,sha256=Jojr0LrShQfm9IgdiazGCtPyfHHaIpBCzZLLhx5_F3Q,254 +win_inet_pton-1.1.0.dist-info/METADATA,sha256=zPsQtuWBxJe3zswPwbEZ6wMmPN-a1f65pXAe9dHgGoY,2301 +win_inet_pton-1.1.0.dist-info/RECORD,, +win_inet_pton-1.1.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +win_inet_pton-1.1.0.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109 +win_inet_pton-1.1.0.dist-info/direct_url.json,sha256=jxDJdR_IlsCZhl4aKLYZ-aHpWWv1DW6CSnuuy0nQFx0,74 +win_inet_pton-1.1.0.dist-info/top_level.txt,sha256=WNHBAgIa2hB2YqUjnxivo12U9MB2nwcEWwUIM_g0QiY,14 +win_inet_pton.py,sha256=CXu_Vyyw302_RBOSORdcAzV3Cg7uBWESoXWyLvqwNPg,4035 diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/WHEEL b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..104f3874635f24f0d2918dfeaf6a59652274460c --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: setuptools (75.6.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..6d40469c173ace4a12a7361014b78aaef609f11d --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/win_inet_pton_1733130564612/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..c6a9445f5d09f678044dac53e1d081f1584e6958 --- /dev/null +++ b/micromamba_root/Lib/site-packages/win_inet_pton-1.1.0.dist-info/top_level.txt @@ -0,0 +1 @@ +win_inet_pton diff --git a/micromamba_root/Lib/site-packages/yaml/__init__.py b/micromamba_root/Lib/site-packages/yaml/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d58f0891737def7f38e5d86dde2dbf9be0c13dce --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/__init__.py @@ -0,0 +1,390 @@ + +from .error import * + +from .tokens import * +from .events import * +from .nodes import * + +from .loader import * +from .dumper import * + +__version__ = '6.0.3' +try: + from .cyaml import * + __with_libyaml__ = True +except ImportError: + __with_libyaml__ = False + +import io + +#------------------------------------------------------------------------------ +# XXX "Warnings control" is now deprecated. Leaving in the API function to not +# break code that uses it. +#------------------------------------------------------------------------------ +def warnings(settings=None): + if settings is None: + return {} + +#------------------------------------------------------------------------------ +def scan(stream, Loader=Loader): + """ + Scan a YAML stream and produce scanning tokens. + """ + loader = Loader(stream) + try: + while loader.check_token(): + yield loader.get_token() + finally: + loader.dispose() + +def parse(stream, Loader=Loader): + """ + Parse a YAML stream and produce parsing events. + """ + loader = Loader(stream) + try: + while loader.check_event(): + yield loader.get_event() + finally: + loader.dispose() + +def compose(stream, Loader=Loader): + """ + Parse the first YAML document in a stream + and produce the corresponding representation tree. + """ + loader = Loader(stream) + try: + return loader.get_single_node() + finally: + loader.dispose() + +def compose_all(stream, Loader=Loader): + """ + Parse all YAML documents in a stream + and produce corresponding representation trees. + """ + loader = Loader(stream) + try: + while loader.check_node(): + yield loader.get_node() + finally: + loader.dispose() + +def load(stream, Loader): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + """ + loader = Loader(stream) + try: + return loader.get_single_data() + finally: + loader.dispose() + +def load_all(stream, Loader): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + """ + loader = Loader(stream) + try: + while loader.check_data(): + yield loader.get_data() + finally: + loader.dispose() + +def full_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load(stream, FullLoader) + +def full_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load_all(stream, FullLoader) + +def safe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load(stream, SafeLoader) + +def safe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load_all(stream, SafeLoader) + +def unsafe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load(stream, UnsafeLoader) + +def unsafe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load_all(stream, UnsafeLoader) + +def emit(events, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + """ + Emit YAML parsing events into a stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + stream = io.StringIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + try: + for event in events: + dumper.emit(event) + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize_all(nodes, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None): + """ + Serialize a sequence of representation trees into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end) + try: + dumper.open() + for node in nodes: + dumper.serialize(node) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize(node, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a representation tree into a YAML stream. + If stream is None, return the produced string instead. + """ + return serialize_all([node], stream, Dumper=Dumper, **kwds) + +def dump_all(documents, stream=None, Dumper=Dumper, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + """ + Serialize a sequence of Python objects into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, default_style=default_style, + default_flow_style=default_flow_style, + canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end, sort_keys=sort_keys) + try: + dumper.open() + for data in documents: + dumper.represent(data) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def dump(data, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a Python object into a YAML stream. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=Dumper, **kwds) + +def safe_dump_all(documents, stream=None, **kwds): + """ + Serialize a sequence of Python objects into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all(documents, stream, Dumper=SafeDumper, **kwds) + +def safe_dump(data, stream=None, **kwds): + """ + Serialize a Python object into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=SafeDumper, **kwds) + +def add_implicit_resolver(tag, regexp, first=None, + Loader=None, Dumper=Dumper): + """ + Add an implicit scalar detector. + If an implicit scalar value matches the given regexp, + the corresponding tag is assigned to the scalar. + first is a sequence of possible initial characters or None. + """ + if Loader is None: + loader.Loader.add_implicit_resolver(tag, regexp, first) + loader.FullLoader.add_implicit_resolver(tag, regexp, first) + loader.UnsafeLoader.add_implicit_resolver(tag, regexp, first) + else: + Loader.add_implicit_resolver(tag, regexp, first) + Dumper.add_implicit_resolver(tag, regexp, first) + +def add_path_resolver(tag, path, kind=None, Loader=None, Dumper=Dumper): + """ + Add a path based resolver for the given tag. + A path is a list of keys that forms a path + to a node in the representation tree. + Keys can be string values, integers, or None. + """ + if Loader is None: + loader.Loader.add_path_resolver(tag, path, kind) + loader.FullLoader.add_path_resolver(tag, path, kind) + loader.UnsafeLoader.add_path_resolver(tag, path, kind) + else: + Loader.add_path_resolver(tag, path, kind) + Dumper.add_path_resolver(tag, path, kind) + +def add_constructor(tag, constructor, Loader=None): + """ + Add a constructor for the given tag. + Constructor is a function that accepts a Loader instance + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_constructor(tag, constructor) + loader.FullLoader.add_constructor(tag, constructor) + loader.UnsafeLoader.add_constructor(tag, constructor) + else: + Loader.add_constructor(tag, constructor) + +def add_multi_constructor(tag_prefix, multi_constructor, Loader=None): + """ + Add a multi-constructor for the given tag prefix. + Multi-constructor is called for a node if its tag starts with tag_prefix. + Multi-constructor accepts a Loader instance, a tag suffix, + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_multi_constructor(tag_prefix, multi_constructor) + loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor) + loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor) + else: + Loader.add_multi_constructor(tag_prefix, multi_constructor) + +def add_representer(data_type, representer, Dumper=Dumper): + """ + Add a representer for the given type. + Representer is a function accepting a Dumper instance + and an instance of the given data type + and producing the corresponding representation node. + """ + Dumper.add_representer(data_type, representer) + +def add_multi_representer(data_type, multi_representer, Dumper=Dumper): + """ + Add a representer for the given type. + Multi-representer is a function accepting a Dumper instance + and an instance of the given data type or subtype + and producing the corresponding representation node. + """ + Dumper.add_multi_representer(data_type, multi_representer) + +class YAMLObjectMetaclass(type): + """ + The metaclass for YAMLObject. + """ + def __init__(cls, name, bases, kwds): + super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds) + if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None: + if isinstance(cls.yaml_loader, list): + for loader in cls.yaml_loader: + loader.add_constructor(cls.yaml_tag, cls.from_yaml) + else: + cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml) + + cls.yaml_dumper.add_representer(cls, cls.to_yaml) + +class YAMLObject(metaclass=YAMLObjectMetaclass): + """ + An object that can dump itself to a YAML stream + and load itself from a YAML stream. + """ + + __slots__ = () # no direct instantiation, so allow immutable subclasses + + yaml_loader = [Loader, FullLoader, UnsafeLoader] + yaml_dumper = Dumper + + yaml_tag = None + yaml_flow_style = None + + @classmethod + def from_yaml(cls, loader, node): + """ + Convert a representation node to a Python object. + """ + return loader.construct_yaml_object(node, cls) + + @classmethod + def to_yaml(cls, dumper, data): + """ + Convert a Python object to a representation node. + """ + return dumper.represent_yaml_object(cls.yaml_tag, data, cls, + flow_style=cls.yaml_flow_style) + diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36ba035e4ad1e82ad8dc08f7674be8f3ee18965d Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/composer.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/composer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7baca6745ffd3424f55495c1b6395addd0b32381 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/composer.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/constructor.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/constructor.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0234937ae1d8e144b2ce5189e12b2f9d23fffdb6 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/constructor.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/cyaml.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/cyaml.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cae572ac09d16ccc8406ce41ff61a96bbfcfc041 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/cyaml.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/dumper.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/dumper.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b66ade61f6a2dd4a82b69e4cca162c6eb94eeb7f Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/dumper.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/emitter.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/emitter.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c2476670ba1d228be6a87581bbb8bf1d9d7b166 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/emitter.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/error.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/error.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a631d9601e344f3952886f66f821e2ba82a18fe Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/error.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/events.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/events.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e09619ac694789e37ef9595030c14ab58f26d72 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/events.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/loader.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/loader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..418b22dbd6488fe64dfbaf881f914bf8c18ce3de Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/loader.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/nodes.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/nodes.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7fa7d21d45246f4c5acd07d798de87311e0f738 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/nodes.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/parser.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/parser.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74cf0202aaae0b69862c0d4027fb6b1c406dd9ea Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/parser.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/reader.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/reader.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6405c952a7c7e88572a95285b3b8471a76b09249 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/reader.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/representer.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/representer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18f5e4d1bb6f7e089b0fcdca93324aa5aec22145 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/representer.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/resolver.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/resolver.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d90d989abe34885dd9f510cb5179d68551a5c987 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/resolver.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/scanner.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/scanner.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b847f3b2ebc5e5aa3dc5abf14ef96c268eef5a19 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/scanner.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/serializer.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/serializer.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edeff60cebef0c26bb37063917a00cf115eb4067 Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/serializer.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/__pycache__/tokens.cpython-314.pyc b/micromamba_root/Lib/site-packages/yaml/__pycache__/tokens.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..624600a07cfc4ffbad81919f364584d4783b061d Binary files /dev/null and b/micromamba_root/Lib/site-packages/yaml/__pycache__/tokens.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/yaml/composer.py b/micromamba_root/Lib/site-packages/yaml/composer.py new file mode 100644 index 0000000000000000000000000000000000000000..6d15cb40e3b4198819c91c6f8d8b32807fcf53b2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/composer.py @@ -0,0 +1,139 @@ + +__all__ = ['Composer', 'ComposerError'] + +from .error import MarkedYAMLError +from .events import * +from .nodes import * + +class ComposerError(MarkedYAMLError): + pass + +class Composer: + + def __init__(self): + self.anchors = {} + + def check_node(self): + # Drop the STREAM-START event. + if self.check_event(StreamStartEvent): + self.get_event() + + # If there are more documents available? + return not self.check_event(StreamEndEvent) + + def get_node(self): + # Get the root node of the next document. + if not self.check_event(StreamEndEvent): + return self.compose_document() + + def get_single_node(self): + # Drop the STREAM-START event. + self.get_event() + + # Compose a document if the stream is not empty. + document = None + if not self.check_event(StreamEndEvent): + document = self.compose_document() + + # Ensure that the stream contains no more documents. + if not self.check_event(StreamEndEvent): + event = self.get_event() + raise ComposerError("expected a single document in the stream", + document.start_mark, "but found another document", + event.start_mark) + + # Drop the STREAM-END event. + self.get_event() + + return document + + def compose_document(self): + # Drop the DOCUMENT-START event. + self.get_event() + + # Compose the root node. + node = self.compose_node(None, None) + + # Drop the DOCUMENT-END event. + self.get_event() + + self.anchors = {} + return node + + def compose_node(self, parent, index): + if self.check_event(AliasEvent): + event = self.get_event() + anchor = event.anchor + if anchor not in self.anchors: + raise ComposerError(None, None, "found undefined alias %r" + % anchor, event.start_mark) + return self.anchors[anchor] + event = self.peek_event() + anchor = event.anchor + if anchor is not None: + if anchor in self.anchors: + raise ComposerError("found duplicate anchor %r; first occurrence" + % anchor, self.anchors[anchor].start_mark, + "second occurrence", event.start_mark) + self.descend_resolver(parent, index) + if self.check_event(ScalarEvent): + node = self.compose_scalar_node(anchor) + elif self.check_event(SequenceStartEvent): + node = self.compose_sequence_node(anchor) + elif self.check_event(MappingStartEvent): + node = self.compose_mapping_node(anchor) + self.ascend_resolver() + return node + + def compose_scalar_node(self, anchor): + event = self.get_event() + tag = event.tag + if tag is None or tag == '!': + tag = self.resolve(ScalarNode, event.value, event.implicit) + node = ScalarNode(tag, event.value, + event.start_mark, event.end_mark, style=event.style) + if anchor is not None: + self.anchors[anchor] = node + return node + + def compose_sequence_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(SequenceNode, None, start_event.implicit) + node = SequenceNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + index = 0 + while not self.check_event(SequenceEndEvent): + node.value.append(self.compose_node(node, index)) + index += 1 + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + + def compose_mapping_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(MappingNode, None, start_event.implicit) + node = MappingNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + while not self.check_event(MappingEndEvent): + #key_event = self.peek_event() + item_key = self.compose_node(node, None) + #if item_key in node.value: + # raise ComposerError("while composing a mapping", start_event.start_mark, + # "found duplicate key", key_event.start_mark) + item_value = self.compose_node(node, item_key) + #node.value[item_key] = item_value + node.value.append((item_key, item_value)) + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + diff --git a/micromamba_root/Lib/site-packages/yaml/constructor.py b/micromamba_root/Lib/site-packages/yaml/constructor.py new file mode 100644 index 0000000000000000000000000000000000000000..619acd3070a4845c653fcf22a626e05158035bc2 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/constructor.py @@ -0,0 +1,748 @@ + +__all__ = [ + 'BaseConstructor', + 'SafeConstructor', + 'FullConstructor', + 'UnsafeConstructor', + 'Constructor', + 'ConstructorError' +] + +from .error import * +from .nodes import * + +import collections.abc, datetime, base64, binascii, re, sys, types + +class ConstructorError(MarkedYAMLError): + pass + +class BaseConstructor: + + yaml_constructors = {} + yaml_multi_constructors = {} + + def __init__(self): + self.constructed_objects = {} + self.recursive_objects = {} + self.state_generators = [] + self.deep_construct = False + + def check_data(self): + # If there are more documents available? + return self.check_node() + + def check_state_key(self, key): + """Block special attributes/methods from being set in a newly created + object, to prevent user-controlled methods from being called during + deserialization""" + if self.get_state_keys_blacklist_regexp().match(key): + raise ConstructorError(None, None, + "blacklisted key '%s' in instance state found" % (key,), None) + + def get_data(self): + # Construct and return the next document. + if self.check_node(): + return self.construct_document(self.get_node()) + + def get_single_data(self): + # Ensure that the stream contains a single document and construct it. + node = self.get_single_node() + if node is not None: + return self.construct_document(node) + return None + + def construct_document(self, node): + data = self.construct_object(node) + while self.state_generators: + state_generators = self.state_generators + self.state_generators = [] + for generator in state_generators: + for dummy in generator: + pass + self.constructed_objects = {} + self.recursive_objects = {} + self.deep_construct = False + return data + + def construct_object(self, node, deep=False): + if node in self.constructed_objects: + return self.constructed_objects[node] + if deep: + old_deep = self.deep_construct + self.deep_construct = True + if node in self.recursive_objects: + raise ConstructorError(None, None, + "found unconstructable recursive node", node.start_mark) + self.recursive_objects[node] = None + constructor = None + tag_suffix = None + if node.tag in self.yaml_constructors: + constructor = self.yaml_constructors[node.tag] + else: + for tag_prefix in self.yaml_multi_constructors: + if tag_prefix is not None and node.tag.startswith(tag_prefix): + tag_suffix = node.tag[len(tag_prefix):] + constructor = self.yaml_multi_constructors[tag_prefix] + break + else: + if None in self.yaml_multi_constructors: + tag_suffix = node.tag + constructor = self.yaml_multi_constructors[None] + elif None in self.yaml_constructors: + constructor = self.yaml_constructors[None] + elif isinstance(node, ScalarNode): + constructor = self.__class__.construct_scalar + elif isinstance(node, SequenceNode): + constructor = self.__class__.construct_sequence + elif isinstance(node, MappingNode): + constructor = self.__class__.construct_mapping + if tag_suffix is None: + data = constructor(self, node) + else: + data = constructor(self, tag_suffix, node) + if isinstance(data, types.GeneratorType): + generator = data + data = next(generator) + if self.deep_construct: + for dummy in generator: + pass + else: + self.state_generators.append(generator) + self.constructed_objects[node] = data + del self.recursive_objects[node] + if deep: + self.deep_construct = old_deep + return data + + def construct_scalar(self, node): + if not isinstance(node, ScalarNode): + raise ConstructorError(None, None, + "expected a scalar node, but found %s" % node.id, + node.start_mark) + return node.value + + def construct_sequence(self, node, deep=False): + if not isinstance(node, SequenceNode): + raise ConstructorError(None, None, + "expected a sequence node, but found %s" % node.id, + node.start_mark) + return [self.construct_object(child, deep=deep) + for child in node.value] + + def construct_mapping(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + mapping = {} + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + if not isinstance(key, collections.abc.Hashable): + raise ConstructorError("while constructing a mapping", node.start_mark, + "found unhashable key", key_node.start_mark) + value = self.construct_object(value_node, deep=deep) + mapping[key] = value + return mapping + + def construct_pairs(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + pairs = [] + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + value = self.construct_object(value_node, deep=deep) + pairs.append((key, value)) + return pairs + + @classmethod + def add_constructor(cls, tag, constructor): + if not 'yaml_constructors' in cls.__dict__: + cls.yaml_constructors = cls.yaml_constructors.copy() + cls.yaml_constructors[tag] = constructor + + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): + if not 'yaml_multi_constructors' in cls.__dict__: + cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy() + cls.yaml_multi_constructors[tag_prefix] = multi_constructor + +class SafeConstructor(BaseConstructor): + + def construct_scalar(self, node): + if isinstance(node, MappingNode): + for key_node, value_node in node.value: + if key_node.tag == 'tag:yaml.org,2002:value': + return self.construct_scalar(value_node) + return super().construct_scalar(node) + + def flatten_mapping(self, node): + merge = [] + index = 0 + while index < len(node.value): + key_node, value_node = node.value[index] + if key_node.tag == 'tag:yaml.org,2002:merge': + del node.value[index] + if isinstance(value_node, MappingNode): + self.flatten_mapping(value_node) + merge.extend(value_node.value) + elif isinstance(value_node, SequenceNode): + submerge = [] + for subnode in value_node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing a mapping", + node.start_mark, + "expected a mapping for merging, but found %s" + % subnode.id, subnode.start_mark) + self.flatten_mapping(subnode) + submerge.append(subnode.value) + submerge.reverse() + for value in submerge: + merge.extend(value) + else: + raise ConstructorError("while constructing a mapping", node.start_mark, + "expected a mapping or list of mappings for merging, but found %s" + % value_node.id, value_node.start_mark) + elif key_node.tag == 'tag:yaml.org,2002:value': + key_node.tag = 'tag:yaml.org,2002:str' + index += 1 + else: + index += 1 + if merge: + node.value = merge + node.value + + def construct_mapping(self, node, deep=False): + if isinstance(node, MappingNode): + self.flatten_mapping(node) + return super().construct_mapping(node, deep=deep) + + def construct_yaml_null(self, node): + self.construct_scalar(node) + return None + + bool_values = { + 'yes': True, + 'no': False, + 'true': True, + 'false': False, + 'on': True, + 'off': False, + } + + def construct_yaml_bool(self, node): + value = self.construct_scalar(node) + return self.bool_values[value.lower()] + + def construct_yaml_int(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '') + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '0': + return 0 + elif value.startswith('0b'): + return sign*int(value[2:], 2) + elif value.startswith('0x'): + return sign*int(value[2:], 16) + elif value[0] == '0': + return sign*int(value, 8) + elif ':' in value: + digits = [int(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*int(value) + + inf_value = 1e300 + while inf_value != inf_value*inf_value: + inf_value *= inf_value + nan_value = -inf_value/inf_value # Trying to make a quiet NaN (like C99). + + def construct_yaml_float(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '').lower() + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '.inf': + return sign*self.inf_value + elif value == '.nan': + return self.nan_value + elif ':' in value: + digits = [float(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0.0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*float(value) + + def construct_yaml_binary(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + timestamp_regexp = re.compile( + r'''^(?P<year>[0-9][0-9][0-9][0-9]) + -(?P<month>[0-9][0-9]?) + -(?P<day>[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P<hour>[0-9][0-9]?) + :(?P<minute>[0-9][0-9]) + :(?P<second>[0-9][0-9]) + (?:\.(?P<fraction>[0-9]*))? + (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?) + (?::(?P<tz_minute>[0-9][0-9]))?))?)?$''', re.X) + + def construct_yaml_timestamp(self, node): + value = self.construct_scalar(node) + match = self.timestamp_regexp.match(node.value) + values = match.groupdict() + year = int(values['year']) + month = int(values['month']) + day = int(values['day']) + if not values['hour']: + return datetime.date(year, month, day) + hour = int(values['hour']) + minute = int(values['minute']) + second = int(values['second']) + fraction = 0 + tzinfo = None + if values['fraction']: + fraction = values['fraction'][:6] + while len(fraction) < 6: + fraction += '0' + fraction = int(fraction) + if values['tz_sign']: + tz_hour = int(values['tz_hour']) + tz_minute = int(values['tz_minute'] or 0) + delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute) + if values['tz_sign'] == '-': + delta = -delta + tzinfo = datetime.timezone(delta) + elif values['tz']: + tzinfo = datetime.timezone.utc + return datetime.datetime(year, month, day, hour, minute, second, fraction, + tzinfo=tzinfo) + + def construct_yaml_omap(self, node): + # Note: we do not check for duplicate keys, because it's too + # CPU-expensive. + omap = [] + yield omap + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + omap.append((key, value)) + + def construct_yaml_pairs(self, node): + # Note: the same code as `construct_yaml_omap`. + pairs = [] + yield pairs + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + pairs.append((key, value)) + + def construct_yaml_set(self, node): + data = set() + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_str(self, node): + return self.construct_scalar(node) + + def construct_yaml_seq(self, node): + data = [] + yield data + data.extend(self.construct_sequence(node)) + + def construct_yaml_map(self, node): + data = {} + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_object(self, node, cls): + data = cls.__new__(cls) + yield data + if hasattr(data, '__setstate__'): + state = self.construct_mapping(node, deep=True) + data.__setstate__(state) + else: + state = self.construct_mapping(node) + data.__dict__.update(state) + + def construct_undefined(self, node): + raise ConstructorError(None, None, + "could not determine a constructor for the tag %r" % node.tag, + node.start_mark) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:null', + SafeConstructor.construct_yaml_null) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:bool', + SafeConstructor.construct_yaml_bool) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:int', + SafeConstructor.construct_yaml_int) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:float', + SafeConstructor.construct_yaml_float) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:binary', + SafeConstructor.construct_yaml_binary) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:timestamp', + SafeConstructor.construct_yaml_timestamp) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:omap', + SafeConstructor.construct_yaml_omap) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:pairs', + SafeConstructor.construct_yaml_pairs) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:set', + SafeConstructor.construct_yaml_set) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:str', + SafeConstructor.construct_yaml_str) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:seq', + SafeConstructor.construct_yaml_seq) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:map', + SafeConstructor.construct_yaml_map) + +SafeConstructor.add_constructor(None, + SafeConstructor.construct_undefined) + +class FullConstructor(SafeConstructor): + # 'extend' is blacklisted because it is used by + # construct_python_object_apply to add `listitems` to a newly generate + # python instance + def get_state_keys_blacklist(self): + return ['^extend$', '^__.*__$'] + + def get_state_keys_blacklist_regexp(self): + if not hasattr(self, 'state_keys_blacklist_regexp'): + self.state_keys_blacklist_regexp = re.compile('(' + '|'.join(self.get_state_keys_blacklist()) + ')') + return self.state_keys_blacklist_regexp + + def construct_python_str(self, node): + return self.construct_scalar(node) + + def construct_python_unicode(self, node): + return self.construct_scalar(node) + + def construct_python_bytes(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + def construct_python_long(self, node): + return self.construct_yaml_int(node) + + def construct_python_complex(self, node): + return complex(self.construct_scalar(node)) + + def construct_python_tuple(self, node): + return tuple(self.construct_sequence(node)) + + def find_python_module(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python module", mark, + "expected non-empty name appended to the tag", mark) + if unsafe: + try: + __import__(name) + except ImportError as exc: + raise ConstructorError("while constructing a Python module", mark, + "cannot find module %r (%s)" % (name, exc), mark) + if name not in sys.modules: + raise ConstructorError("while constructing a Python module", mark, + "module %r is not imported" % name, mark) + return sys.modules[name] + + def find_python_name(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python object", mark, + "expected non-empty name appended to the tag", mark) + if '.' in name: + module_name, object_name = name.rsplit('.', 1) + else: + module_name = 'builtins' + object_name = name + if unsafe: + try: + __import__(module_name) + except ImportError as exc: + raise ConstructorError("while constructing a Python object", mark, + "cannot find module %r (%s)" % (module_name, exc), mark) + if module_name not in sys.modules: + raise ConstructorError("while constructing a Python object", mark, + "module %r is not imported" % module_name, mark) + module = sys.modules[module_name] + if not hasattr(module, object_name): + raise ConstructorError("while constructing a Python object", mark, + "cannot find %r in the module %r" + % (object_name, module.__name__), mark) + return getattr(module, object_name) + + def construct_python_name(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python name", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_name(suffix, node.start_mark) + + def construct_python_module(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python module", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_module(suffix, node.start_mark) + + def make_python_instance(self, suffix, node, + args=None, kwds=None, newobj=False, unsafe=False): + if not args: + args = [] + if not kwds: + kwds = {} + cls = self.find_python_name(suffix, node.start_mark) + if not (unsafe or isinstance(cls, type)): + raise ConstructorError("while constructing a Python instance", node.start_mark, + "expected a class, but found %r" % type(cls), + node.start_mark) + if newobj and isinstance(cls, type): + return cls.__new__(cls, *args, **kwds) + else: + return cls(*args, **kwds) + + def set_python_instance_state(self, instance, state, unsafe=False): + if hasattr(instance, '__setstate__'): + instance.__setstate__(state) + else: + slotstate = {} + if isinstance(state, tuple) and len(state) == 2: + state, slotstate = state + if hasattr(instance, '__dict__'): + if not unsafe and state: + for key in state.keys(): + self.check_state_key(key) + instance.__dict__.update(state) + elif state: + slotstate.update(state) + for key, value in slotstate.items(): + if not unsafe: + self.check_state_key(key) + setattr(instance, key, value) + + def construct_python_object(self, suffix, node): + # Format: + # !!python/object:module.name { ... state ... } + instance = self.make_python_instance(suffix, node, newobj=True) + yield instance + deep = hasattr(instance, '__setstate__') + state = self.construct_mapping(node, deep=deep) + self.set_python_instance_state(instance, state) + + def construct_python_object_apply(self, suffix, node, newobj=False): + # Format: + # !!python/object/apply # (or !!python/object/new) + # args: [ ... arguments ... ] + # kwds: { ... keywords ... } + # state: ... state ... + # listitems: [ ... listitems ... ] + # dictitems: { ... dictitems ... } + # or short format: + # !!python/object/apply [ ... arguments ... ] + # The difference between !!python/object/apply and !!python/object/new + # is how an object is created, check make_python_instance for details. + if isinstance(node, SequenceNode): + args = self.construct_sequence(node, deep=True) + kwds = {} + state = {} + listitems = [] + dictitems = {} + else: + value = self.construct_mapping(node, deep=True) + args = value.get('args', []) + kwds = value.get('kwds', {}) + state = value.get('state', {}) + listitems = value.get('listitems', []) + dictitems = value.get('dictitems', {}) + instance = self.make_python_instance(suffix, node, args, kwds, newobj) + if state: + self.set_python_instance_state(instance, state) + if listitems: + instance.extend(listitems) + if dictitems: + for key in dictitems: + instance[key] = dictitems[key] + return instance + + def construct_python_object_new(self, suffix, node): + return self.construct_python_object_apply(suffix, node, newobj=True) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/none', + FullConstructor.construct_yaml_null) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bool', + FullConstructor.construct_yaml_bool) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/str', + FullConstructor.construct_python_str) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/unicode', + FullConstructor.construct_python_unicode) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bytes', + FullConstructor.construct_python_bytes) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/int', + FullConstructor.construct_yaml_int) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/long', + FullConstructor.construct_python_long) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/float', + FullConstructor.construct_yaml_float) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/complex', + FullConstructor.construct_python_complex) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/list', + FullConstructor.construct_yaml_seq) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/tuple', + FullConstructor.construct_python_tuple) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/dict', + FullConstructor.construct_yaml_map) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/name:', + FullConstructor.construct_python_name) + +class UnsafeConstructor(FullConstructor): + + def find_python_module(self, name, mark): + return super(UnsafeConstructor, self).find_python_module(name, mark, unsafe=True) + + def find_python_name(self, name, mark): + return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True) + + def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): + return super(UnsafeConstructor, self).make_python_instance( + suffix, node, args, kwds, newobj, unsafe=True) + + def set_python_instance_state(self, instance, state): + return super(UnsafeConstructor, self).set_python_instance_state( + instance, state, unsafe=True) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/module:', + UnsafeConstructor.construct_python_module) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object:', + UnsafeConstructor.construct_python_object) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/new:', + UnsafeConstructor.construct_python_object_new) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/apply:', + UnsafeConstructor.construct_python_object_apply) + +# Constructor is same as UnsafeConstructor. Need to leave this in place in case +# people have extended it directly. +class Constructor(UnsafeConstructor): + pass diff --git a/micromamba_root/Lib/site-packages/yaml/cyaml.py b/micromamba_root/Lib/site-packages/yaml/cyaml.py new file mode 100644 index 0000000000000000000000000000000000000000..0c21345879b298bb8668201bebe7d289586b17f9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/cyaml.py @@ -0,0 +1,101 @@ + +__all__ = [ + 'CBaseLoader', 'CSafeLoader', 'CFullLoader', 'CUnsafeLoader', 'CLoader', + 'CBaseDumper', 'CSafeDumper', 'CDumper' +] + +from yaml._yaml import CParser, CEmitter + +from .constructor import * + +from .serializer import * +from .representer import * + +from .resolver import * + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class CSafeLoader(CParser, SafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class CFullLoader(CParser, FullConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class CUnsafeLoader(CParser, UnsafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + UnsafeConstructor.__init__(self) + Resolver.__init__(self) + +class CLoader(CParser, Constructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + Constructor.__init__(self) + Resolver.__init__(self) + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CSafeDumper(CEmitter, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CDumper(CEmitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/micromamba_root/Lib/site-packages/yaml/dumper.py b/micromamba_root/Lib/site-packages/yaml/dumper.py new file mode 100644 index 0000000000000000000000000000000000000000..6aadba551f3836b02f4752277f4b3027073defad --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/dumper.py @@ -0,0 +1,62 @@ + +__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] + +from .emitter import * +from .serializer import * +from .representer import * +from .resolver import * + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class Dumper(Emitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/micromamba_root/Lib/site-packages/yaml/emitter.py b/micromamba_root/Lib/site-packages/yaml/emitter.py new file mode 100644 index 0000000000000000000000000000000000000000..a664d011162af69184df2f8e59ab7feec818f7c7 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/emitter.py @@ -0,0 +1,1137 @@ + +# Emitter expects events obeying the following grammar: +# stream ::= STREAM-START document* STREAM-END +# document ::= DOCUMENT-START node DOCUMENT-END +# node ::= SCALAR | sequence | mapping +# sequence ::= SEQUENCE-START node* SEQUENCE-END +# mapping ::= MAPPING-START (node node)* MAPPING-END + +__all__ = ['Emitter', 'EmitterError'] + +from .error import YAMLError +from .events import * + +class EmitterError(YAMLError): + pass + +class ScalarAnalysis: + def __init__(self, scalar, empty, multiline, + allow_flow_plain, allow_block_plain, + allow_single_quoted, allow_double_quoted, + allow_block): + self.scalar = scalar + self.empty = empty + self.multiline = multiline + self.allow_flow_plain = allow_flow_plain + self.allow_block_plain = allow_block_plain + self.allow_single_quoted = allow_single_quoted + self.allow_double_quoted = allow_double_quoted + self.allow_block = allow_block + +class Emitter: + + DEFAULT_TAG_PREFIXES = { + '!' : '!', + 'tag:yaml.org,2002:' : '!!', + } + + def __init__(self, stream, canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + + # The stream should have the methods `write` and possibly `flush`. + self.stream = stream + + # Encoding can be overridden by STREAM-START. + self.encoding = None + + # Emitter is a state machine with a stack of states to handle nested + # structures. + self.states = [] + self.state = self.expect_stream_start + + # Current event and the event queue. + self.events = [] + self.event = None + + # The current indentation level and the stack of previous indents. + self.indents = [] + self.indent = None + + # Flow level. + self.flow_level = 0 + + # Contexts. + self.root_context = False + self.sequence_context = False + self.mapping_context = False + self.simple_key_context = False + + # Characteristics of the last emitted character: + # - current position. + # - is it a whitespace? + # - is it an indention character + # (indentation space, '-', '?', or ':')? + self.line = 0 + self.column = 0 + self.whitespace = True + self.indention = True + + # Whether the document requires an explicit document indicator + self.open_ended = False + + # Formatting details. + self.canonical = canonical + self.allow_unicode = allow_unicode + self.best_indent = 2 + if indent and 1 < indent < 10: + self.best_indent = indent + self.best_width = 80 + if width and width > self.best_indent*2: + self.best_width = width + self.best_line_break = '\n' + if line_break in ['\r', '\n', '\r\n']: + self.best_line_break = line_break + + # Tag prefixes. + self.tag_prefixes = None + + # Prepared anchor and tag. + self.prepared_anchor = None + self.prepared_tag = None + + # Scalar analysis and style. + self.analysis = None + self.style = None + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def emit(self, event): + self.events.append(event) + while not self.need_more_events(): + self.event = self.events.pop(0) + self.state() + self.event = None + + # In some cases, we wait for a few next events before emitting. + + def need_more_events(self): + if not self.events: + return True + event = self.events[0] + if isinstance(event, DocumentStartEvent): + return self.need_events(1) + elif isinstance(event, SequenceStartEvent): + return self.need_events(2) + elif isinstance(event, MappingStartEvent): + return self.need_events(3) + else: + return False + + def need_events(self, count): + level = 0 + for event in self.events[1:]: + if isinstance(event, (DocumentStartEvent, CollectionStartEvent)): + level += 1 + elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)): + level -= 1 + elif isinstance(event, StreamEndEvent): + level = -1 + if level < 0: + return False + return (len(self.events) < count+1) + + def increase_indent(self, flow=False, indentless=False): + self.indents.append(self.indent) + if self.indent is None: + if flow: + self.indent = self.best_indent + else: + self.indent = 0 + elif not indentless: + self.indent += self.best_indent + + # States. + + # Stream handlers. + + def expect_stream_start(self): + if isinstance(self.event, StreamStartEvent): + if self.event.encoding and not hasattr(self.stream, 'encoding'): + self.encoding = self.event.encoding + self.write_stream_start() + self.state = self.expect_first_document_start + else: + raise EmitterError("expected StreamStartEvent, but got %s" + % self.event) + + def expect_nothing(self): + raise EmitterError("expected nothing, but got %s" % self.event) + + # Document handlers. + + def expect_first_document_start(self): + return self.expect_document_start(first=True) + + def expect_document_start(self, first=False): + if isinstance(self.event, DocumentStartEvent): + if (self.event.version or self.event.tags) and self.open_ended: + self.write_indicator('...', True) + self.write_indent() + if self.event.version: + version_text = self.prepare_version(self.event.version) + self.write_version_directive(version_text) + self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy() + if self.event.tags: + handles = sorted(self.event.tags.keys()) + for handle in handles: + prefix = self.event.tags[handle] + self.tag_prefixes[prefix] = handle + handle_text = self.prepare_tag_handle(handle) + prefix_text = self.prepare_tag_prefix(prefix) + self.write_tag_directive(handle_text, prefix_text) + implicit = (first and not self.event.explicit and not self.canonical + and not self.event.version and not self.event.tags + and not self.check_empty_document()) + if not implicit: + self.write_indent() + self.write_indicator('---', True) + if self.canonical: + self.write_indent() + self.state = self.expect_document_root + elif isinstance(self.event, StreamEndEvent): + if self.open_ended: + self.write_indicator('...', True) + self.write_indent() + self.write_stream_end() + self.state = self.expect_nothing + else: + raise EmitterError("expected DocumentStartEvent, but got %s" + % self.event) + + def expect_document_end(self): + if isinstance(self.event, DocumentEndEvent): + self.write_indent() + if self.event.explicit: + self.write_indicator('...', True) + self.write_indent() + self.flush_stream() + self.state = self.expect_document_start + else: + raise EmitterError("expected DocumentEndEvent, but got %s" + % self.event) + + def expect_document_root(self): + self.states.append(self.expect_document_end) + self.expect_node(root=True) + + # Node handlers. + + def expect_node(self, root=False, sequence=False, mapping=False, + simple_key=False): + self.root_context = root + self.sequence_context = sequence + self.mapping_context = mapping + self.simple_key_context = simple_key + if isinstance(self.event, AliasEvent): + self.expect_alias() + elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)): + self.process_anchor('&') + self.process_tag() + if isinstance(self.event, ScalarEvent): + self.expect_scalar() + elif isinstance(self.event, SequenceStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_sequence(): + self.expect_flow_sequence() + else: + self.expect_block_sequence() + elif isinstance(self.event, MappingStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_mapping(): + self.expect_flow_mapping() + else: + self.expect_block_mapping() + else: + raise EmitterError("expected NodeEvent, but got %s" % self.event) + + def expect_alias(self): + if self.event.anchor is None: + raise EmitterError("anchor is not specified for alias") + self.process_anchor('*') + self.state = self.states.pop() + + def expect_scalar(self): + self.increase_indent(flow=True) + self.process_scalar() + self.indent = self.indents.pop() + self.state = self.states.pop() + + # Flow sequence handlers. + + def expect_flow_sequence(self): + self.write_indicator('[', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_sequence_item + + def expect_first_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator(']', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + def expect_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator(']', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + # Flow mapping handlers. + + def expect_flow_mapping(self): + self.write_indicator('{', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_mapping_key + + def expect_first_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator('}', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator('}', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + def expect_flow_mapping_value(self): + if self.canonical or self.column > self.best_width: + self.write_indent() + self.write_indicator(':', True) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + # Block sequence handlers. + + def expect_block_sequence(self): + indentless = (self.mapping_context and not self.indention) + self.increase_indent(flow=False, indentless=indentless) + self.state = self.expect_first_block_sequence_item + + def expect_first_block_sequence_item(self): + return self.expect_block_sequence_item(first=True) + + def expect_block_sequence_item(self, first=False): + if not first and isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + self.write_indicator('-', True, indention=True) + self.states.append(self.expect_block_sequence_item) + self.expect_node(sequence=True) + + # Block mapping handlers. + + def expect_block_mapping(self): + self.increase_indent(flow=False) + self.state = self.expect_first_block_mapping_key + + def expect_first_block_mapping_key(self): + return self.expect_block_mapping_key(first=True) + + def expect_block_mapping_key(self, first=False): + if not first and isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + if self.check_simple_key(): + self.states.append(self.expect_block_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True, indention=True) + self.states.append(self.expect_block_mapping_value) + self.expect_node(mapping=True) + + def expect_block_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + def expect_block_mapping_value(self): + self.write_indent() + self.write_indicator(':', True, indention=True) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + # Checkers. + + def check_empty_sequence(self): + return (isinstance(self.event, SequenceStartEvent) and self.events + and isinstance(self.events[0], SequenceEndEvent)) + + def check_empty_mapping(self): + return (isinstance(self.event, MappingStartEvent) and self.events + and isinstance(self.events[0], MappingEndEvent)) + + def check_empty_document(self): + if not isinstance(self.event, DocumentStartEvent) or not self.events: + return False + event = self.events[0] + return (isinstance(event, ScalarEvent) and event.anchor is None + and event.tag is None and event.implicit and event.value == '') + + def check_simple_key(self): + length = 0 + if isinstance(self.event, NodeEvent) and self.event.anchor is not None: + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + length += len(self.prepared_anchor) + if isinstance(self.event, (ScalarEvent, CollectionStartEvent)) \ + and self.event.tag is not None: + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(self.event.tag) + length += len(self.prepared_tag) + if isinstance(self.event, ScalarEvent): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + length += len(self.analysis.scalar) + return (length < 128 and (isinstance(self.event, AliasEvent) + or (isinstance(self.event, ScalarEvent) + and not self.analysis.empty and not self.analysis.multiline) + or self.check_empty_sequence() or self.check_empty_mapping())) + + # Anchor, Tag, and Scalar processors. + + def process_anchor(self, indicator): + if self.event.anchor is None: + self.prepared_anchor = None + return + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + if self.prepared_anchor: + self.write_indicator(indicator+self.prepared_anchor, True) + self.prepared_anchor = None + + def process_tag(self): + tag = self.event.tag + if isinstance(self.event, ScalarEvent): + if self.style is None: + self.style = self.choose_scalar_style() + if ((not self.canonical or tag is None) and + ((self.style == '' and self.event.implicit[0]) + or (self.style != '' and self.event.implicit[1]))): + self.prepared_tag = None + return + if self.event.implicit[0] and tag is None: + tag = '!' + self.prepared_tag = None + else: + if (not self.canonical or tag is None) and self.event.implicit: + self.prepared_tag = None + return + if tag is None: + raise EmitterError("tag is not specified") + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(tag) + if self.prepared_tag: + self.write_indicator(self.prepared_tag, True) + self.prepared_tag = None + + def choose_scalar_style(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.event.style == '"' or self.canonical: + return '"' + if not self.event.style and self.event.implicit[0]: + if (not (self.simple_key_context and + (self.analysis.empty or self.analysis.multiline)) + and (self.flow_level and self.analysis.allow_flow_plain + or (not self.flow_level and self.analysis.allow_block_plain))): + return '' + if self.event.style and self.event.style in '|>': + if (not self.flow_level and not self.simple_key_context + and self.analysis.allow_block): + return self.event.style + if not self.event.style or self.event.style == '\'': + if (self.analysis.allow_single_quoted and + not (self.simple_key_context and self.analysis.multiline)): + return '\'' + return '"' + + def process_scalar(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.style is None: + self.style = self.choose_scalar_style() + split = (not self.simple_key_context) + #if self.analysis.multiline and split \ + # and (not self.style or self.style in '\'\"'): + # self.write_indent() + if self.style == '"': + self.write_double_quoted(self.analysis.scalar, split) + elif self.style == '\'': + self.write_single_quoted(self.analysis.scalar, split) + elif self.style == '>': + self.write_folded(self.analysis.scalar) + elif self.style == '|': + self.write_literal(self.analysis.scalar) + else: + self.write_plain(self.analysis.scalar, split) + self.analysis = None + self.style = None + + # Analyzers. + + def prepare_version(self, version): + major, minor = version + if major != 1: + raise EmitterError("unsupported YAML version: %d.%d" % (major, minor)) + return '%d.%d' % (major, minor) + + def prepare_tag_handle(self, handle): + if not handle: + raise EmitterError("tag handle must not be empty") + if handle[0] != '!' or handle[-1] != '!': + raise EmitterError("tag handle must start and end with '!': %r" % handle) + for ch in handle[1:-1]: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the tag handle: %r" + % (ch, handle)) + return handle + + def prepare_tag_prefix(self, prefix): + if not prefix: + raise EmitterError("tag prefix must not be empty") + chunks = [] + start = end = 0 + if prefix[0] == '!': + end = 1 + while end < len(prefix): + ch = prefix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?!:@&=+$,_.~*\'()[]': + end += 1 + else: + if start < end: + chunks.append(prefix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ord(ch)) + if start < end: + chunks.append(prefix[start:end]) + return ''.join(chunks) + + def prepare_tag(self, tag): + if not tag: + raise EmitterError("tag must not be empty") + if tag == '!': + return tag + handle = None + suffix = tag + prefixes = sorted(self.tag_prefixes.keys()) + for prefix in prefixes: + if tag.startswith(prefix) \ + and (prefix == '!' or len(prefix) < len(tag)): + handle = self.tag_prefixes[prefix] + suffix = tag[len(prefix):] + chunks = [] + start = end = 0 + while end < len(suffix): + ch = suffix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.~*\'()[]' \ + or (ch == '!' and handle != '!'): + end += 1 + else: + if start < end: + chunks.append(suffix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ch) + if start < end: + chunks.append(suffix[start:end]) + suffix_text = ''.join(chunks) + if handle: + return '%s%s' % (handle, suffix_text) + else: + return '!<%s>' % suffix_text + + def prepare_anchor(self, anchor): + if not anchor: + raise EmitterError("anchor must not be empty") + for ch in anchor: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the anchor: %r" + % (ch, anchor)) + return anchor + + def analyze_scalar(self, scalar): + + # Empty scalar is a special case. + if not scalar: + return ScalarAnalysis(scalar=scalar, empty=True, multiline=False, + allow_flow_plain=False, allow_block_plain=True, + allow_single_quoted=True, allow_double_quoted=True, + allow_block=False) + + # Indicators and special characters. + block_indicators = False + flow_indicators = False + line_breaks = False + special_characters = False + + # Important whitespace combinations. + leading_space = False + leading_break = False + trailing_space = False + trailing_break = False + break_space = False + space_break = False + + # Check document indicators. + if scalar.startswith('---') or scalar.startswith('...'): + block_indicators = True + flow_indicators = True + + # First character or preceded by a whitespace. + preceded_by_whitespace = True + + # Last character or followed by a whitespace. + followed_by_whitespace = (len(scalar) == 1 or + scalar[1] in '\0 \t\r\n\x85\u2028\u2029') + + # The previous character is a space. + previous_space = False + + # The previous character is a break. + previous_break = False + + index = 0 + while index < len(scalar): + ch = scalar[index] + + # Check for indicators. + if index == 0: + # Leading indicators are special characters. + if ch in '#,[]{}&*!|>\'\"%@`': + flow_indicators = True + block_indicators = True + if ch in '?:': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '-' and followed_by_whitespace: + flow_indicators = True + block_indicators = True + else: + # Some indicators cannot appear within a scalar as well. + if ch in ',?[]{}': + flow_indicators = True + if ch == ':': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '#' and preceded_by_whitespace: + flow_indicators = True + block_indicators = True + + # Check for line breaks, special, and unicode characters. + if ch in '\n\x85\u2028\u2029': + line_breaks = True + if not (ch == '\n' or '\x20' <= ch <= '\x7E'): + if (ch == '\x85' or '\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD' + or '\U00010000' <= ch < '\U0010ffff') and ch != '\uFEFF': + unicode_characters = True + if not self.allow_unicode: + special_characters = True + else: + special_characters = True + + # Detect important whitespace combinations. + if ch == ' ': + if index == 0: + leading_space = True + if index == len(scalar)-1: + trailing_space = True + if previous_break: + break_space = True + previous_space = True + previous_break = False + elif ch in '\n\x85\u2028\u2029': + if index == 0: + leading_break = True + if index == len(scalar)-1: + trailing_break = True + if previous_space: + space_break = True + previous_space = False + previous_break = True + else: + previous_space = False + previous_break = False + + # Prepare for the next character. + index += 1 + preceded_by_whitespace = (ch in '\0 \t\r\n\x85\u2028\u2029') + followed_by_whitespace = (index+1 >= len(scalar) or + scalar[index+1] in '\0 \t\r\n\x85\u2028\u2029') + + # Let's decide what styles are allowed. + allow_flow_plain = True + allow_block_plain = True + allow_single_quoted = True + allow_double_quoted = True + allow_block = True + + # Leading and trailing whitespaces are bad for plain scalars. + if (leading_space or leading_break + or trailing_space or trailing_break): + allow_flow_plain = allow_block_plain = False + + # We do not permit trailing spaces for block scalars. + if trailing_space: + allow_block = False + + # Spaces at the beginning of a new line are only acceptable for block + # scalars. + if break_space: + allow_flow_plain = allow_block_plain = allow_single_quoted = False + + # Spaces followed by breaks, as well as special character are only + # allowed for double quoted scalars. + if space_break or special_characters: + allow_flow_plain = allow_block_plain = \ + allow_single_quoted = allow_block = False + + # Although the plain scalar writer supports breaks, we never emit + # multiline plain scalars. + if line_breaks: + allow_flow_plain = allow_block_plain = False + + # Flow indicators are forbidden for flow plain scalars. + if flow_indicators: + allow_flow_plain = False + + # Block indicators are forbidden for block plain scalars. + if block_indicators: + allow_block_plain = False + + return ScalarAnalysis(scalar=scalar, + empty=False, multiline=line_breaks, + allow_flow_plain=allow_flow_plain, + allow_block_plain=allow_block_plain, + allow_single_quoted=allow_single_quoted, + allow_double_quoted=allow_double_quoted, + allow_block=allow_block) + + # Writers. + + def flush_stream(self): + if hasattr(self.stream, 'flush'): + self.stream.flush() + + def write_stream_start(self): + # Write BOM if needed. + if self.encoding and self.encoding.startswith('utf-16'): + self.stream.write('\uFEFF'.encode(self.encoding)) + + def write_stream_end(self): + self.flush_stream() + + def write_indicator(self, indicator, need_whitespace, + whitespace=False, indention=False): + if self.whitespace or not need_whitespace: + data = indicator + else: + data = ' '+indicator + self.whitespace = whitespace + self.indention = self.indention and indention + self.column += len(data) + self.open_ended = False + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_indent(self): + indent = self.indent or 0 + if not self.indention or self.column > indent \ + or (self.column == indent and not self.whitespace): + self.write_line_break() + if self.column < indent: + self.whitespace = True + data = ' '*(indent-self.column) + self.column = indent + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_line_break(self, data=None): + if data is None: + data = self.best_line_break + self.whitespace = True + self.indention = True + self.line += 1 + self.column = 0 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_version_directive(self, version_text): + data = '%%YAML %s' % version_text + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + def write_tag_directive(self, handle_text, prefix_text): + data = '%%TAG %s %s' % (handle_text, prefix_text) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + # Scalar streams. + + def write_single_quoted(self, text, split=True): + self.write_indicator('\'', True) + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch is None or ch != ' ': + if start+1 == end and self.column > self.best_width and split \ + and start != 0 and end != len(text): + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029' or ch == '\'': + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch == '\'': + data = '\'\'' + self.column += 2 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + 1 + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + self.write_indicator('\'', False) + + ESCAPE_REPLACEMENTS = { + '\0': '0', + '\x07': 'a', + '\x08': 'b', + '\x09': 't', + '\x0A': 'n', + '\x0B': 'v', + '\x0C': 'f', + '\x0D': 'r', + '\x1B': 'e', + '\"': '\"', + '\\': '\\', + '\x85': 'N', + '\xA0': '_', + '\u2028': 'L', + '\u2029': 'P', + } + + def write_double_quoted(self, text, split=True): + self.write_indicator('"', True) + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if ch is None or ch in '"\\\x85\u2028\u2029\uFEFF' \ + or not ('\x20' <= ch <= '\x7E' + or (self.allow_unicode + and ('\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD'))): + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + if ch in self.ESCAPE_REPLACEMENTS: + data = '\\'+self.ESCAPE_REPLACEMENTS[ch] + elif ch <= '\xFF': + data = '\\x%02X' % ord(ch) + elif ch <= '\uFFFF': + data = '\\u%04X' % ord(ch) + else: + data = '\\U%08X' % ord(ch) + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end+1 + if 0 < end < len(text)-1 and (ch == ' ' or start >= end) \ + and self.column+(end-start) > self.best_width and split: + data = text[start:end]+'\\' + if start < end: + start = end + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_indent() + self.whitespace = False + self.indention = False + if text[start] == ' ': + data = '\\' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + end += 1 + self.write_indicator('"', False) + + def determine_block_hints(self, text): + hints = '' + if text: + if text[0] in ' \n\x85\u2028\u2029': + hints += str(self.best_indent) + if text[-1] not in '\n\x85\u2028\u2029': + hints += '-' + elif len(text) == 1 or text[-2] in '\n\x85\u2028\u2029': + hints += '+' + return hints + + def write_folded(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('>'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + leading_space = True + spaces = False + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if not leading_space and ch is not None and ch != ' ' \ + and text[start] == '\n': + self.write_line_break() + leading_space = (ch == ' ') + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + elif spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width: + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + spaces = (ch == ' ') + end += 1 + + def write_literal(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('|'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + else: + if ch is None or ch in '\n\x85\u2028\u2029': + data = text[start:end] + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + + def write_plain(self, text, split=True): + if self.root_context: + self.open_ended = True + if not text: + return + if not self.whitespace: + data = ' ' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.whitespace = False + self.indention = False + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width and split: + self.write_indent() + self.whitespace = False + self.indention = False + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + self.whitespace = False + self.indention = False + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 diff --git a/micromamba_root/Lib/site-packages/yaml/error.py b/micromamba_root/Lib/site-packages/yaml/error.py new file mode 100644 index 0000000000000000000000000000000000000000..b796b4dc519512c4825ff539a2e6aa20f4d370d0 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/error.py @@ -0,0 +1,75 @@ + +__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] + +class Mark: + + def __init__(self, name, index, line, column, buffer, pointer): + self.name = name + self.index = index + self.line = line + self.column = column + self.buffer = buffer + self.pointer = pointer + + def get_snippet(self, indent=4, max_length=75): + if self.buffer is None: + return None + head = '' + start = self.pointer + while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029': + start -= 1 + if self.pointer-start > max_length/2-1: + head = ' ... ' + start += 5 + break + tail = '' + end = self.pointer + while end < len(self.buffer) and self.buffer[end] not in '\0\r\n\x85\u2028\u2029': + end += 1 + if end-self.pointer > max_length/2-1: + tail = ' ... ' + end -= 5 + break + snippet = self.buffer[start:end] + return ' '*indent + head + snippet + tail + '\n' \ + + ' '*(indent+self.pointer-start+len(head)) + '^' + + def __str__(self): + snippet = self.get_snippet() + where = " in \"%s\", line %d, column %d" \ + % (self.name, self.line+1, self.column+1) + if snippet is not None: + where += ":\n"+snippet + return where + +class YAMLError(Exception): + pass + +class MarkedYAMLError(YAMLError): + + def __init__(self, context=None, context_mark=None, + problem=None, problem_mark=None, note=None): + self.context = context + self.context_mark = context_mark + self.problem = problem + self.problem_mark = problem_mark + self.note = note + + def __str__(self): + lines = [] + if self.context is not None: + lines.append(self.context) + if self.context_mark is not None \ + and (self.problem is None or self.problem_mark is None + or self.context_mark.name != self.problem_mark.name + or self.context_mark.line != self.problem_mark.line + or self.context_mark.column != self.problem_mark.column): + lines.append(str(self.context_mark)) + if self.problem is not None: + lines.append(self.problem) + if self.problem_mark is not None: + lines.append(str(self.problem_mark)) + if self.note is not None: + lines.append(self.note) + return '\n'.join(lines) + diff --git a/micromamba_root/Lib/site-packages/yaml/events.py b/micromamba_root/Lib/site-packages/yaml/events.py new file mode 100644 index 0000000000000000000000000000000000000000..f79ad389cb6c9517e391dcd25534866bc9ccd36a --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/events.py @@ -0,0 +1,86 @@ + +# Abstract classes. + +class Event(object): + def __init__(self, start_mark=None, end_mark=None): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] + if hasattr(self, key)] + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +class NodeEvent(Event): + def __init__(self, anchor, start_mark=None, end_mark=None): + self.anchor = anchor + self.start_mark = start_mark + self.end_mark = end_mark + +class CollectionStartEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None, + flow_style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class CollectionEndEvent(Event): + pass + +# Implementations. + +class StreamStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndEvent(Event): + pass + +class DocumentStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None, version=None, tags=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + self.version = version + self.tags = tags + +class DocumentEndEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + +class AliasEvent(NodeEvent): + pass + +class ScalarEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, value, + start_mark=None, end_mark=None, style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class SequenceStartEvent(CollectionStartEvent): + pass + +class SequenceEndEvent(CollectionEndEvent): + pass + +class MappingStartEvent(CollectionStartEvent): + pass + +class MappingEndEvent(CollectionEndEvent): + pass + diff --git a/micromamba_root/Lib/site-packages/yaml/loader.py b/micromamba_root/Lib/site-packages/yaml/loader.py new file mode 100644 index 0000000000000000000000000000000000000000..e90c11224c38e559cdf0cb205f0692ebd4fb8681 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/loader.py @@ -0,0 +1,63 @@ + +__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] + +from .reader import * +from .scanner import * +from .parser import * +from .composer import * +from .constructor import * +from .resolver import * + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) + +# UnsafeLoader is the same as Loader (which is and was always unsafe on +# untrusted input). Use of either Loader or UnsafeLoader should be rare, since +# FullLoad should be able to load almost all YAML safely. Loader is left intact +# to ensure backwards compatibility. +class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) diff --git a/micromamba_root/Lib/site-packages/yaml/nodes.py b/micromamba_root/Lib/site-packages/yaml/nodes.py new file mode 100644 index 0000000000000000000000000000000000000000..c4f070c41e1fb1bc01af27d69329e92dded38908 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/nodes.py @@ -0,0 +1,49 @@ + +class Node(object): + def __init__(self, tag, value, start_mark, end_mark): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + value = self.value + #if isinstance(value, list): + # if len(value) == 0: + # value = '<empty>' + # elif len(value) == 1: + # value = '<1 item>' + # else: + # value = '<%d items>' % len(value) + #else: + # if len(value) > 75: + # value = repr(value[:70]+u' ... ') + # else: + # value = repr(value) + value = repr(value) + return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value) + +class ScalarNode(Node): + id = 'scalar' + def __init__(self, tag, value, + start_mark=None, end_mark=None, style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class CollectionNode(Node): + def __init__(self, tag, value, + start_mark=None, end_mark=None, flow_style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class SequenceNode(CollectionNode): + id = 'sequence' + +class MappingNode(CollectionNode): + id = 'mapping' + diff --git a/micromamba_root/Lib/site-packages/yaml/parser.py b/micromamba_root/Lib/site-packages/yaml/parser.py new file mode 100644 index 0000000000000000000000000000000000000000..13a5995d292045d0f865a99abf692bd35dc87814 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/parser.py @@ -0,0 +1,589 @@ + +# The following YAML grammar is LL(1) and is parsed by a recursive descent +# parser. +# +# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +# implicit_document ::= block_node DOCUMENT-END* +# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +# block_node_or_indentless_sequence ::= +# ALIAS +# | properties (block_content | indentless_block_sequence)? +# | block_content +# | indentless_block_sequence +# block_node ::= ALIAS +# | properties block_content? +# | block_content +# flow_node ::= ALIAS +# | properties flow_content? +# | flow_content +# properties ::= TAG ANCHOR? | ANCHOR TAG? +# block_content ::= block_collection | flow_collection | SCALAR +# flow_content ::= flow_collection | SCALAR +# block_collection ::= block_sequence | block_mapping +# flow_collection ::= flow_sequence | flow_mapping +# block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +# indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +# block_mapping ::= BLOCK-MAPPING_START +# ((KEY block_node_or_indentless_sequence?)? +# (VALUE block_node_or_indentless_sequence?)?)* +# BLOCK-END +# flow_sequence ::= FLOW-SEQUENCE-START +# (flow_sequence_entry FLOW-ENTRY)* +# flow_sequence_entry? +# FLOW-SEQUENCE-END +# flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# flow_mapping ::= FLOW-MAPPING-START +# (flow_mapping_entry FLOW-ENTRY)* +# flow_mapping_entry? +# FLOW-MAPPING-END +# flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# +# FIRST sets: +# +# stream: { STREAM-START } +# explicit_document: { DIRECTIVE DOCUMENT-START } +# implicit_document: FIRST(block_node) +# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_sequence: { BLOCK-SEQUENCE-START } +# block_mapping: { BLOCK-MAPPING-START } +# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY } +# indentless_sequence: { ENTRY } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_sequence: { FLOW-SEQUENCE-START } +# flow_mapping: { FLOW-MAPPING-START } +# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } +# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } + +__all__ = ['Parser', 'ParserError'] + +from .error import MarkedYAMLError +from .tokens import * +from .events import * +from .scanner import * + +class ParserError(MarkedYAMLError): + pass + +class Parser: + # Since writing a recursive-descendant parser is a straightforward task, we + # do not give many comments here. + + DEFAULT_TAGS = { + '!': '!', + '!!': 'tag:yaml.org,2002:', + } + + def __init__(self): + self.current_event = None + self.yaml_version = None + self.tag_handles = {} + self.states = [] + self.marks = [] + self.state = self.parse_stream_start + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def check_event(self, *choices): + # Check the type of the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + if self.current_event is not None: + if not choices: + return True + for choice in choices: + if isinstance(self.current_event, choice): + return True + return False + + def peek_event(self): + # Get the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + return self.current_event + + def get_event(self): + # Get the next event and proceed further. + if self.current_event is None: + if self.state: + self.current_event = self.state() + value = self.current_event + self.current_event = None + return value + + # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END + # implicit_document ::= block_node DOCUMENT-END* + # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + + def parse_stream_start(self): + + # Parse the stream start. + token = self.get_token() + event = StreamStartEvent(token.start_mark, token.end_mark, + encoding=token.encoding) + + # Prepare the next state. + self.state = self.parse_implicit_document_start + + return event + + def parse_implicit_document_start(self): + + # Parse an implicit document. + if not self.check_token(DirectiveToken, DocumentStartToken, + StreamEndToken): + self.tag_handles = self.DEFAULT_TAGS + token = self.peek_token() + start_mark = end_mark = token.start_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=False) + + # Prepare the next state. + self.states.append(self.parse_document_end) + self.state = self.parse_block_node + + return event + + else: + return self.parse_document_start() + + def parse_document_start(self): + + # Parse any extra document end indicators. + while self.check_token(DocumentEndToken): + self.get_token() + + # Parse an explicit document. + if not self.check_token(StreamEndToken): + token = self.peek_token() + start_mark = token.start_mark + version, tags = self.process_directives() + if not self.check_token(DocumentStartToken): + raise ParserError(None, None, + "expected '<document start>', but found %r" + % self.peek_token().id, + self.peek_token().start_mark) + token = self.get_token() + end_mark = token.end_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=True, version=version, tags=tags) + self.states.append(self.parse_document_end) + self.state = self.parse_document_content + else: + # Parse the end of the stream. + token = self.get_token() + event = StreamEndEvent(token.start_mark, token.end_mark) + assert not self.states + assert not self.marks + self.state = None + return event + + def parse_document_end(self): + + # Parse the document end. + token = self.peek_token() + start_mark = end_mark = token.start_mark + explicit = False + if self.check_token(DocumentEndToken): + token = self.get_token() + end_mark = token.end_mark + explicit = True + event = DocumentEndEvent(start_mark, end_mark, + explicit=explicit) + + # Prepare the next state. + self.state = self.parse_document_start + + return event + + def parse_document_content(self): + if self.check_token(DirectiveToken, + DocumentStartToken, DocumentEndToken, StreamEndToken): + event = self.process_empty_scalar(self.peek_token().start_mark) + self.state = self.states.pop() + return event + else: + return self.parse_block_node() + + def process_directives(self): + self.yaml_version = None + self.tag_handles = {} + while self.check_token(DirectiveToken): + token = self.get_token() + if token.name == 'YAML': + if self.yaml_version is not None: + raise ParserError(None, None, + "found duplicate YAML directive", token.start_mark) + major, minor = token.value + if major != 1: + raise ParserError(None, None, + "found incompatible YAML document (version 1.* is required)", + token.start_mark) + self.yaml_version = token.value + elif token.name == 'TAG': + handle, prefix = token.value + if handle in self.tag_handles: + raise ParserError(None, None, + "duplicate tag handle %r" % handle, + token.start_mark) + self.tag_handles[handle] = prefix + if self.tag_handles: + value = self.yaml_version, self.tag_handles.copy() + else: + value = self.yaml_version, None + for key in self.DEFAULT_TAGS: + if key not in self.tag_handles: + self.tag_handles[key] = self.DEFAULT_TAGS[key] + return value + + # block_node_or_indentless_sequence ::= ALIAS + # | properties (block_content | indentless_block_sequence)? + # | block_content + # | indentless_block_sequence + # block_node ::= ALIAS + # | properties block_content? + # | block_content + # flow_node ::= ALIAS + # | properties flow_content? + # | flow_content + # properties ::= TAG ANCHOR? | ANCHOR TAG? + # block_content ::= block_collection | flow_collection | SCALAR + # flow_content ::= flow_collection | SCALAR + # block_collection ::= block_sequence | block_mapping + # flow_collection ::= flow_sequence | flow_mapping + + def parse_block_node(self): + return self.parse_node(block=True) + + def parse_flow_node(self): + return self.parse_node() + + def parse_block_node_or_indentless_sequence(self): + return self.parse_node(block=True, indentless_sequence=True) + + def parse_node(self, block=False, indentless_sequence=False): + if self.check_token(AliasToken): + token = self.get_token() + event = AliasEvent(token.value, token.start_mark, token.end_mark) + self.state = self.states.pop() + else: + anchor = None + tag = None + start_mark = end_mark = tag_mark = None + if self.check_token(AnchorToken): + token = self.get_token() + start_mark = token.start_mark + end_mark = token.end_mark + anchor = token.value + if self.check_token(TagToken): + token = self.get_token() + tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + elif self.check_token(TagToken): + token = self.get_token() + start_mark = tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + if self.check_token(AnchorToken): + token = self.get_token() + end_mark = token.end_mark + anchor = token.value + if tag is not None: + handle, suffix = tag + if handle is not None: + if handle not in self.tag_handles: + raise ParserError("while parsing a node", start_mark, + "found undefined tag handle %r" % handle, + tag_mark) + tag = self.tag_handles[handle]+suffix + else: + tag = suffix + #if tag == '!': + # raise ParserError("while parsing a node", start_mark, + # "found non-specific tag '!'", tag_mark, + # "Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.") + if start_mark is None: + start_mark = end_mark = self.peek_token().start_mark + event = None + implicit = (tag is None or tag == '!') + if indentless_sequence and self.check_token(BlockEntryToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark) + self.state = self.parse_indentless_sequence_entry + else: + if self.check_token(ScalarToken): + token = self.get_token() + end_mark = token.end_mark + if (token.plain and tag is None) or tag == '!': + implicit = (True, False) + elif tag is None: + implicit = (False, True) + else: + implicit = (False, False) + event = ScalarEvent(anchor, tag, implicit, token.value, + start_mark, end_mark, style=token.style) + self.state = self.states.pop() + elif self.check_token(FlowSequenceStartToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_sequence_first_entry + elif self.check_token(FlowMappingStartToken): + end_mark = self.peek_token().end_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_mapping_first_key + elif block and self.check_token(BlockSequenceStartToken): + end_mark = self.peek_token().start_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_sequence_first_entry + elif block and self.check_token(BlockMappingStartToken): + end_mark = self.peek_token().start_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_mapping_first_key + elif anchor is not None or tag is not None: + # Empty scalars are allowed even if a tag or an anchor is + # specified. + event = ScalarEvent(anchor, tag, (implicit, False), '', + start_mark, end_mark) + self.state = self.states.pop() + else: + if block: + node = 'block' + else: + node = 'flow' + token = self.peek_token() + raise ParserError("while parsing a %s node" % node, start_mark, + "expected the node content, but found %r" % token.id, + token.start_mark) + return event + + # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END + + def parse_block_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_sequence_entry() + + def parse_block_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, BlockEndToken): + self.states.append(self.parse_block_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_block_sequence_entry + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block collection", self.marks[-1], + "expected <block end>, but found %r" % token.id, token.start_mark) + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + # indentless_sequence ::= (BLOCK-ENTRY block_node?)+ + + def parse_indentless_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, + KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_indentless_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_indentless_sequence_entry + return self.process_empty_scalar(token.end_mark) + token = self.peek_token() + event = SequenceEndEvent(token.start_mark, token.start_mark) + self.state = self.states.pop() + return event + + # block_mapping ::= BLOCK-MAPPING_START + # ((KEY block_node_or_indentless_sequence?)? + # (VALUE block_node_or_indentless_sequence?)?)* + # BLOCK-END + + def parse_block_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_mapping_key() + + def parse_block_mapping_key(self): + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_value) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_value + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block mapping", self.marks[-1], + "expected <block end>, but found %r" % token.id, token.start_mark) + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_block_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_key) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_block_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + # flow_sequence ::= FLOW-SEQUENCE-START + # (flow_sequence_entry FLOW-ENTRY)* + # flow_sequence_entry? + # FLOW-SEQUENCE-END + # flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + # + # Note that while production rules for both flow_sequence_entry and + # flow_mapping_entry are equal, their interpretations are different. + # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?` + # generate an inline mapping (set syntax). + + def parse_flow_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_sequence_entry(first=True) + + def parse_flow_sequence_entry(self, first=False): + if not self.check_token(FlowSequenceEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow sequence", self.marks[-1], + "expected ',' or ']', but got %r" % token.id, token.start_mark) + + if self.check_token(KeyToken): + token = self.peek_token() + event = MappingStartEvent(None, None, True, + token.start_mark, token.end_mark, + flow_style=True) + self.state = self.parse_flow_sequence_entry_mapping_key + return event + elif not self.check_token(FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry) + return self.parse_flow_node() + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_sequence_entry_mapping_key(self): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_value + return self.process_empty_scalar(token.end_mark) + + def parse_flow_sequence_entry_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_end) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_end + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_sequence_entry_mapping_end + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_sequence_entry_mapping_end(self): + self.state = self.parse_flow_sequence_entry + token = self.peek_token() + return MappingEndEvent(token.start_mark, token.start_mark) + + # flow_mapping ::= FLOW-MAPPING-START + # (flow_mapping_entry FLOW-ENTRY)* + # flow_mapping_entry? + # FLOW-MAPPING-END + # flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + + def parse_flow_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_mapping_key(first=True) + + def parse_flow_mapping_key(self, first=False): + if not self.check_token(FlowMappingEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow mapping", self.marks[-1], + "expected ',' or '}', but got %r" % token.id, token.start_mark) + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_value + return self.process_empty_scalar(token.end_mark) + elif not self.check_token(FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_empty_value) + return self.parse_flow_node() + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_key) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_mapping_empty_value(self): + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(self.peek_token().start_mark) + + def process_empty_scalar(self, mark): + return ScalarEvent(None, None, (True, False), '', mark, mark) + diff --git a/micromamba_root/Lib/site-packages/yaml/reader.py b/micromamba_root/Lib/site-packages/yaml/reader.py new file mode 100644 index 0000000000000000000000000000000000000000..774b0219b5932a0ee1c27e637371de5ba8d9cb16 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/reader.py @@ -0,0 +1,185 @@ +# This module contains abstractions for the input stream. You don't have to +# looks further, there are no pretty code. +# +# We define two classes here. +# +# Mark(source, line, column) +# It's just a record and its only use is producing nice error messages. +# Parser does not use it for any other purposes. +# +# Reader(source, data) +# Reader determines the encoding of `data` and converts it to unicode. +# Reader provides the following methods and attributes: +# reader.peek(length=1) - return the next `length` characters +# reader.forward(length=1) - move the current position to `length` characters. +# reader.index - the number of the current character. +# reader.line, stream.column - the line and the column of the current character. + +__all__ = ['Reader', 'ReaderError'] + +from .error import YAMLError, Mark + +import codecs, re + +class ReaderError(YAMLError): + + def __init__(self, name, position, character, encoding, reason): + self.name = name + self.character = character + self.position = position + self.encoding = encoding + self.reason = reason + + def __str__(self): + if isinstance(self.character, bytes): + return "'%s' codec can't decode byte #x%02x: %s\n" \ + " in \"%s\", position %d" \ + % (self.encoding, ord(self.character), self.reason, + self.name, self.position) + else: + return "unacceptable character #x%04x: %s\n" \ + " in \"%s\", position %d" \ + % (self.character, self.reason, + self.name, self.position) + +class Reader(object): + # Reader: + # - determines the data encoding and converts it to a unicode string, + # - checks if characters are in allowed range, + # - adds '\0' to the end. + + # Reader accepts + # - a `bytes` object, + # - a `str` object, + # - a file-like object with its `read` method returning `str`, + # - a file-like object with its `read` method returning `unicode`. + + # Yeah, it's ugly and slow. + + def __init__(self, stream): + self.name = None + self.stream = None + self.stream_pointer = 0 + self.eof = True + self.buffer = '' + self.pointer = 0 + self.raw_buffer = None + self.raw_decode = None + self.encoding = None + self.index = 0 + self.line = 0 + self.column = 0 + if isinstance(stream, str): + self.name = "<unicode string>" + self.check_printable(stream) + self.buffer = stream+'\0' + elif isinstance(stream, bytes): + self.name = "<byte string>" + self.raw_buffer = stream + self.determine_encoding() + else: + self.stream = stream + self.name = getattr(stream, 'name', "<file>") + self.eof = False + self.raw_buffer = None + self.determine_encoding() + + def peek(self, index=0): + try: + return self.buffer[self.pointer+index] + except IndexError: + self.update(index+1) + return self.buffer[self.pointer+index] + + def prefix(self, length=1): + if self.pointer+length >= len(self.buffer): + self.update(length) + return self.buffer[self.pointer:self.pointer+length] + + def forward(self, length=1): + if self.pointer+length+1 >= len(self.buffer): + self.update(length+1) + while length: + ch = self.buffer[self.pointer] + self.pointer += 1 + self.index += 1 + if ch in '\n\x85\u2028\u2029' \ + or (ch == '\r' and self.buffer[self.pointer] != '\n'): + self.line += 1 + self.column = 0 + elif ch != '\uFEFF': + self.column += 1 + length -= 1 + + def get_mark(self): + if self.stream is None: + return Mark(self.name, self.index, self.line, self.column, + self.buffer, self.pointer) + else: + return Mark(self.name, self.index, self.line, self.column, + None, None) + + def determine_encoding(self): + while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2): + self.update_raw() + if isinstance(self.raw_buffer, bytes): + if self.raw_buffer.startswith(codecs.BOM_UTF16_LE): + self.raw_decode = codecs.utf_16_le_decode + self.encoding = 'utf-16-le' + elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE): + self.raw_decode = codecs.utf_16_be_decode + self.encoding = 'utf-16-be' + else: + self.raw_decode = codecs.utf_8_decode + self.encoding = 'utf-8' + self.update(1) + + NON_PRINTABLE = re.compile('[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uD7FF\uE000-\uFFFD\U00010000-\U0010ffff]') + def check_printable(self, data): + match = self.NON_PRINTABLE.search(data) + if match: + character = match.group() + position = self.index+(len(self.buffer)-self.pointer)+match.start() + raise ReaderError(self.name, position, ord(character), + 'unicode', "special characters are not allowed") + + def update(self, length): + if self.raw_buffer is None: + return + self.buffer = self.buffer[self.pointer:] + self.pointer = 0 + while len(self.buffer) < length: + if not self.eof: + self.update_raw() + if self.raw_decode is not None: + try: + data, converted = self.raw_decode(self.raw_buffer, + 'strict', self.eof) + except UnicodeDecodeError as exc: + character = self.raw_buffer[exc.start] + if self.stream is not None: + position = self.stream_pointer-len(self.raw_buffer)+exc.start + else: + position = exc.start + raise ReaderError(self.name, position, character, + exc.encoding, exc.reason) + else: + data = self.raw_buffer + converted = len(data) + self.check_printable(data) + self.buffer += data + self.raw_buffer = self.raw_buffer[converted:] + if self.eof: + self.buffer += '\0' + self.raw_buffer = None + break + + def update_raw(self, size=4096): + data = self.stream.read(size) + if self.raw_buffer is None: + self.raw_buffer = data + else: + self.raw_buffer += data + self.stream_pointer += len(data) + if not data: + self.eof = True diff --git a/micromamba_root/Lib/site-packages/yaml/representer.py b/micromamba_root/Lib/site-packages/yaml/representer.py new file mode 100644 index 0000000000000000000000000000000000000000..808ca06dfbd60c9a23eb079151b74a82ef688749 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/representer.py @@ -0,0 +1,389 @@ + +__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', + 'RepresenterError'] + +from .error import * +from .nodes import * + +import datetime, copyreg, types, base64, collections + +class RepresenterError(YAMLError): + pass + +class BaseRepresenter: + + yaml_representers = {} + yaml_multi_representers = {} + + def __init__(self, default_style=None, default_flow_style=False, sort_keys=True): + self.default_style = default_style + self.sort_keys = sort_keys + self.default_flow_style = default_flow_style + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent(self, data): + node = self.represent_data(data) + self.serialize(node) + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent_data(self, data): + if self.ignore_aliases(data): + self.alias_key = None + else: + self.alias_key = id(data) + if self.alias_key is not None: + if self.alias_key in self.represented_objects: + node = self.represented_objects[self.alias_key] + #if node is None: + # raise RepresenterError("recursive objects are not allowed: %r" % data) + return node + #self.represented_objects[alias_key] = None + self.object_keeper.append(data) + data_types = type(data).__mro__ + if data_types[0] in self.yaml_representers: + node = self.yaml_representers[data_types[0]](self, data) + else: + for data_type in data_types: + if data_type in self.yaml_multi_representers: + node = self.yaml_multi_representers[data_type](self, data) + break + else: + if None in self.yaml_multi_representers: + node = self.yaml_multi_representers[None](self, data) + elif None in self.yaml_representers: + node = self.yaml_representers[None](self, data) + else: + node = ScalarNode(None, str(data)) + #if alias_key is not None: + # self.represented_objects[alias_key] = node + return node + + @classmethod + def add_representer(cls, data_type, representer): + if not 'yaml_representers' in cls.__dict__: + cls.yaml_representers = cls.yaml_representers.copy() + cls.yaml_representers[data_type] = representer + + @classmethod + def add_multi_representer(cls, data_type, representer): + if not 'yaml_multi_representers' in cls.__dict__: + cls.yaml_multi_representers = cls.yaml_multi_representers.copy() + cls.yaml_multi_representers[data_type] = representer + + def represent_scalar(self, tag, value, style=None): + if style is None: + style = self.default_style + node = ScalarNode(tag, value, style=style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + return node + + def represent_sequence(self, tag, sequence, flow_style=None): + value = [] + node = SequenceNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + for item in sequence: + node_item = self.represent_data(item) + if not (isinstance(node_item, ScalarNode) and not node_item.style): + best_style = False + value.append(node_item) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def represent_mapping(self, tag, mapping, flow_style=None): + value = [] + node = MappingNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + if hasattr(mapping, 'items'): + mapping = list(mapping.items()) + if self.sort_keys: + try: + mapping = sorted(mapping) + except TypeError: + pass + for item_key, item_value in mapping: + node_key = self.represent_data(item_key) + node_value = self.represent_data(item_value) + if not (isinstance(node_key, ScalarNode) and not node_key.style): + best_style = False + if not (isinstance(node_value, ScalarNode) and not node_value.style): + best_style = False + value.append((node_key, node_value)) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def ignore_aliases(self, data): + return False + +class SafeRepresenter(BaseRepresenter): + + def ignore_aliases(self, data): + if data is None: + return True + if isinstance(data, tuple) and data == (): + return True + if isinstance(data, (str, bytes, bool, int, float)): + return True + + def represent_none(self, data): + return self.represent_scalar('tag:yaml.org,2002:null', 'null') + + def represent_str(self, data): + return self.represent_scalar('tag:yaml.org,2002:str', data) + + def represent_binary(self, data): + if hasattr(base64, 'encodebytes'): + data = base64.encodebytes(data).decode('ascii') + else: + data = base64.encodestring(data).decode('ascii') + return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|') + + def represent_bool(self, data): + if data: + value = 'true' + else: + value = 'false' + return self.represent_scalar('tag:yaml.org,2002:bool', value) + + def represent_int(self, data): + return self.represent_scalar('tag:yaml.org,2002:int', str(data)) + + inf_value = 1e300 + while repr(inf_value) != repr(inf_value*inf_value): + inf_value *= inf_value + + def represent_float(self, data): + if data != data or (data == 0.0 and data == 1.0): + value = '.nan' + elif data == self.inf_value: + value = '.inf' + elif data == -self.inf_value: + value = '-.inf' + else: + value = repr(data).lower() + # Note that in some cases `repr(data)` represents a float number + # without the decimal parts. For instance: + # >>> repr(1e17) + # '1e17' + # Unfortunately, this is not a valid float representation according + # to the definition of the `!!float` tag. We fix this by adding + # '.0' before the 'e' symbol. + if '.' not in value and 'e' in value: + value = value.replace('e', '.0e', 1) + return self.represent_scalar('tag:yaml.org,2002:float', value) + + def represent_list(self, data): + #pairs = (len(data) > 0 and isinstance(data, list)) + #if pairs: + # for item in data: + # if not isinstance(item, tuple) or len(item) != 2: + # pairs = False + # break + #if not pairs: + return self.represent_sequence('tag:yaml.org,2002:seq', data) + #value = [] + #for item_key, item_value in data: + # value.append(self.represent_mapping(u'tag:yaml.org,2002:map', + # [(item_key, item_value)])) + #return SequenceNode(u'tag:yaml.org,2002:pairs', value) + + def represent_dict(self, data): + return self.represent_mapping('tag:yaml.org,2002:map', data) + + def represent_set(self, data): + value = {} + for key in data: + value[key] = None + return self.represent_mapping('tag:yaml.org,2002:set', value) + + def represent_date(self, data): + value = data.isoformat() + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_datetime(self, data): + value = data.isoformat(' ') + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_yaml_object(self, tag, data, cls, flow_style=None): + if hasattr(data, '__getstate__'): + state = data.__getstate__() + else: + state = data.__dict__.copy() + return self.represent_mapping(tag, state, flow_style=flow_style) + + def represent_undefined(self, data): + raise RepresenterError("cannot represent an object", data) + +SafeRepresenter.add_representer(type(None), + SafeRepresenter.represent_none) + +SafeRepresenter.add_representer(str, + SafeRepresenter.represent_str) + +SafeRepresenter.add_representer(bytes, + SafeRepresenter.represent_binary) + +SafeRepresenter.add_representer(bool, + SafeRepresenter.represent_bool) + +SafeRepresenter.add_representer(int, + SafeRepresenter.represent_int) + +SafeRepresenter.add_representer(float, + SafeRepresenter.represent_float) + +SafeRepresenter.add_representer(list, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(tuple, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(dict, + SafeRepresenter.represent_dict) + +SafeRepresenter.add_representer(set, + SafeRepresenter.represent_set) + +SafeRepresenter.add_representer(datetime.date, + SafeRepresenter.represent_date) + +SafeRepresenter.add_representer(datetime.datetime, + SafeRepresenter.represent_datetime) + +SafeRepresenter.add_representer(None, + SafeRepresenter.represent_undefined) + +class Representer(SafeRepresenter): + + def represent_complex(self, data): + if data.imag == 0.0: + data = '%r' % data.real + elif data.real == 0.0: + data = '%rj' % data.imag + elif data.imag > 0: + data = '%r+%rj' % (data.real, data.imag) + else: + data = '%r%rj' % (data.real, data.imag) + return self.represent_scalar('tag:yaml.org,2002:python/complex', data) + + def represent_tuple(self, data): + return self.represent_sequence('tag:yaml.org,2002:python/tuple', data) + + def represent_name(self, data): + name = '%s.%s' % (data.__module__, data.__name__) + return self.represent_scalar('tag:yaml.org,2002:python/name:'+name, '') + + def represent_module(self, data): + return self.represent_scalar( + 'tag:yaml.org,2002:python/module:'+data.__name__, '') + + def represent_object(self, data): + # We use __reduce__ API to save the data. data.__reduce__ returns + # a tuple of length 2-5: + # (function, args, state, listitems, dictitems) + + # For reconstructing, we calls function(*args), then set its state, + # listitems, and dictitems if they are not None. + + # A special case is when function.__name__ == '__newobj__'. In this + # case we create the object with args[0].__new__(*args). + + # Another special case is when __reduce__ returns a string - we don't + # support it. + + # We produce a !!python/object, !!python/object/new or + # !!python/object/apply node. + + cls = type(data) + if cls in copyreg.dispatch_table: + reduce = copyreg.dispatch_table[cls](data) + elif hasattr(data, '__reduce_ex__'): + reduce = data.__reduce_ex__(2) + elif hasattr(data, '__reduce__'): + reduce = data.__reduce__() + else: + raise RepresenterError("cannot represent an object", data) + reduce = (list(reduce)+[None]*5)[:5] + function, args, state, listitems, dictitems = reduce + args = list(args) + if state is None: + state = {} + if listitems is not None: + listitems = list(listitems) + if dictitems is not None: + dictitems = dict(dictitems) + if function.__name__ == '__newobj__': + function = args[0] + args = args[1:] + tag = 'tag:yaml.org,2002:python/object/new:' + newobj = True + else: + tag = 'tag:yaml.org,2002:python/object/apply:' + newobj = False + function_name = '%s.%s' % (function.__module__, function.__name__) + if not args and not listitems and not dictitems \ + and isinstance(state, dict) and newobj: + return self.represent_mapping( + 'tag:yaml.org,2002:python/object:'+function_name, state) + if not listitems and not dictitems \ + and isinstance(state, dict) and not state: + return self.represent_sequence(tag+function_name, args) + value = {} + if args: + value['args'] = args + if state or not isinstance(state, dict): + value['state'] = state + if listitems: + value['listitems'] = listitems + if dictitems: + value['dictitems'] = dictitems + return self.represent_mapping(tag+function_name, value) + + def represent_ordered_dict(self, data): + # Provide uniform representation across different Python versions. + data_type = type(data) + tag = 'tag:yaml.org,2002:python/object/apply:%s.%s' \ + % (data_type.__module__, data_type.__name__) + items = [[key, value] for key, value in data.items()] + return self.represent_sequence(tag, [items]) + +Representer.add_representer(complex, + Representer.represent_complex) + +Representer.add_representer(tuple, + Representer.represent_tuple) + +Representer.add_multi_representer(type, + Representer.represent_name) + +Representer.add_representer(collections.OrderedDict, + Representer.represent_ordered_dict) + +Representer.add_representer(types.FunctionType, + Representer.represent_name) + +Representer.add_representer(types.BuiltinFunctionType, + Representer.represent_name) + +Representer.add_representer(types.ModuleType, + Representer.represent_module) + +Representer.add_multi_representer(object, + Representer.represent_object) + diff --git a/micromamba_root/Lib/site-packages/yaml/resolver.py b/micromamba_root/Lib/site-packages/yaml/resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..3522bdaaf6358110b608f4e6503b9d314c82d887 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/resolver.py @@ -0,0 +1,227 @@ + +__all__ = ['BaseResolver', 'Resolver'] + +from .error import * +from .nodes import * + +import re + +class ResolverError(YAMLError): + pass + +class BaseResolver: + + DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str' + DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq' + DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map' + + yaml_implicit_resolvers = {} + yaml_path_resolvers = {} + + def __init__(self): + self.resolver_exact_paths = [] + self.resolver_prefix_paths = [] + + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): + if not 'yaml_implicit_resolvers' in cls.__dict__: + implicit_resolvers = {} + for key in cls.yaml_implicit_resolvers: + implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:] + cls.yaml_implicit_resolvers = implicit_resolvers + if first is None: + first = [None] + for ch in first: + cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp)) + + @classmethod + def add_path_resolver(cls, tag, path, kind=None): + # Note: `add_path_resolver` is experimental. The API could be changed. + # `new_path` is a pattern that is matched against the path from the + # root to the node that is being considered. `node_path` elements are + # tuples `(node_check, index_check)`. `node_check` is a node class: + # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`. `None` + # matches any kind of a node. `index_check` could be `None`, a boolean + # value, a string value, or a number. `None` and `False` match against + # any _value_ of sequence and mapping nodes. `True` matches against + # any _key_ of a mapping node. A string `index_check` matches against + # a mapping value that corresponds to a scalar key which content is + # equal to the `index_check` value. An integer `index_check` matches + # against a sequence value with the index equal to `index_check`. + if not 'yaml_path_resolvers' in cls.__dict__: + cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy() + new_path = [] + for element in path: + if isinstance(element, (list, tuple)): + if len(element) == 2: + node_check, index_check = element + elif len(element) == 1: + node_check = element[0] + index_check = True + else: + raise ResolverError("Invalid path element: %s" % element) + else: + node_check = None + index_check = element + if node_check is str: + node_check = ScalarNode + elif node_check is list: + node_check = SequenceNode + elif node_check is dict: + node_check = MappingNode + elif node_check not in [ScalarNode, SequenceNode, MappingNode] \ + and not isinstance(node_check, str) \ + and node_check is not None: + raise ResolverError("Invalid node checker: %s" % node_check) + if not isinstance(index_check, (str, int)) \ + and index_check is not None: + raise ResolverError("Invalid index checker: %s" % index_check) + new_path.append((node_check, index_check)) + if kind is str: + kind = ScalarNode + elif kind is list: + kind = SequenceNode + elif kind is dict: + kind = MappingNode + elif kind not in [ScalarNode, SequenceNode, MappingNode] \ + and kind is not None: + raise ResolverError("Invalid node kind: %s" % kind) + cls.yaml_path_resolvers[tuple(new_path), kind] = tag + + def descend_resolver(self, current_node, current_index): + if not self.yaml_path_resolvers: + return + exact_paths = {} + prefix_paths = [] + if current_node: + depth = len(self.resolver_prefix_paths) + for path, kind in self.resolver_prefix_paths[-1]: + if self.check_resolver_prefix(depth, path, kind, + current_node, current_index): + if len(path) > depth: + prefix_paths.append((path, kind)) + else: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + for path, kind in self.yaml_path_resolvers: + if not path: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + prefix_paths.append((path, kind)) + self.resolver_exact_paths.append(exact_paths) + self.resolver_prefix_paths.append(prefix_paths) + + def ascend_resolver(self): + if not self.yaml_path_resolvers: + return + self.resolver_exact_paths.pop() + self.resolver_prefix_paths.pop() + + def check_resolver_prefix(self, depth, path, kind, + current_node, current_index): + node_check, index_check = path[depth-1] + if isinstance(node_check, str): + if current_node.tag != node_check: + return + elif node_check is not None: + if not isinstance(current_node, node_check): + return + if index_check is True and current_index is not None: + return + if (index_check is False or index_check is None) \ + and current_index is None: + return + if isinstance(index_check, str): + if not (isinstance(current_index, ScalarNode) + and index_check == current_index.value): + return + elif isinstance(index_check, int) and not isinstance(index_check, bool): + if index_check != current_index: + return + return True + + def resolve(self, kind, value, implicit): + if kind is ScalarNode and implicit[0]: + if value == '': + resolvers = self.yaml_implicit_resolvers.get('', []) + else: + resolvers = self.yaml_implicit_resolvers.get(value[0], []) + wildcard_resolvers = self.yaml_implicit_resolvers.get(None, []) + for tag, regexp in resolvers + wildcard_resolvers: + if regexp.match(value): + return tag + implicit = implicit[1] + if self.yaml_path_resolvers: + exact_paths = self.resolver_exact_paths[-1] + if kind in exact_paths: + return exact_paths[kind] + if None in exact_paths: + return exact_paths[None] + if kind is ScalarNode: + return self.DEFAULT_SCALAR_TAG + elif kind is SequenceNode: + return self.DEFAULT_SEQUENCE_TAG + elif kind is MappingNode: + return self.DEFAULT_MAPPING_TAG + +class Resolver(BaseResolver): + pass + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:bool', + re.compile(r'''^(?:yes|Yes|YES|no|No|NO + |true|True|TRUE|false|False|FALSE + |on|On|ON|off|Off|OFF)$''', re.X), + list('yYnNtTfFoO')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:float', + re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)? + |\.[0-9][0-9_]*(?:[eE][-+][0-9]+)? + |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]* + |[-+]?\.(?:inf|Inf|INF) + |\.(?:nan|NaN|NAN))$''', re.X), + list('-+0123456789.')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:int', + re.compile(r'''^(?:[-+]?0b[0-1_]+ + |[-+]?0[0-7_]+ + |[-+]?(?:0|[1-9][0-9_]*) + |[-+]?0x[0-9a-fA-F_]+ + |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X), + list('-+0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:merge', + re.compile(r'^(?:<<)$'), + ['<']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:null', + re.compile(r'''^(?: ~ + |null|Null|NULL + | )$''', re.X), + ['~', 'n', 'N', '']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:timestamp', + re.compile(r'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] + |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]? + (?:[Tt]|[ \t]+)[0-9][0-9]? + :[0-9][0-9] :[0-9][0-9] (?:\.[0-9]*)? + (?:[ \t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X), + list('0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:value', + re.compile(r'^(?:=)$'), + ['=']) + +# The following resolver is only for documentation purposes. It cannot work +# because plain scalars cannot start with '!', '&', or '*'. +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:yaml', + re.compile(r'^(?:!|&|\*)$'), + list('!&*')) + diff --git a/micromamba_root/Lib/site-packages/yaml/scanner.py b/micromamba_root/Lib/site-packages/yaml/scanner.py new file mode 100644 index 0000000000000000000000000000000000000000..de925b07f1eaec33c9c305a8a69f9eb7ac5983c5 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/scanner.py @@ -0,0 +1,1435 @@ + +# Scanner produces tokens of the following types: +# STREAM-START +# STREAM-END +# DIRECTIVE(name, value) +# DOCUMENT-START +# DOCUMENT-END +# BLOCK-SEQUENCE-START +# BLOCK-MAPPING-START +# BLOCK-END +# FLOW-SEQUENCE-START +# FLOW-MAPPING-START +# FLOW-SEQUENCE-END +# FLOW-MAPPING-END +# BLOCK-ENTRY +# FLOW-ENTRY +# KEY +# VALUE +# ALIAS(value) +# ANCHOR(value) +# TAG(value) +# SCALAR(value, plain, style) +# +# Read comments in the Scanner code for more details. +# + +__all__ = ['Scanner', 'ScannerError'] + +from .error import MarkedYAMLError +from .tokens import * + +class ScannerError(MarkedYAMLError): + pass + +class SimpleKey: + # See below simple keys treatment. + + def __init__(self, token_number, required, index, line, column, mark): + self.token_number = token_number + self.required = required + self.index = index + self.line = line + self.column = column + self.mark = mark + +class Scanner: + + def __init__(self): + """Initialize the scanner.""" + # It is assumed that Scanner and Reader will have a common descendant. + # Reader do the dirty work of checking for BOM and converting the + # input data to Unicode. It also adds NUL to the end. + # + # Reader supports the following methods + # self.peek(i=0) # peek the next i-th character + # self.prefix(l=1) # peek the next l characters + # self.forward(l=1) # read the next l characters and move the pointer. + + # Had we reached the end of the stream? + self.done = False + + # The number of unclosed '{' and '['. `flow_level == 0` means block + # context. + self.flow_level = 0 + + # List of processed tokens that are not yet emitted. + self.tokens = [] + + # Add the STREAM-START token. + self.fetch_stream_start() + + # Number of tokens that were emitted through the `get_token` method. + self.tokens_taken = 0 + + # The current indentation level. + self.indent = -1 + + # Past indentation levels. + self.indents = [] + + # Variables related to simple keys treatment. + + # A simple key is a key that is not denoted by the '?' indicator. + # Example of simple keys: + # --- + # block simple key: value + # ? not a simple key: + # : { flow simple key: value } + # We emit the KEY token before all keys, so when we find a potential + # simple key, we try to locate the corresponding ':' indicator. + # Simple keys should be limited to a single line and 1024 characters. + + # Can a simple key start at the current position? A simple key may + # start: + # - at the beginning of the line, not counting indentation spaces + # (in block context), + # - after '{', '[', ',' (in the flow context), + # - after '?', ':', '-' (in the block context). + # In the block context, this flag also signifies if a block collection + # may start at the current position. + self.allow_simple_key = True + + # Keep track of possible simple keys. This is a dictionary. The key + # is `flow_level`; there can be no more that one possible simple key + # for each level. The value is a SimpleKey record: + # (token_number, required, index, line, column, mark) + # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow), + # '[', or '{' tokens. + self.possible_simple_keys = {} + + # Public methods. + + def check_token(self, *choices): + # Check if the next token is one of the given types. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + if not choices: + return True + for choice in choices: + if isinstance(self.tokens[0], choice): + return True + return False + + def peek_token(self): + # Return the next token, but do not delete if from the queue. + # Return None if no more tokens. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + return self.tokens[0] + else: + return None + + def get_token(self): + # Return the next token. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + self.tokens_taken += 1 + return self.tokens.pop(0) + + # Private methods. + + def need_more_tokens(self): + if self.done: + return False + if not self.tokens: + return True + # The current token may be a potential simple key, so we + # need to look further. + self.stale_possible_simple_keys() + if self.next_possible_simple_key() == self.tokens_taken: + return True + + def fetch_more_tokens(self): + + # Eat whitespaces and comments until we reach the next token. + self.scan_to_next_token() + + # Remove obsolete possible simple keys. + self.stale_possible_simple_keys() + + # Compare the current indentation and column. It may add some tokens + # and decrease the current indentation level. + self.unwind_indent(self.column) + + # Peek the next character. + ch = self.peek() + + # Is it the end of stream? + if ch == '\0': + return self.fetch_stream_end() + + # Is it a directive? + if ch == '%' and self.check_directive(): + return self.fetch_directive() + + # Is it the document start? + if ch == '-' and self.check_document_start(): + return self.fetch_document_start() + + # Is it the document end? + if ch == '.' and self.check_document_end(): + return self.fetch_document_end() + + # TODO: support for BOM within a stream. + #if ch == '\uFEFF': + # return self.fetch_bom() <-- issue BOMToken + + # Note: the order of the following checks is NOT significant. + + # Is it the flow sequence start indicator? + if ch == '[': + return self.fetch_flow_sequence_start() + + # Is it the flow mapping start indicator? + if ch == '{': + return self.fetch_flow_mapping_start() + + # Is it the flow sequence end indicator? + if ch == ']': + return self.fetch_flow_sequence_end() + + # Is it the flow mapping end indicator? + if ch == '}': + return self.fetch_flow_mapping_end() + + # Is it the flow entry indicator? + if ch == ',': + return self.fetch_flow_entry() + + # Is it the block entry indicator? + if ch == '-' and self.check_block_entry(): + return self.fetch_block_entry() + + # Is it the key indicator? + if ch == '?' and self.check_key(): + return self.fetch_key() + + # Is it the value indicator? + if ch == ':' and self.check_value(): + return self.fetch_value() + + # Is it an alias? + if ch == '*': + return self.fetch_alias() + + # Is it an anchor? + if ch == '&': + return self.fetch_anchor() + + # Is it a tag? + if ch == '!': + return self.fetch_tag() + + # Is it a literal scalar? + if ch == '|' and not self.flow_level: + return self.fetch_literal() + + # Is it a folded scalar? + if ch == '>' and not self.flow_level: + return self.fetch_folded() + + # Is it a single quoted scalar? + if ch == '\'': + return self.fetch_single() + + # Is it a double quoted scalar? + if ch == '\"': + return self.fetch_double() + + # It must be a plain scalar then. + if self.check_plain(): + return self.fetch_plain() + + # No? It's an error. Let's produce a nice error message. + raise ScannerError("while scanning for the next token", None, + "found character %r that cannot start any token" % ch, + self.get_mark()) + + # Simple keys treatment. + + def next_possible_simple_key(self): + # Return the number of the nearest possible simple key. Actually we + # don't need to loop through the whole dictionary. We may replace it + # with the following code: + # if not self.possible_simple_keys: + # return None + # return self.possible_simple_keys[ + # min(self.possible_simple_keys.keys())].token_number + min_token_number = None + for level in self.possible_simple_keys: + key = self.possible_simple_keys[level] + if min_token_number is None or key.token_number < min_token_number: + min_token_number = key.token_number + return min_token_number + + def stale_possible_simple_keys(self): + # Remove entries that are no longer possible simple keys. According to + # the YAML specification, simple keys + # - should be limited to a single line, + # - should be no longer than 1024 characters. + # Disabling this procedure will allow simple keys of any length and + # height (may cause problems if indentation is broken though). + for level in list(self.possible_simple_keys): + key = self.possible_simple_keys[level] + if key.line != self.line \ + or self.index-key.index > 1024: + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + del self.possible_simple_keys[level] + + def save_possible_simple_key(self): + # The next token may start a simple key. We check if it's possible + # and save its position. This function is called for + # ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'. + + # Check if a simple key is required at the current position. + required = not self.flow_level and self.indent == self.column + + # The next token might be a simple key. Let's save it's number and + # position. + if self.allow_simple_key: + self.remove_possible_simple_key() + token_number = self.tokens_taken+len(self.tokens) + key = SimpleKey(token_number, required, + self.index, self.line, self.column, self.get_mark()) + self.possible_simple_keys[self.flow_level] = key + + def remove_possible_simple_key(self): + # Remove the saved possible key position at the current flow level. + if self.flow_level in self.possible_simple_keys: + key = self.possible_simple_keys[self.flow_level] + + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + + del self.possible_simple_keys[self.flow_level] + + # Indentation functions. + + def unwind_indent(self, column): + + ## In flow context, tokens should respect indentation. + ## Actually the condition should be `self.indent >= column` according to + ## the spec. But this condition will prohibit intuitively correct + ## constructions such as + ## key : { + ## } + #if self.flow_level and self.indent > column: + # raise ScannerError(None, None, + # "invalid indentation or unclosed '[' or '{'", + # self.get_mark()) + + # In the flow context, indentation is ignored. We make the scanner less + # restrictive then specification requires. + if self.flow_level: + return + + # In block context, we may need to issue the BLOCK-END tokens. + while self.indent > column: + mark = self.get_mark() + self.indent = self.indents.pop() + self.tokens.append(BlockEndToken(mark, mark)) + + def add_indent(self, column): + # Check if we need to increase indentation. + if self.indent < column: + self.indents.append(self.indent) + self.indent = column + return True + return False + + # Fetchers. + + def fetch_stream_start(self): + # We always add STREAM-START as the first token and STREAM-END as the + # last token. + + # Read the token. + mark = self.get_mark() + + # Add STREAM-START. + self.tokens.append(StreamStartToken(mark, mark, + encoding=self.encoding)) + + + def fetch_stream_end(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + self.possible_simple_keys = {} + + # Read the token. + mark = self.get_mark() + + # Add STREAM-END. + self.tokens.append(StreamEndToken(mark, mark)) + + # The steam is finished. + self.done = True + + def fetch_directive(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Scan and add DIRECTIVE. + self.tokens.append(self.scan_directive()) + + def fetch_document_start(self): + self.fetch_document_indicator(DocumentStartToken) + + def fetch_document_end(self): + self.fetch_document_indicator(DocumentEndToken) + + def fetch_document_indicator(self, TokenClass): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. Note that there could not be a block collection + # after '---'. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Add DOCUMENT-START or DOCUMENT-END. + start_mark = self.get_mark() + self.forward(3) + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_start(self): + self.fetch_flow_collection_start(FlowSequenceStartToken) + + def fetch_flow_mapping_start(self): + self.fetch_flow_collection_start(FlowMappingStartToken) + + def fetch_flow_collection_start(self, TokenClass): + + # '[' and '{' may start a simple key. + self.save_possible_simple_key() + + # Increase the flow level. + self.flow_level += 1 + + # Simple keys are allowed after '[' and '{'. + self.allow_simple_key = True + + # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_end(self): + self.fetch_flow_collection_end(FlowSequenceEndToken) + + def fetch_flow_mapping_end(self): + self.fetch_flow_collection_end(FlowMappingEndToken) + + def fetch_flow_collection_end(self, TokenClass): + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Decrease the flow level. + self.flow_level -= 1 + + # No simple keys after ']' or '}'. + self.allow_simple_key = False + + # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_entry(self): + + # Simple keys are allowed after ','. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add FLOW-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(FlowEntryToken(start_mark, end_mark)) + + def fetch_block_entry(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a new entry? + if not self.allow_simple_key: + raise ScannerError(None, None, + "sequence entries are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-SEQUENCE-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockSequenceStartToken(mark, mark)) + + # It's an error for the block entry to occur in the flow context, + # but we let the parser detect this. + else: + pass + + # Simple keys are allowed after '-'. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add BLOCK-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(BlockEntryToken(start_mark, end_mark)) + + def fetch_key(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a key (not necessary a simple)? + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping keys are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-MAPPING-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after '?' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add KEY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(KeyToken(start_mark, end_mark)) + + def fetch_value(self): + + # Do we determine a simple key? + if self.flow_level in self.possible_simple_keys: + + # Add KEY. + key = self.possible_simple_keys[self.flow_level] + del self.possible_simple_keys[self.flow_level] + self.tokens.insert(key.token_number-self.tokens_taken, + KeyToken(key.mark, key.mark)) + + # If this key starts a new block mapping, we need to add + # BLOCK-MAPPING-START. + if not self.flow_level: + if self.add_indent(key.column): + self.tokens.insert(key.token_number-self.tokens_taken, + BlockMappingStartToken(key.mark, key.mark)) + + # There cannot be two simple keys one after another. + self.allow_simple_key = False + + # It must be a part of a complex key. + else: + + # Block context needs additional checks. + # (Do we really need them? They will be caught by the parser + # anyway.) + if not self.flow_level: + + # We are allowed to start a complex value if and only if + # we can start a simple key. + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping values are not allowed here", + self.get_mark()) + + # If this value starts a new block mapping, we need to add + # BLOCK-MAPPING-START. It will be detected as an error later by + # the parser. + if not self.flow_level: + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after ':' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add VALUE. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(ValueToken(start_mark, end_mark)) + + def fetch_alias(self): + + # ALIAS could be a simple key. + self.save_possible_simple_key() + + # No simple keys after ALIAS. + self.allow_simple_key = False + + # Scan and add ALIAS. + self.tokens.append(self.scan_anchor(AliasToken)) + + def fetch_anchor(self): + + # ANCHOR could start a simple key. + self.save_possible_simple_key() + + # No simple keys after ANCHOR. + self.allow_simple_key = False + + # Scan and add ANCHOR. + self.tokens.append(self.scan_anchor(AnchorToken)) + + def fetch_tag(self): + + # TAG could start a simple key. + self.save_possible_simple_key() + + # No simple keys after TAG. + self.allow_simple_key = False + + # Scan and add TAG. + self.tokens.append(self.scan_tag()) + + def fetch_literal(self): + self.fetch_block_scalar(style='|') + + def fetch_folded(self): + self.fetch_block_scalar(style='>') + + def fetch_block_scalar(self, style): + + # A simple key may follow a block scalar. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Scan and add SCALAR. + self.tokens.append(self.scan_block_scalar(style)) + + def fetch_single(self): + self.fetch_flow_scalar(style='\'') + + def fetch_double(self): + self.fetch_flow_scalar(style='"') + + def fetch_flow_scalar(self, style): + + # A flow scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after flow scalars. + self.allow_simple_key = False + + # Scan and add SCALAR. + self.tokens.append(self.scan_flow_scalar(style)) + + def fetch_plain(self): + + # A plain scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after plain scalars. But note that `scan_plain` will + # change this flag if the scan is finished at the beginning of the + # line. + self.allow_simple_key = False + + # Scan and add SCALAR. May change `allow_simple_key`. + self.tokens.append(self.scan_plain()) + + # Checkers. + + def check_directive(self): + + # DIRECTIVE: ^ '%' ... + # The '%' indicator is already checked. + if self.column == 0: + return True + + def check_document_start(self): + + # DOCUMENT-START: ^ '---' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '---' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_document_end(self): + + # DOCUMENT-END: ^ '...' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '...' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_block_entry(self): + + # BLOCK-ENTRY: '-' (' '|'\n') + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_key(self): + + # KEY(flow context): '?' + if self.flow_level: + return True + + # KEY(block context): '?' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_value(self): + + # VALUE(flow context): ':' + if self.flow_level: + return True + + # VALUE(block context): ':' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_plain(self): + + # A plain scalar may start with any non-space character except: + # '-', '?', ':', ',', '[', ']', '{', '}', + # '#', '&', '*', '!', '|', '>', '\'', '\"', + # '%', '@', '`'. + # + # It may also start with + # '-', '?', ':' + # if it is followed by a non-space character. + # + # Note that we limit the last rule to the block context (except the + # '-' character) because we want the flow context to be space + # independent. + ch = self.peek() + return ch not in '\0 \t\r\n\x85\u2028\u2029-?:,[]{}#&*!|>\'\"%@`' \ + or (self.peek(1) not in '\0 \t\r\n\x85\u2028\u2029' + and (ch == '-' or (not self.flow_level and ch in '?:'))) + + # Scanners. + + def scan_to_next_token(self): + # We ignore spaces, line breaks and comments. + # If we find a line break in the block context, we set the flag + # `allow_simple_key` on. + # The byte order mark is stripped if it's the first character in the + # stream. We do not yet support BOM inside the stream as the + # specification requires. Any such mark will be considered as a part + # of the document. + # + # TODO: We need to make tab handling rules more sane. A good rule is + # Tabs cannot precede tokens + # BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END, + # KEY(block), VALUE(block), BLOCK-ENTRY + # So the checking code is + # if <TAB>: + # self.allow_simple_keys = False + # We also need to add the check for `allow_simple_keys == True` to + # `unwind_indent` before issuing BLOCK-END. + # Scanners for block, flow, and plain scalars need to be modified. + + if self.index == 0 and self.peek() == '\uFEFF': + self.forward() + found = False + while not found: + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + if self.scan_line_break(): + if not self.flow_level: + self.allow_simple_key = True + else: + found = True + + def scan_directive(self): + # See the specification for details. + start_mark = self.get_mark() + self.forward() + name = self.scan_directive_name(start_mark) + value = None + if name == 'YAML': + value = self.scan_yaml_directive_value(start_mark) + end_mark = self.get_mark() + elif name == 'TAG': + value = self.scan_tag_directive_value(start_mark) + end_mark = self.get_mark() + else: + end_mark = self.get_mark() + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + self.scan_directive_ignored_line(start_mark) + return DirectiveToken(name, value, start_mark, end_mark) + + def scan_directive_name(self, start_mark): + # See the specification for details. + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + return value + + def scan_yaml_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + major = self.scan_yaml_directive_number(start_mark) + if self.peek() != '.': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or '.', but found %r" % self.peek(), + self.get_mark()) + self.forward() + minor = self.scan_yaml_directive_number(start_mark) + if self.peek() not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or ' ', but found %r" % self.peek(), + self.get_mark()) + return (major, minor) + + def scan_yaml_directive_number(self, start_mark): + # See the specification for details. + ch = self.peek() + if not ('0' <= ch <= '9'): + raise ScannerError("while scanning a directive", start_mark, + "expected a digit, but found %r" % ch, self.get_mark()) + length = 0 + while '0' <= self.peek(length) <= '9': + length += 1 + value = int(self.prefix(length)) + self.forward(length) + return value + + def scan_tag_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + handle = self.scan_tag_directive_handle(start_mark) + while self.peek() == ' ': + self.forward() + prefix = self.scan_tag_directive_prefix(start_mark) + return (handle, prefix) + + def scan_tag_directive_handle(self, start_mark): + # See the specification for details. + value = self.scan_tag_handle('directive', start_mark) + ch = self.peek() + if ch != ' ': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_tag_directive_prefix(self, start_mark): + # See the specification for details. + value = self.scan_tag_uri('directive', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_directive_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a comment or a line break, but found %r" + % ch, self.get_mark()) + self.scan_line_break() + + def scan_anchor(self, TokenClass): + # The specification does not restrict characters for anchors and + # aliases. This may lead to problems, for instance, the document: + # [ *alias, value ] + # can be interpreted in two ways, as + # [ "value" ] + # and + # [ *alias , "value" ] + # Therefore we restrict aliases to numbers and ASCII letters. + start_mark = self.get_mark() + indicator = self.peek() + if indicator == '*': + name = 'alias' + else: + name = 'anchor' + self.forward() + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \t\r\n\x85\u2028\u2029?:,]}%@`': + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + end_mark = self.get_mark() + return TokenClass(value, start_mark, end_mark) + + def scan_tag(self): + # See the specification for details. + start_mark = self.get_mark() + ch = self.peek(1) + if ch == '<': + handle = None + self.forward(2) + suffix = self.scan_tag_uri('tag', start_mark) + if self.peek() != '>': + raise ScannerError("while parsing a tag", start_mark, + "expected '>', but found %r" % self.peek(), + self.get_mark()) + self.forward() + elif ch in '\0 \t\r\n\x85\u2028\u2029': + handle = None + suffix = '!' + self.forward() + else: + length = 1 + use_handle = False + while ch not in '\0 \r\n\x85\u2028\u2029': + if ch == '!': + use_handle = True + break + length += 1 + ch = self.peek(length) + handle = '!' + if use_handle: + handle = self.scan_tag_handle('tag', start_mark) + else: + handle = '!' + self.forward() + suffix = self.scan_tag_uri('tag', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a tag", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + value = (handle, suffix) + end_mark = self.get_mark() + return TagToken(value, start_mark, end_mark) + + def scan_block_scalar(self, style): + # See the specification for details. + + if style == '>': + folded = True + else: + folded = False + + chunks = [] + start_mark = self.get_mark() + + # Scan the header. + self.forward() + chomping, increment = self.scan_block_scalar_indicators(start_mark) + self.scan_block_scalar_ignored_line(start_mark) + + # Determine the indentation level and go to the first non-empty line. + min_indent = self.indent+1 + if min_indent < 1: + min_indent = 1 + if increment is None: + breaks, max_indent, end_mark = self.scan_block_scalar_indentation() + indent = max(min_indent, max_indent) + else: + indent = min_indent+increment-1 + breaks, end_mark = self.scan_block_scalar_breaks(indent) + line_break = '' + + # Scan the inner part of the block scalar. + while self.column == indent and self.peek() != '\0': + chunks.extend(breaks) + leading_non_space = self.peek() not in ' \t' + length = 0 + while self.peek(length) not in '\0\r\n\x85\u2028\u2029': + length += 1 + chunks.append(self.prefix(length)) + self.forward(length) + line_break = self.scan_line_break() + breaks, end_mark = self.scan_block_scalar_breaks(indent) + if self.column == indent and self.peek() != '\0': + + # Unfortunately, folding rules are ambiguous. + # + # This is the folding according to the specification: + + if folded and line_break == '\n' \ + and leading_non_space and self.peek() not in ' \t': + if not breaks: + chunks.append(' ') + else: + chunks.append(line_break) + + # This is Clark Evans's interpretation (also in the spec + # examples): + # + #if folded and line_break == '\n': + # if not breaks: + # if self.peek() not in ' \t': + # chunks.append(' ') + # else: + # chunks.append(line_break) + #else: + # chunks.append(line_break) + else: + break + + # Chomp the tail. + if chomping is not False: + chunks.append(line_break) + if chomping is True: + chunks.extend(breaks) + + # We are done. + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + def scan_block_scalar_indicators(self, start_mark): + # See the specification for details. + chomping = None + increment = None + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + elif ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected chomping or indentation indicators, but found %r" + % ch, self.get_mark()) + return chomping, increment + + def scan_block_scalar_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected a comment or a line break, but found %r" % ch, + self.get_mark()) + self.scan_line_break() + + def scan_block_scalar_indentation(self): + # See the specification for details. + chunks = [] + max_indent = 0 + end_mark = self.get_mark() + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() != ' ': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + else: + self.forward() + if self.column > max_indent: + max_indent = self.column + return chunks, max_indent, end_mark + + def scan_block_scalar_breaks(self, indent): + # See the specification for details. + chunks = [] + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + while self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + return chunks, end_mark + + def scan_flow_scalar(self, style): + # See the specification for details. + # Note that we loose indentation rules for quoted scalars. Quoted + # scalars don't need to adhere indentation because " and ' clearly + # mark the beginning and the end of them. Therefore we are less + # restrictive then the specification requires. We only need to check + # that document separators are not included in scalars. + if style == '"': + double = True + else: + double = False + chunks = [] + start_mark = self.get_mark() + quote = self.peek() + self.forward() + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + while self.peek() != quote: + chunks.extend(self.scan_flow_scalar_spaces(double, start_mark)) + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + self.forward() + end_mark = self.get_mark() + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + ESCAPE_REPLACEMENTS = { + '0': '\0', + 'a': '\x07', + 'b': '\x08', + 't': '\x09', + '\t': '\x09', + 'n': '\x0A', + 'v': '\x0B', + 'f': '\x0C', + 'r': '\x0D', + 'e': '\x1B', + ' ': '\x20', + '\"': '\"', + '\\': '\\', + '/': '/', + 'N': '\x85', + '_': '\xA0', + 'L': '\u2028', + 'P': '\u2029', + } + + ESCAPE_CODES = { + 'x': 2, + 'u': 4, + 'U': 8, + } + + def scan_flow_scalar_non_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + length = 0 + while self.peek(length) not in '\'\"\\\0 \t\r\n\x85\u2028\u2029': + length += 1 + if length: + chunks.append(self.prefix(length)) + self.forward(length) + ch = self.peek() + if not double and ch == '\'' and self.peek(1) == '\'': + chunks.append('\'') + self.forward(2) + elif (double and ch == '\'') or (not double and ch in '\"\\'): + chunks.append(ch) + self.forward() + elif double and ch == '\\': + self.forward() + ch = self.peek() + if ch in self.ESCAPE_REPLACEMENTS: + chunks.append(self.ESCAPE_REPLACEMENTS[ch]) + self.forward() + elif ch in self.ESCAPE_CODES: + length = self.ESCAPE_CODES[ch] + self.forward() + for k in range(length): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "expected escape sequence of %d hexadecimal numbers, but found %r" % + (length, self.peek(k)), self.get_mark()) + code = int(self.prefix(length), 16) + chunks.append(chr(code)) + self.forward(length) + elif ch in '\r\n\x85\u2028\u2029': + self.scan_line_break() + chunks.extend(self.scan_flow_scalar_breaks(double, start_mark)) + else: + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "found unknown escape character %r" % ch, self.get_mark()) + else: + return chunks + + def scan_flow_scalar_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + length = 0 + while self.peek(length) in ' \t': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch == '\0': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected end of stream", self.get_mark()) + elif ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + breaks = self.scan_flow_scalar_breaks(double, start_mark) + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + else: + chunks.append(whitespaces) + return chunks + + def scan_flow_scalar_breaks(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + # Instead of checking indentation, we check for document + # separators. + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected document separator", self.get_mark()) + while self.peek() in ' \t': + self.forward() + if self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + else: + return chunks + + def scan_plain(self): + # See the specification for details. + # We add an additional restriction for the flow context: + # plain scalars in the flow context cannot contain ',' or '?'. + # We also keep track of the `allow_simple_key` flag here. + # Indentation rules are loosed for the flow context. + chunks = [] + start_mark = self.get_mark() + end_mark = start_mark + indent = self.indent+1 + # We allow zero indentation for scalars, but then we need to check for + # document separators at the beginning of the line. + #if indent == 0: + # indent = 1 + spaces = [] + while True: + length = 0 + if self.peek() == '#': + break + while True: + ch = self.peek(length) + if ch in '\0 \t\r\n\x85\u2028\u2029' \ + or (ch == ':' and + self.peek(length+1) in '\0 \t\r\n\x85\u2028\u2029' + + (u',[]{}' if self.flow_level else u''))\ + or (self.flow_level and ch in ',?[]{}'): + break + length += 1 + if length == 0: + break + self.allow_simple_key = False + chunks.extend(spaces) + chunks.append(self.prefix(length)) + self.forward(length) + end_mark = self.get_mark() + spaces = self.scan_plain_spaces(indent, start_mark) + if not spaces or self.peek() == '#' \ + or (not self.flow_level and self.column < indent): + break + return ScalarToken(''.join(chunks), True, start_mark, end_mark) + + def scan_plain_spaces(self, indent, start_mark): + # See the specification for details. + # The specification is really confusing about tabs in plain scalars. + # We just forbid them completely. Do not use tabs in YAML! + chunks = [] + length = 0 + while self.peek(length) in ' ': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + self.allow_simple_key = True + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + breaks = [] + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() == ' ': + self.forward() + else: + breaks.append(self.scan_line_break()) + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + elif whitespaces: + chunks.append(whitespaces) + return chunks + + def scan_tag_handle(self, name, start_mark): + # See the specification for details. + # For some strange reasons, the specification does not allow '_' in + # tag handles. I have allowed it anyway. + ch = self.peek() + if ch != '!': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length = 1 + ch = self.peek(length) + if ch != ' ': + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if ch != '!': + self.forward(length) + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length += 1 + value = self.prefix(length) + self.forward(length) + return value + + def scan_tag_uri(self, name, start_mark): + # See the specification for details. + # Note: we do not check if URI is well-formed. + chunks = [] + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.!~*\'()[]%': + if ch == '%': + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + chunks.append(self.scan_uri_escapes(name, start_mark)) + else: + length += 1 + ch = self.peek(length) + if length: + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + if not chunks: + raise ScannerError("while parsing a %s" % name, start_mark, + "expected URI, but found %r" % ch, self.get_mark()) + return ''.join(chunks) + + def scan_uri_escapes(self, name, start_mark): + # See the specification for details. + codes = [] + mark = self.get_mark() + while self.peek() == '%': + self.forward() + for k in range(2): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected URI escape sequence of 2 hexadecimal numbers, but found %r" + % self.peek(k), self.get_mark()) + codes.append(int(self.prefix(2), 16)) + self.forward(2) + try: + value = bytes(codes).decode('utf-8') + except UnicodeDecodeError as exc: + raise ScannerError("while scanning a %s" % name, start_mark, str(exc), mark) + return value + + def scan_line_break(self): + # Transforms: + # '\r\n' : '\n' + # '\r' : '\n' + # '\n' : '\n' + # '\x85' : '\n' + # '\u2028' : '\u2028' + # '\u2029 : '\u2029' + # default : '' + ch = self.peek() + if ch in '\r\n\x85': + if self.prefix(2) == '\r\n': + self.forward(2) + else: + self.forward() + return '\n' + elif ch in '\u2028\u2029': + self.forward() + return ch + return '' diff --git a/micromamba_root/Lib/site-packages/yaml/serializer.py b/micromamba_root/Lib/site-packages/yaml/serializer.py new file mode 100644 index 0000000000000000000000000000000000000000..fe911e67ae7a739abb491fbbc6834b9c37bbda4b --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/serializer.py @@ -0,0 +1,111 @@ + +__all__ = ['Serializer', 'SerializerError'] + +from .error import YAMLError +from .events import * +from .nodes import * + +class SerializerError(YAMLError): + pass + +class Serializer: + + ANCHOR_TEMPLATE = 'id%03d' + + def __init__(self, encoding=None, + explicit_start=None, explicit_end=None, version=None, tags=None): + self.use_encoding = encoding + self.use_explicit_start = explicit_start + self.use_explicit_end = explicit_end + self.use_version = version + self.use_tags = tags + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + self.closed = None + + def open(self): + if self.closed is None: + self.emit(StreamStartEvent(encoding=self.use_encoding)) + self.closed = False + elif self.closed: + raise SerializerError("serializer is closed") + else: + raise SerializerError("serializer is already opened") + + def close(self): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif not self.closed: + self.emit(StreamEndEvent()) + self.closed = True + + #def __del__(self): + # self.close() + + def serialize(self, node): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif self.closed: + raise SerializerError("serializer is closed") + self.emit(DocumentStartEvent(explicit=self.use_explicit_start, + version=self.use_version, tags=self.use_tags)) + self.anchor_node(node) + self.serialize_node(node, None, None) + self.emit(DocumentEndEvent(explicit=self.use_explicit_end)) + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + + def anchor_node(self, node): + if node in self.anchors: + if self.anchors[node] is None: + self.anchors[node] = self.generate_anchor(node) + else: + self.anchors[node] = None + if isinstance(node, SequenceNode): + for item in node.value: + self.anchor_node(item) + elif isinstance(node, MappingNode): + for key, value in node.value: + self.anchor_node(key) + self.anchor_node(value) + + def generate_anchor(self, node): + self.last_anchor_id += 1 + return self.ANCHOR_TEMPLATE % self.last_anchor_id + + def serialize_node(self, node, parent, index): + alias = self.anchors[node] + if node in self.serialized_nodes: + self.emit(AliasEvent(alias)) + else: + self.serialized_nodes[node] = True + self.descend_resolver(parent, index) + if isinstance(node, ScalarNode): + detected_tag = self.resolve(ScalarNode, node.value, (True, False)) + default_tag = self.resolve(ScalarNode, node.value, (False, True)) + implicit = (node.tag == detected_tag), (node.tag == default_tag) + self.emit(ScalarEvent(alias, node.tag, implicit, node.value, + style=node.style)) + elif isinstance(node, SequenceNode): + implicit = (node.tag + == self.resolve(SequenceNode, node.value, True)) + self.emit(SequenceStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + index = 0 + for item in node.value: + self.serialize_node(item, node, index) + index += 1 + self.emit(SequenceEndEvent()) + elif isinstance(node, MappingNode): + implicit = (node.tag + == self.resolve(MappingNode, node.value, True)) + self.emit(MappingStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + for key, value in node.value: + self.serialize_node(key, node, None) + self.serialize_node(value, node, key) + self.emit(MappingEndEvent()) + self.ascend_resolver() + diff --git a/micromamba_root/Lib/site-packages/yaml/tokens.py b/micromamba_root/Lib/site-packages/yaml/tokens.py new file mode 100644 index 0000000000000000000000000000000000000000..4d0b48a394ac8c019b401516a12f688df361cf90 --- /dev/null +++ b/micromamba_root/Lib/site-packages/yaml/tokens.py @@ -0,0 +1,104 @@ + +class Token(object): + def __init__(self, start_mark, end_mark): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in self.__dict__ + if not key.endswith('_mark')] + attributes.sort() + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +#class BOMToken(Token): +# id = '<byte order mark>' + +class DirectiveToken(Token): + id = '<directive>' + def __init__(self, name, value, start_mark, end_mark): + self.name = name + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class DocumentStartToken(Token): + id = '<document start>' + +class DocumentEndToken(Token): + id = '<document end>' + +class StreamStartToken(Token): + id = '<stream start>' + def __init__(self, start_mark=None, end_mark=None, + encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndToken(Token): + id = '<stream end>' + +class BlockSequenceStartToken(Token): + id = '<block sequence start>' + +class BlockMappingStartToken(Token): + id = '<block mapping start>' + +class BlockEndToken(Token): + id = '<block end>' + +class FlowSequenceStartToken(Token): + id = '[' + +class FlowMappingStartToken(Token): + id = '{' + +class FlowSequenceEndToken(Token): + id = ']' + +class FlowMappingEndToken(Token): + id = '}' + +class KeyToken(Token): + id = '?' + +class ValueToken(Token): + id = ':' + +class BlockEntryToken(Token): + id = '-' + +class FlowEntryToken(Token): + id = ',' + +class AliasToken(Token): + id = '<alias>' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class AnchorToken(Token): + id = '<anchor>' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class TagToken(Token): + id = '<tag>' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class ScalarToken(Token): + id = '<scalar>' + def __init__(self, value, plain, start_mark, end_mark, style=None): + self.value = value + self.plain = plain + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/INSTALLER b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/METADATA b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..6d202013061c4aa9235985581488c01e45f478c9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/METADATA @@ -0,0 +1,108 @@ +Metadata-Version: 2.4 +Name: zipp +Version: 3.23.1 +Summary: Backport of pathlib-compatible object wrapper for zip files +Author-email: "Jason R. Coombs" <jaraco@jaraco.com> +License-Expression: MIT +Project-URL: Source, https://github.com/jaraco/zipp +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst +License-File: LICENSE +Provides-Extra: test +Requires-Dist: pytest!=8.1.*,>=6; extra == "test" +Requires-Dist: jaraco.itertools; extra == "test" +Requires-Dist: jaraco.functools; extra == "test" +Requires-Dist: more_itertools; extra == "test" +Requires-Dist: big-O; extra == "test" +Requires-Dist: pytest-ignore-flaky; extra == "test" +Requires-Dist: jaraco.test; extra == "test" +Provides-Extra: doc +Requires-Dist: sphinx>=3.5; extra == "doc" +Requires-Dist: jaraco.packaging>=9.3; extra == "doc" +Requires-Dist: rst.linker>=1.9; extra == "doc" +Requires-Dist: furo; extra == "doc" +Requires-Dist: sphinx-lint; extra == "doc" +Requires-Dist: jaraco.tidelift>=1.4; extra == "doc" +Provides-Extra: check +Requires-Dist: pytest-checkdocs>=2.4; extra == "check" +Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check" +Provides-Extra: cover +Requires-Dist: pytest-cov; extra == "cover" +Provides-Extra: enabler +Requires-Dist: pytest-enabler>=2.2; extra == "enabler" +Provides-Extra: type +Requires-Dist: pytest-mypy; extra == "type" +Dynamic: license-file + +.. image:: https://img.shields.io/pypi/v/zipp.svg + :target: https://pypi.org/project/zipp + +.. image:: https://img.shields.io/pypi/pyversions/zipp.svg + +.. image:: https://github.com/jaraco/zipp/actions/workflows/main.yml/badge.svg + :target: https://github.com/jaraco/zipp/actions?query=workflow%3A%22tests%22 + :alt: tests + +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff + +.. image:: https://readthedocs.org/projects/zipp/badge/?version=latest +.. :target: https://zipp.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2025-informational + :target: https://blog.jaraco.com/skeleton + +.. image:: https://tidelift.com/badges/package/pypi/zipp + :target: https://tidelift.com/subscription/pkg/pypi-zipp?utm_source=pypi-zipp&utm_medium=readme + + +A pathlib-compatible Zipfile object wrapper. Official backport of the standard library +`Path object <https://docs.python.org/3.8/library/zipfile.html#path-objects>`_. + + +Compatibility +============= + +New features are introduced in this third-party library and later merged +into CPython. The following table indicates which versions of this library +were contributed to different versions in the standard library: + +.. list-table:: + :header-rows: 1 + + * - zipp + - stdlib + * - 3.21 + - 3.15 + * - 3.18 + - 3.13 + * - 3.16 + - 3.12 + * - 3.5 + - 3.11 + * - 3.2 + - 3.10 + * - 3.3 ?? + - 3.9 + * - 1.0 + - 3.8 + + +Usage +===== + +Use ``zipp.Path`` in place of ``zipfile.Path`` on any Python. + +For Enterprise +============== + +Available as part of the Tidelift Subscription. + +This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. + +`Learn more <https://tidelift.com/subscription/pkg/pypi-zipp?utm_source=pypi-zipp&utm_medium=referral&utm_campaign=github>`_. diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/RECORD b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..d05a8232e153eb7089192e2a4e562c01ff9506b9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/RECORD @@ -0,0 +1,22 @@ +zipp-3.23.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +zipp-3.23.1.dist-info/METADATA,sha256=QgvdwjSWH73LWr38QuMX4KcGkXqcoWP4FWIeF79DR68,3587 +zipp-3.23.1.dist-info/RECORD,, +zipp-3.23.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +zipp-3.23.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91 +zipp-3.23.1.dist-info/direct_url.json,sha256=DNGLctx67qdUzbZqkr0DIR0nh-Lra6-LSGj6H5gd5DI,115 +zipp-3.23.1.dist-info/licenses/LICENSE,sha256=l1WhhRlmbl8PTK49qtPXASvK5IpgCzEjfXXp_hNOZoM,1076 +zipp-3.23.1.dist-info/top_level.txt,sha256=iAbdoSHfaGqBfVb2XuR9JqSQHCoOsOtG6y9C_LSpqFw,5 +zipp/__init__.py,sha256=BsHiDI07HCJfbVU0rXaFfe2XAoivwR0pByJLEgtBJX4,12047 +zipp/__pycache__/__init__.cpython-310.pyc,, +zipp/__pycache__/_functools.cpython-310.pyc,, +zipp/__pycache__/glob.cpython-310.pyc,, +zipp/_functools.py,sha256=LZrqt6bu0I4bxxAbDsNs07fb5ad5_INdG1gzSdhTLv8,789 +zipp/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +zipp/compat/__pycache__/__init__.cpython-310.pyc,, +zipp/compat/__pycache__/overlay.cpython-310.pyc,, +zipp/compat/__pycache__/py310.cpython-310.pyc,, +zipp/compat/__pycache__/py313.cpython-310.pyc,, +zipp/compat/overlay.py,sha256=oEIGAnbr8yGjuKTrVSO2ByewPui71uppbX18BLnYTKE,783 +zipp/compat/py310.py,sha256=S7i6N9mToEn3asNb2ILyjnzvITOXrATD_J4emjyBbDU,256 +zipp/compat/py313.py,sha256=RndvDNtuY7H2D9ecnnzcPBMZ8mZc42gmXD_IwQAXXAE,654 +zipp/glob.py,sha256=DLV9LBsDxA6YVW82e3-tkoNrus1h4R-j3BR6VqS0AzE,3382 diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/REQUESTED b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/WHEEL b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..14a883f292bc96b20c2b76a3081991f2676523a9 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (82.0.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/direct_url.json b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..b93979f406c81cc698ac454ed9fb8d206d334999 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_zipp_1776131454/work"} \ No newline at end of file diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/licenses/LICENSE b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c891f411dc44c70ff121531af2ee189d3da4c871 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/licenses/LICENSE @@ -0,0 +1,18 @@ +MIT License + +Copyright (c) 2026 <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/top_level.txt b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..e82f676f82a3381fa909d1e6578c7a22044fafca --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp-3.23.1.dist-info/top_level.txt @@ -0,0 +1 @@ +zipp diff --git a/micromamba_root/Lib/site-packages/zipp/__init__.py b/micromamba_root/Lib/site-packages/zipp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5f9fadc20416529f3b5d344f48f75a96bbe9db37 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/__init__.py @@ -0,0 +1,457 @@ +""" +A Path-like interface for zipfiles. + +This codebase is shared between zipfile.Path in the stdlib +and zipp in PyPI. See +https://github.com/python/importlib_metadata/wiki/Development-Methodology +for more detail. +""" + +import functools +import io +import itertools +import pathlib +import posixpath +import re +import stat +import sys +import zipfile + +from ._functools import none_as, save_method_args +from .compat.py310 import text_encoding +from .glob import Translator + +__all__ = ['Path'] + + +def _parents(path): + """ + Given a path with elements separated by + posixpath.sep, generate all parents of that path. + + >>> list(_parents('b/d')) + ['b'] + >>> list(_parents('/b/d/')) + ['/b'] + >>> list(_parents('b/d/f/')) + ['b/d', 'b'] + >>> list(_parents('b')) + [] + >>> list(_parents('')) + [] + """ + return itertools.islice(_ancestry(path), 1, None) + + +def _ancestry(path): + """ + Given a path with elements separated by + posixpath.sep, generate all elements of that path. + + >>> list(_ancestry('b/d')) + ['b/d', 'b'] + >>> list(_ancestry('/b/d/')) + ['/b/d', '/b'] + >>> list(_ancestry('b/d/f/')) + ['b/d/f', 'b/d', 'b'] + >>> list(_ancestry('b')) + ['b'] + >>> list(_ancestry('')) + [] + + Multiple separators are treated like a single. + + >>> list(_ancestry('//b//d///f//')) + ['//b//d///f', '//b//d', '//b'] + """ + path = path.rstrip(posixpath.sep) + while path.rstrip(posixpath.sep): + yield path + path, tail = posixpath.split(path) + + +_dedupe = dict.fromkeys +"""Deduplicate an iterable in original order""" + + +def _difference(minuend, subtrahend): + """ + Return items in minuend not in subtrahend, retaining order + with O(1) lookup. + """ + return itertools.filterfalse(set(subtrahend).__contains__, minuend) + + +class InitializedState: + """ + Mix-in to save the initialization state for pickling. + """ + + @save_method_args + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def __getstate__(self): + return self._saved___init__.args, self._saved___init__.kwargs + + def __setstate__(self, state): + args, kwargs = state + super().__init__(*args, **kwargs) + + +class CompleteDirs(InitializedState, zipfile.ZipFile): + """ + A ZipFile subclass that ensures that implied directories + are always included in the namelist. + + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) + ['foo/', 'foo/bar/'] + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) + ['foo/'] + """ + + @staticmethod + def _implied_dirs(names): + parents = itertools.chain.from_iterable(map(_parents, names)) + as_dirs = (p + posixpath.sep for p in parents) + return _dedupe(_difference(as_dirs, names)) + + def namelist(self): + names = super().namelist() + return names + list(self._implied_dirs(names)) + + def _name_set(self): + return set(self.namelist()) + + def resolve_dir(self, name): + """ + If the name represents a directory, return that name + as a directory (with the trailing slash). + """ + names = self._name_set() + dirname = name + '/' + dir_match = name not in names and dirname in names + return dirname if dir_match else name + + def getinfo(self, name): + """ + Supplement getinfo for implied dirs. + """ + try: + return super().getinfo(name) + except KeyError: + if not name.endswith('/') or name not in self._name_set(): + raise + return zipfile.ZipInfo(filename=name) + + @classmethod + def make(cls, source): + """ + Given a source (filename or zipfile), return an + appropriate CompleteDirs subclass. + """ + if isinstance(source, CompleteDirs): + return source + + if not isinstance(source, zipfile.ZipFile): + return cls(source) + + # Only allow for FastLookup when supplied zipfile is read-only + if 'r' not in source.mode: + cls = CompleteDirs + + source.__class__ = cls + return source + + @classmethod + def inject(cls, zf: zipfile.ZipFile) -> zipfile.ZipFile: + """ + Given a writable zip file zf, inject directory entries for + any directories implied by the presence of children. + """ + for name in cls._implied_dirs(zf.namelist()): + zf.writestr(name, b"") + return zf + + +class FastLookup(CompleteDirs): + """ + ZipFile subclass to ensure implicit + dirs exist and are resolved rapidly. + """ + + def namelist(self): + return self._namelist + + @functools.cached_property + def _namelist(self): + return super().namelist() + + def _name_set(self): + return self._name_set_prop + + @functools.cached_property + def _name_set_prop(self): + return super()._name_set() + + +def _extract_text_encoding(encoding=None, *args, **kwargs): + # compute stack level so that the caller of the caller sees any warning. + is_pypy = sys.implementation.name == 'pypy' + # PyPy no longer special cased after 7.3.19 (or maybe 7.3.18) + # See jaraco/zipp#143 + is_old_pypi = is_pypy and sys.pypy_version_info < (7, 3, 19) + stack_level = 3 + is_old_pypi + return text_encoding(encoding, stack_level), args, kwargs + + +class Path: + """ + A :class:`importlib.resources.abc.Traversable` interface for zip files. + + Implements many of the features users enjoy from + :class:`pathlib.Path`. + + Consider a zip file with this structure:: + + . + ├── a.txt + └── b + ├── c.txt + └── d + └── e.txt + + >>> data = io.BytesIO() + >>> zf = zipfile.ZipFile(data, 'w') + >>> zf.writestr('a.txt', 'content of a') + >>> zf.writestr('b/c.txt', 'content of c') + >>> zf.writestr('b/d/e.txt', 'content of e') + >>> zf.filename = 'mem/abcde.zip' + + Path accepts the zipfile object itself or a filename + + >>> path = Path(zf) + + From there, several path operations are available. + + Directory iteration (including the zip file itself): + + >>> a, b = path.iterdir() + >>> a + Path('mem/abcde.zip', 'a.txt') + >>> b + Path('mem/abcde.zip', 'b/') + + name property: + + >>> b.name + 'b' + + join with divide operator: + + >>> c = b / 'c.txt' + >>> c + Path('mem/abcde.zip', 'b/c.txt') + >>> c.name + 'c.txt' + + Read text: + + >>> c.read_text(encoding='utf-8') + 'content of c' + + existence: + + >>> c.exists() + True + >>> (b / 'missing.txt').exists() + False + + Coercion to string: + + >>> import os + >>> str(c).replace(os.sep, posixpath.sep) + 'mem/abcde.zip/b/c.txt' + + At the root, ``name``, ``filename``, and ``parent`` + resolve to the zipfile. + + >>> str(path) + 'mem/abcde.zip' + >>> path.name + 'abcde.zip' + >>> path.filename == pathlib.Path('mem/abcde.zip') + True + >>> str(path.parent) + 'mem' + + If the zipfile has no filename, such attributes are not + valid and accessing them will raise an Exception. + + >>> zf.filename = None + >>> path.name + Traceback (most recent call last): + ... + TypeError: ... + + >>> path.filename + Traceback (most recent call last): + ... + TypeError: ... + + >>> path.parent + Traceback (most recent call last): + ... + TypeError: ... + + # workaround python/cpython#106763 + >>> pass + """ + + __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})" + + def __init__(self, root, at=""): + """ + Construct a Path from a ZipFile or filename. + + Note: When the source is an existing ZipFile object, + its type (__class__) will be mutated to a + specialized type. If the caller wishes to retain the + original type, the caller should either create a + separate ZipFile object or pass a filename. + """ + self.root = FastLookup.make(root) + self.at = at + + def __eq__(self, other): + """ + >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo' + False + """ + if self.__class__ is not other.__class__: + return NotImplemented + return (self.root, self.at) == (other.root, other.at) + + def __hash__(self): + return hash((self.root, self.at)) + + def open(self, mode='r', *args, pwd=None, **kwargs): + """ + Open this entry as text or binary following the semantics + of ``pathlib.Path.open()`` by passing arguments through + to io.TextIOWrapper(). + """ + if self.is_dir(): + raise IsADirectoryError(self) + zip_mode = mode[0] + if zip_mode == 'r' and not self.exists(): + raise FileNotFoundError(self) + stream = self.root.open(self.at, zip_mode, pwd=pwd) + if 'b' in mode: + if args or kwargs: + raise ValueError("encoding args invalid for binary operation") + return stream + # Text mode: + encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) + return io.TextIOWrapper(stream, encoding, *args, **kwargs) + + def _base(self): + return pathlib.PurePosixPath(self.at) if self.at else self.filename + + @property + def name(self): + return self._base().name + + @property + def suffix(self): + return self._base().suffix + + @property + def suffixes(self): + return self._base().suffixes + + @property + def stem(self): + return self._base().stem + + @property + def filename(self): + return pathlib.Path(self.root.filename).joinpath(self.at) + + def read_text(self, *args, **kwargs): + encoding, args, kwargs = _extract_text_encoding(*args, **kwargs) + with self.open('r', encoding, *args, **kwargs) as strm: + return strm.read() + + def read_bytes(self): + with self.open('rb') as strm: + return strm.read() + + def _is_child(self, path): + return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/") + + def _next(self, at): + return self.__class__(self.root, at) + + def is_dir(self): + return not self.at or self.at.endswith("/") + + def is_file(self): + return self.exists() and not self.is_dir() + + def exists(self): + return self.at in self.root._name_set() + + def iterdir(self): + if not self.is_dir(): + raise ValueError("Can't listdir a file") + subs = map(self._next, self.root.namelist()) + return filter(self._is_child, subs) + + def match(self, path_pattern): + return pathlib.PurePosixPath(self.at).match(path_pattern) + + def is_symlink(self): + """ + Return whether this path is a symlink. + """ + info = self.root.getinfo(self.at) + mode = info.external_attr >> 16 + return stat.S_ISLNK(mode) + + def glob(self, pattern): + if not pattern: + raise ValueError(f"Unacceptable pattern: {pattern!r}") + + prefix = re.escape(self.at) + tr = Translator(seps='/') + matches = re.compile(prefix + tr.translate(pattern)).fullmatch + return map(self._next, filter(matches, self.root.namelist())) + + def rglob(self, pattern): + return self.glob(f'**/{pattern}') + + def relative_to(self, other, *extra): + return posixpath.relpath(str(self), str(other.joinpath(*extra))) + + def __str__(self): + root = none_as(self.root.filename, ':zipfile:') + return posixpath.join(root, self.at) if self.at else root + + def __repr__(self): + return self.__repr.format(self=self) + + def joinpath(self, *other): + next = posixpath.join(self.at, *other) + return self._next(self.root.resolve_dir(next)) + + __truediv__ = joinpath + + @property + def parent(self): + if not self.at: + return self.filename.parent + parent_at = posixpath.dirname(self.at.rstrip('/')) + if parent_at: + parent_at += '/' + return self._next(parent_at) diff --git a/micromamba_root/Lib/site-packages/zipp/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fd89250e934ebaf1e8255ffb08f802c18846500 Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/__pycache__/_functools.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/__pycache__/_functools.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..588e20b29a28b9a8c89bb97a63656e355b7f7207 Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/__pycache__/_functools.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/__pycache__/glob.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/__pycache__/glob.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb227765087aad232fd1628f5cc9f197da6bfc24 Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/__pycache__/glob.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/_functools.py b/micromamba_root/Lib/site-packages/zipp/_functools.py new file mode 100644 index 0000000000000000000000000000000000000000..7d82636ac8d627add2635ce3d5580a411d1744e6 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/_functools.py @@ -0,0 +1,31 @@ +import collections +import functools + + +# from jaraco.functools 4.0.2 +def save_method_args(method): + """ + Wrap a method such that when it is called, the args and kwargs are + saved on the method. + """ + args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs') # noqa: PYI024 + + @functools.wraps(method) + def wrapper(self, /, *args, **kwargs): + attr_name = '_saved_' + method.__name__ + attr = args_and_kwargs(args, kwargs) + setattr(self, attr_name, attr) + return method(self, *args, **kwargs) + + return wrapper + + +# from jaraco.functools 4.3 +def none_as(value, replacement=None): + """ + >>> none_as(None, 'foo') + 'foo' + >>> none_as('bar', 'foo') + 'bar' + """ + return replacement if value is None else value diff --git a/micromamba_root/Lib/site-packages/zipp/compat/__init__.py b/micromamba_root/Lib/site-packages/zipp/compat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/__init__.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fbd5b96fe04fe8cd4fc41b34c31d3cd2dbf5ede Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/overlay.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/overlay.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e84661d1b3287f4342634639db5734da74d3a6b Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/overlay.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py310.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py310.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..758afbeb886af779cd83c5c8457a3137eac1fdd2 Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py310.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py313.cpython-314.pyc b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py313.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..397dc491243e2d8185c6d5e73e44ede97a3b0687 Binary files /dev/null and b/micromamba_root/Lib/site-packages/zipp/compat/__pycache__/py313.cpython-314.pyc differ diff --git a/micromamba_root/Lib/site-packages/zipp/compat/overlay.py b/micromamba_root/Lib/site-packages/zipp/compat/overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..5a97ee7cd8b98f3a5487c0a0b0a80ffde5ff4dfd --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/compat/overlay.py @@ -0,0 +1,37 @@ +""" +Expose zipp.Path as .zipfile.Path. + +Includes everything else in ``zipfile`` to match future usage. Just +use: + +>>> from zipp.compat.overlay import zipfile + +in place of ``import zipfile``. + +Relative imports are supported too. + +>>> from zipp.compat.overlay.zipfile import ZipInfo + +The ``zipfile`` object added to ``sys.modules`` needs to be +hashable (#126). + +>>> _ = hash(sys.modules['zipp.compat.overlay.zipfile']) +""" + +import importlib +import sys +import types + +import zipp + + +class HashableNamespace(types.SimpleNamespace): + def __hash__(self): + return hash(tuple(vars(self))) + + +zipfile = HashableNamespace(**vars(importlib.import_module('zipfile'))) +zipfile.Path = zipp.Path +zipfile._path = zipp + +sys.modules[__name__ + '.zipfile'] = zipfile # type: ignore[assignment] diff --git a/micromamba_root/Lib/site-packages/zipp/compat/py310.py b/micromamba_root/Lib/site-packages/zipp/compat/py310.py new file mode 100644 index 0000000000000000000000000000000000000000..e1e7ec229062b8556cdd85f530d1ff301b2e6845 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/compat/py310.py @@ -0,0 +1,13 @@ +import io +import sys + + +def _text_encoding(encoding, stacklevel=2, /): # pragma: no cover + return encoding + + +text_encoding = ( + io.text_encoding # type: ignore[unused-ignore, attr-defined] + if sys.version_info > (3, 10) + else _text_encoding +) diff --git a/micromamba_root/Lib/site-packages/zipp/compat/py313.py b/micromamba_root/Lib/site-packages/zipp/compat/py313.py new file mode 100644 index 0000000000000000000000000000000000000000..ae458690553f92107ce296adf4bb49add8e78250 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/compat/py313.py @@ -0,0 +1,34 @@ +import functools +import sys + + +# from jaraco.functools 4.1 +def identity(x): + return x + + +# from jaraco.functools 4.1 +def apply(transform): + def wrap(func): + return functools.wraps(func)(compose(transform, func)) + + return wrap + + +# from jaraco.functools 4.1 +def compose(*funcs): + def compose_two(f1, f2): + return lambda *args, **kwargs: f1(f2(*args, **kwargs)) + + return functools.reduce(compose_two, funcs) + + +def replace(pattern): + r""" + >>> replace(r'foo\z') + 'foo\\Z' + """ + return pattern[:-2] + pattern[-2:].replace(r'\z', r'\Z') + + +legacy_end_marker = apply(replace) if sys.version_info < (3, 14) else identity diff --git a/micromamba_root/Lib/site-packages/zipp/glob.py b/micromamba_root/Lib/site-packages/zipp/glob.py new file mode 100644 index 0000000000000000000000000000000000000000..1b4ffb33187b65b4378925c472071c845bcecc26 --- /dev/null +++ b/micromamba_root/Lib/site-packages/zipp/glob.py @@ -0,0 +1,116 @@ +import os +import re + +from .compat.py313 import legacy_end_marker + +_default_seps = os.sep + str(os.altsep) * bool(os.altsep) + + +class Translator: + """ + >>> Translator('xyz') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + + >>> Translator('') + Traceback (most recent call last): + ... + AssertionError: Invalid separators + """ + + seps: str + + def __init__(self, seps: str = _default_seps): + assert seps and set(seps) <= set(_default_seps), "Invalid separators" + self.seps = seps + + def translate(self, pattern): + """ + Given a glob pattern, produce a regex that matches it. + """ + return self.extend(self.match_dirs(self.translate_core(pattern))) + + @legacy_end_marker + def extend(self, pattern): + r""" + Extend regex for pattern-wide concerns. + + Apply '(?s:)' to create a non-matching group that + matches newlines (valid on Unix). + + Append '\z' to imply fullmatch even when match is used. + """ + return rf'(?s:{pattern})\z' + + def match_dirs(self, pattern): + """ + Ensure that zipfile.Path directory names are matched. + + zipfile.Path directory names always end in a slash. + """ + return rf'{pattern}[/]?' + + def translate_core(self, pattern): + r""" + Given a glob pattern, produce a regex that matches it. + + >>> t = Translator() + >>> t.translate_core('*.txt').replace('\\\\', '') + '[^/]*\\.txt' + >>> t.translate_core('a?txt') + 'a[^/]txt' + >>> t.translate_core('**/*').replace('\\\\', '') + '.*/[^/][^/]*' + """ + self.restrict_rglob(pattern) + return ''.join(map(self.replace, separate(self.star_not_empty(pattern)))) + + def replace(self, match): + """ + Perform the replacements for a match from :func:`separate`. + """ + return match.group('set') or ( + re.escape(match.group(0)) + .replace('\\*\\*', r'.*') + .replace('\\*', rf'[^{re.escape(self.seps)}]*') + .replace('\\?', r'[^/]') + ) + + def restrict_rglob(self, pattern): + """ + Raise ValueError if ** appears in anything but a full path segment. + + >>> Translator().translate('**foo') + Traceback (most recent call last): + ... + ValueError: ** must appear alone in a path segment + """ + seps_pattern = rf'[{re.escape(self.seps)}]+' + segments = re.split(seps_pattern, pattern) + if any('**' in segment and segment != '**' for segment in segments): + raise ValueError("** must appear alone in a path segment") + + def star_not_empty(self, pattern): + """ + Ensure that * will not match an empty segment. + """ + + def handle_segment(match): + segment = match.group(0) + return '?*' if segment == '*' else segment + + not_seps_pattern = rf'[^{re.escape(self.seps)}]+' + return re.sub(not_seps_pattern, handle_segment, pattern) + + +def separate(pattern): + """ + Separate out character sets to avoid translating their contents. + + >>> [m.group(0) for m in separate('*.txt')] + ['*.txt'] + >>> [m.group(0) for m in separate('a[?]txt')] + ['a', '[?]', 'txt'] + """ + return re.finditer(r'([^\[]+)|(?P<set>[\[].*?[\]])|([\[][^\]]*$)', pattern)