help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
travel-assistant-bot
/
.venv
/
Lib
/
site-packages
/
pip
/
_vendor
/
resolvelib
RSK World
travel-assistant-bot
Travel Assistant Bot - Python + Flask + OpenAI API + Travel Bot + Flight Search + Hotel Booking + Weather
resolvelib
  • __pycache__
  • compat
  • __init__.py537 B
  • providers.py5.7 KB
  • py.typed0 B
  • reporters.py1.6 KB
  • resolvers.py20 KB
  • structs.py4.8 KB
pyopenssl.py_macos.pycookies.pylayout.pyconstrain.pyansi.pyprompt.pydiagnose.py_emoji_codes.py_windows.pyresponse.py
.venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py
Raw Download
Find: Go to:
"""
TLS with SNI_-support for Python 2. Follow these instructions if you would
like to verify TLS certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.

This needs the following packages installed:

* `pyOpenSSL`_ (tested with 16.0.0)
* `cryptography`_ (minimum 1.3.4, from pyopenssl)
* `idna`_ (minimum 2.0, from cryptography)

However, pyopenssl depends on cryptography, which depends on idna, 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 pip._vendor.urllib3.contrib.pyopenssl as pyopenssl
        pyopenssl.inject_into_urllib3()
    except ImportError:
        pass

Now you can use :mod:`urllib3` as you normally would, and it will support SNI
when the required modules are installed.

Activating this module also has the positive side effect of disabling SSL/TLS
compression in Python 2 (see `CRIME attack`_).

.. _sni: https://en.wikipedia.org/wiki/Server_Name_Indication
.. _crime attack: https://en.wikipedia.org/wiki/CRIME_(security_exploit)
.. _pyopenssl: https://www.pyopenssl.org
.. _cryptography: https://cryptography.io
.. _idna: https://github.com/kjd/idna
"""
from __future__ import absolute_import

import OpenSSL.crypto
import OpenSSL.SSL
from cryptography import x509
from cryptography.hazmat.backends.openssl import backend as openssl_backend

try:
    from cryptography.x509 import UnsupportedExtension
except ImportError:
    # UnsupportedExtension is gone in cryptography >= 2.1.0
    class UnsupportedExtension(Exception):
        pass


from io import BytesIO
from socket import error as SocketError
from socket import timeout

try:  # Platform-specific: Python 2
    from socket import _fileobject
except ImportError:  # Platform-specific: Python 3
    _fileobject = None
    from ..packages.backports.makefile import backport_makefile

import logging
import ssl
import sys
import warnings

from .. import util
from ..packages import six
from ..util.ssl_ import PROTOCOL_TLS_CLIENT

warnings.warn(
    "'urllib3.contrib.pyopenssl' module is deprecated and will be removed "
    "in a future release of urllib3 2.x. Read more in this issue: "
    "https://github.com/urllib3/urllib3/issues/2680",
    category=DeprecationWarning,
    stacklevel=2,
)

__all__ = ["inject_into_urllib3", "extract_from_urllib3"]

# SNI always works.
HAS_SNI = True

# Map from urllib3 to PyOpenSSL compatible parameter-values.
_openssl_versions = {
    util.PROTOCOL_TLS: OpenSSL.SSL.SSLv23_METHOD,
    PROTOCOL_TLS_CLIENT: OpenSSL.SSL.SSLv23_METHOD,
    ssl.PROTOCOL_TLSv1: OpenSSL.SSL.TLSv1_METHOD,
}

if hasattr(ssl, "PROTOCOL_SSLv3") and hasattr(OpenSSL.SSL, "SSLv3_METHOD"):
    _openssl_versions[ssl.PROTOCOL_SSLv3] = OpenSSL.SSL.SSLv3_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 = dict((v, k) for k, v in _stdlib_to_openssl_verify.items())

# OpenSSL will only write 16K at a time
SSL_WRITE_BLOCKSIZE = 16384

orig_util_HAS_SNI = util.HAS_SNI
orig_util_SSLContext = util.ssl_.SSLContext


log = logging.getLogger(__name__)


def inject_into_urllib3():
    "Monkey-patch urllib3 with PyOpenSSL-backed SSL-support."

    _validate_dependencies_met()

    util.SSLContext = PyOpenSSLContext
    util.ssl_.SSLContext = PyOpenSSLContext
    util.HAS_SNI = HAS_SNI
    util.ssl_.HAS_SNI = HAS_SNI
    util.IS_PYOPENSSL = True
    util.ssl_.IS_PYOPENSSL = True


def extract_from_urllib3():
    "Undo monkey-patching by :func:`inject_into_urllib3`."

    util.SSLContext = orig_util_SSLContext
    util.ssl_.SSLContext = orig_util_SSLContext
    util.HAS_SNI = orig_util_HAS_SNI
    util.ssl_.HAS_SNI = orig_util_HAS_SNI
    util.IS_PYOPENSSL = False
    util.ssl_.IS_PYOPENSSL = False


def _validate_dependencies_met():
    """
    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):
    """
    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):
        """
        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.
        """
        from pip._vendor import idna

        try:
            for prefix in [u"*.", u"."]:
                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

    name = idna_encode(name)
    if name is None:
        return None
    elif sys.version_info >= (3, 0):
        name = name.decode("utf-8")
    return name


def get_subj_alt_name(peer_cert):
    """
    Given an PyOpenSSL certificate, provides all the subject alternative names.
    """
    # Pass the cert to cryptography, which has much better APIs for this.
    if hasattr(peer_cert, "to_cryptography"):
        cert = peer_cert.to_cryptography()
    else:
        der = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_ASN1, peer_cert)
        cert = x509.load_der_x509_certificate(der, openssl_backend)

    # 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(object):
    """API-compatibility wrapper for Python OpenSSL's Connection-class.

    Note: _makefile_refs, _drop() and _reuse() are needed for the garbage
    collector of pypy.
    """

    def __init__(self, connection, socket, suppress_ragged_eofs=True):
        self.connection = connection
        self.socket = socket
        self.suppress_ragged_eofs = suppress_ragged_eofs
        self._makefile_refs = 0
        self._closed = False

    def fileno(self):
        return self.socket.fileno()

    # Copy-pasted from Python 3.5 source code
    def _decref_socketios(self):
        if self._makefile_refs > 0:
            self._makefile_refs -= 1
        if self._closed:
            self.close()

    def recv(self, *args, **kwargs):
        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 SocketError(str(e))
        except OpenSSL.SSL.ZeroReturnError:
            if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN:
                return b""
            else:
                raise
        except OpenSSL.SSL.WantReadError:
            if not util.wait_for_read(self.socket, self.socket.gettimeout()):
                raise timeout("The read operation timed out")
            else:
                return self.recv(*args, **kwargs)

        # TLS 1.3 post-handshake authentication
        except OpenSSL.SSL.Error as e:
            raise ssl.SSLError("read error: %r" % e)
        else:
            return data

    def recv_into(self, *args, **kwargs):
        try:
            return self.connection.recv_into(*args, **kwargs)
        except OpenSSL.SSL.SysCallError as e:
            if self.suppress_ragged_eofs and e.args == (-1, "Unexpected EOF"):
                return 0
            else:
                raise SocketError(str(e))
        except OpenSSL.SSL.ZeroReturnError:
            if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN:
                return 0
            else:
                raise
        except OpenSSL.SSL.WantReadError:
            if not util.wait_for_read(self.socket, self.socket.gettimeout()):
                raise timeout("The read operation timed out")
            else:
                return self.recv_into(*args, **kwargs)

        # TLS 1.3 post-handshake authentication
        except OpenSSL.SSL.Error as e:
            raise ssl.SSLError("read error: %r" % e)

    def settimeout(self, timeout):
        return self.socket.settimeout(timeout)

    def _send_until_done(self, data):
        while True:
            try:
                return self.connection.send(data)
            except OpenSSL.SSL.WantWriteError:
                if not util.wait_for_write(self.socket, self.socket.gettimeout()):
                    raise timeout()
                continue
            except OpenSSL.SSL.SysCallError as e:
                raise SocketError(str(e))

    def sendall(self, data):
        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):
        # FIXME rethrow compatible exceptions should we ever use this
        self.connection.shutdown()

    def close(self):
        if self._makefile_refs < 1:
            try:
                self._closed = True
                return self.connection.close()
            except OpenSSL.SSL.Error:
                return
        else:
            self._makefile_refs -= 1

    def getpeercert(self, binary_form=False):
        x509 = self.connection.get_peer_certificate()

        if not x509:
            return x509

        if binary_form:
            return OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_ASN1, x509)

        return {
            "subject": ((("commonName", x509.get_subject().CN),),),
            "subjectAltName": get_subj_alt_name(x509),
        }

    def version(self):
        return self.connection.get_protocol_version_name()

    def _reuse(self):
        self._makefile_refs += 1

    def _drop(self):
        if self._makefile_refs < 1:
            self.close()
        else:
            self._makefile_refs -= 1


if _fileobject:  # Platform-specific: Python 2

    def makefile(self, mode, bufsize=-1):
        self._makefile_refs += 1
        return _fileobject(self, mode, bufsize, close=True)

else:  # Platform-specific: Python 3
    makefile = backport_makefile

WrappedSocket.makefile = makefile


class PyOpenSSLContext(object):
    """
    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):
        self.protocol = _openssl_versions[protocol]
        self._ctx = OpenSSL.SSL.Context(self.protocol)
        self._options = 0
        self.check_hostname = False

    @property
    def options(self):
        return self._options

    @options.setter
    def options(self, value):
        self._options = value
        self._ctx.set_options(value)

    @property
    def verify_mode(self):
        return _openssl_to_stdlib_verify[self._ctx.get_verify_mode()]

    @verify_mode.setter
    def verify_mode(self, value):
        self._ctx.set_verify(_stdlib_to_openssl_verify[value], _verify_callback)

    def set_default_verify_paths(self):
        self._ctx.set_default_verify_paths()

    def set_ciphers(self, ciphers):
        if isinstance(ciphers, six.text_type):
            ciphers = ciphers.encode("utf-8")
        self._ctx.set_cipher_list(ciphers)

    def load_verify_locations(self, cafile=None, capath=None, cadata=None):
        if cafile is not None:
            cafile = cafile.encode("utf-8")
        if capath is not None:
            capath = capath.encode("utf-8")
        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("unable to load trusted certificates: %r" % e)

    def load_cert_chain(self, certfile, keyfile=None, password=None):
        self._ctx.use_certificate_chain_file(certfile)
        if password is not None:
            if not isinstance(password, six.binary_type):
                password = password.encode("utf-8")
            self._ctx.set_passwd_cb(lambda *_: password)
        self._ctx.use_privatekey_file(keyfile or certfile)

    def set_alpn_protocols(self, protocols):
        protocols = [six.ensure_binary(p) for p in protocols]
        return self._ctx.set_alpn_protos(protocols)

    def wrap_socket(
        self,
        sock,
        server_side=False,
        do_handshake_on_connect=True,
        suppress_ragged_eofs=True,
        server_hostname=None,
    ):
        cnx = OpenSSL.SSL.Connection(self._ctx, sock)

        if isinstance(server_hostname, six.text_type):  # Platform-specific: Python 3
            server_hostname = server_hostname.encode("utf-8")

        if server_hostname is not None:
            cnx.set_tlsext_host_name(server_hostname)

        cnx.set_connect_state()

        while True:
            try:
                cnx.do_handshake()
            except OpenSSL.SSL.WantReadError:
                if not util.wait_for_read(sock, sock.gettimeout()):
                    raise timeout("select timed out")
                continue
            except OpenSSL.SSL.Error as e:
                raise ssl.SSLError("bad handshake: %r" % e)
            break

        return WrappedSocket(cnx, sock)


def _verify_callback(cnx, x509, err_no, err_depth, return_code):
    return err_no == 0
519 lines•16.7 KB
python
.venv/Lib/site-packages/pip/_vendor/truststore/_macos.py
Raw Download
Find: Go to:
import contextlib
import ctypes
import platform
import ssl
import typing
from ctypes import (
    CDLL,
    POINTER,
    c_bool,
    c_char_p,
    c_int32,
    c_long,
    c_uint32,
    c_ulong,
    c_void_p,
)
from ctypes.util import find_library

from ._ssl_constants import _set_ssl_context_verify_mode

_mac_version = platform.mac_ver()[0]
_mac_version_info = tuple(map(int, _mac_version.split(".")))
if _mac_version_info < (10, 8):
    raise ImportError(
        f"Only OS X 10.8 and newer are supported, not {_mac_version_info[0]}.{_mac_version_info[1]}"
    )

_is_macos_version_10_14_or_later = _mac_version_info >= (10, 14)


def _load_cdll(name: str, macos10_16_path: str) -> CDLL:
    """Loads a CDLL by name, falling back to known path on 10.16+"""
    try:
        # Big Sur is technically 11 but we use 10.16 due to the Big Sur
        # beta being labeled as 10.16.
        path: str | None
        if _mac_version_info >= (10, 16):
            path = macos10_16_path
        else:
            path = find_library(name)
        if not path:
            raise OSError  # Caught and reraised as 'ImportError'
        return CDLL(path, use_errno=True)
    except OSError:
        raise ImportError(f"The library {name} failed to load") from None


Security = _load_cdll(
    "Security", "/System/Library/Frameworks/Security.framework/Security"
)
CoreFoundation = _load_cdll(
    "CoreFoundation",
    "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",
)

Boolean = c_bool
CFIndex = c_long
CFStringEncoding = c_uint32
CFData = c_void_p
CFString = c_void_p
CFArray = c_void_p
CFMutableArray = c_void_p
CFError = c_void_p
CFType = c_void_p
CFTypeID = c_ulong
CFTypeRef = POINTER(CFType)
CFAllocatorRef = c_void_p

OSStatus = c_int32

CFErrorRef = POINTER(CFError)
CFDataRef = POINTER(CFData)
CFStringRef = POINTER(CFString)
CFArrayRef = POINTER(CFArray)
CFMutableArrayRef = POINTER(CFMutableArray)
CFArrayCallBacks = c_void_p
CFOptionFlags = c_uint32

SecCertificateRef = POINTER(c_void_p)
SecPolicyRef = POINTER(c_void_p)
SecTrustRef = POINTER(c_void_p)
SecTrustResultType = c_uint32
SecTrustOptionFlags = c_uint32

try:
    Security.SecCertificateCreateWithData.argtypes = [CFAllocatorRef, CFDataRef]
    Security.SecCertificateCreateWithData.restype = SecCertificateRef

    Security.SecCertificateCopyData.argtypes = [SecCertificateRef]
    Security.SecCertificateCopyData.restype = CFDataRef

    Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
    Security.SecCopyErrorMessageString.restype = CFStringRef

    Security.SecTrustSetAnchorCertificates.argtypes = [SecTrustRef, CFArrayRef]
    Security.SecTrustSetAnchorCertificates.restype = OSStatus

    Security.SecTrustSetAnchorCertificatesOnly.argtypes = [SecTrustRef, Boolean]
    Security.SecTrustSetAnchorCertificatesOnly.restype = OSStatus

    Security.SecPolicyCreateRevocation.argtypes = [CFOptionFlags]
    Security.SecPolicyCreateRevocation.restype = SecPolicyRef

    Security.SecPolicyCreateSSL.argtypes = [Boolean, CFStringRef]
    Security.SecPolicyCreateSSL.restype = SecPolicyRef

    Security.SecTrustCreateWithCertificates.argtypes = [
        CFTypeRef,
        CFTypeRef,
        POINTER(SecTrustRef),
    ]
    Security.SecTrustCreateWithCertificates.restype = OSStatus

    Security.SecTrustGetTrustResult.argtypes = [
        SecTrustRef,
        POINTER(SecTrustResultType),
    ]
    Security.SecTrustGetTrustResult.restype = OSStatus

    Security.SecTrustEvaluate.argtypes = [
        SecTrustRef,
        POINTER(SecTrustResultType),
    ]
    Security.SecTrustEvaluate.restype = OSStatus

    Security.SecTrustRef = SecTrustRef  # type: ignore[attr-defined]
    Security.SecTrustResultType = SecTrustResultType  # type: ignore[attr-defined]
    Security.OSStatus = OSStatus  # type: ignore[attr-defined]

    kSecRevocationUseAnyAvailableMethod = 3
    kSecRevocationRequirePositiveResponse = 8

    CoreFoundation.CFRelease.argtypes = [CFTypeRef]
    CoreFoundation.CFRelease.restype = None

    CoreFoundation.CFGetTypeID.argtypes = [CFTypeRef]
    CoreFoundation.CFGetTypeID.restype = CFTypeID

    CoreFoundation.CFStringCreateWithCString.argtypes = [
        CFAllocatorRef,
        c_char_p,
        CFStringEncoding,
    ]
    CoreFoundation.CFStringCreateWithCString.restype = CFStringRef

    CoreFoundation.CFStringGetCStringPtr.argtypes = [CFStringRef, CFStringEncoding]
    CoreFoundation.CFStringGetCStringPtr.restype = c_char_p

    CoreFoundation.CFStringGetCString.argtypes = [
        CFStringRef,
        c_char_p,
        CFIndex,
        CFStringEncoding,
    ]
    CoreFoundation.CFStringGetCString.restype = c_bool

    CoreFoundation.CFDataCreate.argtypes = [CFAllocatorRef, c_char_p, CFIndex]
    CoreFoundation.CFDataCreate.restype = CFDataRef

    CoreFoundation.CFDataGetLength.argtypes = [CFDataRef]
    CoreFoundation.CFDataGetLength.restype = CFIndex

    CoreFoundation.CFDataGetBytePtr.argtypes = [CFDataRef]
    CoreFoundation.CFDataGetBytePtr.restype = c_void_p

    CoreFoundation.CFArrayCreate.argtypes = [
        CFAllocatorRef,
        POINTER(CFTypeRef),
        CFIndex,
        CFArrayCallBacks,
    ]
    CoreFoundation.CFArrayCreate.restype = CFArrayRef

    CoreFoundation.CFArrayCreateMutable.argtypes = [
        CFAllocatorRef,
        CFIndex,
        CFArrayCallBacks,
    ]
    CoreFoundation.CFArrayCreateMutable.restype = CFMutableArrayRef

    CoreFoundation.CFArrayAppendValue.argtypes = [CFMutableArrayRef, c_void_p]
    CoreFoundation.CFArrayAppendValue.restype = None

    CoreFoundation.CFArrayGetCount.argtypes = [CFArrayRef]
    CoreFoundation.CFArrayGetCount.restype = CFIndex

    CoreFoundation.CFArrayGetValueAtIndex.argtypes = [CFArrayRef, CFIndex]
    CoreFoundation.CFArrayGetValueAtIndex.restype = c_void_p

    CoreFoundation.CFErrorGetCode.argtypes = [CFErrorRef]
    CoreFoundation.CFErrorGetCode.restype = CFIndex

    CoreFoundation.CFErrorCopyDescription.argtypes = [CFErrorRef]
    CoreFoundation.CFErrorCopyDescription.restype = CFStringRef

    CoreFoundation.kCFAllocatorDefault = CFAllocatorRef.in_dll(  # type: ignore[attr-defined]
        CoreFoundation, "kCFAllocatorDefault"
    )
    CoreFoundation.kCFTypeArrayCallBacks = c_void_p.in_dll(  # type: ignore[attr-defined]
        CoreFoundation, "kCFTypeArrayCallBacks"
    )

    CoreFoundation.CFTypeRef = CFTypeRef  # type: ignore[attr-defined]
    CoreFoundation.CFArrayRef = CFArrayRef  # type: ignore[attr-defined]
    CoreFoundation.CFStringRef = CFStringRef  # type: ignore[attr-defined]
    CoreFoundation.CFErrorRef = CFErrorRef  # type: ignore[attr-defined]

except AttributeError as e:
    raise ImportError(f"Error initializing ctypes: {e}") from None

# SecTrustEvaluateWithError is macOS 10.14+
if _is_macos_version_10_14_or_later:
    try:
        Security.SecTrustEvaluateWithError.argtypes = [
            SecTrustRef,
            POINTER(CFErrorRef),
        ]
        Security.SecTrustEvaluateWithError.restype = c_bool
    except AttributeError as e:
        raise ImportError(f"Error initializing ctypes: {e}") from None


def _handle_osstatus(result: OSStatus, _: typing.Any, args: typing.Any) -> typing.Any:
    """
    Raises an error if the OSStatus value is non-zero.
    """
    if int(result) == 0:
        return args

    # Returns a CFString which we need to transform
    # into a UTF-8 Python string.
    error_message_cfstring = None
    try:
        error_message_cfstring = Security.SecCopyErrorMessageString(result, None)

        # First step is convert the CFString into a C string pointer.
        # We try the fast no-copy way first.
        error_message_cfstring_c_void_p = ctypes.cast(
            error_message_cfstring, ctypes.POINTER(ctypes.c_void_p)
        )
        message = CoreFoundation.CFStringGetCStringPtr(
            error_message_cfstring_c_void_p, CFConst.kCFStringEncodingUTF8
        )

        # Quoting the Apple dev docs:
        #
        # "A pointer to a C string or NULL if the internal
        # storage of theString does not allow this to be
        # returned efficiently."
        #
        # So we need to get our hands dirty.
        if message is None:
            buffer = ctypes.create_string_buffer(1024)
            result = CoreFoundation.CFStringGetCString(
                error_message_cfstring_c_void_p,
                buffer,
                1024,
                CFConst.kCFStringEncodingUTF8,
            )
            if not result:
                raise OSError("Error copying C string from CFStringRef")
            message = buffer.value

    finally:
        if error_message_cfstring is not None:
            CoreFoundation.CFRelease(error_message_cfstring)

    # If no message can be found for this status we come
    # up with a generic one that forwards the status code.
    if message is None or message == "":
        message = f"SecureTransport operation returned a non-zero OSStatus: {result}"

    raise ssl.SSLError(message)


Security.SecTrustCreateWithCertificates.errcheck = _handle_osstatus  # type: ignore[assignment]
Security.SecTrustSetAnchorCertificates.errcheck = _handle_osstatus  # type: ignore[assignment]
Security.SecTrustSetAnchorCertificatesOnly.errcheck = _handle_osstatus  # type: ignore[assignment]
Security.SecTrustGetTrustResult.errcheck = _handle_osstatus  # type: ignore[assignment]
Security.SecTrustEvaluate.errcheck = _handle_osstatus  # type: ignore[assignment]


class CFConst:
    """CoreFoundation constants"""

    kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)

    errSecIncompleteCertRevocationCheck = -67635
    errSecHostNameMismatch = -67602
    errSecCertificateExpired = -67818
    errSecNotTrusted = -67843


def _bytes_to_cf_data_ref(value: bytes) -> CFDataRef:  # type: ignore[valid-type]
    return CoreFoundation.CFDataCreate(  # type: ignore[no-any-return]
        CoreFoundation.kCFAllocatorDefault, value, len(value)
    )


def _bytes_to_cf_string(value: bytes) -> CFString:
    """
    Given a Python binary data, create a CFString.
    The string must be CFReleased by the caller.
    """
    c_str = ctypes.c_char_p(value)
    cf_str = CoreFoundation.CFStringCreateWithCString(
        CoreFoundation.kCFAllocatorDefault,
        c_str,
        CFConst.kCFStringEncodingUTF8,
    )
    return cf_str  # type: ignore[no-any-return]


def _cf_string_ref_to_str(cf_string_ref: CFStringRef) -> str | None:  # type: ignore[valid-type]
    """
    Creates a Unicode string from a CFString object. Used entirely for error
    reporting.
    Yes, it annoys me quite a lot that this function is this complex.
    """

    string = CoreFoundation.CFStringGetCStringPtr(
        cf_string_ref, CFConst.kCFStringEncodingUTF8
    )
    if string is None:
        buffer = ctypes.create_string_buffer(1024)
        result = CoreFoundation.CFStringGetCString(
            cf_string_ref, buffer, 1024, CFConst.kCFStringEncodingUTF8
        )
        if not result:
            raise OSError("Error copying C string from CFStringRef")
        string = buffer.value
    if string is not None:
        string = string.decode("utf-8")
    return string  # type: ignore[no-any-return]


def _der_certs_to_cf_cert_array(certs: list[bytes]) -> CFMutableArrayRef:  # type: ignore[valid-type]
    """Builds a CFArray of SecCertificateRefs from a list of DER-encoded certificates.
    Responsibility of the caller to call CoreFoundation.CFRelease on the CFArray.
    """
    cf_array = CoreFoundation.CFArrayCreateMutable(
        CoreFoundation.kCFAllocatorDefault,
        0,
        ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
    )
    if not cf_array:
        raise MemoryError("Unable to allocate memory!")

    for cert_data in certs:
        cf_data = None
        sec_cert_ref = None
        try:
            cf_data = _bytes_to_cf_data_ref(cert_data)
            sec_cert_ref = Security.SecCertificateCreateWithData(
                CoreFoundation.kCFAllocatorDefault, cf_data
            )
            CoreFoundation.CFArrayAppendValue(cf_array, sec_cert_ref)
        finally:
            if cf_data:
                CoreFoundation.CFRelease(cf_data)
            if sec_cert_ref:
                CoreFoundation.CFRelease(sec_cert_ref)

    return cf_array  # type: ignore[no-any-return]


@contextlib.contextmanager
def _configure_context(ctx: ssl.SSLContext) -> typing.Iterator[None]:
    check_hostname = ctx.check_hostname
    verify_mode = ctx.verify_mode
    ctx.check_hostname = False
    _set_ssl_context_verify_mode(ctx, ssl.CERT_NONE)
    try:
        yield
    finally:
        ctx.check_hostname = check_hostname
        _set_ssl_context_verify_mode(ctx, verify_mode)


def _verify_peercerts_impl(
    ssl_context: ssl.SSLContext,
    cert_chain: list[bytes],
    server_hostname: str | None = None,
) -> None:
    certs = None
    policies = None
    trust = None
    try:
        # Only set a hostname on the policy if we're verifying the hostname
        # on the leaf certificate.
        if server_hostname is not None and ssl_context.check_hostname:
            cf_str_hostname = None
            try:
                cf_str_hostname = _bytes_to_cf_string(server_hostname.encode("ascii"))
                ssl_policy = Security.SecPolicyCreateSSL(True, cf_str_hostname)
            finally:
                if cf_str_hostname:
                    CoreFoundation.CFRelease(cf_str_hostname)
        else:
            ssl_policy = Security.SecPolicyCreateSSL(True, None)

        policies = ssl_policy
        if ssl_context.verify_flags & ssl.VERIFY_CRL_CHECK_CHAIN:
            # Add explicit policy requiring positive revocation checks
            policies = CoreFoundation.CFArrayCreateMutable(
                CoreFoundation.kCFAllocatorDefault,
                0,
                ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
            )
            CoreFoundation.CFArrayAppendValue(policies, ssl_policy)
            CoreFoundation.CFRelease(ssl_policy)
            revocation_policy = Security.SecPolicyCreateRevocation(
                kSecRevocationUseAnyAvailableMethod
                | kSecRevocationRequirePositiveResponse
            )
            CoreFoundation.CFArrayAppendValue(policies, revocation_policy)
            CoreFoundation.CFRelease(revocation_policy)
        elif ssl_context.verify_flags & ssl.VERIFY_CRL_CHECK_LEAF:
            raise NotImplementedError("VERIFY_CRL_CHECK_LEAF not implemented for macOS")

        certs = None
        try:
            certs = _der_certs_to_cf_cert_array(cert_chain)

            # Now that we have certificates loaded and a SecPolicy
            # we can finally create a SecTrust object!
            trust = Security.SecTrustRef()
            Security.SecTrustCreateWithCertificates(
                certs, policies, ctypes.byref(trust)
            )

        finally:
            # The certs are now being held by SecTrust so we can
            # release our handles for the array.
            if certs:
                CoreFoundation.CFRelease(certs)

        # If there are additional trust anchors to load we need to transform
        # the list of DER-encoded certificates into a CFArray.
        ctx_ca_certs_der: list[bytes] | None = ssl_context.get_ca_certs(
            binary_form=True
        )
        if ctx_ca_certs_der:
            ctx_ca_certs = None
            try:
                ctx_ca_certs = _der_certs_to_cf_cert_array(ctx_ca_certs_der)
                Security.SecTrustSetAnchorCertificates(trust, ctx_ca_certs)
            finally:
                if ctx_ca_certs:
                    CoreFoundation.CFRelease(ctx_ca_certs)

        # We always want system certificates.
        Security.SecTrustSetAnchorCertificatesOnly(trust, False)

        # macOS 10.13 and earlier don't support SecTrustEvaluateWithError()
        # so we use SecTrustEvaluate() which means we need to construct error
        # messages ourselves.
        if _is_macos_version_10_14_or_later:
            _verify_peercerts_impl_macos_10_14(ssl_context, trust)
        else:
            _verify_peercerts_impl_macos_10_13(ssl_context, trust)
    finally:
        if policies:
            CoreFoundation.CFRelease(policies)
        if trust:
            CoreFoundation.CFRelease(trust)


def _verify_peercerts_impl_macos_10_13(
    ssl_context: ssl.SSLContext, sec_trust_ref: typing.Any
) -> None:
    """Verify using 'SecTrustEvaluate' API for macOS 10.13 and earlier.
    macOS 10.14 added the 'SecTrustEvaluateWithError' API.
    """
    sec_trust_result_type = Security.SecTrustResultType()
    Security.SecTrustEvaluate(sec_trust_ref, ctypes.byref(sec_trust_result_type))

    try:
        sec_trust_result_type_as_int = int(sec_trust_result_type.value)
    except (ValueError, TypeError):
        sec_trust_result_type_as_int = -1

    # Apple doesn't document these values in their own API docs.
    # See: https://github.com/xybp888/iOS-SDKs/blob/master/iPhoneOS13.0.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h#L84
    if (
        ssl_context.verify_mode == ssl.CERT_REQUIRED
        and sec_trust_result_type_as_int not in (1, 4)
    ):
        # Note that we're not able to ignore only hostname errors
        # for macOS 10.13 and earlier, so check_hostname=False will
        # still return an error.
        sec_trust_result_type_to_message = {
            0: "Invalid trust result type",
            # 1: "Trust evaluation succeeded",
            2: "User confirmation required",
            3: "User specified that certificate is not trusted",
            # 4: "Trust result is unspecified",
            5: "Recoverable trust failure occurred",
            6: "Fatal trust failure occurred",
            7: "Other error occurred, certificate may be revoked",
        }
        error_message = sec_trust_result_type_to_message.get(
            sec_trust_result_type_as_int,
            f"Unknown trust result: {sec_trust_result_type_as_int}",
        )

        err = ssl.SSLCertVerificationError(error_message)
        err.verify_message = error_message
        err.verify_code = sec_trust_result_type_as_int
        raise err


def _verify_peercerts_impl_macos_10_14(
    ssl_context: ssl.SSLContext, sec_trust_ref: typing.Any
) -> None:
    """Verify using 'SecTrustEvaluateWithError' API for macOS 10.14+."""
    cf_error = CoreFoundation.CFErrorRef()
    sec_trust_eval_result = Security.SecTrustEvaluateWithError(
        sec_trust_ref, ctypes.byref(cf_error)
    )
    # sec_trust_eval_result is a bool (0 or 1)
    # where 1 means that the certs are trusted.
    if sec_trust_eval_result == 1:
        is_trusted = True
    elif sec_trust_eval_result == 0:
        is_trusted = False
    else:
        raise ssl.SSLError(
            f"Unknown result from Security.SecTrustEvaluateWithError: {sec_trust_eval_result!r}"
        )

    cf_error_code = 0
    if not is_trusted:
        cf_error_code = CoreFoundation.CFErrorGetCode(cf_error)

        # If the error is a known failure that we're
        # explicitly okay with from SSLContext configuration
        # we can set is_trusted accordingly.
        if ssl_context.verify_mode != ssl.CERT_REQUIRED and (
            cf_error_code == CFConst.errSecNotTrusted
            or cf_error_code == CFConst.errSecCertificateExpired
        ):
            is_trusted = True

    # If we're still not trusted then we start to
    # construct and raise the SSLCertVerificationError.
    if not is_trusted:
        cf_error_string_ref = None
        try:
            cf_error_string_ref = CoreFoundation.CFErrorCopyDescription(cf_error)

            # Can this ever return 'None' if there's a CFError?
            cf_error_message = (
                _cf_string_ref_to_str(cf_error_string_ref)
                or "Certificate verification failed"
            )

            # TODO: Not sure if we need the SecTrustResultType for anything?
            # We only care whether or not it's a success or failure for now.
            sec_trust_result_type = Security.SecTrustResultType()
            Security.SecTrustGetTrustResult(
                sec_trust_ref, ctypes.byref(sec_trust_result_type)
            )

            err = ssl.SSLCertVerificationError(cf_error_message)
            err.verify_message = cf_error_message
            err.verify_code = cf_error_code
            raise err
        finally:
            if cf_error_string_ref:
                CoreFoundation.CFRelease(cf_error_string_ref)
572 lines•20 KB
python
.venv/Lib/site-packages/pip/_vendor/requests/cookies.py
Raw Download
Find: Go to:
"""
requests.cookies
~~~~~~~~~~~~~~~~

Compatibility code to be able to use `http.cookiejar.CookieJar` with requests.

requests.utils imports from here, so be careful with imports.
"""

import calendar
import copy
import time

from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse

try:
    import threading
except ImportError:
    import dummy_threading as threading


class MockRequest:
    """Wraps a `requests.Request` 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.
    """

    def __init__(self, request):
        self._r = request
        self._new_headers = {}
        self.type = urlparse(self._r.url).scheme

    def get_type(self):
        return self.type

    def get_host(self):
        return urlparse(self._r.url).netloc

    def get_origin_req_host(self):
        return self.get_host()

    def get_full_url(self):
        # 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):
        return True

    def has_header(self, name):
        return name in self._r.headers or name in self._new_headers

    def get_header(self, name, default=None):
        return self._r.headers.get(name, self._new_headers.get(name, default))

    def add_header(self, key, val):
        """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, value):
        self._new_headers[name] = value

    def get_new_headers(self):
        return self._new_headers

    @property
    def unverifiable(self):
        return self.is_unverifiable()

    @property
    def origin_req_host(self):
        return self.get_origin_req_host()

    @property
    def host(self):
        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):
        """Make a MockResponse for `cookiejar` to read.

        :param headers: a httplib.HTTPMessage or analogous carrying the headers
        """
        self._headers = headers

    def info(self):
        return self._headers

    def getheaders(self, name):
        self._headers.getheaders(name)


def extract_cookies_to_jar(jar, request, response):
    """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)


def get_cookie_header(jar, request):
    """
    Produce an appropriate Cookie header string to be sent with `request`, or None.

    :rtype: str
    """
    r = MockRequest(request)
    jar.add_cookie_header(r)
    return r.get_new_headers().get("Cookie")


def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
    """Unsets a cookie by name, by default over all domains and paths.

    Wraps CookieJar.clear(), is O(n).
    """
    clearables = []
    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(cookielib.CookieJar, MutableMapping):
    """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).
    """

    def get(self, name, default=None, domain=None, path=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, value, **kwargs):
        """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):
        """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):
        """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):
        """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):
        """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):
        """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):
        """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):
        """Utility method to list all the domains in the jar."""
        domains = []
        for cookie in iter(self):
            if cookie.domain not in domains:
                domains.append(cookie.domain)
        return domains

    def list_paths(self):
        """Utility method to list all the paths in the jar."""
        paths = []
        for cookie in iter(self):
            if cookie.path not in paths:
                paths.append(cookie.path)
        return paths

    def multiple_domains(self):
        """Returns True if there are multiple domains in the jar.
        Returns False otherwise.

        :rtype: bool
        """
        domains = []
        for cookie in iter(self):
            if cookie.domain is not None and cookie.domain in domains:
                return True
            domains.append(cookie.domain)
        return False  # there is only one domain in jar

    def get_dict(self, domain=None, path=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 = {}
        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 __contains__(self, name):
        try:
            return super().__contains__(name)
        except CookieConflictError:
            return True

    def __getitem__(self, name):
        """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, value):
        """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):
        """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, *args, **kwargs):
        if (
            hasattr(cookie.value, "startswith")
            and cookie.value.startswith('"')
            and cookie.value.endswith('"')
        ):
            cookie.value = cookie.value.replace('\\"', "")
        return super().set_cookie(cookie, *args, **kwargs)

    def update(self, other):
        """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, domain=None, path=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, domain=None, path=None):
        """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:
            return toReturn
        raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")

    def __getstate__(self):
        """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):
        """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):
        """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):
        """Return the CookiePolicy instance used."""
        return self._policy


def _copy_cookie_jar(jar):
    if jar is None:
        return None

    if hasattr(jar, "copy"):
        # We're dealing with an instance of RequestsCookieJar
        return jar.copy()
    # 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, value, **kwargs):
    """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 = {
        "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):
    """Convert a Morsel object into a Cookie containing the one k/v pair."""

    expires = 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,
    )


def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True):
    """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, cookies):
    """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):
        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):
        try:
            cookiejar.update(cookies)
        except AttributeError:
            for cookie_in_jar in cookies:
                cookiejar.set_cookie(cookie_in_jar)

    return cookiejar
562 lines•18.2 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/layout.py
Raw Download
Find: Go to:
from abc import ABC, abstractmethod
from itertools import islice
from operator import itemgetter
from threading import RLock
from typing import (
    TYPE_CHECKING,
    Dict,
    Iterable,
    List,
    NamedTuple,
    Optional,
    Sequence,
    Tuple,
    Union,
)

from ._ratio import ratio_resolve
from .align import Align
from .console import Console, ConsoleOptions, RenderableType, RenderResult
from .highlighter import ReprHighlighter
from .panel import Panel
from .pretty import Pretty
from .region import Region
from .repr import Result, rich_repr
from .segment import Segment
from .style import StyleType

if TYPE_CHECKING:
    from pip._vendor.rich.tree import Tree


class LayoutRender(NamedTuple):
    """An individual layout render."""

    region: Region
    render: List[List[Segment]]


RegionMap = Dict["Layout", Region]
RenderMap = Dict["Layout", LayoutRender]


class LayoutError(Exception):
    """Layout related error."""


class NoSplitter(LayoutError):
    """Requested splitter does not exist."""


class _Placeholder:
    """An internal renderable used as a Layout placeholder."""

    highlighter = ReprHighlighter()

    def __init__(self, layout: "Layout", style: StyleType = "") -> None:
        self.layout = layout
        self.style = style

    def __rich_console__(
        self, console: Console, options: ConsoleOptions
    ) -> RenderResult:
        width = options.max_width
        height = options.height or options.size.height
        layout = self.layout
        title = (
            f"{layout.name!r} ({width} x {height})"
            if layout.name
            else f"({width} x {height})"
        )
        yield Panel(
            Align.center(Pretty(layout), vertical="middle"),
            style=self.style,
            title=self.highlighter(title),
            border_style="blue",
            height=height,
        )


class Splitter(ABC):
    """Base class for a splitter."""

    name: str = ""

    @abstractmethod
    def get_tree_icon(self) -> str:
        """Get the icon (emoji) used in layout.tree"""

    @abstractmethod
    def divide(
        self, children: Sequence["Layout"], region: Region
    ) -> Iterable[Tuple["Layout", Region]]:
        """Divide a region amongst several child layouts.

        Args:
            children (Sequence(Layout)): A number of child layouts.
            region (Region): A rectangular region to divide.
        """


class RowSplitter(Splitter):
    """Split a layout region in to rows."""

    name = "row"

    def get_tree_icon(self) -> str:
        return "[layout.tree.row]⬌"

    def divide(
        self, children: Sequence["Layout"], region: Region
    ) -> Iterable[Tuple["Layout", Region]]:
        x, y, width, height = region
        render_widths = ratio_resolve(width, children)
        offset = 0
        _Region = Region
        for child, child_width in zip(children, render_widths):
            yield child, _Region(x + offset, y, child_width, height)
            offset += child_width


class ColumnSplitter(Splitter):
    """Split a layout region in to columns."""

    name = "column"

    def get_tree_icon(self) -> str:
        return "[layout.tree.column]⬍"

    def divide(
        self, children: Sequence["Layout"], region: Region
    ) -> Iterable[Tuple["Layout", Region]]:
        x, y, width, height = region
        render_heights = ratio_resolve(height, children)
        offset = 0
        _Region = Region
        for child, child_height in zip(children, render_heights):
            yield child, _Region(x, y + offset, width, child_height)
            offset += child_height


@rich_repr
class Layout:
    """A renderable to divide a fixed height in to rows or columns.

    Args:
        renderable (RenderableType, optional): Renderable content, or None for placeholder. Defaults to None.
        name (str, optional): Optional identifier for Layout. Defaults to None.
        size (int, optional): Optional fixed size of layout. Defaults to None.
        minimum_size (int, optional): Minimum size of layout. Defaults to 1.
        ratio (int, optional): Optional ratio for flexible layout. Defaults to 1.
        visible (bool, optional): Visibility of layout. Defaults to True.
    """

    splitters = {"row": RowSplitter, "column": ColumnSplitter}

    def __init__(
        self,
        renderable: Optional[RenderableType] = None,
        *,
        name: Optional[str] = None,
        size: Optional[int] = None,
        minimum_size: int = 1,
        ratio: int = 1,
        visible: bool = True,
    ) -> None:
        self._renderable = renderable or _Placeholder(self)
        self.size = size
        self.minimum_size = minimum_size
        self.ratio = ratio
        self.name = name
        self.visible = visible
        self.splitter: Splitter = self.splitters["column"]()
        self._children: List[Layout] = []
        self._render_map: RenderMap = {}
        self._lock = RLock()

    def __rich_repr__(self) -> Result:
        yield "name", self.name, None
        yield "size", self.size, None
        yield "minimum_size", self.minimum_size, 1
        yield "ratio", self.ratio, 1

    @property
    def renderable(self) -> RenderableType:
        """Layout renderable."""
        return self if self._children else self._renderable

    @property
    def children(self) -> List["Layout"]:
        """Gets (visible) layout children."""
        return [child for child in self._children if child.visible]

    @property
    def map(self) -> RenderMap:
        """Get a map of the last render."""
        return self._render_map

    def get(self, name: str) -> Optional["Layout"]:
        """Get a named layout, or None if it doesn't exist.

        Args:
            name (str): Name of layout.

        Returns:
            Optional[Layout]: Layout instance or None if no layout was found.
        """
        if self.name == name:
            return self
        else:
            for child in self._children:
                named_layout = child.get(name)
                if named_layout is not None:
                    return named_layout
        return None

    def __getitem__(self, name: str) -> "Layout":
        layout = self.get(name)
        if layout is None:
            raise KeyError(f"No layout with name {name!r}")
        return layout

    @property
    def tree(self) -> "Tree":
        """Get a tree renderable to show layout structure."""
        from pip._vendor.rich.styled import Styled
        from pip._vendor.rich.table import Table
        from pip._vendor.rich.tree import Tree

        def summary(layout: "Layout") -> Table:
            icon = layout.splitter.get_tree_icon()

            table = Table.grid(padding=(0, 1, 0, 0))

            text: RenderableType = (
                Pretty(layout) if layout.visible else Styled(Pretty(layout), "dim")
            )
            table.add_row(icon, text)
            _summary = table
            return _summary

        layout = self
        tree = Tree(
            summary(layout),
            guide_style=f"layout.tree.{layout.splitter.name}",
            highlight=True,
        )

        def recurse(tree: "Tree", layout: "Layout") -> None:
            for child in layout._children:
                recurse(
                    tree.add(
                        summary(child),
                        guide_style=f"layout.tree.{child.splitter.name}",
                    ),
                    child,
                )

        recurse(tree, self)
        return tree

    def split(
        self,
        *layouts: Union["Layout", RenderableType],
        splitter: Union[Splitter, str] = "column",
    ) -> None:
        """Split the layout in to multiple sub-layouts.

        Args:
            *layouts (Layout): Positional arguments should be (sub) Layout instances.
            splitter (Union[Splitter, str]): Splitter instance or name of splitter.
        """
        _layouts = [
            layout if isinstance(layout, Layout) else Layout(layout)
            for layout in layouts
        ]
        try:
            self.splitter = (
                splitter
                if isinstance(splitter, Splitter)
                else self.splitters[splitter]()
            )
        except KeyError:
            raise NoSplitter(f"No splitter called {splitter!r}")
        self._children[:] = _layouts

    def add_split(self, *layouts: Union["Layout", RenderableType]) -> None:
        """Add a new layout(s) to existing split.

        Args:
            *layouts (Union[Layout, RenderableType]): Positional arguments should be renderables or (sub) Layout instances.

        """
        _layouts = (
            layout if isinstance(layout, Layout) else Layout(layout)
            for layout in layouts
        )
        self._children.extend(_layouts)

    def split_row(self, *layouts: Union["Layout", RenderableType]) -> None:
        """Split the layout in to a row (layouts side by side).

        Args:
            *layouts (Layout): Positional arguments should be (sub) Layout instances.
        """
        self.split(*layouts, splitter="row")

    def split_column(self, *layouts: Union["Layout", RenderableType]) -> None:
        """Split the layout in to a column (layouts stacked on top of each other).

        Args:
            *layouts (Layout): Positional arguments should be (sub) Layout instances.
        """
        self.split(*layouts, splitter="column")

    def unsplit(self) -> None:
        """Reset splits to initial state."""
        del self._children[:]

    def update(self, renderable: RenderableType) -> None:
        """Update renderable.

        Args:
            renderable (RenderableType): New renderable object.
        """
        with self._lock:
            self._renderable = renderable

    def refresh_screen(self, console: "Console", layout_name: str) -> None:
        """Refresh a sub-layout.

        Args:
            console (Console): Console instance where Layout is to be rendered.
            layout_name (str): Name of layout.
        """
        with self._lock:
            layout = self[layout_name]
            region, _lines = self._render_map[layout]
            (x, y, width, height) = region
            lines = console.render_lines(
                layout, console.options.update_dimensions(width, height)
            )
            self._render_map[layout] = LayoutRender(region, lines)
            console.update_screen_lines(lines, x, y)

    def _make_region_map(self, width: int, height: int) -> RegionMap:
        """Create a dict that maps layout on to Region."""
        stack: List[Tuple[Layout, Region]] = [(self, Region(0, 0, width, height))]
        push = stack.append
        pop = stack.pop
        layout_regions: List[Tuple[Layout, Region]] = []
        append_layout_region = layout_regions.append
        while stack:
            append_layout_region(pop())
            layout, region = layout_regions[-1]
            children = layout.children
            if children:
                for child_and_region in layout.splitter.divide(children, region):
                    push(child_and_region)

        region_map = {
            layout: region
            for layout, region in sorted(layout_regions, key=itemgetter(1))
        }
        return region_map

    def render(self, console: Console, options: ConsoleOptions) -> RenderMap:
        """Render the sub_layouts.

        Args:
            console (Console): Console instance.
            options (ConsoleOptions): Console options.

        Returns:
            RenderMap: A dict that maps Layout on to a tuple of Region, lines
        """
        render_width = options.max_width
        render_height = options.height or console.height
        region_map = self._make_region_map(render_width, render_height)
        layout_regions = [
            (layout, region)
            for layout, region in region_map.items()
            if not layout.children
        ]
        render_map: Dict["Layout", "LayoutRender"] = {}
        render_lines = console.render_lines
        update_dimensions = options.update_dimensions

        for layout, region in layout_regions:
            lines = render_lines(
                layout.renderable, update_dimensions(region.width, region.height)
            )
            render_map[layout] = LayoutRender(region, lines)
        return render_map

    def __rich_console__(
        self, console: Console, options: ConsoleOptions
    ) -> RenderResult:
        with self._lock:
            width = options.max_width or console.width
            height = options.height or console.height
            render_map = self.render(console, options.update_dimensions(width, height))
            self._render_map = render_map
            layout_lines: List[List[Segment]] = [[] for _ in range(height)]
            _islice = islice
            for region, lines in render_map.values():
                _x, y, _layout_width, layout_height = region
                for row, line in zip(
                    _islice(layout_lines, y, y + layout_height), lines
                ):
                    row.extend(line)

            new_line = Segment.line()
            for layout_row in layout_lines:
                yield from layout_row
                yield new_line


if __name__ == "__main__":
    from pip._vendor.rich.console import Console

    console = Console()
    layout = Layout()

    layout.split_column(
        Layout(name="header", size=3),
        Layout(ratio=1, name="main"),
        Layout(size=10, name="footer"),
    )

    layout["main"].split_row(Layout(name="side"), Layout(name="body", ratio=2))

    layout["body"].split_row(Layout(name="content", ratio=2), Layout(name="s2"))

    layout["s2"].split_column(
        Layout(name="top"), Layout(name="middle"), Layout(name="bottom")
    )

    layout["side"].split_column(Layout(layout.tree, name="left1"), Layout(name="left2"))

    layout["content"].update("foo")

    console.print(layout)
443 lines•13.7 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/constrain.py
Raw Download
Find: Go to:
from typing import Optional, TYPE_CHECKING

from .jupyter import JupyterMixin
from .measure import Measurement

if TYPE_CHECKING:
    from .console import Console, ConsoleOptions, RenderableType, RenderResult


class Constrain(JupyterMixin):
    """Constrain the width of a renderable to a given number of characters.

    Args:
        renderable (RenderableType): A renderable object.
        width (int, optional): The maximum width (in characters) to render. Defaults to 80.
    """

    def __init__(self, renderable: "RenderableType", width: Optional[int] = 80) -> None:
        self.renderable = renderable
        self.width = width

    def __rich_console__(
        self, console: "Console", options: "ConsoleOptions"
    ) -> "RenderResult":
        if self.width is None:
            yield self.renderable
        else:
            child_options = options.update_width(min(self.width, options.max_width))
            yield from console.render(self.renderable, child_options)

    def __rich_measure__(
        self, console: "Console", options: "ConsoleOptions"
    ) -> "Measurement":
        if self.width is not None:
            options = options.update_width(self.width)
        measurement = Measurement.get(console, options, self.renderable)
        return measurement
38 lines•1.3 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/ansi.py
Raw Download
Find: Go to:
import re
import sys
from contextlib import suppress
from typing import Iterable, NamedTuple, Optional

from .color import Color
from .style import Style
from .text import Text

re_ansi = re.compile(
    r"""
(?:\x1b\](.*?)\x1b\\)|
(?:\x1b([(@-Z\\-_]|\[[0-?]*[ -/]*[@-~]))
""",
    re.VERBOSE,
)


class _AnsiToken(NamedTuple):
    """Result of ansi tokenized string."""

    plain: str = ""
    sgr: Optional[str] = ""
    osc: Optional[str] = ""


def _ansi_tokenize(ansi_text: str) -> Iterable[_AnsiToken]:
    """Tokenize a string in to plain text and ANSI codes.

    Args:
        ansi_text (str): A String containing ANSI codes.

    Yields:
        AnsiToken: A named tuple of (plain, sgr, osc)
    """

    position = 0
    sgr: Optional[str]
    osc: Optional[str]
    for match in re_ansi.finditer(ansi_text):
        start, end = match.span(0)
        osc, sgr = match.groups()
        if start > position:
            yield _AnsiToken(ansi_text[position:start])
        if sgr:
            if sgr == "(":
                position = end + 1
                continue
            if sgr.endswith("m"):
                yield _AnsiToken("", sgr[1:-1], osc)
        else:
            yield _AnsiToken("", sgr, osc)
        position = end
    if position < len(ansi_text):
        yield _AnsiToken(ansi_text[position:])


SGR_STYLE_MAP = {
    1: "bold",
    2: "dim",
    3: "italic",
    4: "underline",
    5: "blink",
    6: "blink2",
    7: "reverse",
    8: "conceal",
    9: "strike",
    21: "underline2",
    22: "not dim not bold",
    23: "not italic",
    24: "not underline",
    25: "not blink",
    26: "not blink2",
    27: "not reverse",
    28: "not conceal",
    29: "not strike",
    30: "color(0)",
    31: "color(1)",
    32: "color(2)",
    33: "color(3)",
    34: "color(4)",
    35: "color(5)",
    36: "color(6)",
    37: "color(7)",
    39: "default",
    40: "on color(0)",
    41: "on color(1)",
    42: "on color(2)",
    43: "on color(3)",
    44: "on color(4)",
    45: "on color(5)",
    46: "on color(6)",
    47: "on color(7)",
    49: "on default",
    51: "frame",
    52: "encircle",
    53: "overline",
    54: "not frame not encircle",
    55: "not overline",
    90: "color(8)",
    91: "color(9)",
    92: "color(10)",
    93: "color(11)",
    94: "color(12)",
    95: "color(13)",
    96: "color(14)",
    97: "color(15)",
    100: "on color(8)",
    101: "on color(9)",
    102: "on color(10)",
    103: "on color(11)",
    104: "on color(12)",
    105: "on color(13)",
    106: "on color(14)",
    107: "on color(15)",
}


class AnsiDecoder:
    """Translate ANSI code in to styled Text."""

    def __init__(self) -> None:
        self.style = Style.null()

    def decode(self, terminal_text: str) -> Iterable[Text]:
        """Decode ANSI codes in an iterable of lines.

        Args:
            lines (Iterable[str]): An iterable of lines of terminal output.

        Yields:
            Text: Marked up Text.
        """
        for line in terminal_text.splitlines():
            yield self.decode_line(line)

    def decode_line(self, line: str) -> Text:
        """Decode a line containing ansi codes.

        Args:
            line (str): A line of terminal output.

        Returns:
            Text: A Text instance marked up according to ansi codes.
        """
        from_ansi = Color.from_ansi
        from_rgb = Color.from_rgb
        _Style = Style
        text = Text()
        append = text.append
        line = line.rsplit("\r", 1)[-1]
        for plain_text, sgr, osc in _ansi_tokenize(line):
            if plain_text:
                append(plain_text, self.style or None)
            elif osc is not None:
                if osc.startswith("8;"):
                    _params, semicolon, link = osc[2:].partition(";")
                    if semicolon:
                        self.style = self.style.update_link(link or None)
            elif sgr is not None:
                # Translate in to semi-colon separated codes
                # Ignore invalid codes, because we want to be lenient
                codes = [
                    min(255, int(_code) if _code else 0)
                    for _code in sgr.split(";")
                    if _code.isdigit() or _code == ""
                ]
                iter_codes = iter(codes)
                for code in iter_codes:
                    if code == 0:
                        # reset
                        self.style = _Style.null()
                    elif code in SGR_STYLE_MAP:
                        # styles
                        self.style += _Style.parse(SGR_STYLE_MAP[code])
                    elif code == 38:
                        #  Foreground
                        with suppress(StopIteration):
                            color_type = next(iter_codes)
                            if color_type == 5:
                                self.style += _Style.from_color(
                                    from_ansi(next(iter_codes))
                                )
                            elif color_type == 2:
                                self.style += _Style.from_color(
                                    from_rgb(
                                        next(iter_codes),
                                        next(iter_codes),
                                        next(iter_codes),
                                    )
                                )
                    elif code == 48:
                        # Background
                        with suppress(StopIteration):
                            color_type = next(iter_codes)
                            if color_type == 5:
                                self.style += _Style.from_color(
                                    None, from_ansi(next(iter_codes))
                                )
                            elif color_type == 2:
                                self.style += _Style.from_color(
                                    None,
                                    from_rgb(
                                        next(iter_codes),
                                        next(iter_codes),
                                        next(iter_codes),
                                    ),
                                )

        return text


if sys.platform != "win32" and __name__ == "__main__":  # pragma: no cover
    import io
    import os
    import pty
    import sys

    decoder = AnsiDecoder()

    stdout = io.BytesIO()

    def read(fd: int) -> bytes:
        data = os.read(fd, 1024)
        stdout.write(data)
        return data

    pty.spawn(sys.argv[1:], read)

    from .console import Console

    console = Console(record=True)

    stdout_result = stdout.getvalue().decode("utf-8")
    print(stdout_result)

    for line in decoder.decode(stdout_result):
        console.print(line)

    console.save_html("stdout.html")
241 lines•6.7 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/prompt.py
Raw Download
Find: Go to:
from typing import Any, Generic, List, Optional, TextIO, TypeVar, Union, overload

from . import get_console
from .console import Console
from .text import Text, TextType

PromptType = TypeVar("PromptType")
DefaultType = TypeVar("DefaultType")


class PromptError(Exception):
    """Exception base class for prompt related errors."""


class InvalidResponse(PromptError):
    """Exception to indicate a response was invalid. Raise this within process_response() to indicate an error
    and provide an error message.

    Args:
        message (Union[str, Text]): Error message.
    """

    def __init__(self, message: TextType) -> None:
        self.message = message

    def __rich__(self) -> TextType:
        return self.message


class PromptBase(Generic[PromptType]):
    """Ask the user for input until a valid response is received. This is the base class, see one of
    the concrete classes for examples.

    Args:
        prompt (TextType, optional): Prompt text. Defaults to "".
        console (Console, optional): A Console instance or None to use global console. Defaults to None.
        password (bool, optional): Enable password input. Defaults to False.
        choices (List[str], optional): A list of valid choices. Defaults to None.
        show_default (bool, optional): Show default in prompt. Defaults to True.
        show_choices (bool, optional): Show choices in prompt. Defaults to True.
    """

    response_type: type = str

    validate_error_message = "[prompt.invalid]Please enter a valid value"
    illegal_choice_message = (
        "[prompt.invalid.choice]Please select one of the available options"
    )
    prompt_suffix = ": "

    choices: Optional[List[str]] = None

    def __init__(
        self,
        prompt: TextType = "",
        *,
        console: Optional[Console] = None,
        password: bool = False,
        choices: Optional[List[str]] = None,
        show_default: bool = True,
        show_choices: bool = True,
    ) -> None:
        self.console = console or get_console()
        self.prompt = (
            Text.from_markup(prompt, style="prompt")
            if isinstance(prompt, str)
            else prompt
        )
        self.password = password
        if choices is not None:
            self.choices = choices
        self.show_default = show_default
        self.show_choices = show_choices

    @classmethod
    @overload
    def ask(
        cls,
        prompt: TextType = "",
        *,
        console: Optional[Console] = None,
        password: bool = False,
        choices: Optional[List[str]] = None,
        show_default: bool = True,
        show_choices: bool = True,
        default: DefaultType,
        stream: Optional[TextIO] = None,
    ) -> Union[DefaultType, PromptType]:
        ...

    @classmethod
    @overload
    def ask(
        cls,
        prompt: TextType = "",
        *,
        console: Optional[Console] = None,
        password: bool = False,
        choices: Optional[List[str]] = None,
        show_default: bool = True,
        show_choices: bool = True,
        stream: Optional[TextIO] = None,
    ) -> PromptType:
        ...

    @classmethod
    def ask(
        cls,
        prompt: TextType = "",
        *,
        console: Optional[Console] = None,
        password: bool = False,
        choices: Optional[List[str]] = None,
        show_default: bool = True,
        show_choices: bool = True,
        default: Any = ...,
        stream: Optional[TextIO] = None,
    ) -> Any:
        """Shortcut to construct and run a prompt loop and return the result.

        Example:
            >>> filename = Prompt.ask("Enter a filename")

        Args:
            prompt (TextType, optional): Prompt text. Defaults to "".
            console (Console, optional): A Console instance or None to use global console. Defaults to None.
            password (bool, optional): Enable password input. Defaults to False.
            choices (List[str], optional): A list of valid choices. Defaults to None.
            show_default (bool, optional): Show default in prompt. Defaults to True.
            show_choices (bool, optional): Show choices in prompt. Defaults to True.
            stream (TextIO, optional): Optional text file open for reading to get input. Defaults to None.
        """
        _prompt = cls(
            prompt,
            console=console,
            password=password,
            choices=choices,
            show_default=show_default,
            show_choices=show_choices,
        )
        return _prompt(default=default, stream=stream)

    def render_default(self, default: DefaultType) -> Text:
        """Turn the supplied default in to a Text instance.

        Args:
            default (DefaultType): Default value.

        Returns:
            Text: Text containing rendering of default value.
        """
        return Text(f"({default})", "prompt.default")

    def make_prompt(self, default: DefaultType) -> Text:
        """Make prompt text.

        Args:
            default (DefaultType): Default value.

        Returns:
            Text: Text to display in prompt.
        """
        prompt = self.prompt.copy()
        prompt.end = ""

        if self.show_choices and self.choices:
            _choices = "/".join(self.choices)
            choices = f"[{_choices}]"
            prompt.append(" ")
            prompt.append(choices, "prompt.choices")

        if (
            default != ...
            and self.show_default
            and isinstance(default, (str, self.response_type))
        ):
            prompt.append(" ")
            _default = self.render_default(default)
            prompt.append(_default)

        prompt.append(self.prompt_suffix)

        return prompt

    @classmethod
    def get_input(
        cls,
        console: Console,
        prompt: TextType,
        password: bool,
        stream: Optional[TextIO] = None,
    ) -> str:
        """Get input from user.

        Args:
            console (Console): Console instance.
            prompt (TextType): Prompt text.
            password (bool): Enable password entry.

        Returns:
            str: String from user.
        """
        return console.input(prompt, password=password, stream=stream)

    def check_choice(self, value: str) -> bool:
        """Check value is in the list of valid choices.

        Args:
            value (str): Value entered by user.

        Returns:
            bool: True if choice was valid, otherwise False.
        """
        assert self.choices is not None
        return value.strip() in self.choices

    def process_response(self, value: str) -> PromptType:
        """Process response from user, convert to prompt type.

        Args:
            value (str): String typed by user.

        Raises:
            InvalidResponse: If ``value`` is invalid.

        Returns:
            PromptType: The value to be returned from ask method.
        """
        value = value.strip()
        try:
            return_value: PromptType = self.response_type(value)
        except ValueError:
            raise InvalidResponse(self.validate_error_message)

        if self.choices is not None and not self.check_choice(value):
            raise InvalidResponse(self.illegal_choice_message)

        return return_value

    def on_validate_error(self, value: str, error: InvalidResponse) -> None:
        """Called to handle validation error.

        Args:
            value (str): String entered by user.
            error (InvalidResponse): Exception instance the initiated the error.
        """
        self.console.print(error)

    def pre_prompt(self) -> None:
        """Hook to display something before the prompt."""

    @overload
    def __call__(self, *, stream: Optional[TextIO] = None) -> PromptType:
        ...

    @overload
    def __call__(
        self, *, default: DefaultType, stream: Optional[TextIO] = None
    ) -> Union[PromptType, DefaultType]:
        ...

    def __call__(self, *, default: Any = ..., stream: Optional[TextIO] = None) -> Any:
        """Run the prompt loop.

        Args:
            default (Any, optional): Optional default value.

        Returns:
            PromptType: Processed value.
        """
        while True:
            self.pre_prompt()
            prompt = self.make_prompt(default)
            value = self.get_input(self.console, prompt, self.password, stream=stream)
            if value == "" and default != ...:
                return default
            try:
                return_value = self.process_response(value)
            except InvalidResponse as error:
                self.on_validate_error(value, error)
                continue
            else:
                return return_value


class Prompt(PromptBase[str]):
    """A prompt that returns a str.

    Example:
        >>> name = Prompt.ask("Enter your name")


    """

    response_type = str


class IntPrompt(PromptBase[int]):
    """A prompt that returns an integer.

    Example:
        >>> burrito_count = IntPrompt.ask("How many burritos do you want to order")

    """

    response_type = int
    validate_error_message = "[prompt.invalid]Please enter a valid integer number"


class FloatPrompt(PromptBase[float]):
    """A prompt that returns a float.

    Example:
        >>> temperature = FloatPrompt.ask("Enter desired temperature")

    """

    response_type = float
    validate_error_message = "[prompt.invalid]Please enter a number"


class Confirm(PromptBase[bool]):
    """A yes / no confirmation prompt.

    Example:
        >>> if Confirm.ask("Continue"):
                run_job()

    """

    response_type = bool
    validate_error_message = "[prompt.invalid]Please enter Y or N"
    choices: List[str] = ["y", "n"]

    def render_default(self, default: DefaultType) -> Text:
        """Render the default as (y) or (n) rather than True/False."""
        yes, no = self.choices
        return Text(f"({yes})" if default else f"({no})", style="prompt.default")

    def process_response(self, value: str) -> bool:
        """Convert choices to a bool."""
        value = value.strip().lower()
        if value not in self.choices:
            raise InvalidResponse(self.validate_error_message)
        return value == self.choices[0]


if __name__ == "__main__":  # pragma: no cover
    from pip._vendor.rich import print

    if Confirm.ask("Run [i]prompt[/i] tests?", default=True):
        while True:
            result = IntPrompt.ask(
                ":rocket: Enter a number between [b]1[/b] and [b]10[/b]", default=5
            )
            if result >= 1 and result <= 10:
                break
            print(":pile_of_poo: [prompt.invalid]Number must be between 1 and 10")
        print(f"number={result}")

        while True:
            password = Prompt.ask(
                "Please enter a password [cyan](must be at least 5 characters)",
                password=True,
            )
            if len(password) >= 5:
                break
            print("[prompt.invalid]password too short")
        print(f"password={password!r}")

        fruit = Prompt.ask("Enter a fruit", choices=["apple", "orange", "pear"])
        print(f"fruit={fruit!r}")

    else:
        print("[b]OK :loudly_crying_face:")
376 lines•11 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/diagnose.py
Raw Download
Find: Go to:
import os
import platform

from pip._vendor.rich import inspect
from pip._vendor.rich.console import Console, get_windows_console_features
from pip._vendor.rich.panel import Panel
from pip._vendor.rich.pretty import Pretty


def report() -> None:  # pragma: no cover
    """Print a report to the terminal with debugging information"""
    console = Console()
    inspect(console)
    features = get_windows_console_features()
    inspect(features)

    env_names = (
        "TERM",
        "COLORTERM",
        "CLICOLOR",
        "NO_COLOR",
        "TERM_PROGRAM",
        "COLUMNS",
        "LINES",
        "JUPYTER_COLUMNS",
        "JUPYTER_LINES",
        "JPY_PARENT_PID",
        "VSCODE_VERBOSE_LOGGING",
    )
    env = {name: os.getenv(name) for name in env_names}
    console.print(Panel.fit((Pretty(env)), title="[b]Environment Variables"))

    console.print(f'platform="{platform.system()}"')


if __name__ == "__main__":  # pragma: no cover
    report()
38 lines•972 B
python
.venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py
Raw Download
Find: Go to:
EMOJI = {
    "1st_place_medal": "🥇",
    "2nd_place_medal": "🥈",
    "3rd_place_medal": "🥉",
    "ab_button_(blood_type)": "🆎",
    "atm_sign": "🏧",
    "a_button_(blood_type)": "🅰",
    "afghanistan": "🇦🇫",
    "albania": "🇦🇱",
    "algeria": "🇩🇿",
    "american_samoa": "🇦🇸",
    "andorra": "🇦🇩",
    "angola": "🇦🇴",
    "anguilla": "🇦🇮",
    "antarctica": "🇦🇶",
    "antigua_&_barbuda": "🇦🇬",
    "aquarius": "♒",
    "argentina": "🇦🇷",
    "aries": "♈",
    "armenia": "🇦🇲",
    "aruba": "🇦🇼",
    "ascension_island": "🇦🇨",
    "australia": "🇦🇺",
    "austria": "🇦🇹",
    "azerbaijan": "🇦🇿",
    "back_arrow": "🔙",
    "b_button_(blood_type)": "🅱",
    "bahamas": "🇧🇸",
    "bahrain": "🇧🇭",
    "bangladesh": "🇧🇩",
    "barbados": "🇧🇧",
    "belarus": "🇧🇾",
    "belgium": "🇧🇪",
    "belize": "🇧🇿",
    "benin": "🇧🇯",
    "bermuda": "🇧🇲",
    "bhutan": "🇧🇹",
    "bolivia": "🇧🇴",
    "bosnia_&_herzegovina": "🇧🇦",
    "botswana": "🇧🇼",
    "bouvet_island": "🇧🇻",
    "brazil": "🇧🇷",
    "british_indian_ocean_territory": "🇮🇴",
    "british_virgin_islands": "🇻🇬",
    "brunei": "🇧🇳",
    "bulgaria": "🇧🇬",
    "burkina_faso": "🇧🇫",
    "burundi": "🇧🇮",
    "cl_button": "🆑",
    "cool_button": "🆒",
    "cambodia": "🇰🇭",
    "cameroon": "🇨🇲",
    "canada": "🇨🇦",
    "canary_islands": "🇮🇨",
    "cancer": "♋",
    "cape_verde": "🇨🇻",
    "capricorn": "♑",
    "caribbean_netherlands": "🇧🇶",
    "cayman_islands": "🇰🇾",
    "central_african_republic": "🇨🇫",
    "ceuta_&_melilla": "🇪🇦",
    "chad": "🇹🇩",
    "chile": "🇨🇱",
    "china": "🇨🇳",
    "christmas_island": "🇨🇽",
    "christmas_tree": "🎄",
    "clipperton_island": "🇨🇵",
    "cocos_(keeling)_islands": "🇨🇨",
    "colombia": "🇨🇴",
    "comoros": "🇰🇲",
    "congo_-_brazzaville": "🇨🇬",
    "congo_-_kinshasa": "🇨🇩",
    "cook_islands": "🇨🇰",
    "costa_rica": "🇨🇷",
    "croatia": "🇭🇷",
    "cuba": "🇨🇺",
    "curaçao": "🇨🇼",
    "cyprus": "🇨🇾",
    "czechia": "🇨🇿",
    "côte_d’ivoire": "🇨🇮",
    "denmark": "🇩🇰",
    "diego_garcia": "🇩🇬",
    "djibouti": "🇩🇯",
    "dominica": "🇩🇲",
    "dominican_republic": "🇩🇴",
    "end_arrow": "🔚",
    "ecuador": "🇪🇨",
    "egypt": "🇪🇬",
    "el_salvador": "🇸🇻",
    "england": "🏴\U000e0067\U000e0062\U000e0065\U000e006e\U000e0067\U000e007f",
    "equatorial_guinea": "🇬🇶",
    "eritrea": "🇪🇷",
    "estonia": "🇪🇪",
    "ethiopia": "🇪🇹",
    "european_union": "🇪🇺",
    "free_button": "🆓",
    "falkland_islands": "🇫🇰",
    "faroe_islands": "🇫🇴",
    "fiji": "🇫🇯",
    "finland": "🇫🇮",
    "france": "🇫🇷",
    "french_guiana": "🇬🇫",
    "french_polynesia": "🇵🇫",
    "french_southern_territories": "🇹🇫",
    "gabon": "🇬🇦",
    "gambia": "🇬🇲",
    "gemini": "♊",
    "georgia": "🇬🇪",
    "germany": "🇩🇪",
    "ghana": "🇬🇭",
    "gibraltar": "🇬🇮",
    "greece": "🇬🇷",
    "greenland": "🇬🇱",
    "grenada": "🇬🇩",
    "guadeloupe": "🇬🇵",
    "guam": "🇬🇺",
    "guatemala": "🇬🇹",
    "guernsey": "🇬🇬",
    "guinea": "🇬🇳",
    "guinea-bissau": "🇬🇼",
    "guyana": "🇬🇾",
    "haiti": "🇭🇹",
    "heard_&_mcdonald_islands": "🇭🇲",
    "honduras": "🇭🇳",
    "hong_kong_sar_china": "🇭🇰",
    "hungary": "🇭🇺",
    "id_button": "🆔",
    "iceland": "🇮🇸",
    "india": "🇮🇳",
    "indonesia": "🇮🇩",
    "iran": "🇮🇷",
    "iraq": "🇮🇶",
    "ireland": "🇮🇪",
    "isle_of_man": "🇮🇲",
    "israel": "🇮🇱",
    "italy": "🇮🇹",
    "jamaica": "🇯🇲",
    "japan": "🗾",
    "japanese_acceptable_button": "🉑",
    "japanese_application_button": "🈸",
    "japanese_bargain_button": "🉐",
    "japanese_castle": "🏯",
    "japanese_congratulations_button": "㊗",
    "japanese_discount_button": "🈹",
    "japanese_dolls": "🎎",
    "japanese_free_of_charge_button": "🈚",
    "japanese_here_button": "🈁",
    "japanese_monthly_amount_button": "🈷",
    "japanese_no_vacancy_button": "🈵",
    "japanese_not_free_of_charge_button": "🈶",
    "japanese_open_for_business_button": "🈺",
    "japanese_passing_grade_button": "🈴",
    "japanese_post_office": "🏣",
    "japanese_prohibited_button": "🈲",
    "japanese_reserved_button": "🈯",
    "japanese_secret_button": "㊙",
    "japanese_service_charge_button": "🈂",
    "japanese_symbol_for_beginner": "🔰",
    "japanese_vacancy_button": "🈳",
    "jersey": "🇯🇪",
    "jordan": "🇯🇴",
    "kazakhstan": "🇰🇿",
    "kenya": "🇰🇪",
    "kiribati": "🇰🇮",
    "kosovo": "🇽🇰",
    "kuwait": "🇰🇼",
    "kyrgyzstan": "🇰🇬",
    "laos": "🇱🇦",
    "latvia": "🇱🇻",
    "lebanon": "🇱🇧",
    "leo": "♌",
    "lesotho": "🇱🇸",
    "liberia": "🇱🇷",
    "libra": "♎",
    "libya": "🇱🇾",
    "liechtenstein": "🇱🇮",
    "lithuania": "🇱🇹",
    "luxembourg": "🇱🇺",
    "macau_sar_china": "🇲🇴",
    "macedonia": "🇲🇰",
    "madagascar": "🇲🇬",
    "malawi": "🇲🇼",
    "malaysia": "🇲🇾",
    "maldives": "🇲🇻",
    "mali": "🇲🇱",
    "malta": "🇲🇹",
    "marshall_islands": "🇲🇭",
    "martinique": "🇲🇶",
    "mauritania": "🇲🇷",
    "mauritius": "🇲🇺",
    "mayotte": "🇾🇹",
    "mexico": "🇲🇽",
    "micronesia": "🇫🇲",
    "moldova": "🇲🇩",
    "monaco": "🇲🇨",
    "mongolia": "🇲🇳",
    "montenegro": "🇲🇪",
    "montserrat": "🇲🇸",
    "morocco": "🇲🇦",
    "mozambique": "🇲🇿",
    "mrs._claus": "🤶",
    "mrs._claus_dark_skin_tone": "🤶🏿",
    "mrs._claus_light_skin_tone": "🤶🏻",
    "mrs._claus_medium-dark_skin_tone": "🤶🏾",
    "mrs._claus_medium-light_skin_tone": "🤶🏼",
    "mrs._claus_medium_skin_tone": "🤶🏽",
    "myanmar_(burma)": "🇲🇲",
    "new_button": "🆕",
    "ng_button": "🆖",
    "namibia": "🇳🇦",
    "nauru": "🇳🇷",
    "nepal": "🇳🇵",
    "netherlands": "🇳🇱",
    "new_caledonia": "🇳🇨",
    "new_zealand": "🇳🇿",
    "nicaragua": "🇳🇮",
    "niger": "🇳🇪",
    "nigeria": "🇳🇬",
    "niue": "🇳🇺",
    "norfolk_island": "🇳🇫",
    "north_korea": "🇰🇵",
    "northern_mariana_islands": "🇲🇵",
    "norway": "🇳🇴",
    "ok_button": "🆗",
    "ok_hand": "👌",
    "ok_hand_dark_skin_tone": "👌🏿",
    "ok_hand_light_skin_tone": "👌🏻",
    "ok_hand_medium-dark_skin_tone": "👌🏾",
    "ok_hand_medium-light_skin_tone": "👌🏼",
    "ok_hand_medium_skin_tone": "👌🏽",
    "on!_arrow": "🔛",
    "o_button_(blood_type)": "🅾",
    "oman": "🇴🇲",
    "ophiuchus": "⛎",
    "p_button": "🅿",
    "pakistan": "🇵🇰",
    "palau": "🇵🇼",
    "palestinian_territories": "🇵🇸",
    "panama": "🇵🇦",
    "papua_new_guinea": "🇵🇬",
    "paraguay": "🇵🇾",
    "peru": "🇵🇪",
    "philippines": "🇵🇭",
    "pisces": "♓",
    "pitcairn_islands": "🇵🇳",
    "poland": "🇵🇱",
    "portugal": "🇵🇹",
    "puerto_rico": "🇵🇷",
    "qatar": "🇶🇦",
    "romania": "🇷🇴",
    "russia": "🇷🇺",
    "rwanda": "🇷🇼",
    "réunion": "🇷🇪",
    "soon_arrow": "🔜",
    "sos_button": "🆘",
    "sagittarius": "♐",
    "samoa": "🇼🇸",
    "san_marino": "🇸🇲",
    "santa_claus": "🎅",
    "santa_claus_dark_skin_tone": "🎅🏿",
    "santa_claus_light_skin_tone": "🎅🏻",
    "santa_claus_medium-dark_skin_tone": "🎅🏾",
    "santa_claus_medium-light_skin_tone": "🎅🏼",
    "santa_claus_medium_skin_tone": "🎅🏽",
    "saudi_arabia": "🇸🇦",
    "scorpio": "♏",
    "scotland": "🏴\U000e0067\U000e0062\U000e0073\U000e0063\U000e0074\U000e007f",
    "senegal": "🇸🇳",
    "serbia": "🇷🇸",
    "seychelles": "🇸🇨",
    "sierra_leone": "🇸🇱",
    "singapore": "🇸🇬",
    "sint_maarten": "🇸🇽",
    "slovakia": "🇸🇰",
    "slovenia": "🇸🇮",
    "solomon_islands": "🇸🇧",
    "somalia": "🇸🇴",
    "south_africa": "🇿🇦",
    "south_georgia_&_south_sandwich_islands": "🇬🇸",
    "south_korea": "🇰🇷",
    "south_sudan": "🇸🇸",
    "spain": "🇪🇸",
    "sri_lanka": "🇱🇰",
    "st._barthélemy": "🇧🇱",
    "st._helena": "🇸🇭",
    "st._kitts_&_nevis": "🇰🇳",
    "st._lucia": "🇱🇨",
    "st._martin": "🇲🇫",
    "st._pierre_&_miquelon": "🇵🇲",
    "st._vincent_&_grenadines": "🇻🇨",
    "statue_of_liberty": "🗽",
    "sudan": "🇸🇩",
    "suriname": "🇸🇷",
    "svalbard_&_jan_mayen": "🇸🇯",
    "swaziland": "🇸🇿",
    "sweden": "🇸🇪",
    "switzerland": "🇨🇭",
    "syria": "🇸🇾",
    "são_tomé_&_príncipe": "🇸🇹",
    "t-rex": "🦖",
    "top_arrow": "🔝",
    "taiwan": "🇹🇼",
    "tajikistan": "🇹🇯",
    "tanzania": "🇹🇿",
    "taurus": "♉",
    "thailand": "🇹🇭",
    "timor-leste": "🇹🇱",
    "togo": "🇹🇬",
    "tokelau": "🇹🇰",
    "tokyo_tower": "🗼",
    "tonga": "🇹🇴",
    "trinidad_&_tobago": "🇹🇹",
    "tristan_da_cunha": "🇹🇦",
    "tunisia": "🇹🇳",
    "turkey": "🦃",
    "turkmenistan": "🇹🇲",
    "turks_&_caicos_islands": "🇹🇨",
    "tuvalu": "🇹🇻",
    "u.s._outlying_islands": "🇺🇲",
    "u.s._virgin_islands": "🇻🇮",
    "up!_button": "🆙",
    "uganda": "🇺🇬",
    "ukraine": "🇺🇦",
    "united_arab_emirates": "🇦🇪",
    "united_kingdom": "🇬🇧",
    "united_nations": "🇺🇳",
    "united_states": "🇺🇸",
    "uruguay": "🇺🇾",
    "uzbekistan": "🇺🇿",
    "vs_button": "🆚",
    "vanuatu": "🇻🇺",
    "vatican_city": "🇻🇦",
    "venezuela": "🇻🇪",
    "vietnam": "🇻🇳",
    "virgo": "♍",
    "wales": "🏴\U000e0067\U000e0062\U000e0077\U000e006c\U000e0073\U000e007f",
    "wallis_&_futuna": "🇼🇫",
    "western_sahara": "🇪🇭",
    "yemen": "🇾🇪",
    "zambia": "🇿🇲",
    "zimbabwe": "🇿🇼",
    "abacus": "🧮",
    "adhesive_bandage": "🩹",
    "admission_tickets": "🎟",
    "adult": "🧑",
    "adult_dark_skin_tone": "🧑🏿",
    "adult_light_skin_tone": "🧑🏻",
    "adult_medium-dark_skin_tone": "🧑🏾",
    "adult_medium-light_skin_tone": "🧑🏼",
    "adult_medium_skin_tone": "🧑🏽",
    "aerial_tramway": "🚡",
    "airplane": "✈",
    "airplane_arrival": "🛬",
    "airplane_departure": "🛫",
    "alarm_clock": "⏰",
    "alembic": "⚗",
    "alien": "👽",
    "alien_monster": "👾",
    "ambulance": "🚑",
    "american_football": "🏈",
    "amphora": "🏺",
    "anchor": "⚓",
    "anger_symbol": "💢",
    "angry_face": "😠",
    "angry_face_with_horns": "👿",
    "anguished_face": "😧",
    "ant": "🐜",
    "antenna_bars": "📶",
    "anxious_face_with_sweat": "😰",
    "articulated_lorry": "🚛",
    "artist_palette": "🎨",
    "astonished_face": "😲",
    "atom_symbol": "⚛",
    "auto_rickshaw": "🛺",
    "automobile": "🚗",
    "avocado": "🥑",
    "axe": "🪓",
    "baby": "👶",
    "baby_angel": "👼",
    "baby_angel_dark_skin_tone": "👼🏿",
    "baby_angel_light_skin_tone": "👼🏻",
    "baby_angel_medium-dark_skin_tone": "👼🏾",
    "baby_angel_medium-light_skin_tone": "👼🏼",
    "baby_angel_medium_skin_tone": "👼🏽",
    "baby_bottle": "🍼",
    "baby_chick": "🐤",
    "baby_dark_skin_tone": "👶🏿",
    "baby_light_skin_tone": "👶🏻",
    "baby_medium-dark_skin_tone": "👶🏾",
    "baby_medium-light_skin_tone": "👶🏼",
    "baby_medium_skin_tone": "👶🏽",
    "baby_symbol": "🚼",
    "backhand_index_pointing_down": "👇",
    "backhand_index_pointing_down_dark_skin_tone": "👇🏿",
    "backhand_index_pointing_down_light_skin_tone": "👇🏻",
    "backhand_index_pointing_down_medium-dark_skin_tone": "👇🏾",
    "backhand_index_pointing_down_medium-light_skin_tone": "👇🏼",
    "backhand_index_pointing_down_medium_skin_tone": "👇🏽",
    "backhand_index_pointing_left": "👈",
    "backhand_index_pointing_left_dark_skin_tone": "👈🏿",
    "backhand_index_pointing_left_light_skin_tone": "👈🏻",
    "backhand_index_pointing_left_medium-dark_skin_tone": "👈🏾",
    "backhand_index_pointing_left_medium-light_skin_tone": "👈🏼",
    "backhand_index_pointing_left_medium_skin_tone": "👈🏽",
    "backhand_index_pointing_right": "👉",
    "backhand_index_pointing_right_dark_skin_tone": "👉🏿",
    "backhand_index_pointing_right_light_skin_tone": "👉🏻",
    "backhand_index_pointing_right_medium-dark_skin_tone": "👉🏾",
    "backhand_index_pointing_right_medium-light_skin_tone": "👉🏼",
    "backhand_index_pointing_right_medium_skin_tone": "👉🏽",
    "backhand_index_pointing_up": "👆",
    "backhand_index_pointing_up_dark_skin_tone": "👆🏿",
    "backhand_index_pointing_up_light_skin_tone": "👆🏻",
    "backhand_index_pointing_up_medium-dark_skin_tone": "👆🏾",
    "backhand_index_pointing_up_medium-light_skin_tone": "👆🏼",
    "backhand_index_pointing_up_medium_skin_tone": "👆🏽",
    "bacon": "🥓",
    "badger": "🦡",
    "badminton": "🏸",
    "bagel": "🥯",
    "baggage_claim": "🛄",
    "baguette_bread": "🥖",
    "balance_scale": "⚖",
    "bald": "🦲",
    "bald_man": "👨\u200d🦲",
    "bald_woman": "👩\u200d🦲",
    "ballet_shoes": "🩰",
    "balloon": "🎈",
    "ballot_box_with_ballot": "🗳",
    "ballot_box_with_check": "☑",
    "banana": "🍌",
    "banjo": "🪕",
    "bank": "🏦",
    "bar_chart": "📊",
    "barber_pole": "💈",
    "baseball": "⚾",
    "basket": "🧺",
    "basketball": "🏀",
    "bat": "🦇",
    "bathtub": "🛁",
    "battery": "🔋",
    "beach_with_umbrella": "🏖",
    "beaming_face_with_smiling_eyes": "😁",
    "bear_face": "🐻",
    "bearded_person": "🧔",
    "bearded_person_dark_skin_tone": "🧔🏿",
    "bearded_person_light_skin_tone": "🧔🏻",
    "bearded_person_medium-dark_skin_tone": "🧔🏾",
    "bearded_person_medium-light_skin_tone": "🧔🏼",
    "bearded_person_medium_skin_tone": "🧔🏽",
    "beating_heart": "💓",
    "bed": "🛏",
    "beer_mug": "🍺",
    "bell": "🔔",
    "bell_with_slash": "🔕",
    "bellhop_bell": "🛎",
    "bento_box": "🍱",
    "beverage_box": "🧃",
    "bicycle": "🚲",
    "bikini": "👙",
    "billed_cap": "🧢",
    "biohazard": "☣",
    "bird": "🐦",
    "birthday_cake": "🎂",
    "black_circle": "⚫",
    "black_flag": "🏴",
    "black_heart": "🖤",
    "black_large_square": "⬛",
    "black_medium-small_square": "◾",
    "black_medium_square": "◼",
    "black_nib": "✒",
    "black_small_square": "▪",
    "black_square_button": "🔲",
    "blond-haired_man": "👱\u200d♂️",
    "blond-haired_man_dark_skin_tone": "👱🏿\u200d♂️",
    "blond-haired_man_light_skin_tone": "👱🏻\u200d♂️",
    "blond-haired_man_medium-dark_skin_tone": "👱🏾\u200d♂️",
    "blond-haired_man_medium-light_skin_tone": "👱🏼\u200d♂️",
    "blond-haired_man_medium_skin_tone": "👱🏽\u200d♂️",
    "blond-haired_person": "👱",
    "blond-haired_person_dark_skin_tone": "👱🏿",
    "blond-haired_person_light_skin_tone": "👱🏻",
    "blond-haired_person_medium-dark_skin_tone": "👱🏾",
    "blond-haired_person_medium-light_skin_tone": "👱🏼",
    "blond-haired_person_medium_skin_tone": "👱🏽",
    "blond-haired_woman": "👱\u200d♀️",
    "blond-haired_woman_dark_skin_tone": "👱🏿\u200d♀️",
    "blond-haired_woman_light_skin_tone": "👱🏻\u200d♀️",
    "blond-haired_woman_medium-dark_skin_tone": "👱🏾\u200d♀️",
    "blond-haired_woman_medium-light_skin_tone": "👱🏼\u200d♀️",
    "blond-haired_woman_medium_skin_tone": "👱🏽\u200d♀️",
    "blossom": "🌼",
    "blowfish": "🐡",
    "blue_book": "📘",
    "blue_circle": "🔵",
    "blue_heart": "💙",
    "blue_square": "🟦",
    "boar": "🐗",
    "bomb": "💣",
    "bone": "🦴",
    "bookmark": "🔖",
    "bookmark_tabs": "📑",
    "books": "📚",
    "bottle_with_popping_cork": "🍾",
    "bouquet": "💐",
    "bow_and_arrow": "🏹",
    "bowl_with_spoon": "🥣",
    "bowling": "🎳",
    "boxing_glove": "🥊",
    "boy": "👦",
    "boy_dark_skin_tone": "👦🏿",
    "boy_light_skin_tone": "👦🏻",
    "boy_medium-dark_skin_tone": "👦🏾",
    "boy_medium-light_skin_tone": "👦🏼",
    "boy_medium_skin_tone": "👦🏽",
    "brain": "🧠",
    "bread": "🍞",
    "breast-feeding": "🤱",
    "breast-feeding_dark_skin_tone": "🤱🏿",
    "breast-feeding_light_skin_tone": "🤱🏻",
    "breast-feeding_medium-dark_skin_tone": "🤱🏾",
    "breast-feeding_medium-light_skin_tone": "🤱🏼",
    "breast-feeding_medium_skin_tone": "🤱🏽",
    "brick": "🧱",
    "bride_with_veil": "👰",
    "bride_with_veil_dark_skin_tone": "👰🏿",
    "bride_with_veil_light_skin_tone": "👰🏻",
    "bride_with_veil_medium-dark_skin_tone": "👰🏾",
    "bride_with_veil_medium-light_skin_tone": "👰🏼",
    "bride_with_veil_medium_skin_tone": "👰🏽",
    "bridge_at_night": "🌉",
    "briefcase": "💼",
    "briefs": "🩲",
    "bright_button": "🔆",
    "broccoli": "🥦",
    "broken_heart": "💔",
    "broom": "🧹",
    "brown_circle": "🟤",
    "brown_heart": "🤎",
    "brown_square": "🟫",
    "bug": "🐛",
    "building_construction": "🏗",
    "bullet_train": "🚅",
    "burrito": "🌯",
    "bus": "🚌",
    "bus_stop": "🚏",
    "bust_in_silhouette": "👤",
    "busts_in_silhouette": "👥",
    "butter": "🧈",
    "butterfly": "🦋",
    "cactus": "🌵",
    "calendar": "📆",
    "call_me_hand": "🤙",
    "call_me_hand_dark_skin_tone": "🤙🏿",
    "call_me_hand_light_skin_tone": "🤙🏻",
    "call_me_hand_medium-dark_skin_tone": "🤙🏾",
    "call_me_hand_medium-light_skin_tone": "🤙🏼",
    "call_me_hand_medium_skin_tone": "🤙🏽",
    "camel": "🐫",
    "camera": "📷",
    "camera_with_flash": "📸",
    "camping": "🏕",
    "candle": "🕯",
    "candy": "🍬",
    "canned_food": "🥫",
    "canoe": "🛶",
    "card_file_box": "🗃",
    "card_index": "📇",
    "card_index_dividers": "🗂",
    "carousel_horse": "🎠",
    "carp_streamer": "🎏",
    "carrot": "🥕",
    "castle": "🏰",
    "cat": "🐱",
    "cat_face": "🐱",
    "cat_face_with_tears_of_joy": "😹",
    "cat_face_with_wry_smile": "😼",
    "chains": "⛓",
    "chair": "🪑",
    "chart_decreasing": "📉",
    "chart_increasing": "📈",
    "chart_increasing_with_yen": "💹",
    "cheese_wedge": "🧀",
    "chequered_flag": "🏁",
    "cherries": "🍒",
    "cherry_blossom": "🌸",
    "chess_pawn": "♟",
    "chestnut": "🌰",
    "chicken": "🐔",
    "child": "🧒",
    "child_dark_skin_tone": "🧒🏿",
    "child_light_skin_tone": "🧒🏻",
    "child_medium-dark_skin_tone": "🧒🏾",
    "child_medium-light_skin_tone": "🧒🏼",
    "child_medium_skin_tone": "🧒🏽",
    "children_crossing": "🚸",
    "chipmunk": "🐿",
    "chocolate_bar": "🍫",
    "chopsticks": "🥢",
    "church": "⛪",
    "cigarette": "🚬",
    "cinema": "🎦",
    "circled_m": "Ⓜ",
    "circus_tent": "🎪",
    "cityscape": "🏙",
    "cityscape_at_dusk": "🌆",
    "clamp": "🗜",
    "clapper_board": "🎬",
    "clapping_hands": "👏",
    "clapping_hands_dark_skin_tone": "👏🏿",
    "clapping_hands_light_skin_tone": "👏🏻",
    "clapping_hands_medium-dark_skin_tone": "👏🏾",
    "clapping_hands_medium-light_skin_tone": "👏🏼",
    "clapping_hands_medium_skin_tone": "👏🏽",
    "classical_building": "🏛",
    "clinking_beer_mugs": "🍻",
    "clinking_glasses": "🥂",
    "clipboard": "📋",
    "clockwise_vertical_arrows": "🔃",
    "closed_book": "📕",
    "closed_mailbox_with_lowered_flag": "📪",
    "closed_mailbox_with_raised_flag": "📫",
    "closed_umbrella": "🌂",
    "cloud": "☁",
    "cloud_with_lightning": "🌩",
    "cloud_with_lightning_and_rain": "⛈",
    "cloud_with_rain": "🌧",
    "cloud_with_snow": "🌨",
    "clown_face": "🤡",
    "club_suit": "♣",
    "clutch_bag": "👝",
    "coat": "🧥",
    "cocktail_glass": "🍸",
    "coconut": "🥥",
    "coffin": "⚰",
    "cold_face": "🥶",
    "collision": "💥",
    "comet": "☄",
    "compass": "🧭",
    "computer_disk": "💽",
    "computer_mouse": "🖱",
    "confetti_ball": "🎊",
    "confounded_face": "😖",
    "confused_face": "😕",
    "construction": "🚧",
    "construction_worker": "👷",
    "construction_worker_dark_skin_tone": "👷🏿",
    "construction_worker_light_skin_tone": "👷🏻",
    "construction_worker_medium-dark_skin_tone": "👷🏾",
    "construction_worker_medium-light_skin_tone": "👷🏼",
    "construction_worker_medium_skin_tone": "👷🏽",
    "control_knobs": "🎛",
    "convenience_store": "🏪",
    "cooked_rice": "🍚",
    "cookie": "🍪",
    "cooking": "🍳",
    "copyright": "©",
    "couch_and_lamp": "🛋",
    "counterclockwise_arrows_button": "🔄",
    "couple_with_heart": "💑",
    "couple_with_heart_man_man": "👨\u200d❤️\u200d👨",
    "couple_with_heart_woman_man": "👩\u200d❤️\u200d👨",
    "couple_with_heart_woman_woman": "👩\u200d❤️\u200d👩",
    "cow": "🐮",
    "cow_face": "🐮",
    "cowboy_hat_face": "🤠",
    "crab": "🦀",
    "crayon": "🖍",
    "credit_card": "💳",
    "crescent_moon": "🌙",
    "cricket": "🦗",
    "cricket_game": "🏏",
    "crocodile": "🐊",
    "croissant": "🥐",
    "cross_mark": "❌",
    "cross_mark_button": "❎",
    "crossed_fingers": "🤞",
    "crossed_fingers_dark_skin_tone": "🤞🏿",
    "crossed_fingers_light_skin_tone": "🤞🏻",
    "crossed_fingers_medium-dark_skin_tone": "🤞🏾",
    "crossed_fingers_medium-light_skin_tone": "🤞🏼",
    "crossed_fingers_medium_skin_tone": "🤞🏽",
    "crossed_flags": "🎌",
    "crossed_swords": "⚔",
    "crown": "👑",
    "crying_cat_face": "😿",
    "crying_face": "😢",
    "crystal_ball": "🔮",
    "cucumber": "🥒",
    "cupcake": "🧁",
    "cup_with_straw": "🥤",
    "curling_stone": "🥌",
    "curly_hair": "🦱",
    "curly-haired_man": "👨\u200d🦱",
    "curly-haired_woman": "👩\u200d🦱",
    "curly_loop": "➰",
    "currency_exchange": "💱",
    "curry_rice": "🍛",
    "custard": "🍮",
    "customs": "🛃",
    "cut_of_meat": "🥩",
    "cyclone": "🌀",
    "dagger": "🗡",
    "dango": "🍡",
    "dashing_away": "💨",
    "deaf_person": "🧏",
    "deciduous_tree": "🌳",
    "deer": "🦌",
    "delivery_truck": "🚚",
    "department_store": "🏬",
    "derelict_house": "🏚",
    "desert": "🏜",
    "desert_island": "🏝",
    "desktop_computer": "🖥",
    "detective": "🕵",
    "detective_dark_skin_tone": "🕵🏿",
    "detective_light_skin_tone": "🕵🏻",
    "detective_medium-dark_skin_tone": "🕵🏾",
    "detective_medium-light_skin_tone": "🕵🏼",
    "detective_medium_skin_tone": "🕵🏽",
    "diamond_suit": "♦",
    "diamond_with_a_dot": "💠",
    "dim_button": "🔅",
    "direct_hit": "🎯",
    "disappointed_face": "😞",
    "diving_mask": "🤿",
    "diya_lamp": "🪔",
    "dizzy": "💫",
    "dizzy_face": "😵",
    "dna": "🧬",
    "dog": "🐶",
    "dog_face": "🐶",
    "dollar_banknote": "💵",
    "dolphin": "🐬",
    "door": "🚪",
    "dotted_six-pointed_star": "🔯",
    "double_curly_loop": "➿",
    "double_exclamation_mark": "‼",
    "doughnut": "🍩",
    "dove": "🕊",
    "down-left_arrow": "↙",
    "down-right_arrow": "↘",
    "down_arrow": "⬇",
    "downcast_face_with_sweat": "😓",
    "downwards_button": "🔽",
    "dragon": "🐉",
    "dragon_face": "🐲",
    "dress": "👗",
    "drooling_face": "🤤",
    "drop_of_blood": "🩸",
    "droplet": "💧",
    "drum": "🥁",
    "duck": "🦆",
    "dumpling": "🥟",
    "dvd": "📀",
    "e-mail": "📧",
    "eagle": "🦅",
    "ear": "👂",
    "ear_dark_skin_tone": "👂🏿",
    "ear_light_skin_tone": "👂🏻",
    "ear_medium-dark_skin_tone": "👂🏾",
    "ear_medium-light_skin_tone": "👂🏼",
    "ear_medium_skin_tone": "👂🏽",
    "ear_of_corn": "🌽",
    "ear_with_hearing_aid": "🦻",
    "egg": "🍳",
    "eggplant": "🍆",
    "eight-pointed_star": "✴",
    "eight-spoked_asterisk": "✳",
    "eight-thirty": "🕣",
    "eight_o’clock": "🕗",
    "eject_button": "⏏",
    "electric_plug": "🔌",
    "elephant": "🐘",
    "eleven-thirty": "🕦",
    "eleven_o’clock": "🕚",
    "elf": "🧝",
    "elf_dark_skin_tone": "🧝🏿",
    "elf_light_skin_tone": "🧝🏻",
    "elf_medium-dark_skin_tone": "🧝🏾",
    "elf_medium-light_skin_tone": "🧝🏼",
    "elf_medium_skin_tone": "🧝🏽",
    "envelope": "✉",
    "envelope_with_arrow": "📩",
    "euro_banknote": "💶",
    "evergreen_tree": "🌲",
    "ewe": "🐑",
    "exclamation_mark": "❗",
    "exclamation_question_mark": "⁉",
    "exploding_head": "🤯",
    "expressionless_face": "😑",
    "eye": "👁",
    "eye_in_speech_bubble": "👁️\u200d🗨️",
    "eyes": "👀",
    "face_blowing_a_kiss": "😘",
    "face_savoring_food": "😋",
    "face_screaming_in_fear": "😱",
    "face_vomiting": "🤮",
    "face_with_hand_over_mouth": "🤭",
    "face_with_head-bandage": "🤕",
    "face_with_medical_mask": "😷",
    "face_with_monocle": "🧐",
    "face_with_open_mouth": "😮",
    "face_with_raised_eyebrow": "🤨",
    "face_with_rolling_eyes": "🙄",
    "face_with_steam_from_nose": "😤",
    "face_with_symbols_on_mouth": "🤬",
    "face_with_tears_of_joy": "😂",
    "face_with_thermometer": "🤒",
    "face_with_tongue": "😛",
    "face_without_mouth": "😶",
    "factory": "🏭",
    "fairy": "🧚",
    "fairy_dark_skin_tone": "🧚🏿",
    "fairy_light_skin_tone": "🧚🏻",
    "fairy_medium-dark_skin_tone": "🧚🏾",
    "fairy_medium-light_skin_tone": "🧚🏼",
    "fairy_medium_skin_tone": "🧚🏽",
    "falafel": "🧆",
    "fallen_leaf": "🍂",
    "family": "👪",
    "family_man_boy": "👨\u200d👦",
    "family_man_boy_boy": "👨\u200d👦\u200d👦",
    "family_man_girl": "👨\u200d👧",
    "family_man_girl_boy": "👨\u200d👧\u200d👦",
    "family_man_girl_girl": "👨\u200d👧\u200d👧",
    "family_man_man_boy": "👨\u200d👨\u200d👦",
    "family_man_man_boy_boy": "👨\u200d👨\u200d👦\u200d👦",
    "family_man_man_girl": "👨\u200d👨\u200d👧",
    "family_man_man_girl_boy": "👨\u200d👨\u200d👧\u200d👦",
    "family_man_man_girl_girl": "👨\u200d👨\u200d👧\u200d👧",
    "family_man_woman_boy": "👨\u200d👩\u200d👦",
    "family_man_woman_boy_boy": "👨\u200d👩\u200d👦\u200d👦",
    "family_man_woman_girl": "👨\u200d👩\u200d👧",
    "family_man_woman_girl_boy": "👨\u200d👩\u200d👧\u200d👦",
    "family_man_woman_girl_girl": "👨\u200d👩\u200d👧\u200d👧",
    "family_woman_boy": "👩\u200d👦",
    "family_woman_boy_boy": "👩\u200d👦\u200d👦",
    "family_woman_girl": "👩\u200d👧",
    "family_woman_girl_boy": "👩\u200d👧\u200d👦",
    "family_woman_girl_girl": "👩\u200d👧\u200d👧",
    "family_woman_woman_boy": "👩\u200d👩\u200d👦",
    "family_woman_woman_boy_boy": "👩\u200d👩\u200d👦\u200d👦",
    "family_woman_woman_girl": "👩\u200d👩\u200d👧",
    "family_woman_woman_girl_boy": "👩\u200d👩\u200d👧\u200d👦",
    "family_woman_woman_girl_girl": "👩\u200d👩\u200d👧\u200d👧",
    "fast-forward_button": "⏩",
    "fast_down_button": "⏬",
    "fast_reverse_button": "⏪",
    "fast_up_button": "⏫",
    "fax_machine": "📠",
    "fearful_face": "😨",
    "female_sign": "♀",
    "ferris_wheel": "🎡",
    "ferry": "⛴",
    "field_hockey": "🏑",
    "file_cabinet": "🗄",
    "file_folder": "📁",
    "film_frames": "🎞",
    "film_projector": "📽",
    "fire": "🔥",
    "fire_extinguisher": "🧯",
    "firecracker": "🧨",
    "fire_engine": "🚒",
    "fireworks": "🎆",
    "first_quarter_moon": "🌓",
    "first_quarter_moon_face": "🌛",
    "fish": "🐟",
    "fish_cake_with_swirl": "🍥",
    "fishing_pole": "🎣",
    "five-thirty": "🕠",
    "five_o’clock": "🕔",
    "flag_in_hole": "⛳",
    "flamingo": "🦩",
    "flashlight": "🔦",
    "flat_shoe": "🥿",
    "fleur-de-lis": "⚜",
    "flexed_biceps": "💪",
    "flexed_biceps_dark_skin_tone": "💪🏿",
    "flexed_biceps_light_skin_tone": "💪🏻",
    "flexed_biceps_medium-dark_skin_tone": "💪🏾",
    "flexed_biceps_medium-light_skin_tone": "💪🏼",
    "flexed_biceps_medium_skin_tone": "💪🏽",
    "floppy_disk": "💾",
    "flower_playing_cards": "🎴",
    "flushed_face": "😳",
    "flying_disc": "🥏",
    "flying_saucer": "🛸",
    "fog": "🌫",
    "foggy": "🌁",
    "folded_hands": "🙏",
    "folded_hands_dark_skin_tone": "🙏🏿",
    "folded_hands_light_skin_tone": "🙏🏻",
    "folded_hands_medium-dark_skin_tone": "🙏🏾",
    "folded_hands_medium-light_skin_tone": "🙏🏼",
    "folded_hands_medium_skin_tone": "🙏🏽",
    "foot": "🦶",
    "footprints": "👣",
    "fork_and_knife": "🍴",
    "fork_and_knife_with_plate": "🍽",
    "fortune_cookie": "🥠",
    "fountain": "⛲",
    "fountain_pen": "🖋",
    "four-thirty": "🕟",
    "four_leaf_clover": "🍀",
    "four_o’clock": "🕓",
    "fox_face": "🦊",
    "framed_picture": "🖼",
    "french_fries": "🍟",
    "fried_shrimp": "🍤",
    "frog_face": "🐸",
    "front-facing_baby_chick": "🐥",
    "frowning_face": "☹",
    "frowning_face_with_open_mouth": "😦",
    "fuel_pump": "⛽",
    "full_moon": "🌕",
    "full_moon_face": "🌝",
    "funeral_urn": "⚱",
    "game_die": "🎲",
    "garlic": "🧄",
    "gear": "⚙",
    "gem_stone": "💎",
    "genie": "🧞",
    "ghost": "👻",
    "giraffe": "🦒",
    "girl": "👧",
    "girl_dark_skin_tone": "👧🏿",
    "girl_light_skin_tone": "👧🏻",
    "girl_medium-dark_skin_tone": "👧🏾",
    "girl_medium-light_skin_tone": "👧🏼",
    "girl_medium_skin_tone": "👧🏽",
    "glass_of_milk": "🥛",
    "glasses": "👓",
    "globe_showing_americas": "🌎",
    "globe_showing_asia-australia": "🌏",
    "globe_showing_europe-africa": "🌍",
    "globe_with_meridians": "🌐",
    "gloves": "🧤",
    "glowing_star": "🌟",
    "goal_net": "🥅",
    "goat": "🐐",
    "goblin": "👺",
    "goggles": "🥽",
    "gorilla": "🦍",
    "graduation_cap": "🎓",
    "grapes": "🍇",
    "green_apple": "🍏",
    "green_book": "📗",
    "green_circle": "🟢",
    "green_heart": "💚",
    "green_salad": "🥗",
    "green_square": "🟩",
    "grimacing_face": "😬",
    "grinning_cat_face": "😺",
    "grinning_cat_face_with_smiling_eyes": "😸",
    "grinning_face": "😀",
    "grinning_face_with_big_eyes": "😃",
    "grinning_face_with_smiling_eyes": "😄",
    "grinning_face_with_sweat": "😅",
    "grinning_squinting_face": "😆",
    "growing_heart": "💗",
    "guard": "💂",
    "guard_dark_skin_tone": "💂🏿",
    "guard_light_skin_tone": "💂🏻",
    "guard_medium-dark_skin_tone": "💂🏾",
    "guard_medium-light_skin_tone": "💂🏼",
    "guard_medium_skin_tone": "💂🏽",
    "guide_dog": "🦮",
    "guitar": "🎸",
    "hamburger": "🍔",
    "hammer": "🔨",
    "hammer_and_pick": "⚒",
    "hammer_and_wrench": "🛠",
    "hamster_face": "🐹",
    "hand_with_fingers_splayed": "🖐",
    "hand_with_fingers_splayed_dark_skin_tone": "🖐🏿",
    "hand_with_fingers_splayed_light_skin_tone": "🖐🏻",
    "hand_with_fingers_splayed_medium-dark_skin_tone": "🖐🏾",
    "hand_with_fingers_splayed_medium-light_skin_tone": "🖐🏼",
    "hand_with_fingers_splayed_medium_skin_tone": "🖐🏽",
    "handbag": "👜",
    "handshake": "🤝",
    "hatching_chick": "🐣",
    "headphone": "🎧",
    "hear-no-evil_monkey": "🙉",
    "heart_decoration": "💟",
    "heart_suit": "♥",
    "heart_with_arrow": "💘",
    "heart_with_ribbon": "💝",
    "heavy_check_mark": "✔",
    "heavy_division_sign": "➗",
    "heavy_dollar_sign": "💲",
    "heavy_heart_exclamation": "❣",
    "heavy_large_circle": "⭕",
    "heavy_minus_sign": "➖",
    "heavy_multiplication_x": "✖",
    "heavy_plus_sign": "➕",
    "hedgehog": "🦔",
    "helicopter": "🚁",
    "herb": "🌿",
    "hibiscus": "🌺",
    "high-heeled_shoe": "👠",
    "high-speed_train": "🚄",
    "high_voltage": "⚡",
    "hiking_boot": "🥾",
    "hindu_temple": "🛕",
    "hippopotamus": "🦛",
    "hole": "🕳",
    "honey_pot": "🍯",
    "honeybee": "🐝",
    "horizontal_traffic_light": "🚥",
    "horse": "🐴",
    "horse_face": "🐴",
    "horse_racing": "🏇",
    "horse_racing_dark_skin_tone": "🏇🏿",
    "horse_racing_light_skin_tone": "🏇🏻",
    "horse_racing_medium-dark_skin_tone": "🏇🏾",
    "horse_racing_medium-light_skin_tone": "🏇🏼",
    "horse_racing_medium_skin_tone": "🏇🏽",
    "hospital": "🏥",
    "hot_beverage": "☕",
    "hot_dog": "🌭",
    "hot_face": "🥵",
    "hot_pepper": "🌶",
    "hot_springs": "♨",
    "hotel": "🏨",
    "hourglass_done": "⌛",
    "hourglass_not_done": "⏳",
    "house": "🏠",
    "house_with_garden": "🏡",
    "houses": "🏘",
    "hugging_face": "🤗",
    "hundred_points": "💯",
    "hushed_face": "😯",
    "ice": "🧊",
    "ice_cream": "🍨",
    "ice_hockey": "🏒",
    "ice_skate": "⛸",
    "inbox_tray": "📥",
    "incoming_envelope": "📨",
    "index_pointing_up": "☝",
    "index_pointing_up_dark_skin_tone": "☝🏿",
    "index_pointing_up_light_skin_tone": "☝🏻",
    "index_pointing_up_medium-dark_skin_tone": "☝🏾",
    "index_pointing_up_medium-light_skin_tone": "☝🏼",
    "index_pointing_up_medium_skin_tone": "☝🏽",
    "infinity": "♾",
    "information": "ℹ",
    "input_latin_letters": "🔤",
    "input_latin_lowercase": "🔡",
    "input_latin_uppercase": "🔠",
    "input_numbers": "🔢",
    "input_symbols": "🔣",
    "jack-o-lantern": "🎃",
    "jeans": "👖",
    "jigsaw": "🧩",
    "joker": "🃏",
    "joystick": "🕹",
    "kaaba": "🕋",
    "kangaroo": "🦘",
    "key": "🔑",
    "keyboard": "⌨",
    "keycap_#": "#️⃣",
    "keycap_*": "*️⃣",
    "keycap_0": "0️⃣",
    "keycap_1": "1️⃣",
    "keycap_10": "🔟",
    "keycap_2": "2️⃣",
    "keycap_3": "3️⃣",
    "keycap_4": "4️⃣",
    "keycap_5": "5️⃣",
    "keycap_6": "6️⃣",
    "keycap_7": "7️⃣",
    "keycap_8": "8️⃣",
    "keycap_9": "9️⃣",
    "kick_scooter": "🛴",
    "kimono": "👘",
    "kiss": "💋",
    "kiss_man_man": "👨\u200d❤️\u200d💋\u200d👨",
    "kiss_mark": "💋",
    "kiss_woman_man": "👩\u200d❤️\u200d💋\u200d👨",
    "kiss_woman_woman": "👩\u200d❤️\u200d💋\u200d👩",
    "kissing_cat_face": "😽",
    "kissing_face": "😗",
    "kissing_face_with_closed_eyes": "😚",
    "kissing_face_with_smiling_eyes": "😙",
    "kitchen_knife": "🔪",
    "kite": "🪁",
    "kiwi_fruit": "🥝",
    "koala": "🐨",
    "lab_coat": "🥼",
    "label": "🏷",
    "lacrosse": "🥍",
    "lady_beetle": "🐞",
    "laptop_computer": "💻",
    "large_blue_diamond": "🔷",
    "large_orange_diamond": "🔶",
    "last_quarter_moon": "🌗",
    "last_quarter_moon_face": "🌜",
    "last_track_button": "⏮",
    "latin_cross": "✝",
    "leaf_fluttering_in_wind": "🍃",
    "leafy_green": "🥬",
    "ledger": "📒",
    "left-facing_fist": "🤛",
    "left-facing_fist_dark_skin_tone": "🤛🏿",
    "left-facing_fist_light_skin_tone": "🤛🏻",
    "left-facing_fist_medium-dark_skin_tone": "🤛🏾",
    "left-facing_fist_medium-light_skin_tone": "🤛🏼",
    "left-facing_fist_medium_skin_tone": "🤛🏽",
    "left-right_arrow": "↔",
    "left_arrow": "⬅",
    "left_arrow_curving_right": "↪",
    "left_luggage": "🛅",
    "left_speech_bubble": "🗨",
    "leg": "🦵",
    "lemon": "🍋",
    "leopard": "🐆",
    "level_slider": "🎚",
    "light_bulb": "💡",
    "light_rail": "🚈",
    "link": "🔗",
    "linked_paperclips": "🖇",
    "lion_face": "🦁",
    "lipstick": "💄",
    "litter_in_bin_sign": "🚮",
    "lizard": "🦎",
    "llama": "🦙",
    "lobster": "🦞",
    "locked": "🔒",
    "locked_with_key": "🔐",
    "locked_with_pen": "🔏",
    "locomotive": "🚂",
    "lollipop": "🍭",
    "lotion_bottle": "🧴",
    "loudly_crying_face": "😭",
    "loudspeaker": "📢",
    "love-you_gesture": "🤟",
    "love-you_gesture_dark_skin_tone": "🤟🏿",
    "love-you_gesture_light_skin_tone": "🤟🏻",
    "love-you_gesture_medium-dark_skin_tone": "🤟🏾",
    "love-you_gesture_medium-light_skin_tone": "🤟🏼",
    "love-you_gesture_medium_skin_tone": "🤟🏽",
    "love_hotel": "🏩",
    "love_letter": "💌",
    "luggage": "🧳",
    "lying_face": "🤥",
    "mage": "🧙",
    "mage_dark_skin_tone": "🧙🏿",
    "mage_light_skin_tone": "🧙🏻",
    "mage_medium-dark_skin_tone": "🧙🏾",
    "mage_medium-light_skin_tone": "🧙🏼",
    "mage_medium_skin_tone": "🧙🏽",
    "magnet": "🧲",
    "magnifying_glass_tilted_left": "🔍",
    "magnifying_glass_tilted_right": "🔎",
    "mahjong_red_dragon": "🀄",
    "male_sign": "♂",
    "man": "👨",
    "man_and_woman_holding_hands": "👫",
    "man_artist": "👨\u200d🎨",
    "man_artist_dark_skin_tone": "👨🏿\u200d🎨",
    "man_artist_light_skin_tone": "👨🏻\u200d🎨",
    "man_artist_medium-dark_skin_tone": "👨🏾\u200d🎨",
    "man_artist_medium-light_skin_tone": "👨🏼\u200d🎨",
    "man_artist_medium_skin_tone": "👨🏽\u200d🎨",
    "man_astronaut": "👨\u200d🚀",
    "man_astronaut_dark_skin_tone": "👨🏿\u200d🚀",
    "man_astronaut_light_skin_tone": "👨🏻\u200d🚀",
    "man_astronaut_medium-dark_skin_tone": "👨🏾\u200d🚀",
    "man_astronaut_medium-light_skin_tone": "👨🏼\u200d🚀",
    "man_astronaut_medium_skin_tone": "👨🏽\u200d🚀",
    "man_biking": "🚴\u200d♂️",
    "man_biking_dark_skin_tone": "🚴🏿\u200d♂️",
    "man_biking_light_skin_tone": "🚴🏻\u200d♂️",
    "man_biking_medium-dark_skin_tone": "🚴🏾\u200d♂️",
    "man_biking_medium-light_skin_tone": "🚴🏼\u200d♂️",
    "man_biking_medium_skin_tone": "🚴🏽\u200d♂️",
    "man_bouncing_ball": "⛹️\u200d♂️",
    "man_bouncing_ball_dark_skin_tone": "⛹🏿\u200d♂️",
    "man_bouncing_ball_light_skin_tone": "⛹🏻\u200d♂️",
    "man_bouncing_ball_medium-dark_skin_tone": "⛹🏾\u200d♂️",
    "man_bouncing_ball_medium-light_skin_tone": "⛹🏼\u200d♂️",
    "man_bouncing_ball_medium_skin_tone": "⛹🏽\u200d♂️",
    "man_bowing": "🙇\u200d♂️",
    "man_bowing_dark_skin_tone": "🙇🏿\u200d♂️",
    "man_bowing_light_skin_tone": "🙇🏻\u200d♂️",
    "man_bowing_medium-dark_skin_tone": "🙇🏾\u200d♂️",
    "man_bowing_medium-light_skin_tone": "🙇🏼\u200d♂️",
    "man_bowing_medium_skin_tone": "🙇🏽\u200d♂️",
    "man_cartwheeling": "🤸\u200d♂️",
    "man_cartwheeling_dark_skin_tone": "🤸🏿\u200d♂️",
    "man_cartwheeling_light_skin_tone": "🤸🏻\u200d♂️",
    "man_cartwheeling_medium-dark_skin_tone": "🤸🏾\u200d♂️",
    "man_cartwheeling_medium-light_skin_tone": "🤸🏼\u200d♂️",
    "man_cartwheeling_medium_skin_tone": "🤸🏽\u200d♂️",
    "man_climbing": "🧗\u200d♂️",
    "man_climbing_dark_skin_tone": "🧗🏿\u200d♂️",
    "man_climbing_light_skin_tone": "🧗🏻\u200d♂️",
    "man_climbing_medium-dark_skin_tone": "🧗🏾\u200d♂️",
    "man_climbing_medium-light_skin_tone": "🧗🏼\u200d♂️",
    "man_climbing_medium_skin_tone": "🧗🏽\u200d♂️",
    "man_construction_worker": "👷\u200d♂️",
    "man_construction_worker_dark_skin_tone": "👷🏿\u200d♂️",
    "man_construction_worker_light_skin_tone": "👷🏻\u200d♂️",
    "man_construction_worker_medium-dark_skin_tone": "👷🏾\u200d♂️",
    "man_construction_worker_medium-light_skin_tone": "👷🏼\u200d♂️",
    "man_construction_worker_medium_skin_tone": "👷🏽\u200d♂️",
    "man_cook": "👨\u200d🍳",
    "man_cook_dark_skin_tone": "👨🏿\u200d🍳",
    "man_cook_light_skin_tone": "👨🏻\u200d🍳",
    "man_cook_medium-dark_skin_tone": "👨🏾\u200d🍳",
    "man_cook_medium-light_skin_tone": "👨🏼\u200d🍳",
    "man_cook_medium_skin_tone": "👨🏽\u200d🍳",
    "man_dancing": "🕺",
    "man_dancing_dark_skin_tone": "🕺🏿",
    "man_dancing_light_skin_tone": "🕺🏻",
    "man_dancing_medium-dark_skin_tone": "🕺🏾",
    "man_dancing_medium-light_skin_tone": "🕺🏼",
    "man_dancing_medium_skin_tone": "🕺🏽",
    "man_dark_skin_tone": "👨🏿",
    "man_detective": "🕵️\u200d♂️",
    "man_detective_dark_skin_tone": "🕵🏿\u200d♂️",
    "man_detective_light_skin_tone": "🕵🏻\u200d♂️",
    "man_detective_medium-dark_skin_tone": "🕵🏾\u200d♂️",
    "man_detective_medium-light_skin_tone": "🕵🏼\u200d♂️",
    "man_detective_medium_skin_tone": "🕵🏽\u200d♂️",
    "man_elf": "🧝\u200d♂️",
    "man_elf_dark_skin_tone": "🧝🏿\u200d♂️",
    "man_elf_light_skin_tone": "🧝🏻\u200d♂️",
    "man_elf_medium-dark_skin_tone": "🧝🏾\u200d♂️",
    "man_elf_medium-light_skin_tone": "🧝🏼\u200d♂️",
    "man_elf_medium_skin_tone": "🧝🏽\u200d♂️",
    "man_facepalming": "🤦\u200d♂️",
    "man_facepalming_dark_skin_tone": "🤦🏿\u200d♂️",
    "man_facepalming_light_skin_tone": "🤦🏻\u200d♂️",
    "man_facepalming_medium-dark_skin_tone": "🤦🏾\u200d♂️",
    "man_facepalming_medium-light_skin_tone": "🤦🏼\u200d♂️",
    "man_facepalming_medium_skin_tone": "🤦🏽\u200d♂️",
    "man_factory_worker": "👨\u200d🏭",
    "man_factory_worker_dark_skin_tone": "👨🏿\u200d🏭",
    "man_factory_worker_light_skin_tone": "👨🏻\u200d🏭",
    "man_factory_worker_medium-dark_skin_tone": "👨🏾\u200d🏭",
    "man_factory_worker_medium-light_skin_tone": "👨🏼\u200d🏭",
    "man_factory_worker_medium_skin_tone": "👨🏽\u200d🏭",
    "man_fairy": "🧚\u200d♂️",
    "man_fairy_dark_skin_tone": "🧚🏿\u200d♂️",
    "man_fairy_light_skin_tone": "🧚🏻\u200d♂️",
    "man_fairy_medium-dark_skin_tone": "🧚🏾\u200d♂️",
    "man_fairy_medium-light_skin_tone": "🧚🏼\u200d♂️",
    "man_fairy_medium_skin_tone": "🧚🏽\u200d♂️",
    "man_farmer": "👨\u200d🌾",
    "man_farmer_dark_skin_tone": "👨🏿\u200d🌾",
    "man_farmer_light_skin_tone": "👨🏻\u200d🌾",
    "man_farmer_medium-dark_skin_tone": "👨🏾\u200d🌾",
    "man_farmer_medium-light_skin_tone": "👨🏼\u200d🌾",
    "man_farmer_medium_skin_tone": "👨🏽\u200d🌾",
    "man_firefighter": "👨\u200d🚒",
    "man_firefighter_dark_skin_tone": "👨🏿\u200d🚒",
    "man_firefighter_light_skin_tone": "👨🏻\u200d🚒",
    "man_firefighter_medium-dark_skin_tone": "👨🏾\u200d🚒",
    "man_firefighter_medium-light_skin_tone": "👨🏼\u200d🚒",
    "man_firefighter_medium_skin_tone": "👨🏽\u200d🚒",
    "man_frowning": "🙍\u200d♂️",
    "man_frowning_dark_skin_tone": "🙍🏿\u200d♂️",
    "man_frowning_light_skin_tone": "🙍🏻\u200d♂️",
    "man_frowning_medium-dark_skin_tone": "🙍🏾\u200d♂️",
    "man_frowning_medium-light_skin_tone": "🙍🏼\u200d♂️",
    "man_frowning_medium_skin_tone": "🙍🏽\u200d♂️",
    "man_genie": "🧞\u200d♂️",
    "man_gesturing_no": "🙅\u200d♂️",
    "man_gesturing_no_dark_skin_tone": "🙅🏿\u200d♂️",
    "man_gesturing_no_light_skin_tone": "🙅🏻\u200d♂️",
    "man_gesturing_no_medium-dark_skin_tone": "🙅🏾\u200d♂️",
    "man_gesturing_no_medium-light_skin_tone": "🙅🏼\u200d♂️",
    "man_gesturing_no_medium_skin_tone": "🙅🏽\u200d♂️",
    "man_gesturing_ok": "🙆\u200d♂️",
    "man_gesturing_ok_dark_skin_tone": "🙆🏿\u200d♂️",
    "man_gesturing_ok_light_skin_tone": "🙆🏻\u200d♂️",
    "man_gesturing_ok_medium-dark_skin_tone": "🙆🏾\u200d♂️",
    "man_gesturing_ok_medium-light_skin_tone": "🙆🏼\u200d♂️",
    "man_gesturing_ok_medium_skin_tone": "🙆🏽\u200d♂️",
    "man_getting_haircut": "💇\u200d♂️",
    "man_getting_haircut_dark_skin_tone": "💇🏿\u200d♂️",
    "man_getting_haircut_light_skin_tone": "💇🏻\u200d♂️",
    "man_getting_haircut_medium-dark_skin_tone": "💇🏾\u200d♂️",
    "man_getting_haircut_medium-light_skin_tone": "💇🏼\u200d♂️",
    "man_getting_haircut_medium_skin_tone": "💇🏽\u200d♂️",
    "man_getting_massage": "💆\u200d♂️",
    "man_getting_massage_dark_skin_tone": "💆🏿\u200d♂️",
    "man_getting_massage_light_skin_tone": "💆🏻\u200d♂️",
    "man_getting_massage_medium-dark_skin_tone": "💆🏾\u200d♂️",
    "man_getting_massage_medium-light_skin_tone": "💆🏼\u200d♂️",
    "man_getting_massage_medium_skin_tone": "💆🏽\u200d♂️",
    "man_golfing": "🏌️\u200d♂️",
    "man_golfing_dark_skin_tone": "🏌🏿\u200d♂️",
    "man_golfing_light_skin_tone": "🏌🏻\u200d♂️",
    "man_golfing_medium-dark_skin_tone": "🏌🏾\u200d♂️",
    "man_golfing_medium-light_skin_tone": "🏌🏼\u200d♂️",
    "man_golfing_medium_skin_tone": "🏌🏽\u200d♂️",
    "man_guard": "💂\u200d♂️",
    "man_guard_dark_skin_tone": "💂🏿\u200d♂️",
    "man_guard_light_skin_tone": "💂🏻\u200d♂️",
    "man_guard_medium-dark_skin_tone": "💂🏾\u200d♂️",
    "man_guard_medium-light_skin_tone": "💂🏼\u200d♂️",
    "man_guard_medium_skin_tone": "💂🏽\u200d♂️",
    "man_health_worker": "👨\u200d⚕️",
    "man_health_worker_dark_skin_tone": "👨🏿\u200d⚕️",
    "man_health_worker_light_skin_tone": "👨🏻\u200d⚕️",
    "man_health_worker_medium-dark_skin_tone": "👨🏾\u200d⚕️",
    "man_health_worker_medium-light_skin_tone": "👨🏼\u200d⚕️",
    "man_health_worker_medium_skin_tone": "👨🏽\u200d⚕️",
    "man_in_lotus_position": "🧘\u200d♂️",
    "man_in_lotus_position_dark_skin_tone": "🧘🏿\u200d♂️",
    "man_in_lotus_position_light_skin_tone": "🧘🏻\u200d♂️",
    "man_in_lotus_position_medium-dark_skin_tone": "🧘🏾\u200d♂️",
    "man_in_lotus_position_medium-light_skin_tone": "🧘🏼\u200d♂️",
    "man_in_lotus_position_medium_skin_tone": "🧘🏽\u200d♂️",
    "man_in_manual_wheelchair": "👨\u200d🦽",
    "man_in_motorized_wheelchair": "👨\u200d🦼",
    "man_in_steamy_room": "🧖\u200d♂️",
    "man_in_steamy_room_dark_skin_tone": "🧖🏿\u200d♂️",
    "man_in_steamy_room_light_skin_tone": "🧖🏻\u200d♂️",
    "man_in_steamy_room_medium-dark_skin_tone": "🧖🏾\u200d♂️",
    "man_in_steamy_room_medium-light_skin_tone": "🧖🏼\u200d♂️",
    "man_in_steamy_room_medium_skin_tone": "🧖🏽\u200d♂️",
    "man_in_suit_levitating": "🕴",
    "man_in_suit_levitating_dark_skin_tone": "🕴🏿",
    "man_in_suit_levitating_light_skin_tone": "🕴🏻",
    "man_in_suit_levitating_medium-dark_skin_tone": "🕴🏾",
    "man_in_suit_levitating_medium-light_skin_tone": "🕴🏼",
    "man_in_suit_levitating_medium_skin_tone": "🕴🏽",
    "man_in_tuxedo": "🤵",
    "man_in_tuxedo_dark_skin_tone": "🤵🏿",
    "man_in_tuxedo_light_skin_tone": "🤵🏻",
    "man_in_tuxedo_medium-dark_skin_tone": "🤵🏾",
    "man_in_tuxedo_medium-light_skin_tone": "🤵🏼",
    "man_in_tuxedo_medium_skin_tone": "🤵🏽",
    "man_judge": "👨\u200d⚖️",
    "man_judge_dark_skin_tone": "👨🏿\u200d⚖️",
    "man_judge_light_skin_tone": "👨🏻\u200d⚖️",
    "man_judge_medium-dark_skin_tone": "👨🏾\u200d⚖️",
    "man_judge_medium-light_skin_tone": "👨🏼\u200d⚖️",
    "man_judge_medium_skin_tone": "👨🏽\u200d⚖️",
    "man_juggling": "🤹\u200d♂️",
    "man_juggling_dark_skin_tone": "🤹🏿\u200d♂️",
    "man_juggling_light_skin_tone": "🤹🏻\u200d♂️",
    "man_juggling_medium-dark_skin_tone": "🤹🏾\u200d♂️",
    "man_juggling_medium-light_skin_tone": "🤹🏼\u200d♂️",
    "man_juggling_medium_skin_tone": "🤹🏽\u200d♂️",
    "man_lifting_weights": "🏋️\u200d♂️",
    "man_lifting_weights_dark_skin_tone": "🏋🏿\u200d♂️",
    "man_lifting_weights_light_skin_tone": "🏋🏻\u200d♂️",
    "man_lifting_weights_medium-dark_skin_tone": "🏋🏾\u200d♂️",
    "man_lifting_weights_medium-light_skin_tone": "🏋🏼\u200d♂️",
    "man_lifting_weights_medium_skin_tone": "🏋🏽\u200d♂️",
    "man_light_skin_tone": "👨🏻",
    "man_mage": "🧙\u200d♂️",
    "man_mage_dark_skin_tone": "🧙🏿\u200d♂️",
    "man_mage_light_skin_tone": "🧙🏻\u200d♂️",
    "man_mage_medium-dark_skin_tone": "🧙🏾\u200d♂️",
    "man_mage_medium-light_skin_tone": "🧙🏼\u200d♂️",
    "man_mage_medium_skin_tone": "🧙🏽\u200d♂️",
    "man_mechanic": "👨\u200d🔧",
    "man_mechanic_dark_skin_tone": "👨🏿\u200d🔧",
    "man_mechanic_light_skin_tone": "👨🏻\u200d🔧",
    "man_mechanic_medium-dark_skin_tone": "👨🏾\u200d🔧",
    "man_mechanic_medium-light_skin_tone": "👨🏼\u200d🔧",
    "man_mechanic_medium_skin_tone": "👨🏽\u200d🔧",
    "man_medium-dark_skin_tone": "👨🏾",
    "man_medium-light_skin_tone": "👨🏼",
    "man_medium_skin_tone": "👨🏽",
    "man_mountain_biking": "🚵\u200d♂️",
    "man_mountain_biking_dark_skin_tone": "🚵🏿\u200d♂️",
    "man_mountain_biking_light_skin_tone": "🚵🏻\u200d♂️",
    "man_mountain_biking_medium-dark_skin_tone": "🚵🏾\u200d♂️",
    "man_mountain_biking_medium-light_skin_tone": "🚵🏼\u200d♂️",
    "man_mountain_biking_medium_skin_tone": "🚵🏽\u200d♂️",
    "man_office_worker": "👨\u200d💼",
    "man_office_worker_dark_skin_tone": "👨🏿\u200d💼",
    "man_office_worker_light_skin_tone": "👨🏻\u200d💼",
    "man_office_worker_medium-dark_skin_tone": "👨🏾\u200d💼",
    "man_office_worker_medium-light_skin_tone": "👨🏼\u200d💼",
    "man_office_worker_medium_skin_tone": "👨🏽\u200d💼",
    "man_pilot": "👨\u200d✈️",
    "man_pilot_dark_skin_tone": "👨🏿\u200d✈️",
    "man_pilot_light_skin_tone": "👨🏻\u200d✈️",
    "man_pilot_medium-dark_skin_tone": "👨🏾\u200d✈️",
    "man_pilot_medium-light_skin_tone": "👨🏼\u200d✈️",
    "man_pilot_medium_skin_tone": "👨🏽\u200d✈️",
    "man_playing_handball": "🤾\u200d♂️",
    "man_playing_handball_dark_skin_tone": "🤾🏿\u200d♂️",
    "man_playing_handball_light_skin_tone": "🤾🏻\u200d♂️",
    "man_playing_handball_medium-dark_skin_tone": "🤾🏾\u200d♂️",
    "man_playing_handball_medium-light_skin_tone": "🤾🏼\u200d♂️",
    "man_playing_handball_medium_skin_tone": "🤾🏽\u200d♂️",
    "man_playing_water_polo": "🤽\u200d♂️",
    "man_playing_water_polo_dark_skin_tone": "🤽🏿\u200d♂️",
    "man_playing_water_polo_light_skin_tone": "🤽🏻\u200d♂️",
    "man_playing_water_polo_medium-dark_skin_tone": "🤽🏾\u200d♂️",
    "man_playing_water_polo_medium-light_skin_tone": "🤽🏼\u200d♂️",
    "man_playing_water_polo_medium_skin_tone": "🤽🏽\u200d♂️",
    "man_police_officer": "👮\u200d♂️",
    "man_police_officer_dark_skin_tone": "👮🏿\u200d♂️",
    "man_police_officer_light_skin_tone": "👮🏻\u200d♂️",
    "man_police_officer_medium-dark_skin_tone": "👮🏾\u200d♂️",
    "man_police_officer_medium-light_skin_tone": "👮🏼\u200d♂️",
    "man_police_officer_medium_skin_tone": "👮🏽\u200d♂️",
    "man_pouting": "🙎\u200d♂️",
    "man_pouting_dark_skin_tone": "🙎🏿\u200d♂️",
    "man_pouting_light_skin_tone": "🙎🏻\u200d♂️",
    "man_pouting_medium-dark_skin_tone": "🙎🏾\u200d♂️",
    "man_pouting_medium-light_skin_tone": "🙎🏼\u200d♂️",
    "man_pouting_medium_skin_tone": "🙎🏽\u200d♂️",
    "man_raising_hand": "🙋\u200d♂️",
    "man_raising_hand_dark_skin_tone": "🙋🏿\u200d♂️",
    "man_raising_hand_light_skin_tone": "🙋🏻\u200d♂️",
    "man_raising_hand_medium-dark_skin_tone": "🙋🏾\u200d♂️",
    "man_raising_hand_medium-light_skin_tone": "🙋🏼\u200d♂️",
    "man_raising_hand_medium_skin_tone": "🙋🏽\u200d♂️",
    "man_rowing_boat": "🚣\u200d♂️",
    "man_rowing_boat_dark_skin_tone": "🚣🏿\u200d♂️",
    "man_rowing_boat_light_skin_tone": "🚣🏻\u200d♂️",
    "man_rowing_boat_medium-dark_skin_tone": "🚣🏾\u200d♂️",
    "man_rowing_boat_medium-light_skin_tone": "🚣🏼\u200d♂️",
    "man_rowing_boat_medium_skin_tone": "🚣🏽\u200d♂️",
    "man_running": "🏃\u200d♂️",
    "man_running_dark_skin_tone": "🏃🏿\u200d♂️",
    "man_running_light_skin_tone": "🏃🏻\u200d♂️",
    "man_running_medium-dark_skin_tone": "🏃🏾\u200d♂️",
    "man_running_medium-light_skin_tone": "🏃🏼\u200d♂️",
    "man_running_medium_skin_tone": "🏃🏽\u200d♂️",
    "man_scientist": "👨\u200d🔬",
    "man_scientist_dark_skin_tone": "👨🏿\u200d🔬",
    "man_scientist_light_skin_tone": "👨🏻\u200d🔬",
    "man_scientist_medium-dark_skin_tone": "👨🏾\u200d🔬",
    "man_scientist_medium-light_skin_tone": "👨🏼\u200d🔬",
    "man_scientist_medium_skin_tone": "👨🏽\u200d🔬",
    "man_shrugging": "🤷\u200d♂️",
    "man_shrugging_dark_skin_tone": "🤷🏿\u200d♂️",
    "man_shrugging_light_skin_tone": "🤷🏻\u200d♂️",
    "man_shrugging_medium-dark_skin_tone": "🤷🏾\u200d♂️",
    "man_shrugging_medium-light_skin_tone": "🤷🏼\u200d♂️",
    "man_shrugging_medium_skin_tone": "🤷🏽\u200d♂️",
    "man_singer": "👨\u200d🎤",
    "man_singer_dark_skin_tone": "👨🏿\u200d🎤",
    "man_singer_light_skin_tone": "👨🏻\u200d🎤",
    "man_singer_medium-dark_skin_tone": "👨🏾\u200d🎤",
    "man_singer_medium-light_skin_tone": "👨🏼\u200d🎤",
    "man_singer_medium_skin_tone": "👨🏽\u200d🎤",
    "man_student": "👨\u200d🎓",
    "man_student_dark_skin_tone": "👨🏿\u200d🎓",
    "man_student_light_skin_tone": "👨🏻\u200d🎓",
    "man_student_medium-dark_skin_tone": "👨🏾\u200d🎓",
    "man_student_medium-light_skin_tone": "👨🏼\u200d🎓",
    "man_student_medium_skin_tone": "👨🏽\u200d🎓",
    "man_surfing": "🏄\u200d♂️",
    "man_surfing_dark_skin_tone": "🏄🏿\u200d♂️",
    "man_surfing_light_skin_tone": "🏄🏻\u200d♂️",
    "man_surfing_medium-dark_skin_tone": "🏄🏾\u200d♂️",
    "man_surfing_medium-light_skin_tone": "🏄🏼\u200d♂️",
    "man_surfing_medium_skin_tone": "🏄🏽\u200d♂️",
    "man_swimming": "🏊\u200d♂️",
    "man_swimming_dark_skin_tone": "🏊🏿\u200d♂️",
    "man_swimming_light_skin_tone": "🏊🏻\u200d♂️",
    "man_swimming_medium-dark_skin_tone": "🏊🏾\u200d♂️",
    "man_swimming_medium-light_skin_tone": "🏊🏼\u200d♂️",
    "man_swimming_medium_skin_tone": "🏊🏽\u200d♂️",
    "man_teacher": "👨\u200d🏫",
    "man_teacher_dark_skin_tone": "👨🏿\u200d🏫",
    "man_teacher_light_skin_tone": "👨🏻\u200d🏫",
    "man_teacher_medium-dark_skin_tone": "👨🏾\u200d🏫",
    "man_teacher_medium-light_skin_tone": "👨🏼\u200d🏫",
    "man_teacher_medium_skin_tone": "👨🏽\u200d🏫",
    "man_technologist": "👨\u200d💻",
    "man_technologist_dark_skin_tone": "👨🏿\u200d💻",
    "man_technologist_light_skin_tone": "👨🏻\u200d💻",
    "man_technologist_medium-dark_skin_tone": "👨🏾\u200d💻",
    "man_technologist_medium-light_skin_tone": "👨🏼\u200d💻",
    "man_technologist_medium_skin_tone": "👨🏽\u200d💻",
    "man_tipping_hand": "💁\u200d♂️",
    "man_tipping_hand_dark_skin_tone": "💁🏿\u200d♂️",
    "man_tipping_hand_light_skin_tone": "💁🏻\u200d♂️",
    "man_tipping_hand_medium-dark_skin_tone": "💁🏾\u200d♂️",
    "man_tipping_hand_medium-light_skin_tone": "💁🏼\u200d♂️",
    "man_tipping_hand_medium_skin_tone": "💁🏽\u200d♂️",
    "man_vampire": "🧛\u200d♂️",
    "man_vampire_dark_skin_tone": "🧛🏿\u200d♂️",
    "man_vampire_light_skin_tone": "🧛🏻\u200d♂️",
    "man_vampire_medium-dark_skin_tone": "🧛🏾\u200d♂️",
    "man_vampire_medium-light_skin_tone": "🧛🏼\u200d♂️",
    "man_vampire_medium_skin_tone": "🧛🏽\u200d♂️",
    "man_walking": "🚶\u200d♂️",
    "man_walking_dark_skin_tone": "🚶🏿\u200d♂️",
    "man_walking_light_skin_tone": "🚶🏻\u200d♂️",
    "man_walking_medium-dark_skin_tone": "🚶🏾\u200d♂️",
    "man_walking_medium-light_skin_tone": "🚶🏼\u200d♂️",
    "man_walking_medium_skin_tone": "🚶🏽\u200d♂️",
    "man_wearing_turban": "👳\u200d♂️",
    "man_wearing_turban_dark_skin_tone": "👳🏿\u200d♂️",
    "man_wearing_turban_light_skin_tone": "👳🏻\u200d♂️",
    "man_wearing_turban_medium-dark_skin_tone": "👳🏾\u200d♂️",
    "man_wearing_turban_medium-light_skin_tone": "👳🏼\u200d♂️",
    "man_wearing_turban_medium_skin_tone": "👳🏽\u200d♂️",
    "man_with_probing_cane": "👨\u200d🦯",
    "man_with_chinese_cap": "👲",
    "man_with_chinese_cap_dark_skin_tone": "👲🏿",
    "man_with_chinese_cap_light_skin_tone": "👲🏻",
    "man_with_chinese_cap_medium-dark_skin_tone": "👲🏾",
    "man_with_chinese_cap_medium-light_skin_tone": "👲🏼",
    "man_with_chinese_cap_medium_skin_tone": "👲🏽",
    "man_zombie": "🧟\u200d♂️",
    "mango": "🥭",
    "mantelpiece_clock": "🕰",
    "manual_wheelchair": "🦽",
    "man’s_shoe": "👞",
    "map_of_japan": "🗾",
    "maple_leaf": "🍁",
    "martial_arts_uniform": "🥋",
    "mate": "🧉",
    "meat_on_bone": "🍖",
    "mechanical_arm": "🦾",
    "mechanical_leg": "🦿",
    "medical_symbol": "⚕",
    "megaphone": "📣",
    "melon": "🍈",
    "memo": "📝",
    "men_with_bunny_ears": "👯\u200d♂️",
    "men_wrestling": "🤼\u200d♂️",
    "menorah": "🕎",
    "men’s_room": "🚹",
    "mermaid": "🧜\u200d♀️",
    "mermaid_dark_skin_tone": "🧜🏿\u200d♀️",
    "mermaid_light_skin_tone": "🧜🏻\u200d♀️",
    "mermaid_medium-dark_skin_tone": "🧜🏾\u200d♀️",
    "mermaid_medium-light_skin_tone": "🧜🏼\u200d♀️",
    "mermaid_medium_skin_tone": "🧜🏽\u200d♀️",
    "merman": "🧜\u200d♂️",
    "merman_dark_skin_tone": "🧜🏿\u200d♂️",
    "merman_light_skin_tone": "🧜🏻\u200d♂️",
    "merman_medium-dark_skin_tone": "🧜🏾\u200d♂️",
    "merman_medium-light_skin_tone": "🧜🏼\u200d♂️",
    "merman_medium_skin_tone": "🧜🏽\u200d♂️",
    "merperson": "🧜",
    "merperson_dark_skin_tone": "🧜🏿",
    "merperson_light_skin_tone": "🧜🏻",
    "merperson_medium-dark_skin_tone": "🧜🏾",
    "merperson_medium-light_skin_tone": "🧜🏼",
    "merperson_medium_skin_tone": "🧜🏽",
    "metro": "🚇",
    "microbe": "🦠",
    "microphone": "🎤",
    "microscope": "🔬",
    "middle_finger": "🖕",
    "middle_finger_dark_skin_tone": "🖕🏿",
    "middle_finger_light_skin_tone": "🖕🏻",
    "middle_finger_medium-dark_skin_tone": "🖕🏾",
    "middle_finger_medium-light_skin_tone": "🖕🏼",
    "middle_finger_medium_skin_tone": "🖕🏽",
    "military_medal": "🎖",
    "milky_way": "🌌",
    "minibus": "🚐",
    "moai": "🗿",
    "mobile_phone": "📱",
    "mobile_phone_off": "📴",
    "mobile_phone_with_arrow": "📲",
    "money-mouth_face": "🤑",
    "money_bag": "💰",
    "money_with_wings": "💸",
    "monkey": "🐒",
    "monkey_face": "🐵",
    "monorail": "🚝",
    "moon_cake": "🥮",
    "moon_viewing_ceremony": "🎑",
    "mosque": "🕌",
    "mosquito": "🦟",
    "motor_boat": "🛥",
    "motor_scooter": "🛵",
    "motorcycle": "🏍",
    "motorized_wheelchair": "🦼",
    "motorway": "🛣",
    "mount_fuji": "🗻",
    "mountain": "⛰",
    "mountain_cableway": "🚠",
    "mountain_railway": "🚞",
    "mouse": "🐭",
    "mouse_face": "🐭",
    "mouth": "👄",
    "movie_camera": "🎥",
    "mushroom": "🍄",
    "musical_keyboard": "🎹",
    "musical_note": "🎵",
    "musical_notes": "🎶",
    "musical_score": "🎼",
    "muted_speaker": "🔇",
    "nail_polish": "💅",
    "nail_polish_dark_skin_tone": "💅🏿",
    "nail_polish_light_skin_tone": "💅🏻",
    "nail_polish_medium-dark_skin_tone": "💅🏾",
    "nail_polish_medium-light_skin_tone": "💅🏼",
    "nail_polish_medium_skin_tone": "💅🏽",
    "name_badge": "📛",
    "national_park": "🏞",
    "nauseated_face": "🤢",
    "nazar_amulet": "🧿",
    "necktie": "👔",
    "nerd_face": "🤓",
    "neutral_face": "😐",
    "new_moon": "🌑",
    "new_moon_face": "🌚",
    "newspaper": "📰",
    "next_track_button": "⏭",
    "night_with_stars": "🌃",
    "nine-thirty": "🕤",
    "nine_o’clock": "🕘",
    "no_bicycles": "🚳",
    "no_entry": "⛔",
    "no_littering": "🚯",
    "no_mobile_phones": "📵",
    "no_one_under_eighteen": "🔞",
    "no_pedestrians": "🚷",
    "no_smoking": "🚭",
    "non-potable_water": "🚱",
    "nose": "👃",
    "nose_dark_skin_tone": "👃🏿",
    "nose_light_skin_tone": "👃🏻",
    "nose_medium-dark_skin_tone": "👃🏾",
    "nose_medium-light_skin_tone": "👃🏼",
    "nose_medium_skin_tone": "👃🏽",
    "notebook": "📓",
    "notebook_with_decorative_cover": "📔",
    "nut_and_bolt": "🔩",
    "octopus": "🐙",
    "oden": "🍢",
    "office_building": "🏢",
    "ogre": "👹",
    "oil_drum": "🛢",
    "old_key": "🗝",
    "old_man": "👴",
    "old_man_dark_skin_tone": "👴🏿",
    "old_man_light_skin_tone": "👴🏻",
    "old_man_medium-dark_skin_tone": "👴🏾",
    "old_man_medium-light_skin_tone": "👴🏼",
    "old_man_medium_skin_tone": "👴🏽",
    "old_woman": "👵",
    "old_woman_dark_skin_tone": "👵🏿",
    "old_woman_light_skin_tone": "👵🏻",
    "old_woman_medium-dark_skin_tone": "👵🏾",
    "old_woman_medium-light_skin_tone": "👵🏼",
    "old_woman_medium_skin_tone": "👵🏽",
    "older_adult": "🧓",
    "older_adult_dark_skin_tone": "🧓🏿",
    "older_adult_light_skin_tone": "🧓🏻",
    "older_adult_medium-dark_skin_tone": "🧓🏾",
    "older_adult_medium-light_skin_tone": "🧓🏼",
    "older_adult_medium_skin_tone": "🧓🏽",
    "om": "🕉",
    "oncoming_automobile": "🚘",
    "oncoming_bus": "🚍",
    "oncoming_fist": "👊",
    "oncoming_fist_dark_skin_tone": "👊🏿",
    "oncoming_fist_light_skin_tone": "👊🏻",
    "oncoming_fist_medium-dark_skin_tone": "👊🏾",
    "oncoming_fist_medium-light_skin_tone": "👊🏼",
    "oncoming_fist_medium_skin_tone": "👊🏽",
    "oncoming_police_car": "🚔",
    "oncoming_taxi": "🚖",
    "one-piece_swimsuit": "🩱",
    "one-thirty": "🕜",
    "one_o’clock": "🕐",
    "onion": "🧅",
    "open_book": "📖",
    "open_file_folder": "📂",
    "open_hands": "👐",
    "open_hands_dark_skin_tone": "👐🏿",
    "open_hands_light_skin_tone": "👐🏻",
    "open_hands_medium-dark_skin_tone": "👐🏾",
    "open_hands_medium-light_skin_tone": "👐🏼",
    "open_hands_medium_skin_tone": "👐🏽",
    "open_mailbox_with_lowered_flag": "📭",
    "open_mailbox_with_raised_flag": "📬",
    "optical_disk": "💿",
    "orange_book": "📙",
    "orange_circle": "🟠",
    "orange_heart": "🧡",
    "orange_square": "🟧",
    "orangutan": "🦧",
    "orthodox_cross": "☦",
    "otter": "🦦",
    "outbox_tray": "📤",
    "owl": "🦉",
    "ox": "🐂",
    "oyster": "🦪",
    "package": "📦",
    "page_facing_up": "📄",
    "page_with_curl": "📃",
    "pager": "📟",
    "paintbrush": "🖌",
    "palm_tree": "🌴",
    "palms_up_together": "🤲",
    "palms_up_together_dark_skin_tone": "🤲🏿",
    "palms_up_together_light_skin_tone": "🤲🏻",
    "palms_up_together_medium-dark_skin_tone": "🤲🏾",
    "palms_up_together_medium-light_skin_tone": "🤲🏼",
    "palms_up_together_medium_skin_tone": "🤲🏽",
    "pancakes": "🥞",
    "panda_face": "🐼",
    "paperclip": "📎",
    "parrot": "🦜",
    "part_alternation_mark": "〽",
    "party_popper": "🎉",
    "partying_face": "🥳",
    "passenger_ship": "🛳",
    "passport_control": "🛂",
    "pause_button": "⏸",
    "paw_prints": "🐾",
    "peace_symbol": "☮",
    "peach": "🍑",
    "peacock": "🦚",
    "peanuts": "🥜",
    "pear": "🍐",
    "pen": "🖊",
    "pencil": "📝",
    "penguin": "🐧",
    "pensive_face": "😔",
    "people_holding_hands": "🧑\u200d🤝\u200d🧑",
    "people_with_bunny_ears": "👯",
    "people_wrestling": "🤼",
    "performing_arts": "🎭",
    "persevering_face": "😣",
    "person_biking": "🚴",
    "person_biking_dark_skin_tone": "🚴🏿",
    "person_biking_light_skin_tone": "🚴🏻",
    "person_biking_medium-dark_skin_tone": "🚴🏾",
    "person_biking_medium-light_skin_tone": "🚴🏼",
    "person_biking_medium_skin_tone": "🚴🏽",
    "person_bouncing_ball": "⛹",
    "person_bouncing_ball_dark_skin_tone": "⛹🏿",
    "person_bouncing_ball_light_skin_tone": "⛹🏻",
    "person_bouncing_ball_medium-dark_skin_tone": "⛹🏾",
    "person_bouncing_ball_medium-light_skin_tone": "⛹🏼",
    "person_bouncing_ball_medium_skin_tone": "⛹🏽",
    "person_bowing": "🙇",
    "person_bowing_dark_skin_tone": "🙇🏿",
    "person_bowing_light_skin_tone": "🙇🏻",
    "person_bowing_medium-dark_skin_tone": "🙇🏾",
    "person_bowing_medium-light_skin_tone": "🙇🏼",
    "person_bowing_medium_skin_tone": "🙇🏽",
    "person_cartwheeling": "🤸",
    "person_cartwheeling_dark_skin_tone": "🤸🏿",
    "person_cartwheeling_light_skin_tone": "🤸🏻",
    "person_cartwheeling_medium-dark_skin_tone": "🤸🏾",
    "person_cartwheeling_medium-light_skin_tone": "🤸🏼",
    "person_cartwheeling_medium_skin_tone": "🤸🏽",
    "person_climbing": "🧗",
    "person_climbing_dark_skin_tone": "🧗🏿",
    "person_climbing_light_skin_tone": "🧗🏻",
    "person_climbing_medium-dark_skin_tone": "🧗🏾",
    "person_climbing_medium-light_skin_tone": "🧗🏼",
    "person_climbing_medium_skin_tone": "🧗🏽",
    "person_facepalming": "🤦",
    "person_facepalming_dark_skin_tone": "🤦🏿",
    "person_facepalming_light_skin_tone": "🤦🏻",
    "person_facepalming_medium-dark_skin_tone": "🤦🏾",
    "person_facepalming_medium-light_skin_tone": "🤦🏼",
    "person_facepalming_medium_skin_tone": "🤦🏽",
    "person_fencing": "🤺",
    "person_frowning": "🙍",
    "person_frowning_dark_skin_tone": "🙍🏿",
    "person_frowning_light_skin_tone": "🙍🏻",
    "person_frowning_medium-dark_skin_tone": "🙍🏾",
    "person_frowning_medium-light_skin_tone": "🙍🏼",
    "person_frowning_medium_skin_tone": "🙍🏽",
    "person_gesturing_no": "🙅",
    "person_gesturing_no_dark_skin_tone": "🙅🏿",
    "person_gesturing_no_light_skin_tone": "🙅🏻",
    "person_gesturing_no_medium-dark_skin_tone": "🙅🏾",
    "person_gesturing_no_medium-light_skin_tone": "🙅🏼",
    "person_gesturing_no_medium_skin_tone": "🙅🏽",
    "person_gesturing_ok": "🙆",
    "person_gesturing_ok_dark_skin_tone": "🙆🏿",
    "person_gesturing_ok_light_skin_tone": "🙆🏻",
    "person_gesturing_ok_medium-dark_skin_tone": "🙆🏾",
    "person_gesturing_ok_medium-light_skin_tone": "🙆🏼",
    "person_gesturing_ok_medium_skin_tone": "🙆🏽",
    "person_getting_haircut": "💇",
    "person_getting_haircut_dark_skin_tone": "💇🏿",
    "person_getting_haircut_light_skin_tone": "💇🏻",
    "person_getting_haircut_medium-dark_skin_tone": "💇🏾",
    "person_getting_haircut_medium-light_skin_tone": "💇🏼",
    "person_getting_haircut_medium_skin_tone": "💇🏽",
    "person_getting_massage": "💆",
    "person_getting_massage_dark_skin_tone": "💆🏿",
    "person_getting_massage_light_skin_tone": "💆🏻",
    "person_getting_massage_medium-dark_skin_tone": "💆🏾",
    "person_getting_massage_medium-light_skin_tone": "💆🏼",
    "person_getting_massage_medium_skin_tone": "💆🏽",
    "person_golfing": "🏌",
    "person_golfing_dark_skin_tone": "🏌🏿",
    "person_golfing_light_skin_tone": "🏌🏻",
    "person_golfing_medium-dark_skin_tone": "🏌🏾",
    "person_golfing_medium-light_skin_tone": "🏌🏼",
    "person_golfing_medium_skin_tone": "🏌🏽",
    "person_in_bed": "🛌",
    "person_in_bed_dark_skin_tone": "🛌🏿",
    "person_in_bed_light_skin_tone": "🛌🏻",
    "person_in_bed_medium-dark_skin_tone": "🛌🏾",
    "person_in_bed_medium-light_skin_tone": "🛌🏼",
    "person_in_bed_medium_skin_tone": "🛌🏽",
    "person_in_lotus_position": "🧘",
    "person_in_lotus_position_dark_skin_tone": "🧘🏿",
    "person_in_lotus_position_light_skin_tone": "🧘🏻",
    "person_in_lotus_position_medium-dark_skin_tone": "🧘🏾",
    "person_in_lotus_position_medium-light_skin_tone": "🧘🏼",
    "person_in_lotus_position_medium_skin_tone": "🧘🏽",
    "person_in_steamy_room": "🧖",
    "person_in_steamy_room_dark_skin_tone": "🧖🏿",
    "person_in_steamy_room_light_skin_tone": "🧖🏻",
    "person_in_steamy_room_medium-dark_skin_tone": "🧖🏾",
    "person_in_steamy_room_medium-light_skin_tone": "🧖🏼",
    "person_in_steamy_room_medium_skin_tone": "🧖🏽",
    "person_juggling": "🤹",
    "person_juggling_dark_skin_tone": "🤹🏿",
    "person_juggling_light_skin_tone": "🤹🏻",
    "person_juggling_medium-dark_skin_tone": "🤹🏾",
    "person_juggling_medium-light_skin_tone": "🤹🏼",
    "person_juggling_medium_skin_tone": "🤹🏽",
    "person_kneeling": "🧎",
    "person_lifting_weights": "🏋",
    "person_lifting_weights_dark_skin_tone": "🏋🏿",
    "person_lifting_weights_light_skin_tone": "🏋🏻",
    "person_lifting_weights_medium-dark_skin_tone": "🏋🏾",
    "person_lifting_weights_medium-light_skin_tone": "🏋🏼",
    "person_lifting_weights_medium_skin_tone": "🏋🏽",
    "person_mountain_biking": "🚵",
    "person_mountain_biking_dark_skin_tone": "🚵🏿",
    "person_mountain_biking_light_skin_tone": "🚵🏻",
    "person_mountain_biking_medium-dark_skin_tone": "🚵🏾",
    "person_mountain_biking_medium-light_skin_tone": "🚵🏼",
    "person_mountain_biking_medium_skin_tone": "🚵🏽",
    "person_playing_handball": "🤾",
    "person_playing_handball_dark_skin_tone": "🤾🏿",
    "person_playing_handball_light_skin_tone": "🤾🏻",
    "person_playing_handball_medium-dark_skin_tone": "🤾🏾",
    "person_playing_handball_medium-light_skin_tone": "🤾🏼",
    "person_playing_handball_medium_skin_tone": "🤾🏽",
    "person_playing_water_polo": "🤽",
    "person_playing_water_polo_dark_skin_tone": "🤽🏿",
    "person_playing_water_polo_light_skin_tone": "🤽🏻",
    "person_playing_water_polo_medium-dark_skin_tone": "🤽🏾",
    "person_playing_water_polo_medium-light_skin_tone": "🤽🏼",
    "person_playing_water_polo_medium_skin_tone": "🤽🏽",
    "person_pouting": "🙎",
    "person_pouting_dark_skin_tone": "🙎🏿",
    "person_pouting_light_skin_tone": "🙎🏻",
    "person_pouting_medium-dark_skin_tone": "🙎🏾",
    "person_pouting_medium-light_skin_tone": "🙎🏼",
    "person_pouting_medium_skin_tone": "🙎🏽",
    "person_raising_hand": "🙋",
    "person_raising_hand_dark_skin_tone": "🙋🏿",
    "person_raising_hand_light_skin_tone": "🙋🏻",
    "person_raising_hand_medium-dark_skin_tone": "🙋🏾",
    "person_raising_hand_medium-light_skin_tone": "🙋🏼",
    "person_raising_hand_medium_skin_tone": "🙋🏽",
    "person_rowing_boat": "🚣",
    "person_rowing_boat_dark_skin_tone": "🚣🏿",
    "person_rowing_boat_light_skin_tone": "🚣🏻",
    "person_rowing_boat_medium-dark_skin_tone": "🚣🏾",
    "person_rowing_boat_medium-light_skin_tone": "🚣🏼",
    "person_rowing_boat_medium_skin_tone": "🚣🏽",
    "person_running": "🏃",
    "person_running_dark_skin_tone": "🏃🏿",
    "person_running_light_skin_tone": "🏃🏻",
    "person_running_medium-dark_skin_tone": "🏃🏾",
    "person_running_medium-light_skin_tone": "🏃🏼",
    "person_running_medium_skin_tone": "🏃🏽",
    "person_shrugging": "🤷",
    "person_shrugging_dark_skin_tone": "🤷🏿",
    "person_shrugging_light_skin_tone": "🤷🏻",
    "person_shrugging_medium-dark_skin_tone": "🤷🏾",
    "person_shrugging_medium-light_skin_tone": "🤷🏼",
    "person_shrugging_medium_skin_tone": "🤷🏽",
    "person_standing": "🧍",
    "person_surfing": "🏄",
    "person_surfing_dark_skin_tone": "🏄🏿",
    "person_surfing_light_skin_tone": "🏄🏻",
    "person_surfing_medium-dark_skin_tone": "🏄🏾",
    "person_surfing_medium-light_skin_tone": "🏄🏼",
    "person_surfing_medium_skin_tone": "🏄🏽",
    "person_swimming": "🏊",
    "person_swimming_dark_skin_tone": "🏊🏿",
    "person_swimming_light_skin_tone": "🏊🏻",
    "person_swimming_medium-dark_skin_tone": "🏊🏾",
    "person_swimming_medium-light_skin_tone": "🏊🏼",
    "person_swimming_medium_skin_tone": "🏊🏽",
    "person_taking_bath": "🛀",
    "person_taking_bath_dark_skin_tone": "🛀🏿",
    "person_taking_bath_light_skin_tone": "🛀🏻",
    "person_taking_bath_medium-dark_skin_tone": "🛀🏾",
    "person_taking_bath_medium-light_skin_tone": "🛀🏼",
    "person_taking_bath_medium_skin_tone": "🛀🏽",
    "person_tipping_hand": "💁",
    "person_tipping_hand_dark_skin_tone": "💁🏿",
    "person_tipping_hand_light_skin_tone": "💁🏻",
    "person_tipping_hand_medium-dark_skin_tone": "💁🏾",
    "person_tipping_hand_medium-light_skin_tone": "💁🏼",
    "person_tipping_hand_medium_skin_tone": "💁🏽",
    "person_walking": "🚶",
    "person_walking_dark_skin_tone": "🚶🏿",
    "person_walking_light_skin_tone": "🚶🏻",
    "person_walking_medium-dark_skin_tone": "🚶🏾",
    "person_walking_medium-light_skin_tone": "🚶🏼",
    "person_walking_medium_skin_tone": "🚶🏽",
    "person_wearing_turban": "👳",
    "person_wearing_turban_dark_skin_tone": "👳🏿",
    "person_wearing_turban_light_skin_tone": "👳🏻",
    "person_wearing_turban_medium-dark_skin_tone": "👳🏾",
    "person_wearing_turban_medium-light_skin_tone": "👳🏼",
    "person_wearing_turban_medium_skin_tone": "👳🏽",
    "petri_dish": "🧫",
    "pick": "⛏",
    "pie": "🥧",
    "pig": "🐷",
    "pig_face": "🐷",
    "pig_nose": "🐽",
    "pile_of_poo": "💩",
    "pill": "💊",
    "pinching_hand": "🤏",
    "pine_decoration": "🎍",
    "pineapple": "🍍",
    "ping_pong": "🏓",
    "pirate_flag": "🏴\u200d☠️",
    "pistol": "🔫",
    "pizza": "🍕",
    "place_of_worship": "🛐",
    "play_button": "▶",
    "play_or_pause_button": "⏯",
    "pleading_face": "🥺",
    "police_car": "🚓",
    "police_car_light": "🚨",
    "police_officer": "👮",
    "police_officer_dark_skin_tone": "👮🏿",
    "police_officer_light_skin_tone": "👮🏻",
    "police_officer_medium-dark_skin_tone": "👮🏾",
    "police_officer_medium-light_skin_tone": "👮🏼",
    "police_officer_medium_skin_tone": "👮🏽",
    "poodle": "🐩",
    "pool_8_ball": "🎱",
    "popcorn": "🍿",
    "post_office": "🏣",
    "postal_horn": "📯",
    "postbox": "📮",
    "pot_of_food": "🍲",
    "potable_water": "🚰",
    "potato": "🥔",
    "poultry_leg": "🍗",
    "pound_banknote": "💷",
    "pouting_cat_face": "😾",
    "pouting_face": "😡",
    "prayer_beads": "📿",
    "pregnant_woman": "🤰",
    "pregnant_woman_dark_skin_tone": "🤰🏿",
    "pregnant_woman_light_skin_tone": "🤰🏻",
    "pregnant_woman_medium-dark_skin_tone": "🤰🏾",
    "pregnant_woman_medium-light_skin_tone": "🤰🏼",
    "pregnant_woman_medium_skin_tone": "🤰🏽",
    "pretzel": "🥨",
    "probing_cane": "🦯",
    "prince": "🤴",
    "prince_dark_skin_tone": "🤴🏿",
    "prince_light_skin_tone": "🤴🏻",
    "prince_medium-dark_skin_tone": "🤴🏾",
    "prince_medium-light_skin_tone": "🤴🏼",
    "prince_medium_skin_tone": "🤴🏽",
    "princess": "👸",
    "princess_dark_skin_tone": "👸🏿",
    "princess_light_skin_tone": "👸🏻",
    "princess_medium-dark_skin_tone": "👸🏾",
    "princess_medium-light_skin_tone": "👸🏼",
    "princess_medium_skin_tone": "👸🏽",
    "printer": "🖨",
    "prohibited": "🚫",
    "purple_circle": "🟣",
    "purple_heart": "💜",
    "purple_square": "🟪",
    "purse": "👛",
    "pushpin": "📌",
    "question_mark": "❓",
    "rabbit": "🐰",
    "rabbit_face": "🐰",
    "raccoon": "🦝",
    "racing_car": "🏎",
    "radio": "📻",
    "radio_button": "🔘",
    "radioactive": "☢",
    "railway_car": "🚃",
    "railway_track": "🛤",
    "rainbow": "🌈",
    "rainbow_flag": "🏳️\u200d🌈",
    "raised_back_of_hand": "🤚",
    "raised_back_of_hand_dark_skin_tone": "🤚🏿",
    "raised_back_of_hand_light_skin_tone": "🤚🏻",
    "raised_back_of_hand_medium-dark_skin_tone": "🤚🏾",
    "raised_back_of_hand_medium-light_skin_tone": "🤚🏼",
    "raised_back_of_hand_medium_skin_tone": "🤚🏽",
    "raised_fist": "✊",
    "raised_fist_dark_skin_tone": "✊🏿",
    "raised_fist_light_skin_tone": "✊🏻",
    "raised_fist_medium-dark_skin_tone": "✊🏾",
    "raised_fist_medium-light_skin_tone": "✊🏼",
    "raised_fist_medium_skin_tone": "✊🏽",
    "raised_hand": "✋",
    "raised_hand_dark_skin_tone": "✋🏿",
    "raised_hand_light_skin_tone": "✋🏻",
    "raised_hand_medium-dark_skin_tone": "✋🏾",
    "raised_hand_medium-light_skin_tone": "✋🏼",
    "raised_hand_medium_skin_tone": "✋🏽",
    "raising_hands": "🙌",
    "raising_hands_dark_skin_tone": "🙌🏿",
    "raising_hands_light_skin_tone": "🙌🏻",
    "raising_hands_medium-dark_skin_tone": "🙌🏾",
    "raising_hands_medium-light_skin_tone": "🙌🏼",
    "raising_hands_medium_skin_tone": "🙌🏽",
    "ram": "🐏",
    "rat": "🐀",
    "razor": "🪒",
    "ringed_planet": "🪐",
    "receipt": "🧾",
    "record_button": "⏺",
    "recycling_symbol": "♻",
    "red_apple": "🍎",
    "red_circle": "🔴",
    "red_envelope": "🧧",
    "red_hair": "🦰",
    "red-haired_man": "👨\u200d🦰",
    "red-haired_woman": "👩\u200d🦰",
    "red_heart": "❤",
    "red_paper_lantern": "🏮",
    "red_square": "🟥",
    "red_triangle_pointed_down": "🔻",
    "red_triangle_pointed_up": "🔺",
    "registered": "®",
    "relieved_face": "😌",
    "reminder_ribbon": "🎗",
    "repeat_button": "🔁",
    "repeat_single_button": "🔂",
    "rescue_worker’s_helmet": "⛑",
    "restroom": "🚻",
    "reverse_button": "◀",
    "revolving_hearts": "💞",
    "rhinoceros": "🦏",
    "ribbon": "🎀",
    "rice_ball": "🍙",
    "rice_cracker": "🍘",
    "right-facing_fist": "🤜",
    "right-facing_fist_dark_skin_tone": "🤜🏿",
    "right-facing_fist_light_skin_tone": "🤜🏻",
    "right-facing_fist_medium-dark_skin_tone": "🤜🏾",
    "right-facing_fist_medium-light_skin_tone": "🤜🏼",
    "right-facing_fist_medium_skin_tone": "🤜🏽",
    "right_anger_bubble": "🗯",
    "right_arrow": "➡",
    "right_arrow_curving_down": "⤵",
    "right_arrow_curving_left": "↩",
    "right_arrow_curving_up": "⤴",
    "ring": "💍",
    "roasted_sweet_potato": "🍠",
    "robot_face": "🤖",
    "rocket": "🚀",
    "roll_of_paper": "🧻",
    "rolled-up_newspaper": "🗞",
    "roller_coaster": "🎢",
    "rolling_on_the_floor_laughing": "🤣",
    "rooster": "🐓",
    "rose": "🌹",
    "rosette": "🏵",
    "round_pushpin": "📍",
    "rugby_football": "🏉",
    "running_shirt": "🎽",
    "running_shoe": "👟",
    "sad_but_relieved_face": "😥",
    "safety_pin": "🧷",
    "safety_vest": "🦺",
    "salt": "🧂",
    "sailboat": "⛵",
    "sake": "🍶",
    "sandwich": "🥪",
    "sari": "🥻",
    "satellite": "📡",
    "satellite_antenna": "📡",
    "sauropod": "🦕",
    "saxophone": "🎷",
    "scarf": "🧣",
    "school": "🏫",
    "school_backpack": "🎒",
    "scissors": "✂",
    "scorpion": "🦂",
    "scroll": "📜",
    "seat": "💺",
    "see-no-evil_monkey": "🙈",
    "seedling": "🌱",
    "selfie": "🤳",
    "selfie_dark_skin_tone": "🤳🏿",
    "selfie_light_skin_tone": "🤳🏻",
    "selfie_medium-dark_skin_tone": "🤳🏾",
    "selfie_medium-light_skin_tone": "🤳🏼",
    "selfie_medium_skin_tone": "🤳🏽",
    "service_dog": "🐕\u200d🦺",
    "seven-thirty": "🕢",
    "seven_o’clock": "🕖",
    "shallow_pan_of_food": "🥘",
    "shamrock": "☘",
    "shark": "🦈",
    "shaved_ice": "🍧",
    "sheaf_of_rice": "🌾",
    "shield": "🛡",
    "shinto_shrine": "⛩",
    "ship": "🚢",
    "shooting_star": "🌠",
    "shopping_bags": "🛍",
    "shopping_cart": "🛒",
    "shortcake": "🍰",
    "shorts": "🩳",
    "shower": "🚿",
    "shrimp": "🦐",
    "shuffle_tracks_button": "🔀",
    "shushing_face": "🤫",
    "sign_of_the_horns": "🤘",
    "sign_of_the_horns_dark_skin_tone": "🤘🏿",
    "sign_of_the_horns_light_skin_tone": "🤘🏻",
    "sign_of_the_horns_medium-dark_skin_tone": "🤘🏾",
    "sign_of_the_horns_medium-light_skin_tone": "🤘🏼",
    "sign_of_the_horns_medium_skin_tone": "🤘🏽",
    "six-thirty": "🕡",
    "six_o’clock": "🕕",
    "skateboard": "🛹",
    "skier": "⛷",
    "skis": "🎿",
    "skull": "💀",
    "skull_and_crossbones": "☠",
    "skunk": "🦨",
    "sled": "🛷",
    "sleeping_face": "😴",
    "sleepy_face": "😪",
    "slightly_frowning_face": "🙁",
    "slightly_smiling_face": "🙂",
    "slot_machine": "🎰",
    "sloth": "🦥",
    "small_airplane": "🛩",
    "small_blue_diamond": "🔹",
    "small_orange_diamond": "🔸",
    "smiling_cat_face_with_heart-eyes": "😻",
    "smiling_face": "☺",
    "smiling_face_with_halo": "😇",
    "smiling_face_with_3_hearts": "🥰",
    "smiling_face_with_heart-eyes": "😍",
    "smiling_face_with_horns": "😈",
    "smiling_face_with_smiling_eyes": "😊",
    "smiling_face_with_sunglasses": "😎",
    "smirking_face": "😏",
    "snail": "🐌",
    "snake": "🐍",
    "sneezing_face": "🤧",
    "snow-capped_mountain": "🏔",
    "snowboarder": "🏂",
    "snowboarder_dark_skin_tone": "🏂🏿",
    "snowboarder_light_skin_tone": "🏂🏻",
    "snowboarder_medium-dark_skin_tone": "🏂🏾",
    "snowboarder_medium-light_skin_tone": "🏂🏼",
    "snowboarder_medium_skin_tone": "🏂🏽",
    "snowflake": "❄",
    "snowman": "☃",
    "snowman_without_snow": "⛄",
    "soap": "🧼",
    "soccer_ball": "⚽",
    "socks": "🧦",
    "softball": "🥎",
    "soft_ice_cream": "🍦",
    "spade_suit": "♠",
    "spaghetti": "🍝",
    "sparkle": "❇",
    "sparkler": "🎇",
    "sparkles": "✨",
    "sparkling_heart": "💖",
    "speak-no-evil_monkey": "🙊",
    "speaker_high_volume": "🔊",
    "speaker_low_volume": "🔈",
    "speaker_medium_volume": "🔉",
    "speaking_head": "🗣",
    "speech_balloon": "💬",
    "speedboat": "🚤",
    "spider": "🕷",
    "spider_web": "🕸",
    "spiral_calendar": "🗓",
    "spiral_notepad": "🗒",
    "spiral_shell": "🐚",
    "spoon": "🥄",
    "sponge": "🧽",
    "sport_utility_vehicle": "🚙",
    "sports_medal": "🏅",
    "spouting_whale": "🐳",
    "squid": "🦑",
    "squinting_face_with_tongue": "😝",
    "stadium": "🏟",
    "star-struck": "🤩",
    "star_and_crescent": "☪",
    "star_of_david": "✡",
    "station": "🚉",
    "steaming_bowl": "🍜",
    "stethoscope": "🩺",
    "stop_button": "⏹",
    "stop_sign": "🛑",
    "stopwatch": "⏱",
    "straight_ruler": "📏",
    "strawberry": "🍓",
    "studio_microphone": "🎙",
    "stuffed_flatbread": "🥙",
    "sun": "☀",
    "sun_behind_cloud": "⛅",
    "sun_behind_large_cloud": "🌥",
    "sun_behind_rain_cloud": "🌦",
    "sun_behind_small_cloud": "🌤",
    "sun_with_face": "🌞",
    "sunflower": "🌻",
    "sunglasses": "😎",
    "sunrise": "🌅",
    "sunrise_over_mountains": "🌄",
    "sunset": "🌇",
    "superhero": "🦸",
    "supervillain": "🦹",
    "sushi": "🍣",
    "suspension_railway": "🚟",
    "swan": "🦢",
    "sweat_droplets": "💦",
    "synagogue": "🕍",
    "syringe": "💉",
    "t-shirt": "👕",
    "taco": "🌮",
    "takeout_box": "🥡",
    "tanabata_tree": "🎋",
    "tangerine": "🍊",
    "taxi": "🚕",
    "teacup_without_handle": "🍵",
    "tear-off_calendar": "📆",
    "teddy_bear": "🧸",
    "telephone": "☎",
    "telephone_receiver": "📞",
    "telescope": "🔭",
    "television": "📺",
    "ten-thirty": "🕥",
    "ten_o’clock": "🕙",
    "tennis": "🎾",
    "tent": "⛺",
    "test_tube": "🧪",
    "thermometer": "🌡",
    "thinking_face": "🤔",
    "thought_balloon": "💭",
    "thread": "🧵",
    "three-thirty": "🕞",
    "three_o’clock": "🕒",
    "thumbs_down": "👎",
    "thumbs_down_dark_skin_tone": "👎🏿",
    "thumbs_down_light_skin_tone": "👎🏻",
    "thumbs_down_medium-dark_skin_tone": "👎🏾",
    "thumbs_down_medium-light_skin_tone": "👎🏼",
    "thumbs_down_medium_skin_tone": "👎🏽",
    "thumbs_up": "👍",
    "thumbs_up_dark_skin_tone": "👍🏿",
    "thumbs_up_light_skin_tone": "👍🏻",
    "thumbs_up_medium-dark_skin_tone": "👍🏾",
    "thumbs_up_medium-light_skin_tone": "👍🏼",
    "thumbs_up_medium_skin_tone": "👍🏽",
    "ticket": "🎫",
    "tiger": "🐯",
    "tiger_face": "🐯",
    "timer_clock": "⏲",
    "tired_face": "😫",
    "toolbox": "🧰",
    "toilet": "🚽",
    "tomato": "🍅",
    "tongue": "👅",
    "tooth": "🦷",
    "top_hat": "🎩",
    "tornado": "🌪",
    "trackball": "🖲",
    "tractor": "🚜",
    "trade_mark": "™",
    "train": "🚋",
    "tram": "🚊",
    "tram_car": "🚋",
    "triangular_flag": "🚩",
    "triangular_ruler": "📐",
    "trident_emblem": "🔱",
    "trolleybus": "🚎",
    "trophy": "🏆",
    "tropical_drink": "🍹",
    "tropical_fish": "🐠",
    "trumpet": "🎺",
    "tulip": "🌷",
    "tumbler_glass": "🥃",
    "turtle": "🐢",
    "twelve-thirty": "🕧",
    "twelve_o’clock": "🕛",
    "two-hump_camel": "🐫",
    "two-thirty": "🕝",
    "two_hearts": "💕",
    "two_men_holding_hands": "👬",
    "two_o’clock": "🕑",
    "two_women_holding_hands": "👭",
    "umbrella": "☂",
    "umbrella_on_ground": "⛱",
    "umbrella_with_rain_drops": "☔",
    "unamused_face": "😒",
    "unicorn_face": "🦄",
    "unlocked": "🔓",
    "up-down_arrow": "↕",
    "up-left_arrow": "↖",
    "up-right_arrow": "↗",
    "up_arrow": "⬆",
    "upside-down_face": "🙃",
    "upwards_button": "🔼",
    "vampire": "🧛",
    "vampire_dark_skin_tone": "🧛🏿",
    "vampire_light_skin_tone": "🧛🏻",
    "vampire_medium-dark_skin_tone": "🧛🏾",
    "vampire_medium-light_skin_tone": "🧛🏼",
    "vampire_medium_skin_tone": "🧛🏽",
    "vertical_traffic_light": "🚦",
    "vibration_mode": "📳",
    "victory_hand": "✌",
    "victory_hand_dark_skin_tone": "✌🏿",
    "victory_hand_light_skin_tone": "✌🏻",
    "victory_hand_medium-dark_skin_tone": "✌🏾",
    "victory_hand_medium-light_skin_tone": "✌🏼",
    "victory_hand_medium_skin_tone": "✌🏽",
    "video_camera": "📹",
    "video_game": "🎮",
    "videocassette": "📼",
    "violin": "🎻",
    "volcano": "🌋",
    "volleyball": "🏐",
    "vulcan_salute": "🖖",
    "vulcan_salute_dark_skin_tone": "🖖🏿",
    "vulcan_salute_light_skin_tone": "🖖🏻",
    "vulcan_salute_medium-dark_skin_tone": "🖖🏾",
    "vulcan_salute_medium-light_skin_tone": "🖖🏼",
    "vulcan_salute_medium_skin_tone": "🖖🏽",
    "waffle": "🧇",
    "waning_crescent_moon": "🌘",
    "waning_gibbous_moon": "🌖",
    "warning": "⚠",
    "wastebasket": "🗑",
    "watch": "⌚",
    "water_buffalo": "🐃",
    "water_closet": "🚾",
    "water_wave": "🌊",
    "watermelon": "🍉",
    "waving_hand": "👋",
    "waving_hand_dark_skin_tone": "👋🏿",
    "waving_hand_light_skin_tone": "👋🏻",
    "waving_hand_medium-dark_skin_tone": "👋🏾",
    "waving_hand_medium-light_skin_tone": "👋🏼",
    "waving_hand_medium_skin_tone": "👋🏽",
    "wavy_dash": "〰",
    "waxing_crescent_moon": "🌒",
    "waxing_gibbous_moon": "🌔",
    "weary_cat_face": "🙀",
    "weary_face": "😩",
    "wedding": "💒",
    "whale": "🐳",
    "wheel_of_dharma": "☸",
    "wheelchair_symbol": "♿",
    "white_circle": "⚪",
    "white_exclamation_mark": "❕",
    "white_flag": "🏳",
    "white_flower": "💮",
    "white_hair": "🦳",
    "white-haired_man": "👨\u200d🦳",
    "white-haired_woman": "👩\u200d🦳",
    "white_heart": "🤍",
    "white_heavy_check_mark": "✅",
    "white_large_square": "⬜",
    "white_medium-small_square": "◽",
    "white_medium_square": "◻",
    "white_medium_star": "⭐",
    "white_question_mark": "❔",
    "white_small_square": "▫",
    "white_square_button": "🔳",
    "wilted_flower": "🥀",
    "wind_chime": "🎐",
    "wind_face": "🌬",
    "wine_glass": "🍷",
    "winking_face": "😉",
    "winking_face_with_tongue": "😜",
    "wolf_face": "🐺",
    "woman": "👩",
    "woman_artist": "👩\u200d🎨",
    "woman_artist_dark_skin_tone": "👩🏿\u200d🎨",
    "woman_artist_light_skin_tone": "👩🏻\u200d🎨",
    "woman_artist_medium-dark_skin_tone": "👩🏾\u200d🎨",
    "woman_artist_medium-light_skin_tone": "👩🏼\u200d🎨",
    "woman_artist_medium_skin_tone": "👩🏽\u200d🎨",
    "woman_astronaut": "👩\u200d🚀",
    "woman_astronaut_dark_skin_tone": "👩🏿\u200d🚀",
    "woman_astronaut_light_skin_tone": "👩🏻\u200d🚀",
    "woman_astronaut_medium-dark_skin_tone": "👩🏾\u200d🚀",
    "woman_astronaut_medium-light_skin_tone": "👩🏼\u200d🚀",
    "woman_astronaut_medium_skin_tone": "👩🏽\u200d🚀",
    "woman_biking": "🚴\u200d♀️",
    "woman_biking_dark_skin_tone": "🚴🏿\u200d♀️",
    "woman_biking_light_skin_tone": "🚴🏻\u200d♀️",
    "woman_biking_medium-dark_skin_tone": "🚴🏾\u200d♀️",
    "woman_biking_medium-light_skin_tone": "🚴🏼\u200d♀️",
    "woman_biking_medium_skin_tone": "🚴🏽\u200d♀️",
    "woman_bouncing_ball": "⛹️\u200d♀️",
    "woman_bouncing_ball_dark_skin_tone": "⛹🏿\u200d♀️",
    "woman_bouncing_ball_light_skin_tone": "⛹🏻\u200d♀️",
    "woman_bouncing_ball_medium-dark_skin_tone": "⛹🏾\u200d♀️",
    "woman_bouncing_ball_medium-light_skin_tone": "⛹🏼\u200d♀️",
    "woman_bouncing_ball_medium_skin_tone": "⛹🏽\u200d♀️",
    "woman_bowing": "🙇\u200d♀️",
    "woman_bowing_dark_skin_tone": "🙇🏿\u200d♀️",
    "woman_bowing_light_skin_tone": "🙇🏻\u200d♀️",
    "woman_bowing_medium-dark_skin_tone": "🙇🏾\u200d♀️",
    "woman_bowing_medium-light_skin_tone": "🙇🏼\u200d♀️",
    "woman_bowing_medium_skin_tone": "🙇🏽\u200d♀️",
    "woman_cartwheeling": "🤸\u200d♀️",
    "woman_cartwheeling_dark_skin_tone": "🤸🏿\u200d♀️",
    "woman_cartwheeling_light_skin_tone": "🤸🏻\u200d♀️",
    "woman_cartwheeling_medium-dark_skin_tone": "🤸🏾\u200d♀️",
    "woman_cartwheeling_medium-light_skin_tone": "🤸🏼\u200d♀️",
    "woman_cartwheeling_medium_skin_tone": "🤸🏽\u200d♀️",
    "woman_climbing": "🧗\u200d♀️",
    "woman_climbing_dark_skin_tone": "🧗🏿\u200d♀️",
    "woman_climbing_light_skin_tone": "🧗🏻\u200d♀️",
    "woman_climbing_medium-dark_skin_tone": "🧗🏾\u200d♀️",
    "woman_climbing_medium-light_skin_tone": "🧗🏼\u200d♀️",
    "woman_climbing_medium_skin_tone": "🧗🏽\u200d♀️",
    "woman_construction_worker": "👷\u200d♀️",
    "woman_construction_worker_dark_skin_tone": "👷🏿\u200d♀️",
    "woman_construction_worker_light_skin_tone": "👷🏻\u200d♀️",
    "woman_construction_worker_medium-dark_skin_tone": "👷🏾\u200d♀️",
    "woman_construction_worker_medium-light_skin_tone": "👷🏼\u200d♀️",
    "woman_construction_worker_medium_skin_tone": "👷🏽\u200d♀️",
    "woman_cook": "👩\u200d🍳",
    "woman_cook_dark_skin_tone": "👩🏿\u200d🍳",
    "woman_cook_light_skin_tone": "👩🏻\u200d🍳",
    "woman_cook_medium-dark_skin_tone": "👩🏾\u200d🍳",
    "woman_cook_medium-light_skin_tone": "👩🏼\u200d🍳",
    "woman_cook_medium_skin_tone": "👩🏽\u200d🍳",
    "woman_dancing": "💃",
    "woman_dancing_dark_skin_tone": "💃🏿",
    "woman_dancing_light_skin_tone": "💃🏻",
    "woman_dancing_medium-dark_skin_tone": "💃🏾",
    "woman_dancing_medium-light_skin_tone": "💃🏼",
    "woman_dancing_medium_skin_tone": "💃🏽",
    "woman_dark_skin_tone": "👩🏿",
    "woman_detective": "🕵️\u200d♀️",
    "woman_detective_dark_skin_tone": "🕵🏿\u200d♀️",
    "woman_detective_light_skin_tone": "🕵🏻\u200d♀️",
    "woman_detective_medium-dark_skin_tone": "🕵🏾\u200d♀️",
    "woman_detective_medium-light_skin_tone": "🕵🏼\u200d♀️",
    "woman_detective_medium_skin_tone": "🕵🏽\u200d♀️",
    "woman_elf": "🧝\u200d♀️",
    "woman_elf_dark_skin_tone": "🧝🏿\u200d♀️",
    "woman_elf_light_skin_tone": "🧝🏻\u200d♀️",
    "woman_elf_medium-dark_skin_tone": "🧝🏾\u200d♀️",
    "woman_elf_medium-light_skin_tone": "🧝🏼\u200d♀️",
    "woman_elf_medium_skin_tone": "🧝🏽\u200d♀️",
    "woman_facepalming": "🤦\u200d♀️",
    "woman_facepalming_dark_skin_tone": "🤦🏿\u200d♀️",
    "woman_facepalming_light_skin_tone": "🤦🏻\u200d♀️",
    "woman_facepalming_medium-dark_skin_tone": "🤦🏾\u200d♀️",
    "woman_facepalming_medium-light_skin_tone": "🤦🏼\u200d♀️",
    "woman_facepalming_medium_skin_tone": "🤦🏽\u200d♀️",
    "woman_factory_worker": "👩\u200d🏭",
    "woman_factory_worker_dark_skin_tone": "👩🏿\u200d🏭",
    "woman_factory_worker_light_skin_tone": "👩🏻\u200d🏭",
    "woman_factory_worker_medium-dark_skin_tone": "👩🏾\u200d🏭",
    "woman_factory_worker_medium-light_skin_tone": "👩🏼\u200d🏭",
    "woman_factory_worker_medium_skin_tone": "👩🏽\u200d🏭",
    "woman_fairy": "🧚\u200d♀️",
    "woman_fairy_dark_skin_tone": "🧚🏿\u200d♀️",
    "woman_fairy_light_skin_tone": "🧚🏻\u200d♀️",
    "woman_fairy_medium-dark_skin_tone": "🧚🏾\u200d♀️",
    "woman_fairy_medium-light_skin_tone": "🧚🏼\u200d♀️",
    "woman_fairy_medium_skin_tone": "🧚🏽\u200d♀️",
    "woman_farmer": "👩\u200d🌾",
    "woman_farmer_dark_skin_tone": "👩🏿\u200d🌾",
    "woman_farmer_light_skin_tone": "👩🏻\u200d🌾",
    "woman_farmer_medium-dark_skin_tone": "👩🏾\u200d🌾",
    "woman_farmer_medium-light_skin_tone": "👩🏼\u200d🌾",
    "woman_farmer_medium_skin_tone": "👩🏽\u200d🌾",
    "woman_firefighter": "👩\u200d🚒",
    "woman_firefighter_dark_skin_tone": "👩🏿\u200d🚒",
    "woman_firefighter_light_skin_tone": "👩🏻\u200d🚒",
    "woman_firefighter_medium-dark_skin_tone": "👩🏾\u200d🚒",
    "woman_firefighter_medium-light_skin_tone": "👩🏼\u200d🚒",
    "woman_firefighter_medium_skin_tone": "👩🏽\u200d🚒",
    "woman_frowning": "🙍\u200d♀️",
    "woman_frowning_dark_skin_tone": "🙍🏿\u200d♀️",
    "woman_frowning_light_skin_tone": "🙍🏻\u200d♀️",
    "woman_frowning_medium-dark_skin_tone": "🙍🏾\u200d♀️",
    "woman_frowning_medium-light_skin_tone": "🙍🏼\u200d♀️",
    "woman_frowning_medium_skin_tone": "🙍🏽\u200d♀️",
    "woman_genie": "🧞\u200d♀️",
    "woman_gesturing_no": "🙅\u200d♀️",
    "woman_gesturing_no_dark_skin_tone": "🙅🏿\u200d♀️",
    "woman_gesturing_no_light_skin_tone": "🙅🏻\u200d♀️",
    "woman_gesturing_no_medium-dark_skin_tone": "🙅🏾\u200d♀️",
    "woman_gesturing_no_medium-light_skin_tone": "🙅🏼\u200d♀️",
    "woman_gesturing_no_medium_skin_tone": "🙅🏽\u200d♀️",
    "woman_gesturing_ok": "🙆\u200d♀️",
    "woman_gesturing_ok_dark_skin_tone": "🙆🏿\u200d♀️",
    "woman_gesturing_ok_light_skin_tone": "🙆🏻\u200d♀️",
    "woman_gesturing_ok_medium-dark_skin_tone": "🙆🏾\u200d♀️",
    "woman_gesturing_ok_medium-light_skin_tone": "🙆🏼\u200d♀️",
    "woman_gesturing_ok_medium_skin_tone": "🙆🏽\u200d♀️",
    "woman_getting_haircut": "💇\u200d♀️",
    "woman_getting_haircut_dark_skin_tone": "💇🏿\u200d♀️",
    "woman_getting_haircut_light_skin_tone": "💇🏻\u200d♀️",
    "woman_getting_haircut_medium-dark_skin_tone": "💇🏾\u200d♀️",
    "woman_getting_haircut_medium-light_skin_tone": "💇🏼\u200d♀️",
    "woman_getting_haircut_medium_skin_tone": "💇🏽\u200d♀️",
    "woman_getting_massage": "💆\u200d♀️",
    "woman_getting_massage_dark_skin_tone": "💆🏿\u200d♀️",
    "woman_getting_massage_light_skin_tone": "💆🏻\u200d♀️",
    "woman_getting_massage_medium-dark_skin_tone": "💆🏾\u200d♀️",
    "woman_getting_massage_medium-light_skin_tone": "💆🏼\u200d♀️",
    "woman_getting_massage_medium_skin_tone": "💆🏽\u200d♀️",
    "woman_golfing": "🏌️\u200d♀️",
    "woman_golfing_dark_skin_tone": "🏌🏿\u200d♀️",
    "woman_golfing_light_skin_tone": "🏌🏻\u200d♀️",
    "woman_golfing_medium-dark_skin_tone": "🏌🏾\u200d♀️",
    "woman_golfing_medium-light_skin_tone": "🏌🏼\u200d♀️",
    "woman_golfing_medium_skin_tone": "🏌🏽\u200d♀️",
    "woman_guard": "💂\u200d♀️",
    "woman_guard_dark_skin_tone": "💂🏿\u200d♀️",
    "woman_guard_light_skin_tone": "💂🏻\u200d♀️",
    "woman_guard_medium-dark_skin_tone": "💂🏾\u200d♀️",
    "woman_guard_medium-light_skin_tone": "💂🏼\u200d♀️",
    "woman_guard_medium_skin_tone": "💂🏽\u200d♀️",
    "woman_health_worker": "👩\u200d⚕️",
    "woman_health_worker_dark_skin_tone": "👩🏿\u200d⚕️",
    "woman_health_worker_light_skin_tone": "👩🏻\u200d⚕️",
    "woman_health_worker_medium-dark_skin_tone": "👩🏾\u200d⚕️",
    "woman_health_worker_medium-light_skin_tone": "👩🏼\u200d⚕️",
    "woman_health_worker_medium_skin_tone": "👩🏽\u200d⚕️",
    "woman_in_lotus_position": "🧘\u200d♀️",
    "woman_in_lotus_position_dark_skin_tone": "🧘🏿\u200d♀️",
    "woman_in_lotus_position_light_skin_tone": "🧘🏻\u200d♀️",
    "woman_in_lotus_position_medium-dark_skin_tone": "🧘🏾\u200d♀️",
    "woman_in_lotus_position_medium-light_skin_tone": "🧘🏼\u200d♀️",
    "woman_in_lotus_position_medium_skin_tone": "🧘🏽\u200d♀️",
    "woman_in_manual_wheelchair": "👩\u200d🦽",
    "woman_in_motorized_wheelchair": "👩\u200d🦼",
    "woman_in_steamy_room": "🧖\u200d♀️",
    "woman_in_steamy_room_dark_skin_tone": "🧖🏿\u200d♀️",
    "woman_in_steamy_room_light_skin_tone": "🧖🏻\u200d♀️",
    "woman_in_steamy_room_medium-dark_skin_tone": "🧖🏾\u200d♀️",
    "woman_in_steamy_room_medium-light_skin_tone": "🧖🏼\u200d♀️",
    "woman_in_steamy_room_medium_skin_tone": "🧖🏽\u200d♀️",
    "woman_judge": "👩\u200d⚖️",
    "woman_judge_dark_skin_tone": "👩🏿\u200d⚖️",
    "woman_judge_light_skin_tone": "👩🏻\u200d⚖️",
    "woman_judge_medium-dark_skin_tone": "👩🏾\u200d⚖️",
    "woman_judge_medium-light_skin_tone": "👩🏼\u200d⚖️",
    "woman_judge_medium_skin_tone": "👩🏽\u200d⚖️",
    "woman_juggling": "🤹\u200d♀️",
    "woman_juggling_dark_skin_tone": "🤹🏿\u200d♀️",
    "woman_juggling_light_skin_tone": "🤹🏻\u200d♀️",
    "woman_juggling_medium-dark_skin_tone": "🤹🏾\u200d♀️",
    "woman_juggling_medium-light_skin_tone": "🤹🏼\u200d♀️",
    "woman_juggling_medium_skin_tone": "🤹🏽\u200d♀️",
    "woman_lifting_weights": "🏋️\u200d♀️",
    "woman_lifting_weights_dark_skin_tone": "🏋🏿\u200d♀️",
    "woman_lifting_weights_light_skin_tone": "🏋🏻\u200d♀️",
    "woman_lifting_weights_medium-dark_skin_tone": "🏋🏾\u200d♀️",
    "woman_lifting_weights_medium-light_skin_tone": "🏋🏼\u200d♀️",
    "woman_lifting_weights_medium_skin_tone": "🏋🏽\u200d♀️",
    "woman_light_skin_tone": "👩🏻",
    "woman_mage": "🧙\u200d♀️",
    "woman_mage_dark_skin_tone": "🧙🏿\u200d♀️",
    "woman_mage_light_skin_tone": "🧙🏻\u200d♀️",
    "woman_mage_medium-dark_skin_tone": "🧙🏾\u200d♀️",
    "woman_mage_medium-light_skin_tone": "🧙🏼\u200d♀️",
    "woman_mage_medium_skin_tone": "🧙🏽\u200d♀️",
    "woman_mechanic": "👩\u200d🔧",
    "woman_mechanic_dark_skin_tone": "👩🏿\u200d🔧",
    "woman_mechanic_light_skin_tone": "👩🏻\u200d🔧",
    "woman_mechanic_medium-dark_skin_tone": "👩🏾\u200d🔧",
    "woman_mechanic_medium-light_skin_tone": "👩🏼\u200d🔧",
    "woman_mechanic_medium_skin_tone": "👩🏽\u200d🔧",
    "woman_medium-dark_skin_tone": "👩🏾",
    "woman_medium-light_skin_tone": "👩🏼",
    "woman_medium_skin_tone": "👩🏽",
    "woman_mountain_biking": "🚵\u200d♀️",
    "woman_mountain_biking_dark_skin_tone": "🚵🏿\u200d♀️",
    "woman_mountain_biking_light_skin_tone": "🚵🏻\u200d♀️",
    "woman_mountain_biking_medium-dark_skin_tone": "🚵🏾\u200d♀️",
    "woman_mountain_biking_medium-light_skin_tone": "🚵🏼\u200d♀️",
    "woman_mountain_biking_medium_skin_tone": "🚵🏽\u200d♀️",
    "woman_office_worker": "👩\u200d💼",
    "woman_office_worker_dark_skin_tone": "👩🏿\u200d💼",
    "woman_office_worker_light_skin_tone": "👩🏻\u200d💼",
    "woman_office_worker_medium-dark_skin_tone": "👩🏾\u200d💼",
    "woman_office_worker_medium-light_skin_tone": "👩🏼\u200d💼",
    "woman_office_worker_medium_skin_tone": "👩🏽\u200d💼",
    "woman_pilot": "👩\u200d✈️",
    "woman_pilot_dark_skin_tone": "👩🏿\u200d✈️",
    "woman_pilot_light_skin_tone": "👩🏻\u200d✈️",
    "woman_pilot_medium-dark_skin_tone": "👩🏾\u200d✈️",
    "woman_pilot_medium-light_skin_tone": "👩🏼\u200d✈️",
    "woman_pilot_medium_skin_tone": "👩🏽\u200d✈️",
    "woman_playing_handball": "🤾\u200d♀️",
    "woman_playing_handball_dark_skin_tone": "🤾🏿\u200d♀️",
    "woman_playing_handball_light_skin_tone": "🤾🏻\u200d♀️",
    "woman_playing_handball_medium-dark_skin_tone": "🤾🏾\u200d♀️",
    "woman_playing_handball_medium-light_skin_tone": "🤾🏼\u200d♀️",
    "woman_playing_handball_medium_skin_tone": "🤾🏽\u200d♀️",
    "woman_playing_water_polo": "🤽\u200d♀️",
    "woman_playing_water_polo_dark_skin_tone": "🤽🏿\u200d♀️",
    "woman_playing_water_polo_light_skin_tone": "🤽🏻\u200d♀️",
    "woman_playing_water_polo_medium-dark_skin_tone": "🤽🏾\u200d♀️",
    "woman_playing_water_polo_medium-light_skin_tone": "🤽🏼\u200d♀️",
    "woman_playing_water_polo_medium_skin_tone": "🤽🏽\u200d♀️",
    "woman_police_officer": "👮\u200d♀️",
    "woman_police_officer_dark_skin_tone": "👮🏿\u200d♀️",
    "woman_police_officer_light_skin_tone": "👮🏻\u200d♀️",
    "woman_police_officer_medium-dark_skin_tone": "👮🏾\u200d♀️",
    "woman_police_officer_medium-light_skin_tone": "👮🏼\u200d♀️",
    "woman_police_officer_medium_skin_tone": "👮🏽\u200d♀️",
    "woman_pouting": "🙎\u200d♀️",
    "woman_pouting_dark_skin_tone": "🙎🏿\u200d♀️",
    "woman_pouting_light_skin_tone": "🙎🏻\u200d♀️",
    "woman_pouting_medium-dark_skin_tone": "🙎🏾\u200d♀️",
    "woman_pouting_medium-light_skin_tone": "🙎🏼\u200d♀️",
    "woman_pouting_medium_skin_tone": "🙎🏽\u200d♀️",
    "woman_raising_hand": "🙋\u200d♀️",
    "woman_raising_hand_dark_skin_tone": "🙋🏿\u200d♀️",
    "woman_raising_hand_light_skin_tone": "🙋🏻\u200d♀️",
    "woman_raising_hand_medium-dark_skin_tone": "🙋🏾\u200d♀️",
    "woman_raising_hand_medium-light_skin_tone": "🙋🏼\u200d♀️",
    "woman_raising_hand_medium_skin_tone": "🙋🏽\u200d♀️",
    "woman_rowing_boat": "🚣\u200d♀️",
    "woman_rowing_boat_dark_skin_tone": "🚣🏿\u200d♀️",
    "woman_rowing_boat_light_skin_tone": "🚣🏻\u200d♀️",
    "woman_rowing_boat_medium-dark_skin_tone": "🚣🏾\u200d♀️",
    "woman_rowing_boat_medium-light_skin_tone": "🚣🏼\u200d♀️",
    "woman_rowing_boat_medium_skin_tone": "🚣🏽\u200d♀️",
    "woman_running": "🏃\u200d♀️",
    "woman_running_dark_skin_tone": "🏃🏿\u200d♀️",
    "woman_running_light_skin_tone": "🏃🏻\u200d♀️",
    "woman_running_medium-dark_skin_tone": "🏃🏾\u200d♀️",
    "woman_running_medium-light_skin_tone": "🏃🏼\u200d♀️",
    "woman_running_medium_skin_tone": "🏃🏽\u200d♀️",
    "woman_scientist": "👩\u200d🔬",
    "woman_scientist_dark_skin_tone": "👩🏿\u200d🔬",
    "woman_scientist_light_skin_tone": "👩🏻\u200d🔬",
    "woman_scientist_medium-dark_skin_tone": "👩🏾\u200d🔬",
    "woman_scientist_medium-light_skin_tone": "👩🏼\u200d🔬",
    "woman_scientist_medium_skin_tone": "👩🏽\u200d🔬",
    "woman_shrugging": "🤷\u200d♀️",
    "woman_shrugging_dark_skin_tone": "🤷🏿\u200d♀️",
    "woman_shrugging_light_skin_tone": "🤷🏻\u200d♀️",
    "woman_shrugging_medium-dark_skin_tone": "🤷🏾\u200d♀️",
    "woman_shrugging_medium-light_skin_tone": "🤷🏼\u200d♀️",
    "woman_shrugging_medium_skin_tone": "🤷🏽\u200d♀️",
    "woman_singer": "👩\u200d🎤",
    "woman_singer_dark_skin_tone": "👩🏿\u200d🎤",
    "woman_singer_light_skin_tone": "👩🏻\u200d🎤",
    "woman_singer_medium-dark_skin_tone": "👩🏾\u200d🎤",
    "woman_singer_medium-light_skin_tone": "👩🏼\u200d🎤",
    "woman_singer_medium_skin_tone": "👩🏽\u200d🎤",
    "woman_student": "👩\u200d🎓",
    "woman_student_dark_skin_tone": "👩🏿\u200d🎓",
    "woman_student_light_skin_tone": "👩🏻\u200d🎓",
    "woman_student_medium-dark_skin_tone": "👩🏾\u200d🎓",
    "woman_student_medium-light_skin_tone": "👩🏼\u200d🎓",
    "woman_student_medium_skin_tone": "👩🏽\u200d🎓",
    "woman_surfing": "🏄\u200d♀️",
    "woman_surfing_dark_skin_tone": "🏄🏿\u200d♀️",
    "woman_surfing_light_skin_tone": "🏄🏻\u200d♀️",
    "woman_surfing_medium-dark_skin_tone": "🏄🏾\u200d♀️",
    "woman_surfing_medium-light_skin_tone": "🏄🏼\u200d♀️",
    "woman_surfing_medium_skin_tone": "🏄🏽\u200d♀️",
    "woman_swimming": "🏊\u200d♀️",
    "woman_swimming_dark_skin_tone": "🏊🏿\u200d♀️",
    "woman_swimming_light_skin_tone": "🏊🏻\u200d♀️",
    "woman_swimming_medium-dark_skin_tone": "🏊🏾\u200d♀️",
    "woman_swimming_medium-light_skin_tone": "🏊🏼\u200d♀️",
    "woman_swimming_medium_skin_tone": "🏊🏽\u200d♀️",
    "woman_teacher": "👩\u200d🏫",
    "woman_teacher_dark_skin_tone": "👩🏿\u200d🏫",
    "woman_teacher_light_skin_tone": "👩🏻\u200d🏫",
    "woman_teacher_medium-dark_skin_tone": "👩🏾\u200d🏫",
    "woman_teacher_medium-light_skin_tone": "👩🏼\u200d🏫",
    "woman_teacher_medium_skin_tone": "👩🏽\u200d🏫",
    "woman_technologist": "👩\u200d💻",
    "woman_technologist_dark_skin_tone": "👩🏿\u200d💻",
    "woman_technologist_light_skin_tone": "👩🏻\u200d💻",
    "woman_technologist_medium-dark_skin_tone": "👩🏾\u200d💻",
    "woman_technologist_medium-light_skin_tone": "👩🏼\u200d💻",
    "woman_technologist_medium_skin_tone": "👩🏽\u200d💻",
    "woman_tipping_hand": "💁\u200d♀️",
    "woman_tipping_hand_dark_skin_tone": "💁🏿\u200d♀️",
    "woman_tipping_hand_light_skin_tone": "💁🏻\u200d♀️",
    "woman_tipping_hand_medium-dark_skin_tone": "💁🏾\u200d♀️",
    "woman_tipping_hand_medium-light_skin_tone": "💁🏼\u200d♀️",
    "woman_tipping_hand_medium_skin_tone": "💁🏽\u200d♀️",
    "woman_vampire": "🧛\u200d♀️",
    "woman_vampire_dark_skin_tone": "🧛🏿\u200d♀️",
    "woman_vampire_light_skin_tone": "🧛🏻\u200d♀️",
    "woman_vampire_medium-dark_skin_tone": "🧛🏾\u200d♀️",
    "woman_vampire_medium-light_skin_tone": "🧛🏼\u200d♀️",
    "woman_vampire_medium_skin_tone": "🧛🏽\u200d♀️",
    "woman_walking": "🚶\u200d♀️",
    "woman_walking_dark_skin_tone": "🚶🏿\u200d♀️",
    "woman_walking_light_skin_tone": "🚶🏻\u200d♀️",
    "woman_walking_medium-dark_skin_tone": "🚶🏾\u200d♀️",
    "woman_walking_medium-light_skin_tone": "🚶🏼\u200d♀️",
    "woman_walking_medium_skin_tone": "🚶🏽\u200d♀️",
    "woman_wearing_turban": "👳\u200d♀️",
    "woman_wearing_turban_dark_skin_tone": "👳🏿\u200d♀️",
    "woman_wearing_turban_light_skin_tone": "👳🏻\u200d♀️",
    "woman_wearing_turban_medium-dark_skin_tone": "👳🏾\u200d♀️",
    "woman_wearing_turban_medium-light_skin_tone": "👳🏼\u200d♀️",
    "woman_wearing_turban_medium_skin_tone": "👳🏽\u200d♀️",
    "woman_with_headscarf": "🧕",
    "woman_with_headscarf_dark_skin_tone": "🧕🏿",
    "woman_with_headscarf_light_skin_tone": "🧕🏻",
    "woman_with_headscarf_medium-dark_skin_tone": "🧕🏾",
    "woman_with_headscarf_medium-light_skin_tone": "🧕🏼",
    "woman_with_headscarf_medium_skin_tone": "🧕🏽",
    "woman_with_probing_cane": "👩\u200d🦯",
    "woman_zombie": "🧟\u200d♀️",
    "woman’s_boot": "👢",
    "woman’s_clothes": "👚",
    "woman’s_hat": "👒",
    "woman’s_sandal": "👡",
    "women_with_bunny_ears": "👯\u200d♀️",
    "women_wrestling": "🤼\u200d♀️",
    "women’s_room": "🚺",
    "woozy_face": "🥴",
    "world_map": "🗺",
    "worried_face": "😟",
    "wrapped_gift": "🎁",
    "wrench": "🔧",
    "writing_hand": "✍",
    "writing_hand_dark_skin_tone": "✍🏿",
    "writing_hand_light_skin_tone": "✍🏻",
    "writing_hand_medium-dark_skin_tone": "✍🏾",
    "writing_hand_medium-light_skin_tone": "✍🏼",
    "writing_hand_medium_skin_tone": "✍🏽",
    "yarn": "🧶",
    "yawning_face": "🥱",
    "yellow_circle": "🟡",
    "yellow_heart": "💛",
    "yellow_square": "🟨",
    "yen_banknote": "💴",
    "yo-yo": "🪀",
    "yin_yang": "☯",
    "zany_face": "🤪",
    "zebra": "🦓",
    "zipper-mouth_face": "🤐",
    "zombie": "🧟",
    "zzz": "💤",
    "åland_islands": "🇦🇽",
    "keycap_asterisk": "*⃣",
    "keycap_digit_eight": "8⃣",
    "keycap_digit_five": "5⃣",
    "keycap_digit_four": "4⃣",
    "keycap_digit_nine": "9⃣",
    "keycap_digit_one": "1⃣",
    "keycap_digit_seven": "7⃣",
    "keycap_digit_six": "6⃣",
    "keycap_digit_three": "3⃣",
    "keycap_digit_two": "2⃣",
    "keycap_digit_zero": "0⃣",
    "keycap_number_sign": "#⃣",
    "light_skin_tone": "🏻",
    "medium_light_skin_tone": "🏼",
    "medium_skin_tone": "🏽",
    "medium_dark_skin_tone": "🏾",
    "dark_skin_tone": "🏿",
    "regional_indicator_symbol_letter_a": "🇦",
    "regional_indicator_symbol_letter_b": "🇧",
    "regional_indicator_symbol_letter_c": "🇨",
    "regional_indicator_symbol_letter_d": "🇩",
    "regional_indicator_symbol_letter_e": "🇪",
    "regional_indicator_symbol_letter_f": "🇫",
    "regional_indicator_symbol_letter_g": "🇬",
    "regional_indicator_symbol_letter_h": "🇭",
    "regional_indicator_symbol_letter_i": "🇮",
    "regional_indicator_symbol_letter_j": "🇯",
    "regional_indicator_symbol_letter_k": "🇰",
    "regional_indicator_symbol_letter_l": "🇱",
    "regional_indicator_symbol_letter_m": "🇲",
    "regional_indicator_symbol_letter_n": "🇳",
    "regional_indicator_symbol_letter_o": "🇴",
    "regional_indicator_symbol_letter_p": "🇵",
    "regional_indicator_symbol_letter_q": "🇶",
    "regional_indicator_symbol_letter_r": "🇷",
    "regional_indicator_symbol_letter_s": "🇸",
    "regional_indicator_symbol_letter_t": "🇹",
    "regional_indicator_symbol_letter_u": "🇺",
    "regional_indicator_symbol_letter_v": "🇻",
    "regional_indicator_symbol_letter_w": "🇼",
    "regional_indicator_symbol_letter_x": "🇽",
    "regional_indicator_symbol_letter_y": "🇾",
    "regional_indicator_symbol_letter_z": "🇿",
    "airplane_arriving": "🛬",
    "space_invader": "👾",
    "football": "🏈",
    "anger": "💢",
    "angry": "😠",
    "anguished": "😧",
    "signal_strength": "📶",
    "arrows_counterclockwise": "🔄",
    "arrow_heading_down": "⤵",
    "arrow_heading_up": "⤴",
    "art": "🎨",
    "astonished": "😲",
    "athletic_shoe": "👟",
    "atm": "🏧",
    "car": "🚗",
    "red_car": "🚗",
    "angel": "👼",
    "back": "🔙",
    "badminton_racquet_and_shuttlecock": "🏸",
    "dollar": "💵",
    "euro": "💶",
    "pound": "💷",
    "yen": "💴",
    "barber": "💈",
    "bath": "🛀",
    "bear": "🐻",
    "heartbeat": "💓",
    "beer": "🍺",
    "no_bell": "🔕",
    "bento": "🍱",
    "bike": "🚲",
    "bicyclist": "🚴",
    "8ball": "🎱",
    "biohazard_sign": "☣",
    "birthday": "🎂",
    "black_circle_for_record": "⏺",
    "clubs": "♣",
    "diamonds": "♦",
    "arrow_double_down": "⏬",
    "hearts": "♥",
    "rewind": "⏪",
    "black_left__pointing_double_triangle_with_vertical_bar": "⏮",
    "arrow_backward": "◀",
    "black_medium_small_square": "◾",
    "question": "❓",
    "fast_forward": "⏩",
    "black_right__pointing_double_triangle_with_vertical_bar": "⏭",
    "arrow_forward": "▶",
    "black_right__pointing_triangle_with_double_vertical_bar": "⏯",
    "arrow_right": "➡",
    "spades": "♠",
    "black_square_for_stop": "⏹",
    "sunny": "☀",
    "phone": "☎",
    "recycle": "♻",
    "arrow_double_up": "⏫",
    "busstop": "🚏",
    "date": "📅",
    "flags": "🎏",
    "cat2": "🐈",
    "joy_cat": "😹",
    "smirk_cat": "😼",
    "chart_with_downwards_trend": "📉",
    "chart_with_upwards_trend": "📈",
    "chart": "💹",
    "mega": "📣",
    "checkered_flag": "🏁",
    "accept": "🉑",
    "ideograph_advantage": "🉐",
    "congratulations": "㊗",
    "secret": "㊙",
    "m": "Ⓜ",
    "city_sunset": "🌆",
    "clapper": "🎬",
    "clap": "👏",
    "beers": "🍻",
    "clock830": "🕣",
    "clock8": "🕗",
    "clock1130": "🕦",
    "clock11": "🕚",
    "clock530": "🕠",
    "clock5": "🕔",
    "clock430": "🕟",
    "clock4": "🕓",
    "clock930": "🕤",
    "clock9": "🕘",
    "clock130": "🕜",
    "clock1": "🕐",
    "clock730": "🕢",
    "clock7": "🕖",
    "clock630": "🕡",
    "clock6": "🕕",
    "clock1030": "🕥",
    "clock10": "🕙",
    "clock330": "🕞",
    "clock3": "🕒",
    "clock1230": "🕧",
    "clock12": "🕛",
    "clock230": "🕝",
    "clock2": "🕑",
    "arrows_clockwise": "🔃",
    "repeat": "🔁",
    "repeat_one": "🔂",
    "closed_lock_with_key": "🔐",
    "mailbox_closed": "📪",
    "mailbox": "📫",
    "cloud_with_tornado": "🌪",
    "cocktail": "🍸",
    "boom": "💥",
    "compression": "🗜",
    "confounded": "😖",
    "confused": "😕",
    "rice": "🍚",
    "cow2": "🐄",
    "cricket_bat_and_ball": "🏏",
    "x": "❌",
    "cry": "😢",
    "curry": "🍛",
    "dagger_knife": "🗡",
    "dancer": "💃",
    "dark_sunglasses": "🕶",
    "dash": "💨",
    "truck": "🚚",
    "derelict_house_building": "🏚",
    "diamond_shape_with_a_dot_inside": "💠",
    "dart": "🎯",
    "disappointed_relieved": "😥",
    "disappointed": "😞",
    "do_not_litter": "🚯",
    "dog2": "🐕",
    "flipper": "🐬",
    "loop": "➿",
    "bangbang": "‼",
    "double_vertical_bar": "⏸",
    "dove_of_peace": "🕊",
    "small_red_triangle_down": "🔻",
    "arrow_down_small": "🔽",
    "arrow_down": "⬇",
    "dromedary_camel": "🐪",
    "e__mail": "📧",
    "corn": "🌽",
    "ear_of_rice": "🌾",
    "earth_americas": "🌎",
    "earth_asia": "🌏",
    "earth_africa": "🌍",
    "eight_pointed_black_star": "✴",
    "eight_spoked_asterisk": "✳",
    "eject_symbol": "⏏",
    "bulb": "💡",
    "emoji_modifier_fitzpatrick_type__1__2": "🏻",
    "emoji_modifier_fitzpatrick_type__3": "🏼",
    "emoji_modifier_fitzpatrick_type__4": "🏽",
    "emoji_modifier_fitzpatrick_type__5": "🏾",
    "emoji_modifier_fitzpatrick_type__6": "🏿",
    "end": "🔚",
    "email": "✉",
    "european_castle": "🏰",
    "european_post_office": "🏤",
    "interrobang": "⁉",
    "expressionless": "😑",
    "eyeglasses": "👓",
    "massage": "💆",
    "yum": "😋",
    "scream": "😱",
    "kissing_heart": "😘",
    "sweat": "😓",
    "face_with_head__bandage": "🤕",
    "triumph": "😤",
    "mask": "😷",
    "no_good": "🙅",
    "ok_woman": "🙆",
    "open_mouth": "😮",
    "cold_sweat": "😰",
    "stuck_out_tongue": "😛",
    "stuck_out_tongue_closed_eyes": "😝",
    "stuck_out_tongue_winking_eye": "😜",
    "joy": "😂",
    "no_mouth": "😶",
    "santa": "🎅",
    "fax": "📠",
    "fearful": "😨",
    "field_hockey_stick_and_ball": "🏑",
    "first_quarter_moon_with_face": "🌛",
    "fish_cake": "🍥",
    "fishing_pole_and_fish": "🎣",
    "facepunch": "👊",
    "punch": "👊",
    "flag_for_afghanistan": "🇦🇫",
    "flag_for_albania": "🇦🇱",
    "flag_for_algeria": "🇩🇿",
    "flag_for_american_samoa": "🇦🇸",
    "flag_for_andorra": "🇦🇩",
    "flag_for_angola": "🇦🇴",
    "flag_for_anguilla": "🇦🇮",
    "flag_for_antarctica": "🇦🇶",
    "flag_for_antigua_&_barbuda": "🇦🇬",
    "flag_for_argentina": "🇦🇷",
    "flag_for_armenia": "🇦🇲",
    "flag_for_aruba": "🇦🇼",
    "flag_for_ascension_island": "🇦🇨",
    "flag_for_australia": "🇦🇺",
    "flag_for_austria": "🇦🇹",
    "flag_for_azerbaijan": "🇦🇿",
    "flag_for_bahamas": "🇧🇸",
    "flag_for_bahrain": "🇧🇭",
    "flag_for_bangladesh": "🇧🇩",
    "flag_for_barbados": "🇧🇧",
    "flag_for_belarus": "🇧🇾",
    "flag_for_belgium": "🇧🇪",
    "flag_for_belize": "🇧🇿",
    "flag_for_benin": "🇧🇯",
    "flag_for_bermuda": "🇧🇲",
    "flag_for_bhutan": "🇧🇹",
    "flag_for_bolivia": "🇧🇴",
    "flag_for_bosnia_&_herzegovina": "🇧🇦",
    "flag_for_botswana": "🇧🇼",
    "flag_for_bouvet_island": "🇧🇻",
    "flag_for_brazil": "🇧🇷",
    "flag_for_british_indian_ocean_territory": "🇮🇴",
    "flag_for_british_virgin_islands": "🇻🇬",
    "flag_for_brunei": "🇧🇳",
    "flag_for_bulgaria": "🇧🇬",
    "flag_for_burkina_faso": "🇧🇫",
    "flag_for_burundi": "🇧🇮",
    "flag_for_cambodia": "🇰🇭",
    "flag_for_cameroon": "🇨🇲",
    "flag_for_canada": "🇨🇦",
    "flag_for_canary_islands": "🇮🇨",
    "flag_for_cape_verde": "🇨🇻",
    "flag_for_caribbean_netherlands": "🇧🇶",
    "flag_for_cayman_islands": "🇰🇾",
    "flag_for_central_african_republic": "🇨🇫",
    "flag_for_ceuta_&_melilla": "🇪🇦",
    "flag_for_chad": "🇹🇩",
    "flag_for_chile": "🇨🇱",
    "flag_for_china": "🇨🇳",
    "flag_for_christmas_island": "🇨🇽",
    "flag_for_clipperton_island": "🇨🇵",
    "flag_for_cocos__islands": "🇨🇨",
    "flag_for_colombia": "🇨🇴",
    "flag_for_comoros": "🇰🇲",
    "flag_for_congo____brazzaville": "🇨🇬",
    "flag_for_congo____kinshasa": "🇨🇩",
    "flag_for_cook_islands": "🇨🇰",
    "flag_for_costa_rica": "🇨🇷",
    "flag_for_croatia": "🇭🇷",
    "flag_for_cuba": "🇨🇺",
    "flag_for_curaçao": "🇨🇼",
    "flag_for_cyprus": "🇨🇾",
    "flag_for_czech_republic": "🇨🇿",
    "flag_for_côte_d’ivoire": "🇨🇮",
    "flag_for_denmark": "🇩🇰",
    "flag_for_diego_garcia": "🇩🇬",
    "flag_for_djibouti": "🇩🇯",
    "flag_for_dominica": "🇩🇲",
    "flag_for_dominican_republic": "🇩🇴",
    "flag_for_ecuador": "🇪🇨",
    "flag_for_egypt": "🇪🇬",
    "flag_for_el_salvador": "🇸🇻",
    "flag_for_equatorial_guinea": "🇬🇶",
    "flag_for_eritrea": "🇪🇷",
    "flag_for_estonia": "🇪🇪",
    "flag_for_ethiopia": "🇪🇹",
    "flag_for_european_union": "🇪🇺",
    "flag_for_falkland_islands": "🇫🇰",
    "flag_for_faroe_islands": "🇫🇴",
    "flag_for_fiji": "🇫🇯",
    "flag_for_finland": "🇫🇮",
    "flag_for_france": "🇫🇷",
    "flag_for_french_guiana": "🇬🇫",
    "flag_for_french_polynesia": "🇵🇫",
    "flag_for_french_southern_territories": "🇹🇫",
    "flag_for_gabon": "🇬🇦",
    "flag_for_gambia": "🇬🇲",
    "flag_for_georgia": "🇬🇪",
    "flag_for_germany": "🇩🇪",
    "flag_for_ghana": "🇬🇭",
    "flag_for_gibraltar": "🇬🇮",
    "flag_for_greece": "🇬🇷",
    "flag_for_greenland": "🇬🇱",
    "flag_for_grenada": "🇬🇩",
    "flag_for_guadeloupe": "🇬🇵",
    "flag_for_guam": "🇬🇺",
    "flag_for_guatemala": "🇬🇹",
    "flag_for_guernsey": "🇬🇬",
    "flag_for_guinea": "🇬🇳",
    "flag_for_guinea__bissau": "🇬🇼",
    "flag_for_guyana": "🇬🇾",
    "flag_for_haiti": "🇭🇹",
    "flag_for_heard_&_mcdonald_islands": "🇭🇲",
    "flag_for_honduras": "🇭🇳",
    "flag_for_hong_kong": "🇭🇰",
    "flag_for_hungary": "🇭🇺",
    "flag_for_iceland": "🇮🇸",
    "flag_for_india": "🇮🇳",
    "flag_for_indonesia": "🇮🇩",
    "flag_for_iran": "🇮🇷",
    "flag_for_iraq": "🇮🇶",
    "flag_for_ireland": "🇮🇪",
    "flag_for_isle_of_man": "🇮🇲",
    "flag_for_israel": "🇮🇱",
    "flag_for_italy": "🇮🇹",
    "flag_for_jamaica": "🇯🇲",
    "flag_for_japan": "🇯🇵",
    "flag_for_jersey": "🇯🇪",
    "flag_for_jordan": "🇯🇴",
    "flag_for_kazakhstan": "🇰🇿",
    "flag_for_kenya": "🇰🇪",
    "flag_for_kiribati": "🇰🇮",
    "flag_for_kosovo": "🇽🇰",
    "flag_for_kuwait": "🇰🇼",
    "flag_for_kyrgyzstan": "🇰🇬",
    "flag_for_laos": "🇱🇦",
    "flag_for_latvia": "🇱🇻",
    "flag_for_lebanon": "🇱🇧",
    "flag_for_lesotho": "🇱🇸",
    "flag_for_liberia": "🇱🇷",
    "flag_for_libya": "🇱🇾",
    "flag_for_liechtenstein": "🇱🇮",
    "flag_for_lithuania": "🇱🇹",
    "flag_for_luxembourg": "🇱🇺",
    "flag_for_macau": "🇲🇴",
    "flag_for_macedonia": "🇲🇰",
    "flag_for_madagascar": "🇲🇬",
    "flag_for_malawi": "🇲🇼",
    "flag_for_malaysia": "🇲🇾",
    "flag_for_maldives": "🇲🇻",
    "flag_for_mali": "🇲🇱",
    "flag_for_malta": "🇲🇹",
    "flag_for_marshall_islands": "🇲🇭",
    "flag_for_martinique": "🇲🇶",
    "flag_for_mauritania": "🇲🇷",
    "flag_for_mauritius": "🇲🇺",
    "flag_for_mayotte": "🇾🇹",
    "flag_for_mexico": "🇲🇽",
    "flag_for_micronesia": "🇫🇲",
    "flag_for_moldova": "🇲🇩",
    "flag_for_monaco": "🇲🇨",
    "flag_for_mongolia": "🇲🇳",
    "flag_for_montenegro": "🇲🇪",
    "flag_for_montserrat": "🇲🇸",
    "flag_for_morocco": "🇲🇦",
    "flag_for_mozambique": "🇲🇿",
    "flag_for_myanmar": "🇲🇲",
    "flag_for_namibia": "🇳🇦",
    "flag_for_nauru": "🇳🇷",
    "flag_for_nepal": "🇳🇵",
    "flag_for_netherlands": "🇳🇱",
    "flag_for_new_caledonia": "🇳🇨",
    "flag_for_new_zealand": "🇳🇿",
    "flag_for_nicaragua": "🇳🇮",
    "flag_for_niger": "🇳🇪",
    "flag_for_nigeria": "🇳🇬",
    "flag_for_niue": "🇳🇺",
    "flag_for_norfolk_island": "🇳🇫",
    "flag_for_north_korea": "🇰🇵",
    "flag_for_northern_mariana_islands": "🇲🇵",
    "flag_for_norway": "🇳🇴",
    "flag_for_oman": "🇴🇲",
    "flag_for_pakistan": "🇵🇰",
    "flag_for_palau": "🇵🇼",
    "flag_for_palestinian_territories": "🇵🇸",
    "flag_for_panama": "🇵🇦",
    "flag_for_papua_new_guinea": "🇵🇬",
    "flag_for_paraguay": "🇵🇾",
    "flag_for_peru": "🇵🇪",
    "flag_for_philippines": "🇵🇭",
    "flag_for_pitcairn_islands": "🇵🇳",
    "flag_for_poland": "🇵🇱",
    "flag_for_portugal": "🇵🇹",
    "flag_for_puerto_rico": "🇵🇷",
    "flag_for_qatar": "🇶🇦",
    "flag_for_romania": "🇷🇴",
    "flag_for_russia": "🇷🇺",
    "flag_for_rwanda": "🇷🇼",
    "flag_for_réunion": "🇷🇪",
    "flag_for_samoa": "🇼🇸",
    "flag_for_san_marino": "🇸🇲",
    "flag_for_saudi_arabia": "🇸🇦",
    "flag_for_senegal": "🇸🇳",
    "flag_for_serbia": "🇷🇸",
    "flag_for_seychelles": "🇸🇨",
    "flag_for_sierra_leone": "🇸🇱",
    "flag_for_singapore": "🇸🇬",
    "flag_for_sint_maarten": "🇸🇽",
    "flag_for_slovakia": "🇸🇰",
    "flag_for_slovenia": "🇸🇮",
    "flag_for_solomon_islands": "🇸🇧",
    "flag_for_somalia": "🇸🇴",
    "flag_for_south_africa": "🇿🇦",
    "flag_for_south_georgia_&_south_sandwich_islands": "🇬🇸",
    "flag_for_south_korea": "🇰🇷",
    "flag_for_south_sudan": "🇸🇸",
    "flag_for_spain": "🇪🇸",
    "flag_for_sri_lanka": "🇱🇰",
    "flag_for_st._barthélemy": "🇧🇱",
    "flag_for_st._helena": "🇸🇭",
    "flag_for_st._kitts_&_nevis": "🇰🇳",
    "flag_for_st._lucia": "🇱🇨",
    "flag_for_st._martin": "🇲🇫",
    "flag_for_st._pierre_&_miquelon": "🇵🇲",
    "flag_for_st._vincent_&_grenadines": "🇻🇨",
    "flag_for_sudan": "🇸🇩",
    "flag_for_suriname": "🇸🇷",
    "flag_for_svalbard_&_jan_mayen": "🇸🇯",
    "flag_for_swaziland": "🇸🇿",
    "flag_for_sweden": "🇸🇪",
    "flag_for_switzerland": "🇨🇭",
    "flag_for_syria": "🇸🇾",
    "flag_for_são_tomé_&_príncipe": "🇸🇹",
    "flag_for_taiwan": "🇹🇼",
    "flag_for_tajikistan": "🇹🇯",
    "flag_for_tanzania": "🇹🇿",
    "flag_for_thailand": "🇹🇭",
    "flag_for_timor__leste": "🇹🇱",
    "flag_for_togo": "🇹🇬",
    "flag_for_tokelau": "🇹🇰",
    "flag_for_tonga": "🇹🇴",
    "flag_for_trinidad_&_tobago": "🇹🇹",
    "flag_for_tristan_da_cunha": "🇹🇦",
    "flag_for_tunisia": "🇹🇳",
    "flag_for_turkey": "🇹🇷",
    "flag_for_turkmenistan": "🇹🇲",
    "flag_for_turks_&_caicos_islands": "🇹🇨",
    "flag_for_tuvalu": "🇹🇻",
    "flag_for_u.s._outlying_islands": "🇺🇲",
    "flag_for_u.s._virgin_islands": "🇻🇮",
    "flag_for_uganda": "🇺🇬",
    "flag_for_ukraine": "🇺🇦",
    "flag_for_united_arab_emirates": "🇦🇪",
    "flag_for_united_kingdom": "🇬🇧",
    "flag_for_united_states": "🇺🇸",
    "flag_for_uruguay": "🇺🇾",
    "flag_for_uzbekistan": "🇺🇿",
    "flag_for_vanuatu": "🇻🇺",
    "flag_for_vatican_city": "🇻🇦",
    "flag_for_venezuela": "🇻🇪",
    "flag_for_vietnam": "🇻🇳",
    "flag_for_wallis_&_futuna": "🇼🇫",
    "flag_for_western_sahara": "🇪🇭",
    "flag_for_yemen": "🇾🇪",
    "flag_for_zambia": "🇿🇲",
    "flag_for_zimbabwe": "🇿🇼",
    "flag_for_åland_islands": "🇦🇽",
    "golf": "⛳",
    "fleur__de__lis": "⚜",
    "muscle": "💪",
    "flushed": "😳",
    "frame_with_picture": "🖼",
    "fries": "🍟",
    "frog": "🐸",
    "hatched_chick": "🐥",
    "frowning": "😦",
    "fuelpump": "⛽",
    "full_moon_with_face": "🌝",
    "gem": "💎",
    "star2": "🌟",
    "golfer": "🏌",
    "mortar_board": "🎓",
    "grimacing": "😬",
    "smile_cat": "😸",
    "grinning": "😀",
    "grin": "😁",
    "heartpulse": "💗",
    "guardsman": "💂",
    "haircut": "💇",
    "hamster": "🐹",
    "raising_hand": "🙋",
    "headphones": "🎧",
    "hear_no_evil": "🙉",
    "cupid": "💘",
    "gift_heart": "💝",
    "heart": "❤",
    "exclamation": "❗",
    "heavy_exclamation_mark": "❗",
    "heavy_heart_exclamation_mark_ornament": "❣",
    "o": "⭕",
    "helm_symbol": "⎈",
    "helmet_with_white_cross": "⛑",
    "high_heel": "👠",
    "bullettrain_side": "🚄",
    "bullettrain_front": "🚅",
    "high_brightness": "🔆",
    "zap": "⚡",
    "hocho": "🔪",
    "knife": "🔪",
    "bee": "🐝",
    "traffic_light": "🚥",
    "racehorse": "🐎",
    "coffee": "☕",
    "hotsprings": "♨",
    "hourglass": "⌛",
    "hourglass_flowing_sand": "⏳",
    "house_buildings": "🏘",
    "100": "💯",
    "hushed": "😯",
    "ice_hockey_stick_and_puck": "🏒",
    "imp": "👿",
    "information_desk_person": "💁",
    "information_source": "ℹ",
    "capital_abcd": "🔠",
    "abc": "🔤",
    "abcd": "🔡",
    "1234": "🔢",
    "symbols": "🔣",
    "izakaya_lantern": "🏮",
    "lantern": "🏮",
    "jack_o_lantern": "🎃",
    "dolls": "🎎",
    "japanese_goblin": "👺",
    "japanese_ogre": "👹",
    "beginner": "🔰",
    "zero": "0️⃣",
    "one": "1️⃣",
    "ten": "🔟",
    "two": "2️⃣",
    "three": "3️⃣",
    "four": "4️⃣",
    "five": "5️⃣",
    "six": "6️⃣",
    "seven": "7️⃣",
    "eight": "8️⃣",
    "nine": "9️⃣",
    "couplekiss": "💏",
    "kissing_cat": "😽",
    "kissing": "😗",
    "kissing_closed_eyes": "😚",
    "kissing_smiling_eyes": "😙",
    "beetle": "🐞",
    "large_blue_circle": "🔵",
    "last_quarter_moon_with_face": "🌜",
    "leaves": "🍃",
    "mag": "🔍",
    "left_right_arrow": "↔",
    "leftwards_arrow_with_hook": "↩",
    "arrow_left": "⬅",
    "lock": "🔒",
    "lock_with_ink_pen": "🔏",
    "sob": "😭",
    "low_brightness": "🔅",
    "lower_left_ballpoint_pen": "🖊",
    "lower_left_crayon": "🖍",
    "lower_left_fountain_pen": "🖋",
    "lower_left_paintbrush": "🖌",
    "mahjong": "🀄",
    "couple": "👫",
    "man_in_business_suit_levitating": "🕴",
    "man_with_gua_pi_mao": "👲",
    "man_with_turban": "👳",
    "mans_shoe": "👞",
    "shoe": "👞",
    "menorah_with_nine_branches": "🕎",
    "mens": "🚹",
    "minidisc": "💽",
    "iphone": "📱",
    "calling": "📲",
    "money__mouth_face": "🤑",
    "moneybag": "💰",
    "rice_scene": "🎑",
    "mountain_bicyclist": "🚵",
    "mouse2": "🐁",
    "lips": "👄",
    "moyai": "🗿",
    "notes": "🎶",
    "nail_care": "💅",
    "ab": "🆎",
    "negative_squared_cross_mark": "❎",
    "a": "🅰",
    "b": "🅱",
    "o2": "🅾",
    "parking": "🅿",
    "new_moon_with_face": "🌚",
    "no_entry_sign": "🚫",
    "underage": "🔞",
    "non__potable_water": "🚱",
    "arrow_upper_right": "↗",
    "arrow_upper_left": "↖",
    "office": "🏢",
    "older_man": "👴",
    "older_woman": "👵",
    "om_symbol": "🕉",
    "on": "🔛",
    "book": "📖",
    "unlock": "🔓",
    "mailbox_with_no_mail": "📭",
    "mailbox_with_mail": "📬",
    "cd": "💿",
    "tada": "🎉",
    "feet": "🐾",
    "walking": "🚶",
    "pencil2": "✏",
    "pensive": "😔",
    "persevere": "😣",
    "bow": "🙇",
    "raised_hands": "🙌",
    "person_with_ball": "⛹",
    "person_with_blond_hair": "👱",
    "pray": "🙏",
    "person_with_pouting_face": "🙎",
    "computer": "💻",
    "pig2": "🐖",
    "hankey": "💩",
    "poop": "💩",
    "shit": "💩",
    "bamboo": "🎍",
    "gun": "🔫",
    "black_joker": "🃏",
    "rotating_light": "🚨",
    "cop": "👮",
    "stew": "🍲",
    "pouch": "👝",
    "pouting_cat": "😾",
    "rage": "😡",
    "put_litter_in_its_place": "🚮",
    "rabbit2": "🐇",
    "racing_motorcycle": "🏍",
    "radioactive_sign": "☢",
    "fist": "✊",
    "hand": "✋",
    "raised_hand_with_fingers_splayed": "🖐",
    "raised_hand_with_part_between_middle_and_ring_fingers": "🖖",
    "blue_car": "🚙",
    "apple": "🍎",
    "relieved": "😌",
    "reversed_hand_with_middle_finger_extended": "🖕",
    "mag_right": "🔎",
    "arrow_right_hook": "↪",
    "sweet_potato": "🍠",
    "robot": "🤖",
    "rolled__up_newspaper": "🗞",
    "rowboat": "🚣",
    "runner": "🏃",
    "running": "🏃",
    "running_shirt_with_sash": "🎽",
    "boat": "⛵",
    "scales": "⚖",
    "school_satchel": "🎒",
    "scorpius": "♏",
    "see_no_evil": "🙈",
    "sheep": "🐑",
    "stars": "🌠",
    "cake": "🍰",
    "six_pointed_star": "🔯",
    "ski": "🎿",
    "sleeping_accommodation": "🛌",
    "sleeping": "😴",
    "sleepy": "😪",
    "sleuth_or_spy": "🕵",
    "heart_eyes_cat": "😻",
    "smiley_cat": "😺",
    "innocent": "😇",
    "heart_eyes": "😍",
    "smiling_imp": "😈",
    "smiley": "😃",
    "sweat_smile": "😅",
    "smile": "😄",
    "laughing": "😆",
    "satisfied": "😆",
    "blush": "😊",
    "smirk": "😏",
    "smoking": "🚬",
    "snow_capped_mountain": "🏔",
    "soccer": "⚽",
    "icecream": "🍦",
    "soon": "🔜",
    "arrow_lower_right": "↘",
    "arrow_lower_left": "↙",
    "speak_no_evil": "🙊",
    "speaker": "🔈",
    "mute": "🔇",
    "sound": "🔉",
    "loud_sound": "🔊",
    "speaking_head_in_silhouette": "🗣",
    "spiral_calendar_pad": "🗓",
    "spiral_note_pad": "🗒",
    "shell": "🐚",
    "sweat_drops": "💦",
    "u5272": "🈹",
    "u5408": "🈴",
    "u55b6": "🈺",
    "u6307": "🈯",
    "u6708": "🈷",
    "u6709": "🈶",
    "u6e80": "🈵",
    "u7121": "🈚",
    "u7533": "🈸",
    "u7981": "🈲",
    "u7a7a": "🈳",
    "cl": "🆑",
    "cool": "🆒",
    "free": "🆓",
    "id": "🆔",
    "koko": "🈁",
    "sa": "🈂",
    "new": "🆕",
    "ng": "🆖",
    "ok": "🆗",
    "sos": "🆘",
    "up": "🆙",
    "vs": "🆚",
    "steam_locomotive": "🚂",
    "ramen": "🍜",
    "partly_sunny": "⛅",
    "city_sunrise": "🌇",
    "surfer": "🏄",
    "swimmer": "🏊",
    "shirt": "👕",
    "tshirt": "👕",
    "table_tennis_paddle_and_ball": "🏓",
    "tea": "🍵",
    "tv": "📺",
    "three_button_mouse": "🖱",
    "+1": "👍",
    "thumbsup": "👍",
    "__1": "👎",
    "-1": "👎",
    "thumbsdown": "👎",
    "thunder_cloud_and_rain": "⛈",
    "tiger2": "🐅",
    "tophat": "🎩",
    "top": "🔝",
    "tm": "™",
    "train2": "🚆",
    "triangular_flag_on_post": "🚩",
    "trident": "🔱",
    "twisted_rightwards_arrows": "🔀",
    "unamused": "😒",
    "small_red_triangle": "🔺",
    "arrow_up_small": "🔼",
    "arrow_up_down": "↕",
    "upside__down_face": "🙃",
    "arrow_up": "⬆",
    "v": "✌",
    "vhs": "📼",
    "wc": "🚾",
    "ocean": "🌊",
    "waving_black_flag": "🏴",
    "wave": "👋",
    "waving_white_flag": "🏳",
    "moon": "🌔",
    "scream_cat": "🙀",
    "weary": "😩",
    "weight_lifter": "🏋",
    "whale2": "🐋",
    "wheelchair": "♿",
    "point_down": "👇",
    "grey_exclamation": "❕",
    "white_frowning_face": "☹",
    "white_check_mark": "✅",
    "point_left": "👈",
    "white_medium_small_square": "◽",
    "star": "⭐",
    "grey_question": "❔",
    "point_right": "👉",
    "relaxed": "☺",
    "white_sun_behind_cloud": "🌥",
    "white_sun_behind_cloud_with_rain": "🌦",
    "white_sun_with_small_cloud": "🌤",
    "point_up_2": "👆",
    "point_up": "☝",
    "wind_blowing_face": "🌬",
    "wink": "😉",
    "wolf": "🐺",
    "dancers": "👯",
    "boot": "👢",
    "womans_clothes": "👚",
    "womans_hat": "👒",
    "sandal": "👡",
    "womens": "🚺",
    "worried": "😟",
    "gift": "🎁",
    "zipper__mouth_face": "🤐",
    "regional_indicator_a": "🇦",
    "regional_indicator_b": "🇧",
    "regional_indicator_c": "🇨",
    "regional_indicator_d": "🇩",
    "regional_indicator_e": "🇪",
    "regional_indicator_f": "🇫",
    "regional_indicator_g": "🇬",
    "regional_indicator_h": "🇭",
    "regional_indicator_i": "🇮",
    "regional_indicator_j": "🇯",
    "regional_indicator_k": "🇰",
    "regional_indicator_l": "🇱",
    "regional_indicator_m": "🇲",
    "regional_indicator_n": "🇳",
    "regional_indicator_o": "🇴",
    "regional_indicator_p": "🇵",
    "regional_indicator_q": "🇶",
    "regional_indicator_r": "🇷",
    "regional_indicator_s": "🇸",
    "regional_indicator_t": "🇹",
    "regional_indicator_u": "🇺",
    "regional_indicator_v": "🇻",
    "regional_indicator_w": "🇼",
    "regional_indicator_x": "🇽",
    "regional_indicator_y": "🇾",
    "regional_indicator_z": "🇿",
}
3,611 lines•136.9 KB
python
.venv/Lib/site-packages/pip/_vendor/rich/_windows.py
Raw Download
Find: Go to:
import sys
from dataclasses import dataclass


@dataclass
class WindowsConsoleFeatures:
    """Windows features available."""

    vt: bool = False
    """The console supports VT codes."""
    truecolor: bool = False
    """The console supports truecolor."""


try:
    import ctypes
    from ctypes import LibraryLoader

    if sys.platform == "win32":
        windll = LibraryLoader(ctypes.WinDLL)
    else:
        windll = None
        raise ImportError("Not windows")

    from pip._vendor.rich._win32_console import (
        ENABLE_VIRTUAL_TERMINAL_PROCESSING,
        GetConsoleMode,
        GetStdHandle,
        LegacyWindowsError,
    )

except (AttributeError, ImportError, ValueError):
    # Fallback if we can't load the Windows DLL
    def get_windows_console_features() -> WindowsConsoleFeatures:
        features = WindowsConsoleFeatures()
        return features

else:

    def get_windows_console_features() -> WindowsConsoleFeatures:
        """Get windows console features.

        Returns:
            WindowsConsoleFeatures: An instance of WindowsConsoleFeatures.
        """
        handle = GetStdHandle()
        try:
            console_mode = GetConsoleMode(handle)
            success = True
        except LegacyWindowsError:
            console_mode = 0
            success = False
        vt = bool(success and console_mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING)
        truecolor = False
        if vt:
            win_version = sys.getwindowsversion()
            truecolor = win_version.major > 10 or (
                win_version.major == 10 and win_version.build >= 15063
            )
        features = WindowsConsoleFeatures(vt=vt, truecolor=truecolor)
        return features


if __name__ == "__main__":
    import platform

    features = get_windows_console_features()
    from pip._vendor.rich import print

    print(f'platform="{platform.system()}"')
    print(repr(features))
72 lines•1.9 KB
python
.venv/Lib/site-packages/pip/_vendor/urllib3/response.py
Raw Download
Find: Go to:
from __future__ import absolute_import

import io
import logging
import sys
import warnings
import zlib
from contextlib import contextmanager
from socket import error as SocketError
from socket import timeout as SocketTimeout

brotli = None

from . import util
from ._collections import HTTPHeaderDict
from .connection import BaseSSLError, HTTPException
from .exceptions import (
    BodyNotHttplibCompatible,
    DecodeError,
    HTTPError,
    IncompleteRead,
    InvalidChunkLength,
    InvalidHeader,
    ProtocolError,
    ReadTimeoutError,
    ResponseNotChunked,
    SSLError,
)
from .packages import six
from .util.response import is_fp_closed, is_response_to_head

log = logging.getLogger(__name__)


class DeflateDecoder(object):
    def __init__(self):
        self._first_try = True
        self._data = b""
        self._obj = zlib.decompressobj()

    def __getattr__(self, name):
        return getattr(self._obj, name)

    def decompress(self, data):
        if not data:
            return data

        if not self._first_try:
            return self._obj.decompress(data)

        self._data += data
        try:
            decompressed = self._obj.decompress(data)
            if decompressed:
                self._first_try = False
                self._data = None
            return decompressed
        except zlib.error:
            self._first_try = False
            self._obj = zlib.decompressobj(-zlib.MAX_WBITS)
            try:
                return self.decompress(self._data)
            finally:
                self._data = None


class GzipDecoderState(object):

    FIRST_MEMBER = 0
    OTHER_MEMBERS = 1
    SWALLOW_DATA = 2


class GzipDecoder(object):
    def __init__(self):
        self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS)
        self._state = GzipDecoderState.FIRST_MEMBER

    def __getattr__(self, name):
        return getattr(self._obj, name)

    def decompress(self, data):
        ret = bytearray()
        if self._state == GzipDecoderState.SWALLOW_DATA or not data:
            return bytes(ret)
        while True:
            try:
                ret += self._obj.decompress(data)
            except zlib.error:
                previous_state = self._state
                # Ignore data after the first error
                self._state = GzipDecoderState.SWALLOW_DATA
                if previous_state == GzipDecoderState.OTHER_MEMBERS:
                    # Allow trailing garbage acceptable in other gzip clients
                    return bytes(ret)
                raise
            data = self._obj.unused_data
            if not data:
                return bytes(ret)
            self._state = GzipDecoderState.OTHER_MEMBERS
            self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS)


if brotli is not None:

    class BrotliDecoder(object):
        # 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):
            self._obj = brotli.Decompressor()
            if hasattr(self._obj, "decompress"):
                self.decompress = self._obj.decompress
            else:
                self.decompress = self._obj.process

        def flush(self):
            if hasattr(self._obj, "flush"):
                return self._obj.flush()
            return b""


class MultiDecoder(object):
    """
    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.
    """

    def __init__(self, modes):
        self._decoders = [_get_decoder(m.strip()) for m in modes.split(",")]

    def flush(self):
        return self._decoders[0].flush()

    def decompress(self, data):
        for d in reversed(self._decoders):
            data = d.decompress(data)
        return data


def _get_decoder(mode):
    if "," in mode:
        return MultiDecoder(mode)

    if mode == "gzip":
        return GzipDecoder()

    if brotli is not None and mode == "br":
        return BrotliDecoder()

    return DeflateDecoder()


class HTTPResponse(io.IOBase):
    """
    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.
    """

    CONTENT_DECODERS = ["gzip", "deflate"]
    if brotli is not None:
        CONTENT_DECODERS += ["br"]
    REDIRECT_STATUSES = [301, 302, 303, 307, 308]

    def __init__(
        self,
        body="",
        headers=None,
        status=0,
        version=0,
        reason=None,
        strict=0,
        preload_content=True,
        decode_content=True,
        original_response=None,
        pool=None,
        connection=None,
        msg=None,
        retries=None,
        enforce_content_length=False,
        request_method=None,
        request_url=None,
        auto_close=True,
    ):

        if isinstance(headers, HTTPHeaderDict):
            self.headers = headers
        else:
            self.headers = HTTPHeaderDict(headers)
        self.status = status
        self.version = version
        self.reason = reason
        self.strict = strict
        self.decode_content = decode_content
        self.retries = retries
        self.enforce_content_length = enforce_content_length
        self.auto_close = auto_close

        self._decoder = None
        self._body = None
        self._fp = None
        self._original_response = original_response
        self._fp_bytes_read = 0
        self.msg = msg
        self._request_url = request_url

        if body and isinstance(body, (six.string_types, bytes)):
            self._body = body

        self._pool = pool
        self._connection = connection

        if hasattr(body, "read"):
            self._fp = body

        # Are we using the chunked-style of transfer encoding?
        self.chunked = False
        self.chunk_left = None
        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

        # Determine length of response
        self.length_remaining = self._init_length(request_method)

        # If requested, preload the body.
        if preload_content and not self._body:
            self._body = self.read(decode_content=decode_content)

    def get_redirect_location(self):
        """
        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

    def release_conn(self):
        if not self._pool or not self._connection:
            return

        self._pool._put_conn(self._connection)
        self._connection = None

    def drain_conn(self):
        """
        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.read()
        except (HTTPError, SocketError, BaseSSLError, HTTPException):
            pass

    @property
    def data(self):
        # For backwards-compat with earlier urllib3 0.4 and earlier.
        if self._body:
            return self._body

        if self._fp:
            return self.read(cache_content=True)

    @property
    def connection(self):
        return self._connection

    def isclosed(self):
        return is_fp_closed(self._fp)

    def tell(self):
        """
        Obtain the number of bytes pulled over the wire so far. May differ from
        the amount of content returned by :meth:``urllib3.response.HTTPResponse.read``
        if bytes are encoded on the wire (e.g, compressed).
        """
        return self._fp_bytes_read

    def _init_length(self, request_method):
        """
        Set initial length value for Response content if available.
        """
        length = self.headers.get("content-length")

        if 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 = set([int(val) for val in length.split(",")])
                if len(lengths) > 1:
                    raise InvalidHeader(
                        "Content-Length contained multiple "
                        "unmatching values (%s)" % length
                    )
                length = lengths.pop()
            except ValueError:
                length = None
            else:
                if length < 0:
                    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

    def _init_decoder(self):
        """
        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 len(encodings):
                    self._decoder = _get_decoder(content_encoding)

    DECODER_ERROR_CLASSES = (IOError, zlib.error)
    if brotli is not None:
        DECODER_ERROR_CLASSES += (brotli.error,)

    def _decode(self, data, decode_content, flush_decoder):
        """
        Decode the data passed in and potentially flush the decoder.
        """
        if not decode_content:
            return data

        try:
            if self._decoder:
                data = self._decoder.decompress(data)
        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,
            )
        if flush_decoder:
            data += self._flush_decoder()

        return data

    def _flush_decoder(self):
        """
        Flushes the decoder. Should only be called if the decoder is actually
        being used.
        """
        if self._decoder:
            buf = self._decoder.decompress(b"")
            return buf + self._decoder.flush()

        return b""

    @contextmanager
    def _error_catcher(self):
        """
        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:
                # 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.")

            except BaseSSLError as e:
                # FIXME: Is there a better way to differentiate between SSLErrors?
                if "read operation timed out" not in str(e):
                    # SSL errors related to framing/MAC get wrapped and reraised here
                    raise SSLError(e)

                raise ReadTimeoutError(self._pool, None, "Read timed out.")

            except (HTTPException, SocketError) as e:
                # This includes IncompleteRead.
                raise ProtocolError("Connection broken: %r" % e, 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):
        """
        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.

        The known cases:
          * 3.8 <= CPython < 3.9.7 because of a bug
            https://github.com/urllib3/urllib3/issues/2513#issuecomment-1152559900.
          * urllib3 injected with pyOpenSSL-backed SSL-support.
          * CPython < 3.10 only when `amt` does not fit 32-bit int.
        """
        assert self._fp
        c_int_max = 2 ** 31 - 1
        if (
            (
                (amt and amt > c_int_max)
                or (self.length_remaining and self.length_remaining > c_int_max)
            )
            and not util.IS_SECURETRANSPORT
            and (util.IS_PYOPENSSL or sys.version_info < (3, 10))
        ):
            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()
        else:
            # StringIO doesn't like amt=None
            return self._fp.read(amt) if amt is not None else self._fp.read()

    def read(self, amt=None, decode_content=None, cache_content=False):
        """
        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 self._fp is None:
            return

        flush_decoder = False
        fp_closed = getattr(self._fp, "closed", False)

        with self._error_catcher():
            data = self._fp_read(amt) if not fp_closed else b""
            if amt is None:
                flush_decoder = True
            else:
                cache_content = False
                if (
                    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()
                    flush_decoder = True
                    if self.enforce_content_length and self.length_remaining not in (
                        0,
                        None,
                    ):
                        # 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)

        if data:
            self._fp_bytes_read += len(data)
            if self.length_remaining is not None:
                self.length_remaining -= len(data)

            data = self._decode(data, decode_content, flush_decoder)

            if cache_content:
                self._body = data

        return data

    def stream(self, amt=2 ** 16, decode_content=None):
        """
        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 self.chunked and self.supports_chunked_reads():
            for line in self.read_chunked(amt, decode_content=decode_content):
                yield line
        else:
            while not is_fp_closed(self._fp):
                data = self.read(amt=amt, decode_content=decode_content)

                if data:
                    yield data

    @classmethod
    def from_httplib(ResponseCls, r, **response_kw):
        """
        Given an :class:`http.client.HTTPResponse` instance ``r``, return a
        corresponding :class:`urllib3.response.HTTPResponse` object.

        Remaining parameters are passed to the HTTPResponse constructor, along
        with ``original_response=r``.
        """
        headers = r.msg

        if not isinstance(headers, HTTPHeaderDict):
            if six.PY2:
                # Python 2.7
                headers = HTTPHeaderDict.from_httplib(headers)
            else:
                headers = HTTPHeaderDict(headers.items())

        # HTTPResponse objects in Python 3 don't have a .strict attribute
        strict = getattr(r, "strict", 0)
        resp = ResponseCls(
            body=r,
            headers=headers,
            status=r.status,
            version=r.version,
            reason=r.reason,
            strict=strict,
            original_response=r,
            **response_kw
        )
        return resp

    # Backwards-compatibility methods for http.client.HTTPResponse
    def getheaders(self):
        warnings.warn(
            "HTTPResponse.getheaders() is deprecated and will be removed "
            "in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.",
            category=DeprecationWarning,
            stacklevel=2,
        )
        return self.headers

    def getheader(self, name, default=None):
        warnings.warn(
            "HTTPResponse.getheader() is deprecated and will be removed "
            "in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default).",
            category=DeprecationWarning,
            stacklevel=2,
        )
        return self.headers.get(name, default)

    # Backwards compatibility for http.cookiejar
    def info(self):
        return self.headers

    # Overrides from io.IOBase
    def close(self):
        if not self.closed:
            self._fp.close()

        if self._connection:
            self._connection.close()

        if not self.auto_close:
            io.IOBase.close(self)

    @property
    def closed(self):
        if not self.auto_close:
            return io.IOBase.closed.__get__(self)
        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):
        if self._fp is None:
            raise IOError("HTTPResponse has no file to get a fileno from")
        elif hasattr(self._fp, "fileno"):
            return self._fp.fileno()
        else:
            raise IOError(
                "The file-like object this HTTPResponse is wrapped "
                "around has no file descriptor"
            )

    def flush(self):
        if (
            self._fp is not None
            and hasattr(self._fp, "flush")
            and not getattr(self._fp, "closed", False)
        ):
            return self._fp.flush()

    def readable(self):
        # This method is required for `io` module compatibility.
        return True

    def readinto(self, b):
        # This method is required for `io` module compatibility.
        temp = self.read(len(b))
        if len(temp) == 0:
            return 0
        else:
            b[: len(temp)] = temp
            return len(temp)

    def supports_chunked_reads(self):
        """
        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):
        # 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
        line = self._fp.fp.readline()
        line = line.split(b";", 1)[0]
        try:
            self.chunk_left = int(line, 16)
        except ValueError:
            # Invalid chunked protocol response, abort.
            self.close()
            raise InvalidChunkLength(self, line)

    def _handle_chunk(self, amt):
        returned_chunk = None
        if amt is None:
            chunk = self._fp._safe_read(self.chunk_left)
            returned_chunk = chunk
            self._fp._safe_read(2)  # Toss the CRLF at the end of the chunk.
            self.chunk_left = None
        elif amt < self.chunk_left:
            value = self._fp._safe_read(amt)
            self.chunk_left = self.chunk_left - amt
            returned_chunk = value
        elif amt == self.chunk_left:
            value = self._fp._safe_read(amt)
            self._fp._safe_read(2)  # 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)
            self._fp._safe_read(2)  # Toss the CRLF at the end of the chunk.
            self.chunk_left = None
        return returned_chunk

    def read_chunked(self, amt=None, decode_content=None):
        """
        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

            # If a response is already read and closed
            # then return immediately.
            if self._fp.fp is None:
                return

            while True:
                self._update_chunk_length()
                if self.chunk_left == 0:
                    break
                chunk = self._handle_chunk(amt)
                decoded = self._decode(
                    chunk, decode_content=decode_content, flush_decoder=False
                )
                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 True:
                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()

    def geturl(self):
        """
        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.
        """
        if self.retries is not None and len(self.retries.history):
            return self.retries.history[-1].redirect_location
        else:
            return self._request_url

    def __iter__(self):
        buffer = []
        for chunk in self.stream(decode_content=True):
            if b"\n" in chunk:
                chunk = chunk.split(b"\n")
                yield b"".join(buffer) + chunk[0] + b"\n"
                for x in chunk[1:-1]:
                    yield x + b"\n"
                if chunk[-1]:
                    buffer = [chunk[-1]]
                else:
                    buffer = []
            else:
                buffer.append(chunk)
        if buffer:
            yield b"".join(buffer)
880 lines•29.9 KB
python
🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer